diff --git a/.DS_Store b/.DS_Store index 00655cb..f13658e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/__pycache__/config.cpython-37.pyc b/__pycache__/config.cpython-37.pyc index 3ee8ae0..1e57af2 100644 Binary files a/__pycache__/config.cpython-37.pyc and b/__pycache__/config.cpython-37.pyc differ diff --git a/__pycache__/contextualise.cpython-37.pyc b/__pycache__/contextualise.cpython-37.pyc index 5509abd..d85feaa 100644 Binary files a/__pycache__/contextualise.cpython-37.pyc and b/__pycache__/contextualise.cpython-37.pyc differ diff --git a/contextualise.py b/contextualise.py index 8a2958a..481514b 100644 --- a/contextualise.py +++ b/contextualise.py @@ -100,7 +100,7 @@ def home(): sessionid = "current_user.id" #add the very first time of connection to the interface # if veryfirstnow is None : - session['veryfirstnow'] = datetime.now() + session['veryfirstnow'] = datetime.now() return render_template('home.html') def functionsession(): return(session) @@ -130,6 +130,7 @@ def description(): #open json file, list filepaths in array and loop with thefile textfile="" + textfiles=[] with open("static/"+jsonfilefordescription, 'r') as f: data_dict = json.load(f) datafromjson = data_dict["files"] @@ -139,12 +140,9 @@ def description(): if file.lower().endswith(('.html')): with open("static/"+file,"r", encoding='utf-8') as f: textfile = f.read() - # wordlinked = ""+word+"" - # textfile = re.sub(word, wordlinked, textfile) textfile = Markup(textfile) - - - return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfile=textfile, idno=idno) + textfiles.append(textfile) + return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfiles=textfiles, idno=idno) @app.route('/diverge', methods=['GET']) def diverge(): @@ -180,7 +178,7 @@ def get_file(): veryfirstnow = session['veryfirstnow'] tadam = None - for t in timelist : + for t in timelist : t = str(t) yo = dt.datetime.strptime(t, '%Y-%m-%d %H:%M:%S.%f') timelistforoperations.append(yo) @@ -223,12 +221,12 @@ def get_file(): #If fullscore length superior 60 characters, insert linebreak - # Defining splitting point + # Defining splitting point n = 60 - # Using list comprehension + # Using list comprehension out = [(fullscore[i:i+n]) for i in range(0, len(fullscore), n)] #joining the strings with linebreaks - tadam = '\n'.join(out) + tadam = '\n'.join(out) # have a message in file if no nav has been recorded so it's less dull than error page if tadam is None: tadam = "This score is Null" diff --git a/fonts/SelectricMono.otf b/fonts/SelectricMono.otf new file mode 100644 index 0000000..2ff1177 Binary files /dev/null and b/fonts/SelectricMono.otf differ diff --git a/fonts/whois-mono.ttf b/fonts/whois-mono.ttf new file mode 100644 index 0000000..d1fd9b3 Binary files /dev/null and b/fonts/whois-mono.ttf differ diff --git a/static/css/main.css b/static/css/main.css index 940ec18..0652b07 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1,11 +1,21 @@ +@font-face { + font-family: 'whois-mono'; + src: url('../../fonts/whois-mono.ttf'); +} + +@font-face { + font-family: 'SelectricMono'; + src: url('../../fonts/SelectricMono.otf'); +} + body{ background: #ffffff; color:blue; - + font-family: 'whois-mono'; } a{ - /*text-decoration: none;*/ + text-decoration: none; } @@ -19,9 +29,18 @@ li a{ li a:hover{ color: orange; - } img{ max-width: 500px; } + +div{ + /* width: 80%; */ + margin:0 auto; + padding: 1em 2em 1em; +} + +.diverge{ + margin-left: 1em; +} diff --git a/templates/description.html b/templates/description.html index a612f88..788b705 100644 --- a/templates/description.html +++ b/templates/description.html @@ -3,40 +3,36 @@

{{ itemid }}

- -

{{ datafromjson }}

+ -
+
+{% set count=[0] %} +{% for item in datafromjson %} - {% for item in datafromjson %} + {% if item.lower().endswith(('.png', '.jpg', '.jpeg')) %} +
+ +
- {% if item.lower().endswith(('.png', '.jpg', '.jpeg')) %} -
- -
+ {% elif item.lower().endswith(('.mp4')) %} +
+ +
- {% elif item.lower().endswith(('.mp4')) %} -
-
+ {% elif item.lower().endswith(('.mp3')) %} +
+ +
- {% elif item.lower().endswith(('.mp3')) %} -
-
- {% endif %} + {% elif item.lower().endswith(('.html')) %} + {{ textfiles[count[0]] }} + {% if count.append(count.pop() + 1) %}{% endif %} +


+ {% endif %} - {% endfor %} +{% endfor %} +
- {% if textfile is defined %} - {{ textfile }} - {% endif %} - - - - -
- {% endblock %} +{% endblock %} diff --git a/templates/diverge.html b/templates/diverge.html index 6150ae9..5b6370c 100644 --- a/templates/diverge.html +++ b/templates/diverge.html @@ -8,9 +8,9 @@ {% for item in wordlist_dict[word] %} {% set address = "/description?id=" + item['id'] %} - + {{ item['sentence'] }} -
+


{% endfor %} {% endif %} diff --git a/templates/layout.html b/templates/layout.html index 9f56dde..20a47fa 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -2,10 +2,10 @@ + P.u.s.h.i.n.g.S.c.o.r.e.s - - +