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