summaryrefslogtreecommitdiffstats
path: root/pywrap/templates/property_info.html
blob: 912d3d59be1f28696d6b1390fc34ef3deb34bf15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{% extends "base.html" %}
{% block title %}Property list{% endblock %}
{% block info %}
<h1>List of properties in branch {{ branch }}</h1>
{% endblock %}

{% block content %}

   <script>
      function set_property()
      {
         var value = document.getElementById("set_val_box").value;
         window.location.href = "{{ url_for('set_property') }}?prop={{ branch }}&"+
                                'val='+value;
      };
   </script>

<table border="1" style="width:100%">
   <tr>
    <th>Name</th>
    <th>Description</th> 
   </tr>
   {% for property in properties %}
   <tr>
      {% if ('childs' in property.flags) or (properties|length != 1) %}
         <td><a href="{{ url_for('get_property_list', branch = property.path) }}">"{{ property.name }}"</td>
         {% if 'description' in property %}
      <script>
      function set_property()
      {
         var value = document.getElementById("set_val_box").value;
         window.location.href = "{{ url_for('set_property') }}?prop={{ branch }}&"+
                                'val='+value;
      };
   </script>
         <td>{{ property.description }}</td>
            {% else %}
            <td></td>
            {% endif %}
         {% else %}
            <td>{{ property.name }}"</td>
            <td>
               <table border="1" style="width:100%">
                  {% if 'description' in property %}
                  <tr>
                     <th> Description </th>
                     <td> {{ property.description }} </td>
                  </tr>
                  {% endif %}
                  <tr>
                     <th> Current value </th>
                     <td> {{ value }} </td>
                  </tr>
                  {% if 'W' in property.mode %}
                     <tr>
                        <th> Set value</th>
                        <td> 
                           <input type="text" name="set_val_box" id="set_val_box" value="" />
                           <input type="button" value="set" onclick="set_property()">
                        </td>
                     </tr>
                  {% endif %}
                  <tr>
                     <th>Mode</th>
                     <td>
                        <ul>
                           {% for m in property.mode %}
                              <li>{{ m }}</li>
                           {% endfor %}
                        </ul>
                     </td>
                  </tr>
                  <tr>
                     <th>Type</th>
                     <td> {{ property.type }} </td>
                  </tr>
                  <tr>
                     <th>Unit</th>
                     <td> {{ property.unit }} </td>
                  </tr>
                  <tr>
                     <th>Path</th>
                     <td> {{ property.path }} </td>
                  </tr>
               </table>
            </td>
         {% endif %}
      </tr>
      {% endfor %}
   </table>
{% endblock %}