mirror of
https://github.com/dolphin-emu/redmine_webhook.git
synced 2026-01-31 01:15:19 +01:00
Merge pull request #37 from yzzy/dmsf-compatibility
Other Redmine plugins compatibility
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
|
||||
<% if User.current.allowed_to?( :manage_hook, @project) %>
|
||||
<% if Webhook.where(:project_id => @project.id).first%>
|
||||
<div class="box tabular">
|
||||
<% Webhook.where(:project_id => @project.id).each do |webhook|%>
|
||||
@@ -15,6 +13,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= form_tag(create_webhook_path(@project), :method => :post, :class => "tabular") do %>
|
||||
<div class="box tabular">
|
||||
<span>
|
||||
@@ -23,8 +22,4 @@
|
||||
<%= submit_tag l(:button_add) %>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
4
init.rb
4
init.rb
@@ -7,5 +7,7 @@ Redmine::Plugin.register :redmine_webhook do
|
||||
version '0.0.5'
|
||||
url 'https://github.com/suer/redmine_webhook'
|
||||
author_url 'http://d.hatena.ne.jp/suer'
|
||||
permission :manage_hook, {:webhook_settings => [:index, :show, :update, :create, :destroy]}, :require => :member
|
||||
project_module :webhooks do
|
||||
permission :manage_hook, {:webhook_settings => [:index, :show, :update, :create, :destroy]}, :require => :member
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,15 +2,17 @@ module RedmineWebhook
|
||||
module ProjectsHelperPatch
|
||||
def project_settings_tabs
|
||||
tabs = super
|
||||
tabs << {
|
||||
webhook_tab = {
|
||||
:name => 'webhook',
|
||||
:controller => 'webhook_settings',
|
||||
:action => :show,
|
||||
:partial => 'webhook_settings/show',
|
||||
:label => :webhook
|
||||
}
|
||||
tabs << webhook_tab if User.current.allowed_to?(:manage_hook, @project)
|
||||
tabs
|
||||
end
|
||||
end
|
||||
|
||||
ProjectsHelper.prepend ProjectsHelperPatch
|
||||
end
|
||||
|
||||
ProjectsController.send(:helper, RedmineWebhook::ProjectsHelperPatch)
|
||||
|
||||
Reference in New Issue
Block a user