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 2fb42fb6b7f3d8b4c3f7a9cadf0dcabf62f285f9
parent e32796a3cf0a4a9f295c5844c265f65d1c47bdaa
Author: parazyd <parazyd@dyne.org>
Date:   Sun, 20 Jan 2019 15:09:56 +0100

Add a link to delete a story upon editing.

Also add some style fixes which are not worth commenting.

Diffstat:
Mtemplates/edit.html | 4++++
Mtemplates/index.html | 2+-
Mtemplates/nav.html | 4+++-
Mutils.py | 6+++---
4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/templates/edit.html b/templates/edit.html @@ -20,6 +20,10 @@ <main role="main" class="container"> + <p> + <a href="/delete?key={{ story['deletekey'] }}" class="btn btn-danger">Delete this story</a> + </p> + <form action="/edit" method="POST" id="storyform"> <input type="text" name="Id" value="{{ story['id'] }}" style="display: none;"> <p class="lead">Name:<br> diff --git a/templates/index.html b/templates/index.html @@ -21,7 +21,7 @@ others of their kind. Make them feel less scared and lonely.</p> <p class="text-center"> - <a href="/submit" class="btn btn-lg btn-secondary">GO AND WRITE DOWN YOUR + <a href="/write" class="btn btn-lg btn-secondary">GO AND WRITE DOWN YOUR STORY!</a> </p> diff --git a/templates/nav.html b/templates/nav.html @@ -9,15 +9,17 @@ <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav mr-auto"> + <!-- <li class="nav-item "> <a class="nav-link" href="/">Home</a> </li> + --> <li class="nav-item"> <a class="nav-link" href="/write">Write!</a> </li> <li class="nav-item dropdown"> - <a class="nav-link dropdown-toggle" href="#" id="navbarDowntown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Stories </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> diff --git a/utils.py b/utils.py @@ -120,7 +120,7 @@ def get_multiple_stories_filtered(col, val, param, reverse=True): return filtered_stories -def makenav(randomize=True): +def makenav(randomize=False): """ Queries the disembark column for filling up the by-country dropdown navigation. @@ -131,8 +131,8 @@ def makenav(randomize=True): havec = list(set(havec)) navlist = [(i, getcountryname(i)) for i in havec] - #if randomize: - # shuffle(navlist) + if randomize: + shuffle(navlist) return navlist