Display legal text when uploading a patch with a new bug
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Oct 2014 16:01:19 +0000 (16:01 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Oct 2014 16:01:19 +0000 (16:01 +0000)
* js/attachment.js:
(setContentTypeDisabledState): Make this work on the Enter Bug
page so that the "Submit Bug" button changes to
"Agree and Submit Bug" when the "patch" checkbox is checked, and
it changes back to "Submit Bug" when unchecked.
* template/en/custom/attachment/createformcontents.html.tmpl:
Include the attachment/patchlegalese.html.tmpl template when
returning the page so that it will be shown when the "patch"
checkbox is checked.  Set the 'product' variable from the CGI
variable of the same name.
* template/en/custom/attachment/patchlegalese.html.tmpl: Add the
'expert_fields' class to the <tr> element so that it gets
shown/hidden when the Show/Hide Advanced Fields links are
clicked.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174772 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/bugs.webkit.org/js/attachment.js
Websites/bugs.webkit.org/template/en/custom/attachment/createformcontents.html.tmpl
Websites/bugs.webkit.org/template/en/custom/attachment/patchlegalese.html.tmpl

index 5a541a80ca2b21ac70e68bd5ff182a409e585462..63a102e4ab69b720085b1c55281ba70907630443 100644 (file)
@@ -55,9 +55,23 @@ function setContentTypeDisabledState(form)
 // if WEBKIT_CHANGES
     if (isdisabled) {
         document.getElementById('legal').style.display = "table-row";
-        document.getElementById('create').value = "Agree and Submit";
+        var createButton = document.getElementById('create');
+        if (createButton && createButton.value == "Submit")
+            createButton.value = "Agree and Submit";
+        else {
+            var commitButton = document.getElementById('commit');
+            if (commitButton && commitButton.value == "Submit Bug")
+                commitButton.value = "Agree and Submit Bug";
+        }
     } else {
-        document.getElementById('create').value = "Submit";
+        var createButton = document.getElementById('create');
+        if (createButton && createButton.value == "Agree and Submit")
+            createButton.value = "Submit";
+        else {
+            var commitButton = document.getElementById('commit');
+            if (commitButton && commitButton.value == "Agree and Submit Bug")
+                commitButton.value = "Submit Bug";
+        }
         document.getElementById('legal').style.display = "none";
     }
 // endif WEBKIT_CHANGES
index 238b94255d081cd626b5042efb68cf3135112947..5ae56bf2f42d75ae652750b7e877410c9d83d113 100644 (file)
     [% END %]
   </td>
 </tr>
+[%# if WEBKIT_CHANGES %]
+[% USE CGI %]
+[% cgi_product = CGI.param('product') %]
+[% PROCESS attachment/patchlegalese.html.tmpl product = cgi_product %]
+[%# endif // WEBKIT_CHANGES %]
 
 [% BLOCK content_types %]
 [%# WEBKIT_CHANGES: Added XHTML source and SVG image. %]
index 0bc8dcead6c18b04980de027e4f2fea1db3d69f1..c71f410c8e419a86f8eee72f562464de22b7a3e6 100644 (file)
@@ -24,7 +24,7 @@
 
 [%# if WEBKIT_CHANGES %]
 [% IF (product == "WebKit" || product == "Security") %] 
-    <tr id="legal" style="display: none;">
+    <tr id="legal" class="expert_fields" style="display: none;">
       <th>Legal:</th>
       <td>
         <b>WebKit Contribution Terms:</b><br/>