From 3e1c9788e72981a963fc47f17f504c1981c2cbc3 Mon Sep 17 00:00:00 2001 From: Miguel Barão Date: Wed, 8 Jan 2020 23:43:17 +0000 Subject: [PATCH] updated maintopics-table.html --- aprendizations/templates/maintopics-table.html | 34 ++++++++++++++++++++-------------- aprendizations/tools.py | 2 +- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/aprendizations/templates/maintopics-table.html b/aprendizations/templates/maintopics-table.html index 7b7b2a6..f764a79 100644 --- a/aprendizations/templates/maintopics-table.html +++ b/aprendizations/templates/maintopics-table.html @@ -63,7 +63,7 @@

{{ course_title }}

- + @@ -71,15 +71,22 @@ {% for t in state %} + {% if t['level'] is None %} - + {% else %} - + + + - {% end %} - {% end %} + {% end %} + + {% end %}
Tópico Nível
{% if t['type']=='chapter' %}
{{ t['name'] }}
+ {% elif t['type']=='learn' %} +
+   + {{ t['name'] }} +
{% else %}
+   {{ t['name'] }}
{% end %} @@ -90,12 +97,14 @@
{% if t['type']=='chapter' %} -
+
+   {{ t['name'] }} -
+ {% elif t['type']=='learn' %}   {{ t['name'] }} @@ -104,25 +113,22 @@ {{ t['name'] }} {% end %}
{% if t['level'] < 0.01 %} {% elif t['type']=='chapter' %} -
- - -
+
{% else %} -
{{int(t['level']*5+0.25)*''}}{% if int(t['level']*5+0.25) < 5 %}{{'' if 0.25 <= t['level']*5-int(t['level']*5) < 0.75 else ''}}{% end %}{{(4-int(t['level']*5+0.25))*'' }} -
- {% end %} + {% end %}
diff --git a/aprendizations/tools.py b/aprendizations/tools.py index 0ec43f3..0073f51 100644 --- a/aprendizations/tools.py +++ b/aprendizations/tools.py @@ -184,7 +184,7 @@ def run_script(script: str, input=stdin, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, - universal_newlines=True, + text=True, # same as universal_newlines=True timeout=timeout, ) except FileNotFoundError: -- libgit2 0.21.2