From: lpsolit%gmail.com <> Date: Thu, 5 Apr 2007 23:18:06 +0000 (+0000) Subject: Bug 286338: Remove admin options from footer in favor of a single link to Admin Optio... X-Git-Tag: bugzilla-3.1.2~250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c64d00a569bb404a8a7f41affc26d662bde2772;p=thirdparty%2Fbugzilla.git Bug 286338: Remove admin options from footer in favor of a single link to Admin Options - Patch by Frédéric Buclin r=justdave a=LpSolit --- diff --git a/admin.cgi b/admin.cgi new file mode 100644 index 0000000000..3edff13387 --- /dev/null +++ b/admin.cgi @@ -0,0 +1,49 @@ +#!/usr/bin/perl -wT +# -*- Mode: perl; indent-tabs-mode: nil -*- +# +# The contents of this file are subject to the Mozilla Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is the Bugzilla Bug Tracking System. +# +# The Initial Developer of the Original Code is Frédéric Buclin. +# Portions created by Frédéric Buclin are Copyright (C) 2007 +# Frédéric Buclin. All Rights Reserved. +# +# Contributor(s): Frédéric Buclin + +use strict; + +use lib qw(.); + +use Bugzilla; +use Bugzilla::Constants; +use Bugzilla::Error; + +my $cgi = Bugzilla->cgi; +my $template = Bugzilla->template; +my $user = Bugzilla->login(LOGIN_REQUIRED); + +print $cgi->header(); + +$user->in_group('admin') + || $user->in_group('tweakparams') + || $user->in_group('editusers') + || $user->can_bless + || (Bugzilla->params->{'useclassification'} && $user->in_group('editclassifications')) + || $user->in_group('editcomponents') + || scalar(@{$user->get_products_by_permission('editcomponents')}) + || $user->in_group('creategroups') + || $user->in_group('editkeywords') + || $user->in_group('bz_canusewhines') + || ThrowUserError('auth_failure', {action => 'access', object => 'administrative_pages'}); + +$template->process('admin/admin.html.tmpl') + || ThrowTemplateError($template->error()); diff --git a/skins/standard/admin.css b/skins/standard/admin.css index e94e889da0..9fcb46c94e 100644 --- a/skins/standard/admin.css +++ b/skins/standard/admin.css @@ -43,3 +43,25 @@ p.areyoureallyreallysure { tr.param_disabled { background-color: lightgrey; } + +td.admin_links { + width: 50%; + padding: 1em; + vertical-align: top; +} + +td.admin_links dt { + margin-top: 1em; +} + +td.admin_links dt.forbidden, td.admin_links dd.forbidden { + font-size: smaller; + font-style: italic; + color: #aaa; +} + +td.admin_links dt.forbidden a, td.admin_links dd.forbidden a { + text-decoration: none; + color: inherit; + cursor: default; +} diff --git a/skins/standard/global.css b/skins/standard/global.css index 0b0a51300f..1687a4aa0c 100644 --- a/skins/standard/global.css +++ b/skins/standard/global.css @@ -139,7 +139,6 @@ } #footer #links-actions, - #footer #links-edit, #footer #links-saved, #footer #links-special { display: table-row; diff --git a/template/en/default/admin/admin.html.tmpl b/template/en/default/admin/admin.html.tmpl new file mode 100644 index 0000000000..15316ed647 --- /dev/null +++ b/template/en/default/admin/admin.html.tmpl @@ -0,0 +1,126 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Frédéric Buclin + #%] + +[% PROCESS global/variables.none.tmpl %] + +[% title = BLOCK %] + Administrate your installation ([% terms.Bugzilla %] + [%+ constants.BUGZILLA_VERSION FILTER html %]) +[% END %] + +[% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] +%] + +
+ This page is only accessible to empowered users. You can access administrive pages + from here (based on your privileges), letting you configure different aspects of + this installation. Note: some sections may not be accessible to you and are marked + using a lighter color. +
+ + + + + + + +
+ +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 231ad98f51..72ab1550ab 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -460,6 +460,10 @@ 'section_num' ], +'admin/admin.html.tmpl' => [ + 'class' +], + 'admin/table.html.tmpl' => [ 'link_uri' ], diff --git a/template/en/default/global/common-links.html.tmpl b/template/en/default/global/common-links.html.tmpl index dca5d7262e..937f7a9553 100644 --- a/template/en/default/global/common-links.html.tmpl +++ b/template/en/default/global/common-links.html.tmpl @@ -55,6 +55,13 @@ [% IF user.login %]
  • | Preferences
  • + [% IF user.groups.tweakparams || user.groups.editusers || user.can_bless + || (Param('useclassification') && user.groups.editclassifications) + || user.groups.editcomponents || user.groups.admin || user.groups.creategroups + || user.groups.editkeywords || user.groups.bz_canusewhines + || user.get_products_by_permission("editcomponents").size %] +
  • | Administration
  • + [% END %]
  • | [% IF user.authorizer.can_logout %] diff --git a/template/en/default/global/useful-links.html.tmpl b/template/en/default/global/useful-links.html.tmpl index 5dff3d5786..998b5a67a0 100644 --- a/template/en/default/global/useful-links.html.tmpl +++ b/template/en/default/global/useful-links.html.tmpl @@ -32,65 +32,7 @@ [% PROCESS "global/common-links.html.tmpl" btn_id = "find_bottom" %]
  • - [%# We have no other choices than enumerating all required privileges to have - # at least one link in this section. %] - [% IF user.login - && (user.groups.tweakparams || user.groups.editusers || user.can_bless - || (Param('useclassification') && user.groups.editclassifications) - || user.groups.editcomponents || user.groups.admin || user.groups.creategroups - || user.groups.editkeywords || user.groups.bz_canusewhines) %] - - [% print_pipe = 0 %] - - [% END %] - - [%# Saved searches %] + [%# Saved searches %] [% IF user.showmybugslink OR user.queries.size OR user.queries_subscribed.size diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 7452ab8d1a..171eb9c204 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -148,7 +148,9 @@ use [% END %] - [% IF object == "attachment" %] + [% IF object == "administrative_pages" %] + administrative pages + [% ELSIF object == "attachment" %] this attachment [% ELSIF object == "bugs" %] [%+ terms.bugs %]