]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
patch-detail: clean up patch detail page template
authorRaxel Gutierrez <raxel@google.com>
Fri, 13 Aug 2021 05:31:19 +0000 (05:31 +0000)
committerStephen Finucane <stephen@that.guru>
Fri, 13 Aug 2021 09:25:34 +0000 (10:25 +0100)
Clean up submission.html to have hyphen-delimited id and class selectors
names for better readability and code health.

Signed-off-by: Raxel Gutierrez <raxel@google.com>
[stephenfin: temporarily re-add removed toggle-div JS]
Signed-off-by: Stephen Finucane <stephen@that.guru>
htdocs/css/style.css
patchwork/templates/patchwork/submission.html
templates/base.html

index 243caa0d968abe272df853c0db6cd447cb5e835e..46a91ee84601e550f209813a0ab7fb7b0b756409 100644 (file)
@@ -182,17 +182,17 @@ input#reorder-change {
 }
 
 /* patch view */
-table.patchmeta th {
+table.patch-meta th {
     text-align: left;
 }
 
-table.patchmeta tr th, table.patchmeta tr td {
+table.patch-meta tr th, table.patch-meta tr td {
     text-align: left;
     padding: 1px 10px;
     vertical-align: top;
 }
 
-.submissionlist ul {
+.submission-list ul {
     list-style-type: none;
     padding: 0;
     margin: 0;
index 978559b8726bb8492e49e4de01f95b8724468cdf..9212fc998c9beedd5fb912a5f98de09ce66b7c64 100644 (file)
@@ -32,7 +32,7 @@ function toggle_div(link_id, headers_id, label_show, label_hide)
   <h1>{{ submission.name }}</h1>
 </div>
 
-<table class="patchmeta">
+<table class="patch-meta">
  <tr>
   <th>Message ID</th>
   {% if submission.list_archive_url %}
@@ -61,12 +61,11 @@ function toggle_div(link_id, headers_id, label_show, label_hide)
 {% endif %}
  <tr>
   <th>Headers</th>
-  <td><a id="togglepatchheaders"
-   href="javascript:toggle_div('togglepatchheaders', 'patchheaders')"
-   >show</a>
-   <div id="patchheaders" class="patchheaders" style="display:none;">
-    <pre>{{submission.headers}}</pre>
-   </div>
+  <td>
+    <a id="toggle-patch-headers" href="javascript:toggle_div('toggle-patch-headers', 'patch-headers')">show</a>
+    <div id="patch-headers" class="patch-headers" style="display:none;">
+      <pre>{{submission.headers}}</pre>
+    </div>
   </td>
  </tr>
 {% if submission.series %}
@@ -76,10 +75,8 @@ function toggle_div(link_id, headers_id, label_show, label_hide)
    <a href="{% url 'patch-list' project_id=project.linkname %}?series={{ submission.series.id }}">
     {{ submission.series.name }}
    </a> |
-   <a id="togglepatchseries"
-      href="javascript:toggle_div('togglepatchseries', 'patchseries', 'expand', 'collapse')"
-   >expand</a>
-   <div id="patchseries" class="submissionlist" style="display:none;">
+   <a id="toggle-patch-series" href="javascript:toggle_div('toggle-patch-series', 'patch-series', 'expand', 'collapse')">expand</a>
+   <div id="patch-series" class="submission-list" style="display:none;">
     <ul>
      {% with submission.series.cover_letter as cover %}
       <li>
@@ -114,10 +111,8 @@ function toggle_div(link_id, headers_id, label_show, label_hide)
  <tr>
   <th>Related</th>
   <td>
-   <a id="togglerelated"
-      href="javascript:toggle_div('togglerelated', 'related')"
-   >show</a>
-   <div id="related" class="submissionlist" style="display:none;">
+   <a id="toggle-related" href="javascript:toggle_div('toggle-related', 'related')">show</a>
+   <div id="related" class="submission-list" style="display:none;">
     <ul>
      {% for sibling in related_same_project %}
       <li>
@@ -129,10 +124,8 @@ function toggle_div(link_id, headers_id, label_show, label_hide)
       </li>
      {% endfor %}
      {% if related_different_project %}
-      <a id="togglerelatedoutside"
-         href="javascript:toggle_div('togglerelatedoutside', 'relatedoutside', 'show from other projects')"
-      >show from other projects</a>
-      <div id="relatedoutside" class="submissionlist" style="display:none;">
+      <a id="toggle-related-outside">show from other projects</a>
+      <div id="related-outside" class="submission-list" style="display:none;">
        {% for sibling in related_outside %}
         <li>
          <a href="{% url 'patch-detail' project_id=sibling.project.linkname msgid=sibling.url_msgid %}">
index 8accb4c3d26030666646c68d48fc2c2b629cf423..a95a11b0654a6a9434ad0ec44ca329822aa9616c 100644 (file)
   {% endfor %}
   </div>
 {% endif %}
-  <div class="container-fluid">
+  <div id="main-content" class="container-fluid">
 {% block body %}
 {% endblock %}
   </div>