Commit 46381d01 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 374020: Re-work the bug editing form to be more usable.

Patch By Guy Pyrzak <guy.pyrzak@gmail.com> r=mkanat, a=mkanat
parent c0b4d49d
...@@ -134,3 +134,60 @@ function updateCalendarFromField(date_field) { ...@@ -134,3 +134,60 @@ function updateCalendarFromField(date_field) {
cal.render(); cal.render();
} }
} }
/* Hide input fields and show the text with (edit) next to it */
function hideEditableField( container, input, action, field_id, original_value ) {
YAHOO.util.Dom.setStyle(container, 'display', 'inline');
YAHOO.util.Dom.setStyle(input, 'display', 'none');
YAHOO.util.Event.addListener(action, 'click', showEditableField, new Array(container, input) );
if(field_id != ""){
YAHOO.util.Event.addListener(window, 'load', checkForChangedFieldValues, new Array(container, input, field_id, original_value ));
}
}
/* showEditableField (e, ContainerInputArray)
* Function hides the (edit) link and the text and displays the input
*
* var e: the event
* var ContainerInputArray: An array containing the (edit) and text area and the input being displayed
* var ContainerInputArray[0]: the conainer that will be hidden usually shows the (edit) text
* var ContainerInputArray[1]: the input area and label that will be displayed
*
*/
function showEditableField (e, ContainerInputArray) {
YAHOO.util.Dom.setStyle(ContainerInputArray[0], 'display', 'none');
YAHOO.util.Dom.setStyle(ContainerInputArray[1], 'display', 'inline');
YAHOO.util.Event.preventDefault(e);
}
/* checkForChangedFieldValues(e, array )
* Function checks if after the autocomplete by the browser if the values match the originals.
* If they don't match then hide the text and show the input so users don't get confused.
*
* var e: the event
* var ContainerInputArray: An array containing the (edit) and text area and the input being displayed
* var ContainerInputArray[0]: the conainer that will be hidden usually shows the (edit) text
* var ContainerInputArray[1]: the input area and label that will be displayed
* var ContainerInputArray[2]: the field that is on the page, might get changed by browser autocomplete
* var ContainerInputArray[3]: the original value from the page loading.
*
*/
function checkForChangedFieldValues(e, ContainerInputArray ) {
var el = document.getElementById(ContainerInputArray[2]);
if ( el ) {
if ( el.value != ContainerInputArray[3] || ( el.value == "" && el.id != "alias") ) {
YAHOO.util.Dom.setStyle(ContainerInputArray[0], 'display', 'none');
YAHOO.util.Dom.setStyle(ContainerInputArray[1], 'display', 'inline');
}
}
}
function hideAliasAndSummary(short_desc_value, alias_value){
// check the short desc field
hideEditableField( 'summary_alias_container', 'summary_alias_input', 'editme_action', 'short_desc', short_desc_value);
// check that the alias hasn't changed
bz_alias_check_array = new Array('summary_alias_container', 'summary_alias_input', 'alias', alias_value )
YAHOO.util.Event.addListener( window, 'load', checkForChangedFieldValues, bz_alias_check_array);
}
...@@ -10,6 +10,7 @@ index.css ...@@ -10,6 +10,7 @@ index.css
panel.css panel.css
params.css params.css
release-notes.css release-notes.css
show_bug.css
show_multiple.css show_multiple.css
summarize-time.css summarize-time.css
voting.css voting.css
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
color: #000; color: #000;
background: #fff url("global/body-back.gif") repeat-x; background: #fff url("global/body-back.gif") repeat-x;
} }
body, td, th, input {
font-family: Verdana, sans-serif;
font-size: small;
}
/* global (end) */ /* global (end) */
/* header (begin) */ /* header (begin) */
...@@ -41,11 +45,6 @@ ...@@ -41,11 +45,6 @@
display: inline; display: inline;
} }
#header .btn,
#header .txt {
font-size: 80%;
}
#header .links { #header .links {
font-size: 85%; font-size: 85%;
border-left: 1px solid silver; border-left: 1px solid silver;
...@@ -397,3 +396,5 @@ form#Create .comment { ...@@ -397,3 +396,5 @@ form#Create .comment {
-moz-border-radius: 5px; -moz-border-radius: 5px;
background: white; background: white;
} }
.bz_alias_short_desc_container {
margin: 8px 0;
padding: 0.3em;
background-color: rgb(208, 208, 208);
-moz-border-radius: 0.5em;
font-size: 125%;
font-weight: bold;
}
.bz_column_spacer {
width: 2em;
}
.bz_default_hidden {
display: none;
}
.related_actions {
font-size: 0.85em;
float: right;
list-style-type: none;
white-space: nowrap;
margin: 0;
padding: 0;
}
.related_actions li {
display: inline;
}
.bz_show_bug_column {
vertical-align: top;
}
.bz_section_spacer {
height: 1em;
}
#bz_field_status {
white-space: nowrap;
}
.bz_time_tracking_table {
border-collapse: collapse;
}
.bz_time_tracking_table th {
text-align: center;
background-color: #ccc;
}
.bz_time_tracking_table td {
text-align: center;
}
.bz_time_tracking_table th,
.bz_time_tracking_table td {
padding: 4px;
border: 1px solid black;
}
.bz_time_tracking_table .bz_summarize_time {
text-align: right;
}
...@@ -176,7 +176,7 @@ sub directive_ok { ...@@ -176,7 +176,7 @@ sub directive_ok {
return 1 if $directive =~ /^(IF|END|UNLESS|FOREACH|PROCESS|INCLUDE| return 1 if $directive =~ /^(IF|END|UNLESS|FOREACH|PROCESS|INCLUDE|
BLOCK|USE|ELSE|NEXT|LAST|DEFAULT|FLUSH| BLOCK|USE|ELSE|NEXT|LAST|DEFAULT|FLUSH|
ELSIF|SET|SWITCH|CASE|WHILE|RETURN|STOP| ELSIF|SET|SWITCH|CASE|WHILE|RETURN|STOP|
TRY|CATCH|FINAL|THROW|CLEAR|MACRO)/x; TRY|CATCH|FINAL|THROW|CLEAR|MACRO|FILTER)/x;
# ? : # ? :
if ($directive =~ /.+\?(.+):(.+)/) { if ($directive =~ /.+\?(.+):(.+)/) {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
title = "Attachment $attachment.id added to $terms.Bug $attachment.bug_id" title = "Attachment $attachment.id added to $terms.Bug $attachment.bug_id"
javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js", javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js",
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ] "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
%] %]
......
...@@ -36,7 +36,11 @@ ...@@ -36,7 +36,11 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "$terms.Bug $id Submitted" title = "$terms.Bug $id Submitted"
javascript_urls = [ "js/util.js", "js/keyword-chooser.js" ] javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js",
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
%] %]
[% header_done = 1 %] [% header_done = 1 %]
......
...@@ -19,6 +19,21 @@ ...@@ -19,6 +19,21 @@
#%] #%]
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% IF bottom_navigator == 1 %]
<ul class="related_actions">
<li><a href="show_bug.cgi?format=multiple&amp;id=
[% bug.bug_id FILTER url_quote %]">Format For Printing</a></li>
<li>&nbsp;-&nbsp;<a href="show_bug.cgi?ctype=xml&amp;id=
[% bug.bug_id FILTER url_quote %]">XML</a></li>
<li>&nbsp;-&nbsp;<a href="enter_bug.cgi?cloned_bug_id=
[% bug.bug_id FILTER url_quote %]">Clone This
[% terms.Bug %]</a></li>
[%# Links to more things users can do with this bug. %]
[% Hook.process("links") %]
<li>&nbsp;-&nbsp;<a href="#">Top of page </a></li>
</ul>
[% END %]
<div class="navigation"> <div class="navigation">
[% IF bug_list && bug_list.size > 0 %] [% IF bug_list && bug_list.size > 0 %]
......
...@@ -44,5 +44,5 @@ ...@@ -44,5 +44,5 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js", javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js",
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ] "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
%] %]
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
] ]
javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js", javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js",
"js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ] "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
%] %]
[% END %] [% END %]
...@@ -57,13 +57,11 @@ doc_section = "bug_page.html" ...@@ -57,13 +57,11 @@ doc_section = "bug_page.html"
[% PROCESS bug/navigate.html.tmpl %] [% PROCESS bug/navigate.html.tmpl %]
<hr>
[% PROCESS bug/edit.html.tmpl %] [% PROCESS bug/edit.html.tmpl %]
<hr> <hr>
[% PROCESS bug/navigate.html.tmpl %] [% PROCESS bug/navigate.html.tmpl bottom_navigator => 1%]
<br> <br>
......
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