Aklapper has uploaded a new change for review. https://gerrit.wikimedia.org/r/106650
Change subject: Display useful links on Bugzilla front page ...................................................................... Display useful links on Bugzilla front page Based on http://bzr.mozilla.org/bugzilla/trunk/revision/8851 in Bugzilla trunk, with some customizations. Bug: 22170 Change-Id: Ia4b025d6429c46346b206a233b3134e5073adb2d --- A index.cgi M skins/contrib/Wikimedia/global.css A skins/contrib/Wikimedia/images/rss.png M template/en/custom/index.html.tmpl 4 files changed, 196 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bugzilla/modifications refs/changes/50/106650/1 diff --git a/index.cgi b/index.cgi new file mode 100644 index 0000000..e52454c --- /dev/null +++ b/index.cgi @@ -0,0 +1,75 @@ +#!/usr/bin/perl -wT +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +############################################################################### +# Script Initialization +############################################################################### + +# Make it harder for us to do dangerous things in Perl. +use strict; + +# Include the Bugzilla CGI and general utility library. +use lib qw(. lib); + +use Bugzilla; +use Bugzilla::Constants; +use Bugzilla::Error; +use Bugzilla::Update; + +# Check whether or not the user is logged in +my $user = Bugzilla->login(LOGIN_OPTIONAL); +my $cgi = Bugzilla->cgi; +my $template = Bugzilla->template; +my $vars = {}; + +# And log out the user if requested. We do this first so that nothing +# else accidentally relies on the current login. +if ($cgi->param('logout')) { + Bugzilla->logout(); + $user = Bugzilla->user; + $vars->{'message'} = "logged_out"; + # Make sure that templates or other code doesn't get confused about this. + $cgi->delete('logout'); +} + +############################################################################### +# Main Body Execution +############################################################################### + +# Return the appropriate HTTP response headers. +print $cgi->header(); + +if ($user->in_group('admin')) { + # If 'urlbase' is not set, display the Welcome page. + unless (Bugzilla->params->{'urlbase'}) { + $template->process('welcome-admin.html.tmpl') + || ThrowTemplateError($template->error()); + exit; + } + # Inform the administrator about new releases, if any. + $vars->{'release'} = Bugzilla::Update::get_notifications(); +} + +# WIKIMEDIA START 22170 +if ($user->id) { + my $dbh = Bugzilla->dbh; + $vars->{assignee_count} = + $dbh->selectrow_array('SELECT COUNT(*) FROM bugs WHERE assigned_to = ? + AND resolution = ""', undef, $user->id); + $vars->{reporter_count} = + $dbh->selectrow_array('SELECT COUNT(*) FROM bugs WHERE reporter = ? + AND resolution = ""', undef, $user->id); + $vars->{requestee_count} = + $dbh->selectrow_array('SELECT COUNT(DISTINCT bug_id) FROM flags + WHERE requestee_id = ?', undef, $user->id); +} +# WIKIMEDIA END 22170 + +# Generate and return the UI (HTML page) from the appropriate template. +$template->process("index.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/skins/contrib/Wikimedia/global.css b/skins/contrib/Wikimedia/global.css index e947c8a..0b6cdab 100644 --- a/skins/contrib/Wikimedia/global.css +++ b/skins/contrib/Wikimedia/global.css @@ -159,6 +159,14 @@ margin: 0; } +/* WIKIMEDIA START 22170 */ +.rss { + background: transparent url(./images/rss.png) no-repeat; + padding-left: 16px; + line-height: 1.5em; +} +/* WIKIMEDIA END 22170 */ + /**************************/ /* Bug links and statuses */ /**************************/ diff --git a/skins/contrib/Wikimedia/images/rss.png b/skins/contrib/Wikimedia/images/rss.png new file mode 100644 index 0000000..1679ab0 --- /dev/null +++ b/skins/contrib/Wikimedia/images/rss.png Binary files differ diff --git a/template/en/custom/index.html.tmpl b/template/en/custom/index.html.tmpl index 49542dc..baab02f 100644 --- a/template/en/custom/index.html.tmpl +++ b/template/en/custom/index.html.tmpl @@ -124,11 +124,11 @@ </div> <div style="clear:both;"></div> - <hr /> [%# List items of links to more things users can do on this installation. %] [% Hook.process('additional_links') %] + <div id="quicksearch" style="padding-top: 15px; padding-bottom: 20px;"> <form id="quicksearchForm" name="quicksearchForm" action="buglist.cgi" method="get" onsubmit="return checkQuicksearch(this);"> <div> @@ -140,6 +140,118 @@ <input id="find" type="submit" value="Quick Search"> </div> </form> + </div> + + <div id="commonqueries" style="border: 1px grey solid; margin-top:15px; padding:5px"> + <h2 style="text-align:center;">Common queries for open reports</h2> + <table border="0" text-align="left" valign="top"> + <tr> + <td style="vertical-align: top; padding-right: 40px"> + <ul> + [% IF user.id %] + <li> + [% title = BLOCK %]Assigned to me[% END %] + <a href="buglist.cgi?f1=assigned_to&o1=equals&v1=%25user%25&resolution=---"> + [% title FILTER html %]</a> ([% assignee_count FILTER html %]) + <a href="buglist.cgi?f1=assigned_to&o1=equals&v1=%25user%25&resolution=---&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + <a href="buglist.cgi?f1=assigned_to&o1=equals&v1=%25user%25&bug_status=ASSIGNED"> + (with ASSIGNED status)</a> + </li> + <li> + [% title = BLOCK %]Reported by me[% END %] + <a href="buglist.cgi?f1=reporter&o1=equals&v1=%25user%25&resolution=---"> + [% title FILTER html %]</a> ([% reporter_count FILTER html %]) + <a href="buglist.cgi?f1=reporter&o1=equals&v1=%25user%25&resolution=---&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + [% IF Bugzilla.has_flags %] + <li> + [% title = BLOCK %]Requests addressed to me[% END %] + <a href="request.cgi?action=queue&requestee=[% user.login FILTER uri %]&group=type&do_union=0"> + [% title FILTER html %]</a> ([% requestee_count FILTER html %]) + <a href="buglist.cgi?f1=requestees.login_name&o1=equals&v1=%25user%25&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + [% END %] + [% END %] + + <li>Actuality (also closed [% terms.bugs %]): + <ul> + <li> + Reported in + <a href="buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=24h">last 24 hours</a> + [% title = BLOCK %][% terms.Bugs %] reported in the last 24 hours[% END %] + <a href="buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=24h&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + | <a href="buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=7d">last 7 days</a> + [% title = BLOCK %][% terms.Bugs %] reported in the last 7 days[% END %] + <a href="buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=7d&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + <li> + Changed in + <a href="buglist.cgi?chfieldfrom=24h">last 24 hours</a> + [% title = BLOCK %][% terms.Bugs %] changed in the last 24 hours[% END %] + <a href="buglist.cgi?chfieldfrom=24h&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + | <a href="buglist.cgi?chfieldfrom=7d">last 7 days</a> + [% title = BLOCK %][% terms.Bugs %] changed in the last 7 days[% END %] + <a href="buglist.cgi?chfieldfrom=7d&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + </ul> + </li> + <li>Actionability: + <ul> + <li> + <a href="buglist.cgi?bug_status=PATCH_TO_REVIEW">In PATCH_TO_REVIEW status</a> + [% title = BLOCK %][% terms.Bugs %] in PATCH_TO_REVIEW status[% END %] + <a href="buglist.cgi?bug_status=PATCH_TO_REVIEW&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + <li> + Without changes for + <a href="buglist.cgi?chfieldto=-6m&resolution=---">6 months</a> + | <a href="buglist.cgi?chfieldto=-2y&resolution=---">2 years</a> + </li> + </ul> + </li> + </ul> + </td> + <td style="vertical-align: top;"> + <ul> + <li>Product Planning: + <ul> + <li> + <a href="report.cgi?x_axis_field=product&y_axis_field=target_milestone&product=Huggle&product=MediaWiki&product=MediaWiki+extensions&product=VisualEditor&product=Wikimedia&resolution=---&j_top=AND&format=table&action=wrap">Product × Target Milestone</a> + </li> + <li> + <a href="report.cgi?x_axis_field=priority&y_axis_field=bug_severity&z_axis_field=product&resolution=---&format=table&action=wrap">Priority × Severity per product</a> + </li> + <li> + <a href="describekeywords.cgi">Keywords</a> + </li> + </ul> + </li> + <li>Popularity: + <ul> + <li> + >=20 votes: <a href="buglist.cgi?votes_type=greaterthaneq&votes=20&resolution=---">All</a> | + <a href="buglist.cgi?votes_type=greaterthaneq&votes=20&resolution=---&product=MediaWiki">MediaWiki</a> | + <a href="buglist.cgi?votes_type=greaterthaneq&votes=20&resolution=---&product=MediaWiki%20extensions">MediaWiki ext.</a> | + <a href="buglist.cgi?votes_type=greaterthaneq&votes=20&resolution=---&product=Wikimedia">Wikimedia</a> + </li> + <li> + <a href="duplicates.cgi">High number of duplicates</a> + </li> + </ul> + </li> + </ul> + </td> + </tr> + </table> + </div> <div class="outro">[% Hook.process('outro') %]</div> </div> -- To view, visit https://gerrit.wikimedia.org/r/106650 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia4b025d6429c46346b206a233b3134e5073adb2d Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/bugzilla/modifications Gerrit-Branch: master Gerrit-Owner: Aklapper <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
