Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gui] Move plugin settings under "settings" tab
This will save a bit Redmine menu bar space by moving "new issue alert" tab under Project->Settings->Email on New Issue Permission got reworked so editing/creating new issue alert implies being allowed to view them. Setting tab is implemented based on "redmine settings" plugin: http://projects.andriylesyuk.com/projects/redmine-settings/wiki
- Loading branch information
Showing
8 changed files
with
78 additions
and
26 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
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
<% can_new = User.current.allowed_to?(:new_newissuealerts, @project) | ||
can_edit = User.current.allowed_to?(:edit_newissuealerts, @project) | ||
%> | ||
<h2><%= l(:newissuealerts_index, :project => @project.name) %></h2> | ||
<% if can_new %> | ||
<p> | ||
<%= link_to(l(:newissuealerts_text), {:controller => 'newissuealerts', :action => 'new', :project_id => @project.identifier}, :class => 'icon icon-add' ) %> | ||
</p> | ||
<% end %> | ||
<% @newissuealerts = Newissuealert.find(:all, :conditions => { :project_id => @project.id } ) %> | ||
<% for newissuealert in @newissuealerts %> | ||
<div class="box tabular settings"> | ||
<p><label><%= l(:email_addresses) %>:</label> <%= newissuealert.mail_addresses %></p> | ||
<p><label><%= l(:enabled) %>:</label> <%= newissuealert.enabled ? l(:general_text_yes) : l(:general_text_no) %></p> | ||
<p><label><%= l(:newissuealerts_set_priority) %>:</label> <%= newissuealert.priority ? l(:general_text_yes) : l(:general_text_no) %></p> | ||
<% if can_edit %> | ||
<p><%= link_to l(:edit_delete), {:controller => 'newissuealerts', :action => 'edit', :id => newissuealert.id, :project_id => @project.identifier } %></p> | ||
<% end %> | ||
</div> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module RedmineNewissuealerts | ||
class Hooks < Redmine::Hook::ViewListener | ||
def newissuealerts_settings_tabs(context = {}) | ||
@project = context[:project] | ||
if @project.module_enabled?('newissuealerts') and User.current.allowed_to?({:controller => :newissuealerts, :action => :index}, context[:project]) | ||
context[:tabs].push({ :name => 'newissuealerts', | ||
:action => :view_newissuealerts, | ||
:partial => 'projects/settings/newissuealerts', | ||
:label => :newissuealert_menuitem}) | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
module RedmineNewissuealerts | ||
module ProjectsHelperPatch | ||
def self.included(base) | ||
base.extend(ClassMethods) | ||
base.send(:include, InstanceMethods) | ||
base.class_eval do | ||
unloadable | ||
alias_method_chain :project_settings_tabs, :hook | ||
end | ||
end | ||
|
||
module ClassMethods | ||
end | ||
|
||
module InstanceMethods | ||
def project_settings_tabs_with_hook | ||
tabs = project_settings_tabs_without_hook | ||
call_hook(:newissuealerts_settings_tabs, { :tabs => tabs }) | ||
return tabs | ||
end | ||
end | ||
end | ||
end |