]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1137307: Bug reports are not valid HTML5 pages
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 13 Apr 2015 11:58:11 +0000 (13:58 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 13 Apr 2015 11:58:11 +0000 (13:58 +0200)
r=dkl a=glob

template/en/default/bug/edit.html.tmpl
template/en/default/bug/field-label.html.tmpl
template/en/default/bug/field.html.tmpl
template/en/default/flag/list.html.tmpl
template/en/default/search/field.html.tmpl

index 3ac7f68219454ce366d54083435bf81d830e94f4..f9b2068927fc94a4ea37fa6e1b4817dcbcd351c4 100644 (file)
         (<span id="alias_nonedit_display">[% bug.alias.join(', ') FILTER html %]</span>)
       [% END %]
       - <span id="short_desc_nonedit_display">[% bug.short_desc FILTER quoteUrls(bug) %]</span>
-      [% IF bug.check_can_change_field('short_desc', 0, 1) %]
+      [% can_edit_short_desc = bug.check_can_change_field('short_desc', 0, 1) %]
+      [% IF can_edit_short_desc %]
         <small>(<a href="#" id="summary_edit_action">edit</a>)</small>
       [% END %]
      </span>
     <div id="summary_input">
       [% INCLUDE "bug/field-label.html.tmpl"
         field = bug_fields.short_desc
-        editable = 1
+        editable = can_edit_short_desc
         accesskey = "s"
         tag_name = 'span'
       %]
     </tr>
     <tr id="field_tablerow_version">
       [% INCLUDE "bug/field-label.html.tmpl"
-        field = bug_fields.version editable = 1 %]
-        
+          field = bug_fields.version
+          editable = bug.check_can_change_field('version', 0, 1) %]
+
       [% PROCESS select selname => "version" %]
     </tr>
     [%############%]    
     [%# PLATFORM #%]
     [%############%]    
     <tr id="field_tablerow_rep_platform">
+      [% can_edit_rep_platform = bug.check_can_change_field('rep_platform', 0, 1) %]
       [% INCLUDE "bug/field-label.html.tmpl"
-           field = bug_fields.rep_platform, editable = 1, accesskey = "h" %]
+           field = bug_fields.rep_platform,
+           editable = can_edit_rep_platform,
+           accesskey = "h" %]
       <td class="field_value">
-       [% INCLUDE bug/field.html.tmpl
+        [% INCLUDE bug/field.html.tmpl
             bug = bug, field = bug_fields.rep_platform,
             no_tds = 1, value = bug.rep_platform
-            editable = bug.check_can_change_field('rep_platform', 0, 1) %]
-       [%+ INCLUDE bug/field.html.tmpl 
+            editable = can_edit_rep_platform %]
+        [%+ INCLUDE bug/field.html.tmpl
             bug = bug, field = bug_fields.op_sys, 
             no_tds = 1, value = bug.op_sys
             editable = bug.check_can_change_field('op_sys', 0, 1) %]
  [%###############################################################%]
     <tr id="field_tablerow_importance">
       <th class="field_label">
-        <label for="priority" accesskey="i">
+        [% can_edit_priority = bug.check_can_change_field('priority', 0, 1) %]
+        <label [% IF can_edit_priority %]for="priority"[% END %] accesskey="i">
           <a href="page.cgi?id=fields.html#importance"><u>I</u>mportance</a></label>:
       </th>
       <td>
        [% INCLUDE bug/field.html.tmpl
             bug = bug, field = bug_fields.priority,
             no_tds = 1, value = bug.priority
-            editable = bug.check_can_change_field('priority', 0, 1) %]
+            editable = can_edit_priority %]
        [%+ INCLUDE bug/field.html.tmpl
             bug = bug, field = bug_fields.bug_severity,
             no_tds = 1, value = bug.bug_severity
       <tr id="field_tablerow_target_milestone">
         [% INCLUDE "bug/field-label.html.tmpl"
           field = bug_fields.target_milestone
-          editable = 1
+          editable = bug.check_can_change_field('target_milestone', 0, 1)
         %]
         [% PROCESS select selname = "target_milestone" %]
       </tr>
     [% END %]
 
     [% IF Param("timetrackinggroup") && bug.deadline %]
-      [% INCLUDE bug/field.html.tmpl field = bug_fields.deadline, value = bug.deadline, editable = 0 %]
+      <tr>
+        <th class="field_label">
+          <a href="page.cgi?id=fields.html#deadline">Deadline</a>:
+        </th>
+        <td>[% bug.deadline FILTER html %]</td>
+      </tr>
     [% END %]
 [% END %]
 
 [% BLOCK section_people %]
 
     <tr id="field_tablerow_assigned_to">
-      <th class="field_label">
-        <a href="page.cgi?id=fields.html#assigned_to">Assigned To</a>:
-      </th>
+      [% can_edit_assigned_to = bug.check_can_change_field("assigned_to", 0, 1) %]
+      [% INCLUDE "bug/field-label.html.tmpl"
+          field = bug_fields.assigned_to
+          editable = can_edit_assigned_to
+      %]
       <td>
-        [% IF bug.check_can_change_field("assigned_to", 0, 1) %]
+        [% IF can_edit_assigned_to %]
           <div id="bz_assignee_edit_container" class="bz_default_hidden">
             <span>
               [% INCLUDE global/user.html.tmpl who = bug.assigned_to %]
 
     [% IF Param('useqacontact') %]
     <tr id="field_tablerow_qa_contact">
+      [% can_edit_qa_contact = bug.check_can_change_field("qa_contact", 0, 1) %]
       [% INCLUDE "bug/field-label.html.tmpl"
         field = bug_fields.qa_contact
-        editable = 1
+        editable = can_edit_qa_contact
         accesskey = "q"
       %]
       <td>
-        [% IF bug.check_can_change_field("qa_contact", 0, 1) %]
+        [% IF can_edit_qa_contact %]
           <div id="bz_qa_contact_edit_container" class="bz_default_hidden">
             <span>
               [% INCLUDE global/user.html.tmpl who = bug.qa_contact %]
 [%############################################################################%]
 [% BLOCK section_url_keyword_whiteboard %]
   <tr id="field_tablerow_bug_file_loc">
+    [% can_edit_bug_file_loc = bug.check_can_change_field("bug_file_loc", 0, 1) %]
     [% INCLUDE "bug/field-label.html.tmpl"
       field = bug_fields.bug_file_loc
-      editable = 1
+      editable = can_edit_bug_file_loc
       accesskey = "u"
     %]
     <td>
-      [% IF bug.check_can_change_field("bug_file_loc", 0, 1) %]
+      [% IF can_edit_bug_file_loc %]
         <span id="bz_url_edit_container" class="bz_default_hidden"> 
         [% IF is_safe_url(bug.bug_file_loc) %]
            <a href="[% bug.bug_file_loc FILTER html %]" target="_blank"
         (<a href="#" id="bz_url_edit_action">edit</a>)</span>
       [% END %]
       <span id="bz_url_input_area">
-        [% url_output =  INCLUDE input no_td=1 inputname => "bug_file_loc" size => "40" colspan => 2 %]
+        [% url_output = INCLUDE input no_td = 1 inputname = "bug_file_loc" size = 40 %]
         [% IF NOT bug.check_can_change_field("bug_file_loc", 0, 1)
               AND is_safe_url(bug.bug_file_loc) %]
           <a href="[% bug.bug_file_loc FILTER html %]"
       [% END %]
     </td>
   </tr>
-  
+
   [% IF Param('usestatuswhiteboard') %]
     <tr id="field_tablerow_status_whiteboard">
       [% INCLUDE "bug/field-label.html.tmpl"
         field = bug_fields.status_whiteboard
-        editable = 1
+        editable = bug.check_can_change_field("status_whiteboard", 0, 1)
         accesskey = "w"
       %]
-      [% INCLUDE input inputname => "status_whiteboard" size => "40" colspan => 2 %]
+      [% INCLUDE input inputname = "status_whiteboard" size = 40 %]
     </tr>
   [% END %]
-  
+
   [% IF use_keywords %]
     <tr id="field_tablerow_keywords">
         [% INCLUDE bug/field.html.tmpl
   [% RETURN UNLESS bug.duplicates.size %]
   <tr id="field_tablerow_duplicates">
     <th class="field_label">
-      <label for="duplicates">Duplicates ([% bug.duplicates.size %])</label>:
+      <label>Duplicates ([% bug.duplicates.size %])</label>:
     </th>
-    <td class="field_value" colspan="2">
+    <td class="field_value">
       <span id="duplicates">
         [% FOREACH dupe = bug.duplicates %]
           [% INCLUDE bug/link.html.tmpl bug = dupe, link_text = dupe.id, use_alias = 1 %][% " " %]
     <tr id="field_tablerow_blocked">
       <th>&nbsp;</th>
 
-      <td colspan="2" id="show_dependency_tree_or_graph">
+      <td id="show_dependency_tree_or_graph">
         Show dependency <a href="showdependencytree.cgi?id=[% bug.bug_id %]&amp;hide_resolved=1">tree</a>
 
         [% USE Bugzilla %]
 [% BLOCK section_cclist %]
     <tr id="field_tablerow_cclist">
       <th class="field_label">
-        <label for="newcc" accesskey="a">CC List:</label>
+        <label [% IF user.id %]for="newcc"[% END %] accesskey="a">
+          CC List:
+        </label>
       </th>
       <td>
         [% IF user.id %]
             </div>
           [% END %]
           [% IF bug.cc.size %]
-            <select id="cc" multiple="multiple" size="5"
-              [% IF bug.user.canedit %]name="cc"[% END %]>
+            <select id="cc" multiple="multiple" size="5" [% 'name="cc"' IF bug.user.canedit %]>
               [% FOREACH c = bug.cc %]
                 <option value="[% c FILTER email FILTER html %]">
                   [% c FILTER email FILTER html %]</option>
 
 [% BLOCK section_aliases %]
   <tr id="field_tablerow_alias">
-    [% INCLUDE "bug/field-label.html.tmpl"
-       field = bug_fields.alias, editable = 1
-    %]
+    [% INCLUDE "bug/field-label.html.tmpl" field = bug_fields.alias %]
     <td>
       [% IF bug.alias.size %]
         [% bug.alias.join(', ') FILTER html %]
         <br>
         <div id="alias_edit_area">
           <div>
-            <div>
-              <label for="aliases">
-                <b>Add</b>
-              </label>
-            </div>
-              <input name="newalias" id="newalias" size="20">
+            <label for="newalias" class="field_label">Add</label>
+            <br>
+            <input name="newalias" id="newalias" size="20">
           </div>
           [% IF bug.alias.size %]
             <select id="alias" name="alias" multiple="multiple" size="5">
 
             <input type="checkbox" id="removealias" name="removealias">
             <label for="removealias">Remove selected aliases</label>
-
           [% END %]
         </div>
         <script type="text/javascript">
 [%# *** Custom Fields *** %]
   [% FOREACH field = Bugzilla.active_custom_fields %]
     <tr>
-      [% PROCESS bug/field.html.tmpl value = bug.${field.name}
-                                     editable = bug.check_can_change_field(field.name, 0, 1)
-                                     value_span = 2 %]
+      [% INCLUDE bug/field.html.tmpl value = bug.${field.name}
+                                     editable = bug.check_can_change_field(field.name, 0, 1) %]
     </tr>
     [% IF extra_field_item %]
       <tr>
          field = bug_fields.remaining_time, editable = 1
       %]
       [% INCLUDE "bug/field-label.html.tmpl"
-         field = bug_fields.percentage_complete, editable = 1
+         field = bug_fields.percentage_complete
       %]
       <th>
         Gain:
index 95ac28acbd2c6a15088d1522905085ad6382b27c..94e2728fcdfbccdebe0ede370934344df77e5930 100644 (file)
@@ -8,6 +8,7 @@
 
 [%# INTERFACE:
   #   field: a Bugzilla::Field object
+  #   editable: if true, a label pointing to the editable field will be added.
   #   desc_url: An alternate link to help for the field.
   #   hidden: True if the field label should start hidden.
   #   rowspan: a "rowspan" value for the label's <th>.
index 59dd140db418f7a7e915774e1ef6ec75002f01cf..f1ddf633fc8e66a0c726c99ed58df1d757002c0e 100644 (file)
@@ -9,6 +9,7 @@
 [%# INTERFACE:
   #   field: a Bugzilla::Field object
   #   value: The value of the field for this bug.
+  #   field_hidden (optional): boolean; if true, the field is hidden by default.
   #   override_legal_values (optional): The list of legal values, for select fields.
   #   editable: Whether the field should be displayed as an editable
   #             <input> or as just the plain text of its value.
                 value="[% value FILTER html %]">
          <div id="[% field.name FILTER html %]_autocomplete"></div>
        </div>
-       <script type="text/javascript" defer="defer">
+       <script type="text/javascript">
          if (typeof YAHOO.bugzilla.field_array === "undefined")
            YAHOO.bugzilla.field_array = [];
          YAHOO.bugzilla.field_array["[% field.name FILTER js %]"] = [
index 047fd44259a8dfd81c6d8b5c2b0fb88de1b2271b..169cf8a51fedf975ddbe44d40b73029e31ae0e5e 100644 (file)
 <table id="[% flag_table_id FILTER html %]">
   [% UNLESS flag_no_header %]
     <tr>
-      <th colspan="3">
-        Flags:
-      </th>
+      <th colspan="3">Flags:</th>
       [% IF any_flags_requesteeble %]
-        <th>
-          Requestee:
-        </th>
+        <th>Requestee:</th>
+      [% END %]
+      [% IF edit_multiple_bugs %]
+        <th>&nbsp;</th>
       [% END %]
     </tr>
   [% END %]
       [% NEXT UNLESS type.flags && type.flags.size > 0 && type.is_multiplicable && type.is_active %]
       [% IF !separator_displayed %]
         <tbody class="bz_flag_type">
-          <tr><td colspan="3"><hr></td></tr>
+          [% sep_length = 3 + (any_flags_requesteeble ? 1 : 0) + (edit_multiple_bugs ? 1 : 0) %]
+          <tr>
+            <td colspan="[% sep_length FILTER html %]"><hr></td>
+          </tr>
         </tbody>
         [% separator_displayed = 1 %]
       [% END %]
           <option value="--do_not_change--">--do_not_change--</option>
         [% END %]
         [% IF !flag || (can_edit_flag && user.can_request_flag(type)) || flag.setter_id == user.id %]
-          <option value="X"></option>
+          <option value="X" label="X"></option>
         [% END %]
         [% IF type.is_active && can_edit_flag %]
           [% IF (type.is_requestable && user.can_request_flag(type)) || (flag && flag.status == "?") %]
           [% END %]
         </td>
       [% END %]
-      <td>
-        [% IF type.is_multiplicable && edit_multiple_bugs %]
+      [% IF edit_multiple_bugs %]
+        <td>
+        [% IF type.is_multiplicable %]
           <input type="checkbox" name="flags_add-[% type.id %]"
                  id="flags_add-[% type.id %]" value="1">
           <label for="flags_add-[% type.id %]"
-                 title="If ticked, always create a new flag. Leaving it unchecked will update existing flag(s) and add a new flag if it does not exist">
+                 title="If ticked, always create a new flag. Leaving it unchecked will
+                        update existing flag(s) and add a new flag if it does not exist">
             Always add
           </label>
         [% END %]
-      </td>
+        </td>
+      [% END %]
     </tr>
   </tbody>
 [% END %]
index 90156238de45d917b1f7c650f3cb63fecfc4d33b..5a95d67c15816513eb29ca85695108ea15b70c5c 100644 (file)
@@ -42,7 +42,7 @@
               value="[% value FILTER html %]" [% 'autofocus' IF focus %]>
        <div id="[% field.name FILTER html %]_autocomplete"></div>
     </div>
-    <script type="text/javascript" defer="defer">
+    <script type="text/javascript">
       if (typeof YAHOO.bugzilla.field_array === "undefined")
         YAHOO.bugzilla.field_array = [];
       YAHOO.bugzilla.field_array["[% field.name FILTER js %]"] = [