]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 524254: Make the comment box in bug/edit.html.tmpl into a BLOCK
authormkanat%bugzilla.org <>
Sun, 13 Dec 2009 22:47:33 +0000 (22:47 +0000)
committermkanat%bugzilla.org <>
Sun, 13 Dec 2009 22:47:33 +0000 (22:47 +0000)
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

skins/standard/global.css
template/en/default/bug/comments.html.tmpl
template/en/default/bug/edit.html.tmpl

index 457f909ee091e14ae298656849c77ba1167a89fd..a7b4b253ed4b57582eb9a6faa327dd741374a201 100644 (file)
@@ -273,6 +273,10 @@ div#docslinks {
 /* Comments */
 /************/
 
+.bz_comment_table td {
+    vertical-align: top;
+}
+
 .bz_comment {
     margin-bottom: 2em;
 }
@@ -303,6 +307,14 @@ div#docslinks {
     float: right;
 }
 
+.bz_collapse_expand_comments {
+    padding: 0;
+    margin: 0 0 0 1em;
+    list-style-type: none;
+}
+.bz_collapse_expand_comments li {
+    margin-bottom: .5em;
+}
 .bz_collapse_comment {
     text-decoration: none;
 }
index 9a04b71470a47a4fd7c84ac455d935c641a54b1f..41b91d79aa2614c0e6a2766a99814fd8f5b00de1 100644 (file)
     [% END %]
 [% END %]
 
-[% IF mode == "edit" %]
-  <a href="#" onclick="toggle_all_comments('collapse'); return false;">Collapse All Comments</a> -
-  <a href="#" onclick="toggle_all_comments('expand'); return false;">Expand All Comments</a>
-  <hr>
-[% END %]
+<!-- This auto-sizes the comments and positions the collapse/expand links 
+     to the right. -->
+<table class="bz_comment_table" cellpadding="0" cellspacing="0"><tr>
+<td>
 
 [% FOREACH comment = comments %]
   [% IF count >= start_at %]
   #%]  
 [% Hook.process("aftercomments") %]
 
+</td>
+<td>
+  [% IF mode == "edit" %]
+    <ul class="bz_collapse_expand_comments">
+      <li><a href="#" onclick="toggle_all_comments('collapse'); 
+                               return false;">Collapse All Comments</a></li>
+      <li><a href="#" onclick="toggle_all_comments('expand');
+                               return false;">Expand All Comments</a></li>
+    </ul>
+  [% END %]
+</td>
+</tr></table>
+
 [%############################################################################%]
 [%# Block for individual comments                                            #%]
 [%############################################################################%]
index 401d71ca3a70979902f16a2999086cfce529a0b9..88952d11a68990d2716967e371539217261c826d 100644 (file)
              bugid       = bug.bug_id
              num_attachment_flag_types = bug.num_attachment_flag_types
              show_attachment_flags = bug.show_attachment_flags
-   %]
+  %]
 
 
-[%# *** Comments Groups *** %]
+  [% PROCESS comment_box %]
+
+  [%# *** Additional Comments *** %]
+  <div id="comments">
+    [% PROCESS bug/comments.html.tmpl
+      comments = bug.comments
+      mode = user.id ? "edit" : "show"
+    %]
+  </div>
 
-  <br>
-  <table cellpadding="1" cellspacing="1">
-    <tr>
-      <td id="comment_status_commit">
-        <!-- The table keeps the commit button aligned with the box. -->
-        <a name="add_comment"></a>
-        [% IF user.id %]
-          <label for="comment" accesskey="c"><b>Additional <u>C</u>omments</b></label>:
-          [% IF user.is_insider %]
-            <input type="checkbox" name="commentprivacy" value="1"
-                   id="newcommentprivacy"
-                   onClick="updateCommentTagControl(this, form)">
-            <label for="newcommentprivacy"> 
-              Make comment private (visible only to members of the
-              <strong>[% Param('insidergroup') FILTER html %]</strong>
-              group)
-            </label>
-          [% END %]
-          <table><tr><td>
-          [% INCLUDE global/textarea.html.tmpl
-                     name      = 'comment'
-                     id        = 'comment'
-                     minrows   = 10
-                     maxrows   = 25
-                     cols      = constants.COMMENT_COLS
-          %]
-          [% Hook.process("after_comment_textarea") %]
-          <br>
-          [% PROCESS commit_button id=""%]
-          <table class="status" cellspacing="0" cellpadding="0">
-            <tr>
-              <td class="field_label">
-                <b><a href="page.cgi?id=fields.html#status">Status</a></b>:
-              </td>
-              <td>
-                <a name="bug_status_bottom"></a>
-                [% PROCESS bug/knob.html.tmpl %]
-              </td>
-            </tr>
-          </table>
-          </td></tr></table>
-        [% ELSE %]
-          <fieldset>
-            <legend>Note</legend>
-            <p>
-              You need to
-              <a href="show_bug.cgi?id=
-                       [%- bug.bug_id %]&amp;GoAheadAndLogIn=1">log in</a>
-              before you can comment on or make changes to this [% terms.bug %].
-            </p>
-          </fieldset>
-        [% END %]
-        [%# *** Additional Comments *** %]
-        <hr>
-        <div id="comments">
-        [% PROCESS bug/comments.html.tmpl
-           comments = bug.comments
-           mode = user.id ? "edit" : "show"
-         %]
-        </div>
-        
-      </td>
-    </tr>
-  </table>
 </form>
 
 [%############################################################################%]
   </table> 
 [% END %]
 
+[%############################################################################%]
+[%# Block for the Additional Comments box                                    #%]
+[%############################################################################%]
+
+[% BLOCK comment_box %]
+  <div class="bz_section_additional_comments">
+    <a name="add_comment"></a>
+    [% IF user.id %]
+      <label for="comment" accesskey="c"><b>Additional 
+        <u>C</u>omments</b></label>:
+
+      [% IF user.is_insider %]
+        <input type="checkbox" name="commentprivacy" value="1"
+               id="newcommentprivacy"
+               onClick="updateCommentTagControl(this, form)">
+        <label for="newcommentprivacy">
+          Make comment private (visible only to members of the
+          <strong>[% Param('insidergroup') FILTER html %]</strong> group)
+        </label>
+      [% END %]
+
+      <!-- This table keeps the submit button aligned with the box. -->
+      <table><tr><td>
+        [% INCLUDE global/textarea.html.tmpl
+                   name      = 'comment'
+                   id        = 'comment'
+                   minrows   = 10
+                   maxrows   = 25
+                   cols      = constants.COMMENT_COLS
+        %]
+        [% Hook.process("after_comment_textarea", 'bug/edit.html.tmpl') %]
+        <br>
+        [% PROCESS commit_button id=""%]
+
+        <table class="status" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="field_label">
+              <b><a href="page.cgi?id=fields.html#status">Status</a></b>:
+            </td>
+            <td>
+              <a name="bug_status_bottom"></a>
+              [% PROCESS bug/knob.html.tmpl %]
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+
+    [%# For logged-out users %]
+    [% ELSE %]
+      <table><tr><td><fieldset>
+        <legend>Note</legend>
+        You need to
+        <a href="show_bug.cgi?id=
+                 [%- bug.bug_id %]&amp;GoAheadAndLogIn=1">log in</a>
+         before you can comment on or make changes to this [% terms.bug %].
+      </fieldset></table><tr></td>
+    [% END %]
+  </div>
+[% END %]
+
 [%############################################################################%]
 [%# Block for SELECT fields                                                  #%]
 [%############################################################################%]