hooks scaffold

This commit is contained in:
Dmitriy Zaporozhets 2012-01-04 02:07:56 +02:00
parent 495deea7eb
commit 2d3b6375f3
8 changed files with 40 additions and 7 deletions

View file

@ -1,10 +1,16 @@
= render "repositories/head"
.right= link_to "Add new", new_project_hook_path(@project), :class => "grey-button append-bottom-10"
- unless @hooks.empty?
%div.update-data.ui-box.ui-box-small
.data
- @hooks.each do |hook|
%a.update-item{:href => project_hooks_path(@project, hook)}
%a.update-item{:href => project_hook_path(@project, hook)}
%span.update-title{:style => "margin-bottom:0px;"}
= hook.url
%span.update-author.right
Added
= time_ago_in_words(hook.created_at)
ago
- else
%h3 No hooks

View file

@ -0,0 +1,13 @@
= render "repositories/head"
= form_for [@project, @hook], :as => :hook, :url => project_hooks_path(@project) do |f|
-if @hook.errors.any?
%ul
- @hook.errors.full_messages.each do |msg|
%li= msg
= f.label :url, "URL:"
= f.text_field :url, :class => "text_field"
.clear
%br
.merge-tabs
= f.submit "Save", :class => "grey-button"

View file

@ -0,0 +1,7 @@
= render "repositories/head"
= debug @hook
- if can? current_user, :admin_project, @project
.merge-tabs
.right
= link_to 'Remove', project_hook_path(@project, @hook), :confirm => 'Are you sure?', :method => :delete, :class => "red-button"

View file

@ -8,7 +8,7 @@
= link_to tags_project_repository_path(@project), :class => "tab #{'active' if current_page?(tags_project_repository_path(@project)) }" do
%span
Tags
-#= link_to "#", :class => "tab" do
= link_to project_hooks_path, :class => "tab #{'active' if controller.controller_name == "hooks" }" do
%span
Hooks
-#= link_to "#", :class => "tab" do