Pārlūkot izejas kodu

Templates: reformat HTML

Pierre Kancir 4 gadi atpakaļ
vecāks
revīzija
ed8520898d
2 mainītis faili ar 70 papildinājumiem un 66 dzēšanām
  1. 18 17
      templates/generate.html
  2. 52 49
      templates/index.html

+ 18 - 17
templates/generate.html

@@ -2,7 +2,7 @@
 <html>
 
 <head>
-<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/main.css') }}">
+    <link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='styles/main.css') }}">
 </head>
 
 
@@ -10,22 +10,22 @@
 <h2>ArduPilot Custom Firmware Builder</h2>
 
 {% if error %}
-  <p>{{ error }} {{ex}}</p>
+<p>{{ error }} {{ex}}</p>
 {% else %}
-  <body onload="javascript: reload()">
+<body onload="javascript: reload()">
 
 <div id="main">
-<a href="https://custom.ardupilot.org/">
-<div id="logo">
-</div>
-</a>
+    <a href="https://custom.ardupilot.org/">
+        <div id="logo">
+        </div>
+    </a>
     <div id="menu">
         <p>Build in progress...</p>
         <form action="/builds/{{token}}" target="_blank">
-            <input type="submit" value="Go to build directory" />
+            <input type="submit" value="Go to build directory"/>
         </form>
         <form action="/builds" target="_blank">
-            <input type="submit" value="See all builds" />
+            <input type="submit" value="See all builds"/>
         </form>
         <form action="/">
             <input type="submit" value="Queue another build">
@@ -33,11 +33,12 @@
     </div>
     <p>Build ID: {{ token }}</p>
     <p>Build progress:</p>
-    <textarea  
-        id="build_output" rows="30" cols="100" readonly>
+    <textarea
+            id="build_output" rows="30" cols="100" readonly>
     </textarea>
-    <br><input type="checkbox" id="AutoScroll" checked>AutoScroll<script>
-      function reload() {
+    <br><input type="checkbox" id="AutoScroll" checked>AutoScroll
+    <script>
+        function reload() {
             var output = document.getElementById('build_output');
             var xhr = new XMLHttpRequest();
             xhr.open('GET', "/builds/{{token}}/build.log");
@@ -47,7 +48,7 @@
             xhr.setRequestHeader("Expires", "Tue, 01 Jan 1980 1:00:00 GMT");
             xhr.setRequestHeader("Pragma", "no-cache");
 
-            xhr.onload = function() {
+            xhr.onload = function () {
                 if (xhr.status == 200) {
                     output.textContent = xhr.responseText;
 
@@ -59,13 +60,13 @@
                         return;
                     }
                 }
-                setTimeout(reload,3000)
+                setTimeout(reload, 3000)
             }
             xhr.send();
-      }
+        }
     </script>
 
-  </body>
+</body>
 {% endif %}
 
 </html>

+ 52 - 49
templates/index.html

@@ -2,17 +2,17 @@
 
 
 <head>
-<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/main.css') }}">
-<script type="text/javascript" src="{{ url_for('static', filename='js/CollapsibleLists.js')}}"></script>
-<title>ArduPilot Custom Firmware Builder</title>
+    <link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='styles/main.css') }}">
+    <script type="text/javascript" src="{{ url_for('static', filename='js/CollapsibleLists.js')}}"></script>
+    <title>ArduPilot Custom Firmware Builder</title>
 </head>
 
 <body onload="javascript: reload()">
 <div id="main">
-<a href="https://custom.ardupilot.org/">
-<div id="logo">
-</div>
-</a>
+    <a href="https://custom.ardupilot.org/">
+        <div id="logo">
+        </div>
+    </a>
 
     <div id="menu">
         <h2>ArduPilot Custom Firmware Builder</h2>
@@ -27,53 +27,56 @@
             <label for="vehicle">Choose a vehicle:</label>
             <select name="vehicle">
                 {% for vehicle in get_vehicles()[0] %}
