#155 Fix HTML issues reported by SonarQube scan
Merged 3 years ago by jskladan. Opened 3 years ago by lholecek.
taskotron/ lholecek/resultsdb sonar-scan-fixes  into  develop

@@ -1,66 +0,0 @@ 

- {% macro render_field(field) %}

-   <th>{{ field.label }}</th>

-   <td>{{ field(**kwargs)|safe }}</td>

-   <td>

-     {% for error in field.errors %}

-        <span style="color: red;">{{error}}</span>

-     {% endfor %}

-   </td>

- {% endmacro %}

- 

- <!-- inspired by https://gist.github.com/maximebf/3986659 -->

- {% macro form_field(field) %}

-     {% set with_label = kwargs.pop('with_label', False) %}

- 

-     {% set inline_ = '' %}

-     {% if field.type  == 'BooleanField' %}

-         <div class="checkbox">

-           <label>

-             {{ field(**kwargs) }}

-             {{ field.label.text|safe }}

-           </label>

-         </div>

- 

- 

-     {% elif field.type == 'RadioField' %}

-       {% for subfield in field %}

-         <div class="radio">

-           <label>

-             {{ subfield(**kwargs) }}

-             {{ subfield.label.text|safe }}

-           </label>

-         </div>

-       {% endfor %}

-     {% else %}

-         <div class="form-group {% if field.errors %}has-error{% endif %}">

-             {% set placeholder = '' %}

-             {% if not with_label %}

-                 {% set placeholder = field.label.text %}

-             {% endif %}

- 

-             {% if with_label %}

-                 <label for="{{ field.id }}">

-                     {{ field.label.text }}{% if field.flags.required %} *{% endif %}:

-                 </label>

-             {% endif %}

- 

-             {% set class_ = 'form-control' %}

-             {% if field.type == 'FileField' %}

-                 {% set class_ = class_ + ' input-file' %}

-             {% endif %}

- 

-             {{ field(class_=class_, placeholder=placeholder, **kwargs) }}

- 

-             {% if field.errors %}

-                 <span class="help-block">{{ field.errors|join(', ') }}</span>

-             {% endif %}

- 

-             {% if field.description %}

-                 <p class="help-block">{{ field.description|safe }}</p>

-             {% endif %}

-         </div>

-     {% endif %}

- {% endmacro %}

- 

- 

- 

file modified
+11 -14
@@ -1,11 +1,13 @@ 

  <!DOCTYPE html>

- <html>

+ <html lang="en">

    <head>

+     <meta name="viewport" content="width=device-width, initial-scale=1">

+ 

      <title>{{ title|default('ResultsDB') }}</title>

-       <meta name="viewport" content="width=device-width, initial-scale=1.0">

-       <!-- Bootstrap -->

-       <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">

-       <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css') }}">

+ 

+     <!-- Bootstrap -->

+     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

+     <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css') }}">

    </head>

  

    <body>
@@ -18,7 +20,7 @@ 

              <span class="icon-bar"></span>

              <span class="icon-bar"></span>

            </button>

-           <span class="navbar-brand"><b>ResultsDB</b></span>

+           <span class="navbar-brand"><strong>ResultsDB</strong></span>

          </div>

          <div class="navbar-collapse collapse">

  
@@ -28,10 +30,6 @@ 

                <li><a href="{{ url_for('api_v2.get_testcases') }}">Testcases</a></li>

            </ul>

  

- <!--         <div class="navbar-right">

-              <input type="button" class="btn btn-default navbar-btn" value="Search" onclick="location.href='';">

-          </div> -->

- 

          </div><!--/.nav-collapse -->

        </div><!--/.container -->

      </div><!--/.navbar -->
@@ -58,11 +56,10 @@ 

        </footer>

      {% endblock %}

  

- 

      <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->

-     <script src="//code.jquery.com/jquery.js"></script>

-     <!-- Include all compiled plugins -->

-     <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>

+     <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>

+     <!-- Include all compiled plugins (below), or include individual files as needed -->

+     <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>

  

      {% if config['FEDMENU_URL'] is defined %}

      <script src="{{ config['FEDMENU_URL'] }}/js/fedmenu.js"></script>

no initial comment

Pull-Request has been merged by jskladan

3 years ago