Browse Source

Implement log frontend

marches
Josh Gordon 3 years ago
parent
commit
0bd516d5a2
  1. 7
      app/routes.py
  2. 3
      app/templates/index.html
  3. 9
      app/templates/marchLog.html
  4. 2
      app/templates/marchMap.html
  5. 6
      app/templates/marchWorld.html

7
app/routes.py

@ -90,15 +90,16 @@ def marchWorld(world):
pfile.close()
#image_map = [(10,20,35),(50,40,20)] #("place name",x,y,r)
#image_map = [("Temple of Constant Explosions",10,20,35),("Deep Gnome Workshop",50,40,20)] #(place,x,y,r)
log_list = [("5/3/19",[("Josh Gordon","bottom text"),("Anthony Rinaldo","lorem ipsum")])] # :: [(Date,[(CharacterName,String)])]
log_list = ["Raiding Cosi"] # :: [AdventureName]
return render_template("marchWorld.html",worldname=world,players=player_list,logs=log_list)
@app.route("/marches/world/<world>/<logname>")
@app.route("/marches/worlds/<world>/<logname>")
def marchLog(world,logname):
print(logname)
#... code
#logname is title of adventure
#log type is (DateString,X,Y,[(Name,Text)])
return render_template("marchLog.html",worldname=world,log=None)
return render_template("marchLog.html",worldname=world,log=("current time",40,50,[("Lorem","ipsum. this is some data. data data data."),("Anthony","Someone's gonna see this code and theyre gonna shoot me")]))
def bucket_route(uri, dir, sing=None):
if sing is None:

3
app/templates/index.html

@ -22,6 +22,9 @@
</ul>
</nav>
<a href="/marches">.</a>
{% if searchResults is defined %}
{{ macros.itemTable(searchResults) }}
{% endif %}

9
app/templates/marchLog.html

@ -0,0 +1,9 @@
{% extends "base.html" %}
{% block content %}
{% set (sdate,x,y,ls) = log %}
<h2><a href="/marches/worlds/{{worldname}}">{{sdate}}</a></h2>
{% for (char,text) in ls %}
<h3>{{char}}</h3>
<p>{{text}}</p>
{% endfor %}
{% endblock %}

2
app/templates/marchMap.html

@ -1,6 +1,8 @@
{% extends "base.html" %}
{% block content %}
<h2><a href="/marches/worlds/{{worldname}}">{{worldname}}</a></h2>
<img class="bigmap" src="/static/{{worldname}}.png" alt="themap" usemap="#worldmap">
<map name="worldmap">

6
app/templates/marchWorld.html

@ -18,6 +18,10 @@
</div>
</section>
<section class="logs">
<ul>
{% for name in logs %}
<li><a href="/marches/worlds/{{worldname}}/{{name}}">{{name}}</a></li>
{% endfor %}
</ul>
</section>
{% endblock %}
Loading…
Cancel
Save