Skip to content
Snippets Groups Projects
Commit dfabadf4 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang
Browse files

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
parent 39b44b1c
Branches
Tags
No related merge requests found
Showing
with 55 additions and 79 deletions
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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 ],
......
......@@ -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 ],
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
<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">&#9654;</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">&#9654;</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">&#9654;</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>
<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)) -%>
<% 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" %>
public/images/database_key.png

764 B

public/images/group.png

753 B

public/images/help.png

526 B | W: | H:

public/images/help.png

786 B | W: | H:

public/images/help.png
public/images/help.png
public/images/help.png
public/images/help.png
  • 2-up
  • Swipe
  • Onion skin
public/images/plugin.png

591 B

public/images/text_list_bullets.png

344 B

0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment