Browse Source

added navbar and front page

master
Cristina Cochior 6 years ago
parent
commit
c223dd94b8
  1. BIN
      __pycache__/contextualise.cpython-37.pyc
  2. 17
      contextualise.py
  3. BIN
      static/.DS_Store
  4. 4
      static/css/main.css
  5. 24
      templates/home.html
  6. 11
      templates/layout.html

BIN
__pycache__/contextualise.cpython-37.pyc

Binary file not shown.

17
contextualise.py

@ -49,12 +49,15 @@ session['id'] = []
session['veryfirstnow'] = None session['veryfirstnow'] = None
#VARS FOR THE SCORES #VARS FOR THE SCORES
wordpath = [] wordpath = []
idlist = [] idlist = []
timelist = [] timelist = []
timelistforoperations = [] timelistforoperations = []
# preparing the index.json file for the navbar
index_dict = {}
###################################################################################### ######################################################################################
#SOME JSON AND WALK OS REALTED THINGIES #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) fullpath = os.path.join(path, name)
jsonfiles.append(fullpath[7:]) 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: for name in files:
if name.endswith(".json"): if name.endswith(".json"):
fullpath = os.path.join(path, name) fullpath = os.path.join(path, name)
jsonfiles.append(fullpath[7:]) jsonfiles.append(fullpath[8:])
fullpathjsonfiles.append(fullpath) 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 dict = {} #dict for the form entries
@ -101,7 +108,7 @@ def home():
#add the very first time of connection to the interface #add the very first time of connection to the interface
# if veryfirstnow is None : # if veryfirstnow is None :
session['veryfirstnow'] = datetime.now() session['veryfirstnow'] = datetime.now()
return render_template('home.html') return render_template('home.html', wordlist_dict=wordlist_dict, index_dict=index_dict)
def functionsession(): def functionsession():
return(session) return(session)

BIN
static/.DS_Store

Binary file not shown.

4
static/css/main.css

@ -47,3 +47,7 @@ div{
.diverge{ .diverge{
margin-left: 1em; margin-left: 1em;
} }
.index {
display: block;
}

24
templates/home.html

@ -1,7 +1,19 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block content %} {% block content %}
<div class="home"> <div class="home">
<h1>Start</h1> <h1>Welcome to the Pushing Scores archive</h1>
<p>This will be the page with all the keywords.</p> {% for word in wordlist_dict %}
</div> {% set address = "/diverge?search=" + word %}
{% endblock %} <a href={{address}}>
{{ word }}
</a>
{% endfor %}
</div>
{% endblock content %}
{% block index %}
{% for each in index_dict %}
{% set address = "/description?id=" + each %}
<a href={{address}}>{{index_dict[each]}}</a>
{% endfor %}
{% endblock index %}

11
templates/layout.html

@ -3,12 +3,17 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>P.u.s.h.i.n.g.S.c.o.r.e.s</title> <title><a href="">P.u.s.h.i.n.g.S.c.o.r.e.s</a></title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> -->
</head> </head>
<body> <body>
<header> <header>
<div class="index">
{% block index %}
{% endblock index %}
</div>
<div class="container"> <div class="container">
<h1 class="logo">P.u.s.h.i.n.g.S.c.o.r.e.s</h1> <h1 class="logo">P.u.s.h.i.n.g.S.c.o.r.e.s</h1>
<strong><nav> <strong><nav>
@ -23,7 +28,7 @@
</header> </header>
<div class="container"> <div class="container">
{% block content %} {% block content %}
{% endblock %} {% endblock content %}
</div> </div>
</body> </body>
</html> </html>

Loading…
Cancel
Save