Browse Source

added navbar and front page

master
Cristina Cochior 5 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
#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)

BIN
static/.DS_Store

Binary file not shown.

4
static/css/main.css

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

24
templates/home.html

@ -1,7 +1,19 @@
{% extends "layout.html" %}
{% block content %}
<div class="home">
<h1>Start</h1>
<p>This will be the page with all the keywords.</p>
</div>
{% endblock %}
{% block content %}
<div class="home">
<h1>Welcome to the Pushing Scores archive</h1>
{% for word in wordlist_dict %}
{% set address = "/diverge?search=" + word %}
<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>
<meta charset="UTF-8">
<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="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> -->
</head>
<body>
<header>
<div class="index">
{% block index %}
{% endblock index %}
</div>
<div class="container">
<h1 class="logo">P.u.s.h.i.n.g.S.c.o.r.e.s</h1>
<strong><nav>
@ -23,7 +28,7 @@
</header>
<div class="container">
{% block content %}
{% endblock %}
{% endblock content %}
</div>
</body>
</html>

Loading…
Cancel
Save