diasporadiaries

a platform for writing stories with personal accounts and messages
git clone git://parazyd.org/diasporadiaries.git
Log | Files | Refs | Submodules | README | LICENSE

commit 205f93a0814b0aa398646849483b8ba1bca2cc6c
parent cb4fc4d68e995d4a2f84d63304481d54aa871e25
Author: parazyd <parazyd@dyne.org>
Date:   Mon, 21 Jan 2019 21:44:31 +0100

Unify story card views.

Diffstat:
Mtemplates/country.html | 66+-----------------------------------------------------------------
Mtemplates/dashboard.html | 73+------------------------------------------------------------------------
Atemplates/gallery.html | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+), 137 deletions(-)

diff --git a/templates/country.html b/templates/country.html @@ -13,71 +13,7 @@ {% endif %} <hr style="width: 100%; height: 2px;"> - <div class="album py-5 bg-light"> - <div class="container"> - - {% if filtered_stories %} - {% set stor = filtered_stories %} - {% else %} - {% set stor = stories %} - {% endif %} - - {% for i in stor %} - {% if loop.index % 3 == 1 %} - <div class="row"> - {% endif %} - - <div class="col-md-4"> - <div class="card"> - <div class="card-body"> - <p class="card-text small">{{ i['abstract'] }}</p> - - <div class="card-body"> - <a href="/view?id={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Read</a> - - <img style="height: 1em;" src="/static/img/flags/{{ i['embark'] }}.png" alt="{{ i['embarkname'] }}" title="{{ i['embarkname' ]}}"> - <span class="fa fa-anchor"></span> - <img style="height: 1em;" src="/static/img/flags/{{ i['disembark'] }}.png" alt="{{ i['disembarkname'] }}" title="{{ i['disembarkname'] }}"> - </div> - - <p class="text-muted small text-right"> - {% if i['email'] %} - by <a href="/profile?id={{ profiles['email'] }}">{{ i['name'] }}</a><br> - {% else %} - by {{ i['name'] }}<br> - {% endif %} - {{ i['date'] }} {{ i['time'] }} - </p> - - </div> - </div> - </div> - - {% if loop.index % 3 == 0 or loop.last %} - </div> - {% if not loop.last %} - <hr style="width: 100%; height: 2px;"> - {% endif %} - {% endif %} - - {% endfor %} - </div> - </div> - - <div class="container"> - <div class="countrylist-bottom"> - <p class="lead">List by country of embarkment:</p> - <a href="/country?id={{ cc }}"> - <img style="height: 2em;" src="/static/img/flags/globe.png" alt="All around the globe" title="All around the globe"> - </a> - {% for j in clist %} - <!-- LIST ONLY FROM J TO I --> - <a href="/country?id={{ cc }}&from={{ j[0] }}"> - <img style="height: 2em;" src="/static/img/flags/{{ j[0] }}.png" alt="{{ j[1] }}" title="{{ j[1] }}"> - </a> - {% endfor %} - </div> - </div> +{% include 'gallery.html' %} </main> diff --git a/templates/dashboard.html b/templates/dashboard.html @@ -9,78 +9,7 @@ <h1 class="cover-heading">Dashboard - {{ listtype }} stories</h1> <hr style="width: 100%; height: 2px;"> - <div class="album py-5 bg-light"> - <div class="container"> - {% if filtered_stories %} - {% set stor = filtered_stories %} - {% else %} - {% set stor = stories %} - {% endif %} - - {% if not stor %} - <p>No stories to list.</p> - {% endif %} - - {% for i in stor %} - {% if loop.index % 3 == 1 %} - <div class="row"> - {% endif %} - - <div class="col-md-4"> - <div class="card"> - <div class="card-body"> - <p class="card-text small">{{ i['abstract'] }}</p> - - <div class="card-body"> - <a href="/edit?id={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Edit</a> - {% if i['visible'] == 0 %} - <a href="/dashboard?approveid={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Add</a> - {% else %} - <a href="/dashboard?hideid={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Hide</a> - {% endif %} - - <img style="height: 1em;" src="/static/img/flags/{{ i['embark'] }}.png" alt="{{ i['embarkname'] }}" title="{{ i['embarkname' ]}}"> - <span class="fa fa-anchor" style="height: 1em;"></span> - <img style="height: 1em;" src="/static/img/flags/{{ i['disembark'] }}.png" alt="{{ i['disembarkname'] }}" title="{{ i['disembarkname'] }}"> - </div> - - <p class="text-muted small text-right"> - {% if i['email'] %} - by <a href="/profile?id={{ profiles['email'] }}">{{ i['name'] }}</a><br> - {% else %} - by {{ i['name'] }}<br> - {% endif %} - {{ i['date'] }} {{ i['time'] }} - </p> - - </div> - </div> - </div> - - {% if loop.index % 3 == 0 or loop.last %} - </div> - {% if not loop.last %} - <hr style="width: 100%; height: 2px;"> - {% endif %} - {% endif %} - - {% endfor %} - </div> - </div> - - <div class="container"> - <div class="countrylist-bottom"> - <p class="lead">List by country of disembarkment:</p> - <a href="/dashboard?list={{ listtype }}"> - <img style="height: 2em;" src="/static/img/flags/globe.png" alt="All around the globe" title="All around the globe"> - </a> - {% for j in clist %} - <!-- LIST ONLY FROM J TO I --> - <a href="/dashboard?list={{ listtype}}&to={{ j[0] }}"> - <img style="height: 2em;" src="/static/img/flags/{{ j[0] }}.png" alt="{{ j[1] }}" title="{{ j[1] }}"> - </a> - {% endfor %} - </div> +{% include 'gallery.html' %} </main> diff --git a/templates/gallery.html b/templates/gallery.html @@ -0,0 +1,84 @@ + <div class="album py-5 bg-light"> + <div class="container"> + {% if filtered_stories %} + {% set stor = filtered_stories %} + {% else %} + {% set stor = stories %} + {% endif %} + + {% if not stor %} + <p>No stories to list.</p> + {% endif %} + + {% for i in stor %} + {% if loop.index % 3 == 1 %} + <div class="row"> + {% endif %} + + <div class="col-md-4"> + <div class="card"> + <div class="card-body"> + + <p class="card-text small">{{ i['abstract'] }}</p> + + <div class="card-body"> + {% if request.endpoint == 'dashboard' %} + <a href="/edit?id={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Edit</a> + {% if i['visible'] == 0 %} + <a href="/dashboard?approveid={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Add</a> + {% else %} + <a href="/dashboard?hideid={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Hide</a> + {% endif %} + {% else %} + <a href="/view?id={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Read</a> + {% endif %} + + <img style="height: 1em;" src="/static/img/flags/{{ i['embark'] }}.png" alt="{{ i['embarkname'] }}" title="{{ i['embarkname'] }}"> + <span class="fa fa-anchor"></span> + <img style="height: 1em;" src="/static/img/flags/{{ i['disembark'] }}.png" alt="{{ i['disembarkname'] }}" title="{{ i['disembarkname'] }}"> + </div> + + <p class="text-muted text-right"> + {% if i['email'] %} + by <a href="/profile?id={{ profiles['email'] }}">{{ i['name'] }}</a><br> + {% else %} + by {{ i['name'] }}<br> + {% endif %} + {{ i['date'] }} {{ i['time'] }} + </p> + </div> + </div> + </div> + + {% if loop.index % 3 == 0 or loop.last %} + </div> + {% if not loop.last %} + <hr style="width: 100%; height: 2px"> + {% endif %} + {% endif %} + {% endfor %} + </div> + </div> + + <div class="container"> + <div class="countrylist-bottom"> + {% if request.endpoint == 'dashboard' %} + <p class="lead">List by country of disembarkment:</p> + <a href="/dashboard?list={{ listtype }}"> + {% else %} + <p class="lead">List by country of embarkment:</p> + <a href="/country?id={{ cc }}"> + {% endif %} + <img style="height: 2em;" src="/static/img/flags/globe.png" alt="All around the globe" title="All around the globe"> + </a> + {% for j in clist %} + {% if request.endpoint == 'dashboard' %} + <a href="/dashboard?list={{ listtype }}&to={{ j[0] }}"> + {% else %} + <a href="/country?id={{ cc }}&from={{ j[0] }}"> + {% endif %} + <img style="height: 2em;" src="/static/img/flags/{{ j[0] }}.png" alt="{{ j[1] }}" title="{{ j[1] }}"> + </a> + {% endfor %} + </div> + </div>