Commit d4f65f36 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 390955: Add some useful standard searches to the index page

r=dkl a=sgreen
parent 32466314
images/rss.png

764 Bytes

...@@ -45,6 +45,19 @@ if ($user->in_group('admin')) { ...@@ -45,6 +45,19 @@ if ($user->in_group('admin')) {
$vars->{'release'} = Bugzilla::Update::get_notifications(); $vars->{'release'} = Bugzilla::Update::get_notifications();
} }
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);
}
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("index.html.tmpl", $vars) $template->process("index.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -259,6 +259,12 @@ div#docslinks { ...@@ -259,6 +259,12 @@ div#docslinks {
margin: 0; margin: 0;
} }
.rss {
background: transparent url(../../images/rss.png) no-repeat;
padding-left: 16px;
line-height: 1.5em;
}
/**************************/ /**************************/
/* Bug links and statuses */ /* Bug links and statuses */
/**************************/ /**************************/
......
...@@ -68,13 +68,11 @@ ...@@ -68,13 +68,11 @@
.bz_common_actions a:hover { .bz_common_actions a:hover {
text-decoration: none; text-decoration: none;
} }
#enter_bug { background: url(index/file-a-bug.png) no-repeat; } #enter_bug { background: url(index/file-a-bug.png) no-repeat; }
#query { background: url(index/search.png) no-repeat; } #query { background: url(index/search.png) no-repeat; }
#account { #account { background: url(index/new-account.png) no-repeat; }
background: url(index/new-account.png) no-repeat; #help { background: url(index/help.png) no-repeat; }
margin-right: 0;
}
#quicksearchForm #quicksearchForm
{ {
clear: both; clear: both;
...@@ -106,7 +104,16 @@ ...@@ -106,7 +104,16 @@
margin: 0 0 0.8em 0; margin: 0 0 0.8em 0;
padding: 0; padding: 0;
} }
#common_queries ul {
list-style: none;
padding-left: 1.5em;
}
#common_queries li a {
text-decoration: none;
}
ul.additional_links ul.additional_links
{ {
list-style: none; list-style: none;
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
<!-- <!--
function onLoadActions() { function onLoadActions() {
quicksearchHelpText('quicksearch_main', 'show'); quicksearchHelpText('quicksearch_main', 'show');
if( window.external.AddSearchProvider ){
YAHOO.util.Dom.removeClass('quicksearch_plugin', 'bz_default_hidden');
}
document.getElementById('quicksearch_top').focus(); document.getElementById('quicksearch_top').focus();
} }
var quicksearch_message = "Enter [% terms.abug %] # or some search terms"; var quicksearch_message = "Enter [% terms.abug %] # or some search terms";
...@@ -101,73 +98,105 @@ YAHOO.util.Event.onDOMReady(onLoadActions); ...@@ -101,73 +98,105 @@ YAHOO.util.Event.onDOMReady(onLoadActions);
[% END %] [% END %]
<div id="page-index"> <div id="page-index">
<table> <h1 id="welcome"> Welcome to [% terms.Bugzilla %]</h1>
<tr> <div class="intro">[% Hook.process('intro') %]</div>
<td>
<h1 id="welcome"> Welcome to [% terms.Bugzilla %]</h1> <div class="bz_common_actions">
<div class="intro">[% Hook.process('intro') %]</div> <ul>
<li>
<div class="bz_common_actions"> <a id="enter_bug" href="enter_bug.cgi"><span>File [% terms.aBug %]</span></a>
<ul> </li>
<li> <li>
<a id="enter_bug" href="enter_bug.cgi"><span>File <a id="query" href="query.cgi"><span>Search</span></a>
[%= terms.aBug %]</span></a> </li>
</li> <li>
<li> <a id="account"
<a id="query" href="query.cgi"><span>Search</span></a> [% IF user.id %]
</li> href="userprefs.cgi"><span>User Preferences</span></a>
<li> [% ELSIF Param('createemailregexp') && user.authorizer.user_can_create_account %]
<a id="account" href="createaccount.cgi"><span>Open a New Account</span></a>
[% IF user.id %] [% ELSE %]
href="userprefs.cgi"><span>User Preferences</span></a> href="?GoAheadAndLogIn=1"><span>Log In</span></a>
[% ELSIF Param('createemailregexp') [% END %]
&& user.authorizer.user_can_create_account </li>
%] [% IF Param("docs_urlbase") %]
href="createaccount.cgi"><span>Open a New Account</span></a> <li>
[% ELSE %] <a id="help" href="[% docs_urlbase FILTER html %]using.html"><span>Documentation</span></a>
href="?GoAheadAndLogIn=1"><span>Log In</span></a> </li>
[% END %] [% END %]
</li> </ul>
</ul> </div>
</div>
<div>
<form id="quicksearchForm" name="quicksearchForm" action="buglist.cgi" <form id="quicksearchForm" name="quicksearchForm" action="buglist.cgi"
onsubmit="return checkQuicksearch(this);"> onsubmit="return checkQuicksearch(this);">
<div> <input id="quicksearch_main" type="text" name="quicksearch" title="Quick Search"
<input id="quicksearch_main" type="text" name="quicksearch" onfocus="quicksearchHelpText(this.id, 'hide');"
title="Quick Search" onblur="quicksearchHelpText(this.id, 'show');">
onfocus="quicksearchHelpText(this.id, 'hide');" <input id="find" type="submit" value="Quick Search">
onblur="quicksearchHelpText(this.id, 'show');" <a href="page.cgi?id=quicksearch.html" title="Quick Search help">[?]</a>
> </form>
<input id="find" type="submit" value="Quick Search">
<ul class="additional_links" id="quicksearch_links"> <ul class="additional_links">
<li> [% Hook.process('additional_links') %]
<a href="page.cgi?id=quicksearch.html">Quick Search help</a> </ul>
</li> </div>
<li class="bz_default_hidden" id="quicksearch_plugin">
| <div id="common_queries">
<a href="javascript:window.external.AddSearchProvider('[% urlbase FILTER html %]search_plugin.cgi')"> <h4>Common Queries:</h4>
Install the Quick Search plugin <ul>
</a> [% IF user.id %]
</li> <li>
</ul> [% title = BLOCK %]Open [% terms.bugs %] assigned to me[% END %]
<ul class="additional_links"> <a href="buglist.cgi?f1=assigned_to&amp;o1=equals&amp;v1=%25user%25&amp;resolution=---">
<li> [% title FILTER html %]</a> ([% assignee_count FILTER html %])
<a href="[% docs_urlbase FILTER html %]using.html"> <a href="buglist.cgi?f1=assigned_to&amp;o1=equals&amp;v1=%25user%25&amp;resolution=---&amp;ctype=atom&amp;title=[% title FILTER uri %]"
[%- terms.Bugzilla %] User's Guide</a> class="rss">&nbsp;</a>
</li> </li>
<li> <li>
| [% title = BLOCK %]Open [% terms.bugs %] reported by me[% END %]
<a href="page.cgi?id=release-notes.html">Release Notes</a> <a href="buglist.cgi?f1=reporter&amp;o1=equals&amp;v1=%25user%25&amp;resolution=---">
</li> [% title FILTER html %]</a> ([% reporter_count FILTER html %])
[% Hook.process('additional_links') %] <a href="buglist.cgi?f1=reporter&amp;o1=equals&amp;v1=%25user%25&amp;resolution=---&amp;ctype=atom&amp;title=[% title FILTER uri %]"
</ul> class="rss">&nbsp;</a>
</div> </li>
</form> [% IF Bugzilla.has_flags %]
<div class="outro">[% Hook.process('outro') %]</div> <li>
</td> [% title = BLOCK %]Requests addressed to me[% END %]
</tr> <a href="request.cgi?action=queue&amp;requestee=[% user.login FILTER uri %]&amp;group=type&amp;do_union=0">
</table> [% title FILTER html %]</a> ([% requestee_count FILTER html %])
<a href="buglist.cgi?f1=requestees.login_name&amp;o1=equals&amp;v1=%25user%25&amp;ctype=atom&amp;title=[% title FILTER uri %]"
class="rss">&nbsp;</a>
</li>
[% END %]
[% END %]
<li>
[% terms.Bugs %] reported in the
<a href="buglist.cgi?chfield=[Bug%20creation]&amp;chfieldfrom=24h">last 24 hours</a>
[% title = BLOCK %][% terms.Bugs %] reported in the last 24 hours[% END %]
<a href="buglist.cgi?chfield=[Bug%20creation]&amp;chfieldfrom=24h&amp;ctype=atom&amp;title=[% title FILTER uri %]"
class="rss">&nbsp;</a>
| <a href="buglist.cgi?chfield=[Bug%20creation]&amp;chfieldfrom=7d">last 7 days</a>
[% title = BLOCK %][% terms.Bugs %] reported in the last 7 days[% END %]
<a href="buglist.cgi?chfield=[Bug%20creation]&amp;chfieldfrom=7d&amp;ctype=atom&amp;title=[% title FILTER uri %]"
class="rss">&nbsp;</a>
</li>
<li>
[% terms.Bugs %] changed in the
<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&amp;ctype=atom&amp;title=[% title FILTER uri %]"
class="rss">&nbsp;</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&amp;ctype=atom&amp;title=[% title FILTER uri %]"
class="rss">&nbsp;</a>
</li>
</ul>
</div>
<div class="outro">[% Hook.process('outro') %]</div>
</div> </div>
[% PROCESS global/footer.html.tmpl %] [% PROCESS global/footer.html.tmpl %]
Markdown is supported
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