Commit 3e1c9788e72981a963fc47f17f504c1981c2cbc3

Authored by Miguel Barão
1 parent 1d9be510
Exists in master and in 1 other branch dev

updated maintopics-table.html

aprendizations/templates/maintopics-table.html
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 <h4>{{ course_title }}</h4> 63 <h4>{{ course_title }}</h4>
64 64
65 <table class="table table-hover"> 65 <table class="table table-hover">
66 - <thead> 66 + <thead class="">
67 <tr> 67 <tr>
68 <th>Tópico</th> 68 <th>Tópico</th>
69 <th class="text-center">Nível</th> 69 <th class="text-center">Nível</th>
@@ -71,15 +71,22 @@ @@ -71,15 +71,22 @@
71 </thead> 71 </thead>
72 <tbody> 72 <tbody>
73 {% for t in state %} 73 {% for t in state %}
  74 + <!-- ------------------------------------------------------------- -->
74 {% if t['level'] is None %} 75 {% if t['level'] is None %}
75 - <tr class="table-primary"> 76 + <tr class="table-secondary">
76 <td> 77 <td>
77 {% if t['type']=='chapter' %} 78 {% if t['type']=='chapter' %}
78 <div class="text-muted lead"> 79 <div class="text-muted lead">
79 {{ t['name'] }} 80 {{ t['name'] }}
80 </div> 81 </div>
  82 + {% elif t['type']=='learn' %}
  83 + <div class="text-muted">
  84 + <i class="fas fa-book"></i>&nbsp;
  85 + {{ t['name'] }}
  86 + </div>
81 {% else %} 87 {% else %}
82 <div class="text-muted"> 88 <div class="text-muted">
  89 + <i class="fas fa-pencil-alt"></i>&nbsp;
83 {{ t['name'] }} 90 {{ t['name'] }}
84 </div> 91 </div>
85 {% end %} 92 {% end %}
@@ -90,12 +97,14 @@ @@ -90,12 +97,14 @@
90 </tr> 97 </tr>
91 98
92 {% else %} 99 {% else %}
93 - <tr class="clickable-row" data-href="/topic/{{t['ref']}}"> 100 +
  101 + <tr class="clickable-row " data-href="/topic/{{t['ref']}}">
94 <td class="text-primary"> 102 <td class="text-primary">
95 {% if t['type']=='chapter' %} 103 {% if t['type']=='chapter' %}
96 - <div class="lead"> 104 + <h5>
  105 + <i class="fas fa-flag-checkered"></i>&nbsp;
97 {{ t['name'] }} 106 {{ t['name'] }}
98 - </div> 107 + </h5>
99 {% elif t['type']=='learn' %} 108 {% elif t['type']=='learn' %}
100 <i class="fas fa-book"></i>&nbsp; 109 <i class="fas fa-book"></i>&nbsp;
101 {{ t['name'] }} 110 {{ t['name'] }}
@@ -104,25 +113,22 @@ @@ -104,25 +113,22 @@
104 {{ t['name'] }} 113 {{ t['name'] }}
105 {% end %} 114 {% end %}
106 </td> 115 </td>
  116 +
107 <td class="text-center"> 117 <td class="text-center">
108 {% if t['level'] < 0.01 %} 118 {% if t['level'] < 0.01 %}
109 <i class="fas fa-lock-open text-success"></i> 119 <i class="fas fa-lock-open text-success"></i>
110 {% elif t['type']=='chapter' %} 120 {% elif t['type']=='chapter' %}
111 - <div class="text-xs-right">  
112 - <i class="fas fa-trophy fa-lg text-warning"></i>  
113 - <!-- <i class="fas fa-award fa-lg text-warning"></i> -->  
114 - </div> 121 + <h5><i class="fas fa-award text-warning"></i></h5>
115 {% else %} 122 {% else %}
116 - <div class="text-xs-right">  
117 <span class="text-nowrap text-warning" data-toggle="tooltip" data-placement="bottom" title="{{round(t['level']*5, 2)}}"> 123 <span class="text-nowrap text-warning" data-toggle="tooltip" data-placement="bottom" title="{{round(t['level']*5, 2)}}">
118 {{int(t['level']*5+0.25)*'<i class="fas fa-star"></i>'}}{% if int(t['level']*5+0.25) < 5 %}{{'<i class="fas fa-star-half-alt"></i>' if 0.25 <= t['level']*5-int(t['level']*5) < 0.75 else '<i class="far fa-star"></i>'}}{% end %}{{(4-int(t['level']*5+0.25))*'<i class="far fa-star"></i>' }} 124 {{int(t['level']*5+0.25)*'<i class="fas fa-star"></i>'}}{% if int(t['level']*5+0.25) < 5 %}{{'<i class="fas fa-star-half-alt"></i>' if 0.25 <= t['level']*5-int(t['level']*5) < 0.75 else '<i class="far fa-star"></i>'}}{% end %}{{(4-int(t['level']*5+0.25))*'<i class="far fa-star"></i>' }}
119 </span> 125 </span>
120 - </div>  
121 - {% end %} 126 + {% end %} <!-- if -->
122 </td> 127 </td>
123 </tr> 128 </tr>
124 - {% end %}  
125 - {% end %} 129 + {% end %} <!-- if level is none -->
  130 + <!-- ------------------------------------------------------------- -->
  131 + {% end %} <!-- for -->
126 </tbody> 132 </tbody>
127 </table> 133 </table>
128 </div> 134 </div>
aprendizations/tools.py
@@ -184,7 +184,7 @@ def run_script(script: str, @@ -184,7 +184,7 @@ def run_script(script: str,
184 input=stdin, 184 input=stdin,
185 stdout=subprocess.PIPE, 185 stdout=subprocess.PIPE,
186 stderr=subprocess.STDOUT, 186 stderr=subprocess.STDOUT,
187 - universal_newlines=True, 187 + text=True, # same as universal_newlines=True
188 timeout=timeout, 188 timeout=timeout,
189 ) 189 )
190 except FileNotFoundError: 190 except FileNotFoundError: