diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-17 18:21:02 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-12-17 18:21:02 +0000 |
commit | dfabadf4f7e00d5769f96eb2d6944c7ed7c6e410 (patch) | |
tree | 49d01d51e6501b8c1803f23dc0ae8e948e47c8bf | |
parent | 39b44b1cb94f68514bf9ce7ae76ee7228bf6ce07 (diff) | |
download | redmine-dfabadf4f7e00d5769f96eb2d6944c7ed7c6e410.tar.gz redmine-dfabadf4f7e00d5769f96eb2d6944c7ed7c6e410.zip |
Adds an admin layout that displays the admin menu in the sidebar.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3176 e93f8b46-1217-0410-a6f0-8f06a7374b81
24 files changed, 72 insertions, 79 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 61d1eada7..d0bfc41c5 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class AdminController < ApplicationController + layout 'admin' + before_filter :require_admin helper :sort diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a794b3b28..144ccdd57 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -177,7 +177,7 @@ class ApplicationController < ActionController::Base def render_403 @project = nil - render :template => "common/403", :layout => !request.xhr?, :status => 403 + render :template => "common/403", :layout => (request.xhr? ? false : 'base'), :status => 403 return false end diff --git a/app/controllers/auth_sources_controller.rb b/app/controllers/auth_sources_controller.rb index 981f29f03..0f5fba141 100644 --- a/app/controllers/auth_sources_controller.rb +++ b/app/controllers/auth_sources_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class AuthSourcesController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb index ec101fe5a..ec16be566 100644 --- a/app/controllers/custom_fields_controller.rb +++ b/app/controllers/custom_fields_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class CustomFieldsController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/controllers/enumerations_controller.rb b/app/controllers/enumerations_controller.rb index 8070df03d..d39f5edf7 100644 --- a/app/controllers/enumerations_controller.rb +++ b/app/controllers/enumerations_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class EnumerationsController < ApplicationController + layout 'admin' + before_filter :require_admin helper :custom_fields diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 54b5d1b97..96e59c288 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -16,7 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class GroupsController < ApplicationController - layout 'base' + layout 'admin' + before_filter :require_admin helper :custom_fields diff --git a/app/controllers/issue_statuses_controller.rb b/app/controllers/issue_statuses_controller.rb index 3be6abf3f..88f97ecb4 100644 --- a/app/controllers/issue_statuses_controller.rb +++ b/app/controllers/issue_statuses_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class IssueStatusesController < ApplicationController + layout 'admin' + before_filter :require_admin verify :method => :post, :only => [ :destroy, :create, :update, :move, :update_issue_done_ratio ], diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index 8074b18b9..c701cac74 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class RolesController < ApplicationController + layout 'admin' + before_filter :require_admin verify :method => :post, :only => [ :destroy, :move ], diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index c1d94850f..77e1da56b 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class SettingsController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb index cf797d853..1b7eddcb9 100644 --- a/app/controllers/trackers_controller.rb +++ b/app/controllers/trackers_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class TrackersController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 05dc5bc59..991afbfff 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class UsersController < ApplicationController + layout 'admin' + before_filter :require_admin, :except => :show helper :sort @@ -62,7 +64,8 @@ class UsersController < ApplicationController if @user != User.current && !User.current.admin? && @memberships.empty? && events.empty? render_404 and return end - + render :layout => 'base' + rescue ActiveRecord::RecordNotFound render_404 end diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb index f11aa4730..6e7c58e26 100644 --- a/app/controllers/workflows_controller.rb +++ b/app/controllers/workflows_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class WorkflowsController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/views/admin/_menu.rhtml b/app/views/admin/_menu.rhtml index ef2abbc56..87fa5c780 100644 --- a/app/views/admin/_menu.rhtml +++ b/app/views/admin/_menu.rhtml @@ -1,25 +1,19 @@ -<div id="menuAdmin" class="menu" onmouseover="menuMouseover(event)"> - <a class="menuItem" href="#" onmouseover="menuItemMouseover(event,'menuProjects');" onclick="this.blur(); return false;"><span class="menuItemText"><%=l(:label_project_plural)%></span><span class="menuItemArrow">▶</span></a> - <a class="menuItem" href="#" onmouseover="menuItemMouseover(event,'menuUsers');" onclick="this.blur(); return false;"><span class="menuItemText"><%=l(:label_user_plural)%></span><span class="menuItemArrow">▶</span></a> - <%= link_to l(:label_role_and_permissions), {:controller => 'roles' }, :class => "menuItem" %> - <a class="menuItem" href="#" onmouseover="menuItemMouseover(event,'menuTrackers');" onclick="this.blur(); return false;"><span class="menuItemText"><%=l(:label_issue_tracking)%></span><span class="menuItemArrow">▶</span></a> - <%= link_to l(:label_custom_field_plural), {:controller => 'custom_fields' }, :class => "menuItem" %> - <%= link_to l(:label_enumerations), {:controller => 'enumerations' }, :class => "menuItem" %> - <%= link_to l(:field_mail_notification), {:controller => 'admin', :action => 'mail_options' }, :class => "menuItem" %> - <%= link_to l(:label_authentication), {:controller => 'auth_sources' }, :class => "menuItem" %> - <%= link_to l(:label_settings), {:controller => 'settings' }, :class => "menuItem" %> - <%= link_to l(:label_information_plural), {:controller => 'admin', :action => 'info' }, :class => "menuItem" %> -</div> -<div id="menuTrackers" class="menu"> - <%= link_to l(:label_tracker_plural), {:controller => 'trackers' }, :class => "menuItem" %> - <%= link_to l(:label_issue_status_plural), {:controller => 'issue_statuses' }, :class => "menuItem" %> - <%= link_to l(:label_workflow), {:controller => 'roles', :action => 'workflow' }, :class => "menuItem" %> -</div> -<div id="menuProjects" class="menu"> - <%= link_to l(:button_list), {:controller => 'admin', :action => 'projects' }, :class => "menuItem" %> - <%= link_to l(:label_new), {:controller => 'projects', :action => 'add' }, :class => "menuItem" %> -</div> -<div id="menuUsers" class="menu"> - <%= link_to l(:button_list), {:controller => 'users' }, :class => "menuItem" %> - <%= link_to l(:label_new), {:controller => 'users', :action => 'add' }, :class => "menuItem" %> +<div id="admin-menu"> + <ul> + <li><%= link_to l(:label_project_plural), {:controller => 'admin', :action => 'projects'}, :class => 'projects' %></li> + <li><%= link_to l(:label_user_plural), {:controller => 'users'}, :class => 'users' %></li> + <li><%= link_to l(:label_group_plural), {:controller => 'groups'}, :class => 'groups' %></li> + <li><%= link_to l(:label_role_and_permissions), {:controller => 'roles'}, :class => 'roles' %></li> + <li><%= link_to l(:label_tracker_plural), {:controller => 'trackers'}, :class => 'trackers' %></li> + <li><%= link_to l(:label_issue_status_plural), {:controller => 'issue_statuses'}, :class => 'issue_statuses' %></li> + <li><%= link_to l(:label_workflow), {:controller => 'workflows', :action => 'edit'}, :class => 'workflows' %></li> + <li><%= link_to l(:label_custom_field_plural), {:controller => 'custom_fields'}, :class => 'custom_fields' %></li> + <li><%= link_to l(:label_enumerations), {:controller => 'enumerations'}, :class => 'enumerations' %></li> + <li><%= link_to l(:label_settings), {:controller => 'settings'}, :class => 'settings' %></li> + <% menu_items_for(:admin_menu) do |item| -%> + <li><%= link_to h(item.caption), item.url, item.html_options %></li> + <% end -%> + <li><%= link_to l(:label_plugins), {:controller => 'admin', :action => 'plugins'}, :class => 'plugins' %></li> + <li><%= link_to l(:label_information_plural), {:controller => 'admin', :action => 'info'}, :class => 'info' %></li> + </ul> </div> diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml index 3c96a9a0a..f7e72313e 100644 --- a/app/views/admin/index.rhtml +++ b/app/views/admin/index.rhtml @@ -1,56 +1,8 @@ <h2><%=l(:label_administration)%></h2> -<%= render :partial => 'no_data' if @no_configuration_data %> - -<p class="icon22 icon22-projects"> -<%= link_to l(:label_project_plural), :controller => 'admin', :action => 'projects' %> | -<%= link_to l(:label_new), :controller => 'projects', :action => 'add' %> -</p> - -<p class="icon22 icon22-users"> -<%= link_to l(:label_user_plural), :controller => 'users' %> | -<%= link_to l(:label_new), :controller => 'users', :action => 'add' %> -</p> - -<p class="icon22 icon22-groups"> -<%= link_to l(:label_group_plural), :controller => 'groups' %> | -<%= link_to l(:label_new), :controller => 'groups', :action => 'new' %> -</p> - -<p class="icon22 icon22-role"> -<%= link_to l(:label_role_and_permissions), :controller => 'roles' %> -</p> - -<p class="icon22 icon22-tracker"> -<%= link_to l(:label_tracker_plural), :controller => 'trackers' %> | -<%= link_to l(:label_issue_status_plural), :controller => 'issue_statuses' %> | -<%= link_to l(:label_workflow), :controller => 'workflows', :action => 'edit' %> -</p> - -<p class="icon22 icon22-workflow"> -<%= link_to l(:label_custom_field_plural), :controller => 'custom_fields' %> -</p> - -<p class="icon22 icon22-options"> -<%= link_to l(:label_enumerations), :controller => 'enumerations' %> -</p> - -<p class="icon22 icon22-settings"> -<%= link_to l(:label_settings), :controller => 'settings' %> -</p> - -<% menu_items_for(:admin_menu) do |item| -%> - <%= content_tag 'p', - link_to(h(item.caption), item.url, item.html_options), - :class => ["icon22", "icon22-#{item.name}"].join(' ') %> -<% end -%> - -<p class="icon22 icon22-plugin"> -<%= link_to l(:label_plugins), :controller => 'admin', :action => 'plugins' %> -</p> - -<p class="icon22 icon22-info"> -<%= link_to l(:label_information_plural), :controller => 'admin', :action => 'info' %> -</p> +<div id="admin-index"> + <%= render :partial => 'no_data' if @no_configuration_data %> + <%= render :partial => 'menu' %> +</div> <% html_title(l(:label_administration)) -%> diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml new file mode 100644 index 000000000..197c32a84 --- /dev/null +++ b/app/views/layouts/admin.rhtml @@ -0,0 +1,8 @@ +<% unless controller_name == 'admin' && action_name == 'index' %> + <% content_for :sidebar do %> + <h3><%=l(:label_administration)%></h3> + <%= render :partial => 'admin/menu' %> + <% end %> +<% end %> + +<%= render :file => "layouts/base" %> diff --git a/public/images/database_key.png b/public/images/database_key.png Binary files differnew file mode 100644 index 000000000..333414767 --- /dev/null +++ b/public/images/database_key.png diff --git a/public/images/group.png b/public/images/group.png Binary files differnew file mode 100644 index 000000000..7fb4e1f1e --- /dev/null +++ b/public/images/group.png diff --git a/public/images/help.png b/public/images/help.png Binary files differindex af4e6ff46..5c870176d 100644 --- a/public/images/help.png +++ b/public/images/help.png diff --git a/public/images/plugin.png b/public/images/plugin.png Binary files differnew file mode 100644 index 000000000..6187b15ae --- /dev/null +++ b/public/images/plugin.png diff --git a/public/images/text_list_bullets.png b/public/images/text_list_bullets.png Binary files differnew file mode 100644 index 000000000..4a8672bde --- /dev/null +++ b/public/images/text_list_bullets.png diff --git a/public/images/textfield.png b/public/images/textfield.png Binary files differnew file mode 100644 index 000000000..d37e7304e --- /dev/null +++ b/public/images/textfield.png diff --git a/public/images/ticket_go.png b/public/images/ticket_go.png Binary files differnew file mode 100644 index 000000000..49e54fd87 --- /dev/null +++ b/public/images/ticket_go.png diff --git a/public/images/user.png b/public/images/user.png Binary files differindex 5f55e7e49..30383c2de 100644 --- a/public/images/user.png +++ b/public/images/user.png diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 1e1ab61cb..1735dc2e0 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -48,6 +48,23 @@ h4, .wiki h3 {font-size: 13px;padding: 2px 10px 1px 0px;margin-bottom: 5px; bord #main-menu li a:hover {background:#759FCF; color:#fff;} #main-menu li a.selected, #main-menu li a.selected:hover {background:#fff; color:#555;} +#admin-menu ul {margin: 0; padding: 0;} +#admin-menu li {margin: 0; padding: 0 0 12px 0; list-style-type:none;} + +#admin-menu a { background-position: 0% 40%; background-repeat: no-repeat; padding-left: 20px; padding-top: 2px; padding-bottom: 3px;} +#admin-menu a.projects { background-image: url(../images/projects.png); } +#admin-menu a.users { background-image: url(../images/user.png); } +#admin-menu a.groups { background-image: url(../images/group.png); } +#admin-menu a.roles { background-image: url(../images/database_key.png); } +#admin-menu a.trackers { background-image: url(../images/ticket.png); } +#admin-menu a.issue_statuses { background-image: url(../images/ticket_edit.png); } +#admin-menu a.workflows { background-image: url(../images/ticket_go.png); } +#admin-menu a.custom_fields { background-image: url(../images/textfield.png); } +#admin-menu a.enumerations { background-image: url(../images/text_list_bullets.png); } +#admin-menu a.settings { background-image: url(../images/changeset.png); } +#admin-menu a.plugins { background-image: url(../images/plugin.png); } +#admin-menu a.info { background-image: url(../images/help.png); } + #main {background-color:#EEEEEE;} #sidebar{ float: right; width: 17%; position: relative; z-index: 9; min-height: 600px; padding: 0; margin: 0;} |