-                    {% if vehicle == get_vehicles()[1] %}
-                        <option value="{{vehicle}}" selected>{{vehicle}}</option>
-                    {% else %}
-                        <option value="{{vehicle}}">{{vehicle}}</option>
-                    {% endif %}
+                {% if vehicle == get_vehicles()[1] %}
+                <option value="{{vehicle}}" selected>{{vehicle}}</option>
+                {% else %}
+                <option value="{{vehicle}}">{{vehicle}}</option>
+                {% endif %}
                 {% endfor %}
             </select>
             <p/>
             <label for="board">Choose a board:</label>
             <select name="board">
                 {% for board in get_boards()[0] %}
-                    {% if board == get_boards()[1] %}
-                        <option value="{{board}}" selected>{{board}}</option>
-                    {% else %}
-                        <option value="{{board}}">{{board}}</option>
-                    {% endif %}
+                {% if board == get_boards()[1] %}
+                <option value="{{board}}" selected>{{board}}</option>
+                {% else %}
+                <option value="{{board}}">{{board}}</option>
+                {% endif %}
                 {% endfor %}
             </select>
             <p/>
             <label for="board">Select Features:</label>
             <ul class="collapsibleList">
-              {% for c in get_build_categories() %}
-              <li>{{c}}
-                <ul>
-                  {% for f in get_build_options(c) %}
-                    <li>
-                    {% if f.default == 1 %}
-                    <input onclick='dependencies(this, "{{f.label}}", "{{f.dependency}}");' type="checkbox" name="{{f.label}}" id="{{f.label}}" value="1" checked>
-                    {% else %}
-                    <input onclick='dependencies(this, "{{f.label}}", "{{f.dependency}}");' type="checkbox" name="{{f.label}}" id="{{f.label}}" value="1">
-                    {% endif %}
-                    {{f.description}}
-                    </li>
-                  {% endfor %}
-                </ul>
-               </li>
-              {% endfor %}
+                {% for c in get_build_categories() %}
+                <li>{{c}}
+                    <ul>
+                        {% for f in get_build_options(c) %}
+                        <li>
+                            {% if f.default == 1 %}
+                            <input onclick='dependencies(this, "{{f.label}}", "{{f.dependency}}");' type="checkbox"
+                                   name="{{f.label}}" id="{{f.label}}" value="1" checked>
+                            {% else %}
+                            <input onclick='dependencies(this, "{{f.label}}", "{{f.dependency}}");' type="checkbox"
+                                   name="{{f.label}}" id="{{f.label}}" value="1">
+                            {% endif %}
+                            {{f.description}}
+                        </li>
+                        {% endfor %}
+                    </ul>
+                </li>
+                {% endfor %}
             </ul>
             <br>
             <input type="submit" value="Generate">
         </form>
     </div>
-<hr>
+    <hr>
     <div id="build_status"></div>
-<br />
+    <br/>
     <script>
         CollapsibleLists.apply();
+
         function reload() {
             var output = document.getElementById('build_status');
             var xhr = new XMLHttpRequest();
@@ -84,28 +87,28 @@
             xhr.setRequestHeader("Expires", "Tue, 01 Jan 1980 1:00:00 GMT");
             xhr.setRequestHeader("Pragma", "no-cache");
 
-            xhr.onload = function() {
+            xhr.onload = function () {
                 if (xhr.status == 200) {
                     output.innerHTML = xhr.responseText;
                 }
-                setTimeout(reload,5000)
+                setTimeout(reload, 5000)
             }
             xhr.send();
-            }
-        
+        }
+
         function dependencies(cb, f_label, f_dependency1) {
             switch (cb.name) {
-            case f_label:
-                const f_dependency = f_dependency1.split(",")
-                var arrayLength = f_dependency.length;
-                for (var i = 0; i < arrayLength; i++) {
-                    if (document.getElementById(f_dependency[i]).checked == false){
-                        document.getElementById(f_dependency[i]).checked = cb.checked;
-                }
-                }
-            break;
-            }
+                case f_label:
+                    const f_dependency = f_dependency1.split(",")
+                    var arrayLength = f_dependency.length;
+                    for (var i = 0; i < arrayLength; i++) {
+                        if (document.getElementById(f_dependency[i]).checked == false) {
+                            document.getElementById(f_dependency[i]).checked = cb.checked;
+                        }
+                    }
+                    break;
             }
+        }
     </script>
 </body>