Commit d8f23ea4 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 475063: Make the logged-out index.cgi simpler

Patch By Guy Pyrzak <guy.pyrzak@gmail.com> r=mkanat, a=mkanat
parent 138c15b1
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
* The Original Code is the Bugzilla Bug Tracking System. * The Original Code is the Bugzilla Bug Tracking System.
* *
* Contributor(s): Vitaly Harisov <vitaly@rathedg.com> * Contributor(s): Vitaly Harisov <vitaly@rathedg.com>
* Guy Pyrzak <guy.pyrzak@gmail.com>
*/ */
/* index page (begin) */ /* index page (begin) */
...@@ -20,66 +21,125 @@ ...@@ -20,66 +21,125 @@
padding: 0.2em 0.2em 0.15em 0.2em; padding: 0.2em 0.2em 0.15em 0.2em;
} }
#page-index ul, #page-index li, /* Hide from NN4 */
#page-index p, #page-index form p
#new_release
{ {
margin: 0; border: 2px solid red;
padding: 0; padding: 0.5em 1em;
margin: 1em;
font-weight: bold;
} }
#page-index ul #new_release .notice
{ {
padding-bottom: 1em; font-size: 80%;
font-weight: normal;
} }
#page-index li #welcome-admin a
{ {
list-style: none; font-weight: bold;
} }
#page-index p div.bz_common_actions
{ {
padding-bottom: 0.5em; height: 190px;
width: 195px;
background-color: blue;
float: left;
margin: 0 3ex;
text-align: center;
margin-bottom: 3em;
} }
div.bz_common_actions span
/* Hide from NN4 */
div#page-index .intro
{ {
width: 250px; position: relative;
height: 200px; top: 95%;
font-weight: bold;
margin-top: 2.3em;
margin-right: 2.3em;
float: right;
background: transparent no-repeat url(index/front.png);
} }
#page-index #report div.bz_common_actions,
div.bz_common_actions a,
div.bz_common_actions a div,
div.bz_common_actions a:visited,
div.bz_common_actions a:hover {
text-decoration: none;
}
a.bz_common_actions {
text-decoration: none;
}
#quicksearchForm
{ {
padding-bottom: 1em; clear: both;
text-align: center;
margin-bottom: 2em;
} }
#page-index #sidebar #quicksearchForm #quicksearch
{ {
padding-top: 1em; width: 25em;
} }
#new_release #quicksearchForm
{ {
border: 2px solid red; margin: 0;
padding: 0.5em 1em; padding: 0;
margin: 1em; }
#page-index table{
border-collapse: collapse;
}
#welcome
{
font-size: x-large;
font-weight: bold; font-weight: bold;
text-align: center;
margin: 0 0 0.8em 0;
padding: 0;
} }
#new_release .notice #enter_bug
{ {
font-size: 80%; background: url(index/bug.gif) no-repeat;
font-weight: normal;
} }
#welcome-admin a #query
{ {
font-weight: bold; background: url(index/search.gif) no-repeat;
}
#account
{
background: url(index/account.gif) no-repeat;
}
ul.additional_links
{
list-style: none;
margin: 0;
padding: 0;
}
ul#quicksearch_links{
margin-bottom: 1em;
}
ul.additional_links li
{
display: inline;
}
ul.additional_links li.bz_default_hidden
{
display: none;
}
input.quicksearch_help_text
{
color: #ccc;
} }
/* index page (end) */ /* index page (end) */
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
subheader = subheader subheader = subheader
onload="setContentTypeDisabledState(document.entryform);" onload="setContentTypeDisabledState(document.entryform);"
style_urls = [ 'skins/standard/create_attachment.css' ] style_urls = [ 'skins/standard/create_attachment.css' ]
javascript_urls = [ "js/yui/yahoo-dom-event.js", "js/attachment.js" ] javascript_urls = [ "js/attachment.js" ]
doc_section = "attachments.html" doc_section = "attachments.html"
%] %]
......
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "Attachment $attachment.id added to $terms.Bug $attachment.bug_id" title = "Attachment $attachment.id added to $terms.Bug $attachment.bug_id"
bodyclasses = bodyclasses bodyclasses = bodyclasses
javascript_urls = [ "js/util.js", "js/field.js", javascript_urls = [ "js/util.js", "js/field.js", "js/yui/calendar.js" ]
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
%] %]
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
title = title title = title
header = header header = header
subheader = subheader subheader = subheader
javascript_urls = [ "js/yui/yahoo-dom-event.js" ]
doc_section = "attachments.html" doc_section = "attachments.html"
%] %]
......
...@@ -43,8 +43,7 @@ ...@@ -43,8 +43,7 @@
subheader = filtered_desc subheader = filtered_desc
header_addl_info = "Last modified: $filtered_timestamp" header_addl_info = "Last modified: $filtered_timestamp"
bodyclasses = bodyclasses bodyclasses = bodyclasses
javascript_urls = [ "js/util.js", "js/field.js", javascript_urls = [ "js/util.js", "js/field.js", "js/yui/calendar.js" ]
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
%] %]
......
...@@ -32,8 +32,7 @@ ...@@ -32,8 +32,7 @@
title = title title = title
style_urls = [ 'skins/standard/create_attachment.css', style_urls = [ 'skins/standard/create_attachment.css',
'skins/standard/yui/calendar.css' ] 'skins/standard/yui/calendar.css' ]
javascript_urls = [ "js/attachment.js", "js/util.js", javascript_urls = [ "js/attachment.js", "js/util.js", "js/yui/calendar.js",
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js",
"js/field.js", "js/yui/cookie.js", "js/TUI.js" ] "js/field.js", "js/yui/cookie.js", "js/TUI.js" ]
%] %]
......
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
title = "$terms.Bug $id Submitted &ndash; $filtered_desc" title = "$terms.Bug $id Submitted &ndash; $filtered_desc"
header = "$terms.Bug&nbsp;$id Submitted" header = "$terms.Bug&nbsp;$id Submitted"
subheader = filtered_desc subheader = filtered_desc
javascript_urls = [ "js/util.js", "js/field.js", javascript_urls = [ "js/util.js", "js/field.js", "js/yui/calendar.js" ]
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
......
...@@ -42,8 +42,7 @@ ...@@ -42,8 +42,7 @@
[% END %] [% END %]
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
javascript_urls = [ "js/util.js", "js/field.js", javascript_urls = [ "js/util.js", "js/field.js", "js/yui/calendar.js" ]
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
%] %]
...@@ -44,8 +44,7 @@ ...@@ -44,8 +44,7 @@
subheader = filtered_desc subheader = filtered_desc
header_addl_info = "Last modified: $filtered_timestamp" header_addl_info = "Last modified: $filtered_timestamp"
bodyclasses = bodyclasses bodyclasses = bodyclasses
javascript_urls = [ "js/util.js", "js/field.js", javascript_urls = [ "js/util.js", "js/field.js", "js/yui/calendar.js" ]
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
%] %]
......
...@@ -188,8 +188,14 @@ ...@@ -188,8 +188,14 @@
type="text/css"> type="text/css">
<![endif]--> <![endif]-->
<script src="js/yui/yahoo-dom-event.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
YAHOO.namespace('bugzilla');
if (YAHOO.env.ua.gecko) {
YAHOO.util.Event._simpleRemove(window, "unload",
YAHOO.util.Event._unload);
}
[%# Make some Bugzilla information available to all scripts. [%# Make some Bugzilla information available to all scripts.
# We don't import every parameter and constant because we # We don't import every parameter and constant because we
# don't want to add a lot of uncached JS to every page. # don't want to add a lot of uncached JS to every page.
...@@ -210,13 +216,6 @@ ...@@ -210,13 +216,6 @@
[% FOREACH javascript_url = javascript_urls %] [% FOREACH javascript_url = javascript_urls %]
<script src="[% javascript_url FILTER html %]" type="text/javascript"></script> <script src="[% javascript_url FILTER html %]" type="text/javascript"></script>
[% END %] [% END %]
[% IF javascript_urls.grep('yui/').size %]
<script type="text/javascript">
YAHOO.namespace('bugzilla');
if( YAHOO.env.ua.gecko )
YAHOO.util.Event._simpleRemove(window, "unload", YAHOO.util.Event._unload);
</script>
[% END %]
[% END %] [% END %]
[%# this puts the live bookmark up on firefox for the Atom feed %] [%# this puts the live bookmark up on firefox for the Atom feed %]
...@@ -247,7 +246,6 @@ ...@@ -247,7 +246,6 @@
# 'bannerhtml' # 'bannerhtml'
#%] #%]
<div id="header"> <div id="header">
[% INCLUDE global/banner.html.tmpl %] [% INCLUDE global/banner.html.tmpl %]
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
# Contributor(s): Terry Weissman <terry@mozilla.org> # Contributor(s): Terry Weissman <terry@mozilla.org>
# Jacob Steenhagen <jake@bugzilla.org> # Jacob Steenhagen <jake@bugzilla.org>
# Vitaly Harisov <vitaly@rathedg.com> # Vitaly Harisov <vitaly@rathedg.com>
# Guy Pyrzak <guy.pyrzak@gmail.com>
#%] #%]
[%# INTERFACE: [%# INTERFACE:
...@@ -33,27 +34,49 @@ ...@@ -33,27 +34,49 @@
header = "Main Page" header = "Main Page"
header_addl_info = "version $constants.BUGZILLA_VERSION" header_addl_info = "version $constants.BUGZILLA_VERSION"
style_urls = [ 'skins/standard/index.css' ] style_urls = [ 'skins/standard/index.css' ]
onload = 'document.forms[\'f\'].quicksearch.focus();'
%] %]
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
function onLoadActions() {
quicksearchHelpText('quicksearch', 'show');
if( window.external.AddSearchProvider ){
YAHOO.util.Dom.removeClass('quicksearch_plugin', 'bz_default_hidden');
}
document.getElementById('quicksearch_top').focus();
}
function addSidebar() { function addSidebar() {
if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) var sidebarname=window.location.host;
{ if (!/bug/i.test(sidebarname))
var sidebarname=window.location.host; sidebarname="[% terms.Bugzilla %] "+sidebarname;
if (!/bug/i.test(sidebarname)) window.sidebar.addPanel (sidebarname, "[% urlbase FILTER html %]sidebar.cgi", "");
sidebarname="[% terms.Bugzilla %] "+sidebarname; }
window.sidebar.addPanel (sidebarname, "[% urlbase FILTER html %]sidebar.cgi", ""); var quicksearch_message = "Enter [% terms.abug %] # or some search terms";
function checkQuicksearch( form ) {
if (form.quicksearch.value == '' || form.quicksearch.value == quicksearch_message ) {
alert('Please enter one or more search terms first.');
return false;
} }
else return true;
{ }
var rv = window.confirm ("Your browser does not support the sidebar extension. " + "Would you like to upgrade now?");
if (rv) function quicksearchHelpText(el_id, action){
document.location.href = "http://www.mozilla.org/"; var el = document.getElementById(el_id);
if ( action == "show") {
if( el.value == "" ) {
el.value = quicksearch_message
YAHOO.util.Dom.addClass(el, "quicksearch_help_text");
}
} else {
if( el.value == quicksearch_message ) {
el.value = "";
YAHOO.util.Dom.removeClass(el, "quicksearch_help_text");
}
} }
} }
YAHOO.util.Event.onDOMReady(onLoadActions);
//--> //-->
</script> </script>
...@@ -101,57 +124,76 @@ function addSidebar() { ...@@ -101,57 +124,76 @@ function addSidebar() {
<div id="page-index"> <div id="page-index">
<div class="intro"></div> <div class="intro"></div>
<table>
<p>Welcome to [% terms.Bugzilla %]. To see what's new in this version <tr>
of [% terms.Bugzilla %], see the <td>
<a href="page.cgi?id=release-notes.html">release notes</a>! <h1 id="welcome"> Welcome to [% terms.Bugzilla %]</h1>
You may also want to read the <a href="enter_bug.cgi" class="bz_common_actions">
<a href="[% docs_urlbase FILTER html %]using.html"> <div class="bz_common_actions" id="enter_bug">
[%- terms.Bugzilla %] User's Guide</a> to find out more about <span>File a Bug</span>
[%+ terms.Bugzilla %] and how to use it.</p> </div>
</a>
<p>Most common actions:</p>
<ul> <a href="query.cgi" class="bz_common_actions">
<li id="query"><a href="query.cgi">Search existing [% terms.bug %] reports</a></li> <div class="bz_common_actions" id="query">
<li id="enter-bug"><a href="enter_bug.cgi">Enter a new [% terms.bug %] report</a></li> <span>Search</span>
<li id="report"><a href="report.cgi">Summary reports and charts</a></li> </div>
[% IF user.id %] </a>
<li id="userprefs"><a href="userprefs.cgi">Change password or user preferences</a></li>
[% IF user.authorizer.can_logout %] <a class="bz_common_actions quicksearch_help_text" href="
<li id="logout"><a href="relogin.cgi">Log out [% user.login FILTER html %]</a></li> [% IF user.id %]
[% END %] userprefs.cgi
[% ELSIF user.authorizer.can_login %] [% ELSIF Param('createemailregexp') && user.authorizer.user_can_create_account %]
</ul> createaccount.cgi
[% PROCESS "account/auth/login-small.html.tmpl" %] [% ELSE %]
<ul> ?GoAheadAndLogIn=1
[% IF Param('createemailregexp') && user.authorizer.user_can_create_account %] [% END %]">
<li id="account"><a href="createaccount.cgi">Open a new [% terms.Bugzilla %] account</a></li> <div class="bz_common_actions" id="account">
[% END %] <span>
[% END %] [% IF user.id %]
<li id="sidebar"><a href="javascript:addSidebar()">Add to Sidebar</a> (requires a Mozilla browser like Mozilla Firefox)</li> User Preferences
<li id="quick_search_plugin"> [% ELSIF Param('createemailregexp') && user.authorizer.user_can_create_account %]
<a href="javascript:window.external.AddSearchProvider('[% urlbase FILTER html %]search_plugin.cgi')">Install Open a new Account
the Quick Search plugin</a> (requires Firefox 2 or Internet Explorer 7) [% ELSE %]
</li> Log In
[% END%]</span>
</div>
[%# List items of links to more things users can do on this installation. %] </a>
[% Hook.process("links") %] <form id="quicksearchForm" name="quicksearchForm" action="buglist.cgi"
onsubmit="return checkQuicksearch(this);">
</ul> <div>
<input id="quicksearch" type="text" name="quicksearch"
<form id="f" name="f" action="buglist.cgi" method="get" onfocus="quicksearchHelpText(this.id, 'hide');"
onsubmit="if (this.quicksearch.value == '') onblur="quicksearchHelpText(this.id, 'show');"
{ alert('Please enter one or more search terms first.'); >
return false; } return true;"> <input id="find" type="submit" value="Quick Search">
<div> <ul class="additional_links" id="quicksearch_links">
<p>Enter [% terms.abug %] # or some search terms:</p> <li>
<input id="quicksearch" type="text" name="quicksearch"> <a href="page.cgi?id=quicksearch.html">Quick Search help</a>
<input id="find" type="submit" value="Find"> </li>
<a href="page.cgi?id=quicksearch.html">[Help]</a> <li class="bz_default_hidden" id="quicksearch_plugin">
</div> |
</form> <a href="javascript:window.external.AddSearchProvider('[% urlbase FILTER html %]search_plugin.cgi')">
Install the Quick Search plugin
</a>
</li>
</ul>
<ul class="additional_links">
<li>
<a href="[% docs_urlbase FILTER html %]using.html">
[%- terms.Bugzilla %] User's Guide
</a>
&nbsp;|
</li>
<li>
<a href="page.cgi?id=release-notes.html" > Release Notes</a>
</li>
</div>
</div>
</form>
</td>
</tr>
</table>
<div class="outro"></div> <div class="outro"></div>
</div> </div>
......
...@@ -46,8 +46,7 @@ ...@@ -46,8 +46,7 @@
title = title title = title
style = style style = style
atomlink = "buglist.cgi?$urlquerypart&title=$title&ctype=atom" atomlink = "buglist.cgi?$urlquerypart&title=$title&ctype=atom"
javascript_urls = [ "js/util.js", "js/field.js", javascript_urls = [ "js/util.js", "js/field.js", "js/yui/calendar.js" ]
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/buglist.css", "skins/standard/yui/calendar.css" ] style_urls = [ "skins/standard/buglist.css", "skins/standard/yui/calendar.css" ]
doc_section = "query.html#list" doc_section = "query.html#list"
%] %]
......
...@@ -86,14 +86,14 @@ to validate webservergroup.\n"; ...@@ -86,14 +86,14 @@ to validate webservergroup.\n";
} }
# Try to fetch a static file (front.png) # Try to fetch a static file (padlock.png)
$ARGV[0] =~ s/\/$//; $ARGV[0] =~ s/\/$//;
my $url = $ARGV[0] . "/skins/standard/index/front.png"; my $url = $ARGV[0] . "/images/padlock.png";
if (fetch($url)) { if (fetch($url)) {
print "TEST-OK Got front picture.\n"; print "TEST-OK Got padlock picture.\n";
} else { } else {
print print
"TEST-FAILED Fetch of skins/standard/index/front.png failed "TEST-FAILED Fetch of images/padlock.png failed
Your web server could not fetch $url. Your web server could not fetch $url.
Check your web server configuration and try again.\n"; Check your web server configuration and try again.\n";
exit(1); exit(1);
......
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