diff --git a/__pycache__/contextualise.cpython-37.pyc b/__pycache__/contextualise.cpython-37.pyc index e316a4b..14caaa9 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 a9e5f46..8201b8c 100644 --- a/contextualise.py +++ b/contextualise.py @@ -49,12 +49,15 @@ session['id'] = [] session['veryfirstnow'] = None #VARS FOR THE SCORES - wordpath = [] idlist = [] timelist = [] timelistforoperations = [] +# preparing the index.json file for the navbar +index_dict = {} + + ###################################################################################### #SOME JSON AND WALK OS REALTED THINGIES ###################################################################################### @@ -77,13 +80,17 @@ for path, subdirs, files in os.walk(path): fullpath = os.path.join(path, name) jsonfiles.append(fullpath[7:]) -#listing the json paths -for path, subdirs, files in os.walk(path): + +#listing the json paths simultaneously generating a new index.json for the navbar +for path, subdirs, files in os.walk('./static/files/'): for name in files: if name.endswith(".json"): fullpath = os.path.join(path, name) - jsonfiles.append(fullpath[7:]) + jsonfiles.append(fullpath[8:]) fullpathjsonfiles.append(fullpath) + with open (fullpath) as f: + temp_dict = json.load(f) + index_dict[temp_dict["id"]] = temp_dict["title"] dict = {} #dict for the form entries @@ -101,7 +108,7 @@ def home(): #add the very first time of connection to the interface # if veryfirstnow is None : session['veryfirstnow'] = datetime.now() - return render_template('home.html') + return render_template('home.html', wordlist_dict=wordlist_dict, index_dict=index_dict) def functionsession(): return(session) diff --git a/static/.DS_Store b/static/.DS_Store index 8e339d9..3ada25c 100644 Binary files a/static/.DS_Store and b/static/.DS_Store differ diff --git a/static/css/main.css b/static/css/main.css index ab4936b..362e545 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -47,3 +47,7 @@ div{ .diverge{ margin-left: 1em; } + +.index { + display: block; +} diff --git a/templates/home.html b/templates/home.html index de231a6..fea21f8 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,7 +1,19 @@ {% extends "layout.html" %} - {% block content %} -
This will be the page with all the keywords.
-