forked from appelier/bigtuna
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User can enable/disable specific hooks
- Loading branch information
Michal Bugno
committed
Dec 9, 2010
1 parent
c801e85
commit a518095
Showing
8 changed files
with
74 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
%h2= "#{@hook.backend.class::NAME} hook for #{@project.name}" | ||
|
||
= form_for(@hook, :url => project_config_hook_path(@project, @hook.backend.class::NAME), :html => {:method => "PUT"}) do |f| | ||
%div | ||
= label_tag("Hooks enabled") | ||
- Hook::AVAILABLE_HOOKS.each do |hook_name| | ||
- if @hook.hook_implemented?(hook_name) | ||
%div | ||
= label_tag("hooks_enabled[#{hook_name}]", hook_name.humanize, :class => "hint") | ||
= check_box_tag("hooks_enabled[#{hook_name}]", "1", @hook.hooks_enabled.include?(hook_name)) | ||
- begin | ||
= render(:partial => "#{@hook.backend.class::NAME}/form", :locals => {:f => f}) | ||
%button{:type => "submit"} Edit | ||
- rescue ActionView::MissingTemplate | ||
%p This hook doesn't have any configuration. | ||
- #pass | ||
%button{:type => "submit"} Edit | ||
= link_to("Back to project edit", edit_project_path(@project), :class => "black_button") |
9 changes: 9 additions & 0 deletions
9
db/migrate/20101209113828_add_hook_disabling_configuration.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class AddHookDisablingConfiguration < ActiveRecord::Migration | ||
def self.up | ||
add_column(:hooks, :hooks_enabled, :text) | ||
end | ||
|
||
def self.down | ||
remove_column(:hooks, :hooks_enabled) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters