[PATCH 14/19] ui: Switch to HTML5 doctype and fix issues

Stephen Finucane stephen.finucane at intel.com
Thu Feb 4 08:31:49 AEDT 2016


From: Damien Lespiau <damien.lespiau at intel.com>

A few common things:

- Remove the 'role' attribute of <nav>
- Don't use the self closing syntax ('/>') on non void elements
- Don't use the language attribution in <script>
- Remove spurious attributes
- The 'check' attribute of <input> doesn't take any value

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
Acked-by: Stephen Finucane <stephen.finucane at intel.com>
---
 patchwork/filters.py                          |  6 +++---
 patchwork/templates/patchwork/filters.html    |  6 +++---
 patchwork/templates/patchwork/patch-list.html | 12 +++++-------
 patchwork/templates/patchwork/patch.html      |  2 +-
 patchwork/templates/patchwork/profile.html    |  2 +-
 templates/base.html                           |  7 +++----
 6 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/patchwork/filters.py b/patchwork/filters.py
index 4ee3998..3aac042 100644
--- a/patchwork/filters.py
+++ b/patchwork/filters.py
@@ -309,10 +309,10 @@ class ArchiveFilter(Filter):
             label = self.description_map[b]
             selected = ''
             if self.archive_state == b:
-                selected = 'checked="true"'
+                selected = 'checked'
             s += ('<label class="checkbox-inline">'
-                  ' <input type="radio" name="%(param)s" ' +
-                  '%(selected)s value="%(value)s">%(label)s' +
+                  ' <input type="radio" name="%(param)s" '
+                  '%(selected)s value="%(value)s">%(label)s'
                   '</label>') % \
                 {'label': label,
                  'param': self.param,
diff --git a/patchwork/templates/patchwork/filters.html b/patchwork/templates/patchwork/filters.html
index 3abfe24..452197b 100644
--- a/patchwork/templates/patchwork/filters.html
+++ b/patchwork/templates/patchwork/filters.html
@@ -1,6 +1,6 @@
 {% load static %}
 
-<script type="text/javascript" language="JavaScript">
+<script type="text/javascript">
 var filterform_displayed = false;
 function filter_click()
 {
@@ -93,7 +93,7 @@ $(document).ready(function() {
     {% if not filter.forced %}
      <a class="filter-action"
         href="{{ filter.url_without_me }}">  <span
-        class="glyphicon glyphicon-minus-sign" /></a>
+        class="glyphicon glyphicon-minus-sign"></span></a>
     {% endif %}
    {% if not forloop.last %}   |   {% endif %}
   {% endfor %}
@@ -104,7 +104,7 @@ $(document).ready(function() {
  {% endif %}
  </div>
  <div id="filterform" style="padding-top: 1em; display: none">
-  <form class="form-horizontal" role="form" method="get">
+  <form class="form-horizontal" method="get">
    {% for filter in filters.available_filters %}
    <div class="form-group">
     <label class="col-sm-2 control-label">{{ filter.name }}</label>
diff --git a/patchwork/templates/patchwork/patch-list.html b/patchwork/templates/patchwork/patch-list.html
index 8400662..2528790 100644
--- a/patchwork/templates/patchwork/patch-list.html
+++ b/patchwork/templates/patchwork/patch-list.html
@@ -35,7 +35,7 @@
 </div>
 {% endif %}
 
-<script type="text/javascript" language="JavaScript">
+<script type="text/javascript">
 $(document).ready(function() {
     $('#patchlist').stickyTableHeaders();
 });
@@ -170,7 +170,7 @@ $(document).ready(function() {
 
 {% include "patchwork/pagination.html" %}
 
-<div class="patchforms" id="patchforms" name="patchforms">
+<div class="patchforms" id="patchforms">
 
 {% if patchform %}
  <div class="patchform patchform-properties">
@@ -184,14 +184,14 @@ $(document).ready(function() {
       </td>
      </tr>
      <tr>
-      <th>Delegate to:</td>
+      <th>Delegate to:</th>
       <td>
        {{ patchform.delegate }}
        {{ patchform.delegate.errors }}
       </td>
      </tr>
      <tr>
-      <th>Archive:</td>
+      <th>Archive:</th>
       <td>
        {{ patchform.archived }}
        {{ patchform.archived.errors }}
@@ -223,7 +223,7 @@ $(document).ready(function() {
     <tr>
      <td>Add to bundle:</td>
      <td>
-       <select name="bundle_id"/>
+       <select name="bundle_id">
         {% for bundle in bundles %}
          <option value="{{bundle.id}}">{{bundle.name}}</option>
         {% endfor %}
@@ -256,6 +256,4 @@ $(document).ready(function() {
  </tr>
 {% endif %}
 
- </table>
 </form>
-
diff --git a/patchwork/templates/patchwork/patch.html b/patchwork/templates/patchwork/patch.html
index ae9355d..4d46354 100644
--- a/patchwork/templates/patchwork/patch.html
+++ b/patchwork/templates/patchwork/patch.html
@@ -8,7 +8,7 @@
 {% block title %}{{patch.name}}{% endblock %}
 
 {% block body %}
-<script language="JavaScript" type="text/javascript">
+<script type="text/javascript">
 function toggle_headers(link_id, headers_id)
 {
     var link = document.getElementById(link_id)
diff --git a/patchwork/templates/patchwork/profile.html b/patchwork/templates/patchwork/profile.html
index 2ec2db1..5bd3e13 100644
--- a/patchwork/templates/patchwork/profile.html
+++ b/patchwork/templates/patchwork/profile.html
@@ -124,7 +124,7 @@ address.</p>
  <table class="form">
 {{ profileform }}
   <tr>
-   <td/>
+   <td></td>
    <td>
     <input type="submit" value="Apply"/>
    </td>
diff --git a/templates/base.html b/templates/base.html
index f5a065d..09839e9 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,6 +1,5 @@
 {% load staticfiles %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
@@ -24,7 +23,7 @@
 {% block headers %}{% endblock %}
  </head>
  <body>
-  <nav class="navbar navbar-inverse navbar-patchwork" role="navigation">
+  <nav class="navbar navbar-inverse navbar-patchwork">
    <div class="container-fluid">
     <div class="navbar-header">
       <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
@@ -71,7 +70,7 @@
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
          <span class="badge">{{ user.profile.n_todo_patches }}</span>
-         <strong>{{ user.username }}</strong> <span class="caret" />
+         <strong>{{ user.username }}</strong> <span class="caret"></span>
        </a>
        <ul class="dropdown-menu" role="menu">
          <li>
-- 
2.0.0



More information about the Patchwork mailing list