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 1d55c5b1343242e0c9efaa25c5296f6abc64e95b
parent b446ab9f04c30b95cd9964b7133ff766c1f4e4af
Author: parazyd <parazyd@dyne.org>
Date:   Wed, 23 Jan 2019 13:24:13 +0100

Indentation improvements in HTML templates.

Diffstat:
Mtemplates/change_pass.html | 18+++++++++---------
Mtemplates/contact.html | 47++++++++++++++++++++++++++---------------------
Mtemplates/country.html | 12++++++------
Mtemplates/dashboard.html | 4++--
Mtemplates/edit.html | 111++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mtemplates/fail.html | 6+++---
Mtemplates/following.html | 52+++++++++++++++++++++++++++-------------------------
Mtemplates/index.html | 102++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mtemplates/login.html | 18+++++++++---------
Mtemplates/messages.html | 96++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mtemplates/profile.html | 129++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mtemplates/success.html | 6+++---
Mtemplates/success_write.html | 42+++++++++++++++++++++---------------------
Mtemplates/view.html | 38++++++++++++++++++++++----------------
Mtemplates/write.html | 90++++++++++++++++++++++++++++++++++++++++----------------------------------------
15 files changed, 393 insertions(+), 378 deletions(-)

diff --git a/templates/change_pass.html b/templates/change_pass.html @@ -16,20 +16,20 @@ <form action="/changepass" method="POST"> <div class="form-group"> - <p class="lead">Old password:<br> - <input type="text" class="form-control" name="oldpassword" placeholder="password" required> - </p> + <p class="lead">Old password:<br> + <input type="text" class="form-control" name="oldpassword" placeholder="password" required> + </p> - <p class="lead">New Password:<br> - <input type="text" class="form-control" name="newpassword" placeholder="password" required> - </p> + <p class="lead">New Password:<br> + <input type="text" class="form-control" name="newpassword" placeholder="password" required> + </p> - <input type="text" name="42" placeholder="Yeah sure" style="display: none;"> + <input type="text" name="42" placeholder="Yeah sure" style="display: none;"> - <input class="btn btn-outline-primary" type="submit" value="Submit"> + <input class="btn btn-outline-primary" type="submit" value="Submit"> </div> </form> </main> - {% include 'footer.html' %} +{% include 'footer.html' %} diff --git a/templates/contact.html b/templates/contact.html @@ -6,35 +6,40 @@ <main role="main" class="container cover"> - <h1 class="cover-heading">Contact</h1> - <hr> + <h1 class="cover-heading">Contact</h1> + <hr> - <p class="lead">You can contact us at <a href="mailto:elena@dyne.org">elena@dyne.org</a> - and <a href="mailto:parazyd@dyne.org">parazyd.dyne.org</a></p> + <p class="lead"> + You can contact us at <a href="mailto:elena@dyne.org">elena@dyne.org</a> + and <a href="mailto:parazyd@dyne.org">parazyd.dyne.org</a> + </p> - <p class="lead">If you wish to donate funds to support Diaspora Diaries, you can - do so with a bank transfer or by sending us bitcoins:</p> + <p class="lead">If you wish to donate funds to support Diaspora Diaries, you + can do so with a bank transfer or by sending us bitcoins:</p> - <h2>Bank transfer</h2> - <p class="lead">People wanting to do a bank transfer can use the following - link: <a href="https://bunq.me/parazyd">https://bunq.me/parazyd</a></p> + <h2>Bank transfer</h2> + <p class="lead">People wanting to do a bank transfer can use the following + link: <a href="https://bunq.me/parazyd">https://bunq.me/parazyd</a></p> - <h2>Bitcoin</h2> - <p class="lead">If you prefer using Bitcoin, please consider sending transactions to the - following address:</p> - <p><a href="bitcoin:1E5S4BrvonFGEgaNRLkX3GRw1yyP4FwrEn">1E5S4BrvonFGEgaNRLkX3GRw1yyP4FwrEn</a></p> + <h2>Bitcoin</h2> + <p class="lead">If you prefer using Bitcoin, please consider sending + transactions to the following address:</p> - <p class="lead">For ease of use, below is a QR code you can scan as well:</p> + <p> + <a href="bitcoin:1E5S4BrvonFGEgaNRLkX3GRw1yyP4FwrEn">1E5S4BrvonFGEgaNRLkX3GRw1yyP4FwrEn</a> + </p> - <p><img src="/static/img/qr-bitcoin.png"></p> + <p class="lead">For ease of use, below is a QR code you can scan as well:</p> - <p class="lead">Thank you kindly! ❤️</p> + <p><img src="/static/img/qr-bitcoin.png"></p> - <hr> - <p>Diaspora Diaries is free software! It is licensed with <a - href="https://www.gnu.org/licenses/agpl-3.0">GNU Affero General - Public License v3</a> and the source code can be found on <a - href="https://github.com/parazyd/diasporadiaries">Github</a>. + <p class="lead">Thank you kindly! ❤️</p> + + <hr> + <p>Diaspora Diaries is free software! It is licensed with <a + href="https://www.gnu.org/licenses/agpl-3.0">GNU Affero General + Public License v3</a> and the source code can be found on <a + href="https://github.com/parazyd/diasporadiaries">Github</a>. </main> diff --git a/templates/country.html b/templates/country.html @@ -6,12 +6,12 @@ <main role="main" class="container cover"> - {% if filtered_stories %} - <h1 class="cover-heading">{{ country }} diaries by people from {{ filtered_stories[0]['embarkname'] }}</h1> - {% else %} - <h1 class="cover-heading">{{ country }} diaries</h1> - {% endif %} - <hr> + {% if filtered_stories %} + <h1 class="cover-heading">{{ country }} diaries by people from {{ filtered_stories[0]['embarkname'] }}</h1> + {% else %} + <h1 class="cover-heading">{{ country }} diaries</h1> + {% endif %} + <hr> {% include 'gallery.html' %} diff --git a/templates/dashboard.html b/templates/dashboard.html @@ -6,8 +6,8 @@ <main role="main" class="container cover"> - <h1 class="cover-heading">Dashboard - {{ listtype }} stories</h1> - <hr> + <h1 class="cover-heading">Dashboard - {{ listtype }} stories</h1> + <hr> {% include 'gallery.html' %} diff --git a/templates/edit.html b/templates/edit.html @@ -20,73 +20,74 @@ <main role="main" class="container"> - <p> - <button type="button" class="btn btn-outline-danger" data-toggle="modal" data-target="#deleteModal"> - Delete this story - </button> - </p> - - <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalTitle" aria-hidden="true"> - <div class="modal-dialog modal-dialog-centered" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <h5 class="modal-title" id="deleteModalLongTitle">Delete story?</h5> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"> - <span aria-hidden="true">&times;</span> - </button> - </div> - <div class="modal-body"> - <p>Are you sure you wish to delete this story?</p> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button> - <a href="/delete?key={{ story['deletekey'] }}" class="btn btn-outline-danger">Delete</a> + <p> + <button type="button" class="btn btn-outline-danger" data-toggle="modal" data-target="#deleteModal"> + Delete this story + </button> + </p> + + <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalTitle" aria-hidden="true"> + <div class="modal-dialog modal-dialog-centered" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title" id="deleteModalLongTitle">Delete story?</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">&times;</span> + </button> + </div> + <div class="modal-body"> + <p>Are you sure you wish to delete this story?</p> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button> + <a href="/delete?key={{ story['deletekey'] }}" class="btn btn-outline-danger">Delete</a> + </div> </div> </div> </div> - </div> - <form action="/edit" method="POST" id="storyform"> - <div class="form-group"> - <input type="text" name="Id" value="{{ story['id'] }}" style="display: none;"> - <p class="lead">Name:<br> - <input type="text" class="form-control" name="Name" required value="{{ story['name'] }}"> - </p> + <form action="/edit" method="POST" id="storyform"> + <div class="form-group"> + <input type="text" name="Id" value="{{ story['id'] }}" style="display: none;"> - <p class="lead">Country of embarkment:<br> - <select name="Embark" class="form-control" form="storyform" onchange="countryCheck(this, 'embarkother');" id="embarkbox"> - <option value="{{ story['embark']}}">{{ story['embarkname'] }}</option> - </select> - <input type="text" class="form-control" name="EmbarkOther" id="embarkother" style="display: none;" placeholder="Type country here"> - </p> + <p class="lead">Name:<br> + <input type="text" class="form-control" name="Name" required value="{{ story['name'] }}"> + </p> + <p class="lead">Country of embarkment:<br> + <select name="Embark" class="form-control" form="storyform" onchange="countryCheck(this, 'embarkother');" id="embarkbox"> + <option value="{{ story['embark']}}">{{ story['embarkname'] }}</option> + </select> + <input type="text" class="form-control" name="EmbarkOther" id="embarkother" style="display: none;" placeholder="Type country here"> + </p> - <p class="lead">Country of disembarkment:<br> - <select name="Disembark" class="form-control" form="storyform" onchange="countryCheck(this, 'disembarkother');" selected="{{ story['disembark'] }}"> - <option value="{{ story['disembark'] }}">{{ story['disembarkname'] }}</option> - </select> - <input type="text" class="form-control" name="DisembarkOther" id="disembarkother" style="display: none;" placeholder="Type country here"> - </p> - <p class="lead">City of the story:<br> - <input type="text" class="form-control" name="City" value="{{ story['city'] }}"> - </p> + <p class="lead">Country of disembarkment:<br> + <select name="Disembark" class="form-control" form="storyform" onchange="countryCheck(this, 'disembarkother');" selected="{{ story['disembark'] }}"> + <option value="{{ story['disembark'] }}">{{ story['disembarkname'] }}</option> + </select> + <input type="text" class="form-control" name="DisembarkOther" id="disembarkother" style="display: none;" placeholder="Type country here"> + </p> - <p class="lead">Email:<br> - <input type="email" class="form-control" name="Email" value="{{ story['email'] }}"> - </p> + <p class="lead">City of the story:<br> + <input type="text" class="form-control" name="City" value="{{ story['city'] }}"> + </p> - <p class="lead">Story abstract:<br> - <textarea name="Abstract" class="form-control" form="storyform">{{ story['abstract'] }}</textarea> - </p> + <p class="lead">Email:<br> + <input type="email" class="form-control" name="Email" value="{{ story['email'] }}"> + </p> - <p class="lead">The story:<br> - <textarea id="storytext" name="Story" form="storyform" required>{{ story['story'] }}</textarea> - </p> + <p class="lead">Story abstract:<br> + <textarea name="Abstract" class="form-control" form="storyform">{{ story['abstract'] }}</textarea> + </p> + + <p class="lead">The story:<br> + <textarea id="storytext" name="Story" form="storyform" required>{{ story['story'] }}</textarea> + </p> - <input type="submit" class="btn btn-outline-primary" value="Submit"> - </div> - </form> + <input type="submit" class="btn btn-outline-primary" value="Submit"> + </div> + </form> </main> diff --git a/templates/fail.html b/templates/fail.html @@ -6,10 +6,10 @@ <main role="main" class="container cover"> - <h1 class="cover-heading">Sorry!</h1> - <hr> + <h1 class="cover-heading">Sorry!</h1> + <hr> - <p class="lead">{{ msg }}</p> + <p class="lead">{{ msg }}</p> </main> diff --git a/templates/following.html b/templates/following.html @@ -6,36 +6,38 @@ <main role="main" class="container cover"> - <h1 class="cover-heading">Users you are following</h1> - <hr> - - <div class="container-fluid"> - {% if following %} - {% for i in following %} - <div class="row"> - <div class="col"> + <h1 class="cover-heading">Users you are following</h1> + <hr> + + <div class="container-fluid"> + {% if following %} + + {% for i in following %} + <div class="row"> <form action="/follow" method="POST" id="followform_{{ i[0] }}"> - <input type="hidden" name="Id" value="{{ i[0] }}"> - <input type="hidden" name="Act" value="unfollow"> - <input type="hidden" name="From" value="/following"> - <h2><a href="/profile?id={{ i[0]}}">{{ i[1] }}</a></h2> - </div> - <div class="col"> - {% for i in countries %} + <div class="col"> + <input type="hidden" name="Id" value="{{ i[0] }}"> + <input type="hidden" name="Act" value="unfollow"> + <input type="hidden" name="From" value="/following"> + <h2><a href="/profile?id={{ i[0]}}">{{ i[1] }}</a></h2> + </div> + <div class="col"> + {% for i in countries %} <img style="height: 2em;" src="/static/img/flags/{{ i[0] }}.png" alt="{{ i[1] }}" title="{{ i[1] }}"> - {% endfor %} - </div> - <div class="col"> - <input type="submit" class="btn btn-primary" value="Following" title="Click to unfollow"> + {% endfor %} + </div> + <div class="col"> + <input type="submit" class="btn btn-primary" value="Following" title="Click to unfollow"> + </div> </form> </div> + <hr> + {% endfor %} + + {% else %} + <p>You aren't following anyone.</p> + {% endif %} </div> - <hr> - {% endfor %} - {% else %} - <p>You aren't following anyone.</p> - {% endif %} - </div> </main> {% include 'footer.html' %} diff --git a/templates/index.html b/templates/index.html @@ -6,57 +6,57 @@ <main role="main" class="container cover"> - <h1 class="cover-heading">Diaspora Diaries</h1> - <hr> - - <p>This is a place where everyone that has an experience with living abroad - can write down their story.</p> - - <p class="lead">You can use your knowledge and the situations you have gone - through to help someone with similar problems, everyday frustrations or just - make them feel less alone. You can also write about the reasons and background - of your migration. After all, we are all just human beings in a search for - peace and happiness.</p> - - <p class="lead">Let your fellow humans know that they are surrounded with - others of their kind. Make them feel less scared and lonely.</p> - - <p class="text-center"> - <a href="/write" class="btn btn-lg btn-secondary">GO AND WRITE DOWN YOUR - STORY!</a> - </p> - - <input class="burger-check" id="burger-check" type="checkbox"> - <label for="burger-check" class="burger">Read more...</label> - - <div class="readmore"> - <p class="lead">In this day and age, there are a lot of people migrating in a - search for a better life. People are changing towns, cities, states and even - continents in their quest for a better surroundings. They are searching for a - place where they can feel more at ease, chase their dreams or simply live - their life.</p> - - <p class="lead">Moving to a place different from the one you were born in, - accustomed to and familiar with is often a difficult and long process that can - be filled with a lot of misunderstandings and dead ends leading to frustration - and overwhelming feeling of loneliness.</p> - - <p class="lead">It is hard to walk through foreign streets, filled with busy - unfamiliar faces, signs, foreign languages, different climate and culture - trying to get your foot in the door and organize your new life. Every - community has its way of doing things, very often not so clearly explained. - It is natural to feel lost and confused.</p> - - <p class="lead">Person changing it’s environment has a fresh and highly - perceptive regard towards new culture and corresponding customs. They can spot - a bizarre rule of conduct from miles ahead. It is strange, it is funny, it is - useful.</p> - - </div> - - <hr> - <h4>Recent stories</h4> - {% include 'gallery.html' %} + <h1 class="cover-heading">Diaspora Diaries</h1> + <hr> + + <p>This is a place where everyone that has an experience with living abroad + can write down their story.</p> + + <p class="lead">You can use your knowledge and the situations you have gone + through to help someone with similar problems, everyday frustrations or just + make them feel less alone. You can also write about the reasons and + background of your migration. After all, we are all just human beings in a + search for peace and happiness.</p> + + <p class="lead">Let your fellow humans know that they are surrounded with + others of their kind. Make them feel less scared and lonely.</p> + + <p class="text-center"> + <a href="/write" class="btn btn-lg btn-primary">GO AND WRITE DOWN YOUR + STORY!</a> + </p> + + <input class="burger-check" id="burger-check" type="checkbox"> + <label for="burger-check" class="burger">Read more...</label> + + <div class="readmore"> + <p class="lead">In this day and age, there are a lot of people migrating + in a search for a better life. People are changing towns, cities, states + and even continents in their quest for a better surroundings. They are + searching for a place where they can feel more at ease, chase their dreams + or simply live their life.</p> + + <p class="lead">Moving to a place different from the one you were born in, + accustomed to and familiar with is often a difficult and long process that + can be filled with a lot of misunderstandings and dead ends leading to + frustration and overwhelming feeling of loneliness.</p> + + <p class="lead">It is hard to walk through foreign streets, filled with + busy unfamiliar faces, signs, foreign languages, different climate and + culture trying to get your foot in the door and organize your new life. + Every community has its way of doing things, very often not so clearly + explained. It is natural to feel lost and confused.</p> + + <p class="lead">Person changing it’s environment has a fresh and highly + perceptive regard towards new culture and corresponding customs. They can + spot a bizarre rule of conduct from miles ahead. It is strange, it is + funny, it is useful.</p> + </div> + + <hr> + <h4>Recent stories</h4> + + {% include 'gallery.html' %} </main> diff --git a/templates/login.html b/templates/login.html @@ -11,18 +11,18 @@ <form action="/login" method="POST"> <div class="form-group"> - <p class="lead">Email:<br> - <input type="email" class="form-control" name="username" placeholder="email" required> - </p> + <p class="lead">Email:<br> + <input type="email" class="form-control" name="username" placeholder="email" required> + </p> - <p class="lead">Password:<br> - <input type="text" class="form-control" name="password" placeholder="password" required> - </p> + <p class="lead">Password:<br> + <input type="text" class="form-control" name="password" placeholder="password" required> + </p> - <input type="text" name="42" placeholder="Yeah sure" style="display: none;"> + <input type="text" name="42" placeholder="Yeah sure" style="display: none;"> - <input class="btn btn-outline-primary" type="submit" value="Login"> - </div> + <input class="btn btn-outline-primary" type="submit" value="Login"> + </div> </form> </main> diff --git a/templates/messages.html b/templates/messages.html @@ -6,62 +6,62 @@ <main role="main" class="container cover"> - {% if them %} - <h1 class="cover-heading">Messages with {{ them['name'] }}</h1> - {% else %} - <h1 class="cover-heading">Messages</h1> - {% endif %} - <hr> + {% if them %} + <h1 class="cover-heading">Messages with {{ them['name'] }}</h1> + {% else %} + <h1 class="cover-heading">Messages</h1> + {% endif %} + <hr> - {% if not single %} - <div class="table-responsive"> - <table class="table table-striped table-hover"> - <thead> - <tr> - <th scope="col">From</th> - <th scope="col">Latest</th> - <th scope="col">At</th> - </tr> - </thead> - <tbody> - {% for i in messages %} - <tr> - <td><a href="/messages?from={{ i[1] }}">{{ i[0] }}</a></td> - <td><a href="/messages?from={{ i[1] }}">{{ i[2]['message'] }}</a></td> - <td>{{ i[2]['time'] }}</td> - </tr> - {% endfor %} - </tbody> - </table> - </div> - {% else %} + {% if not single %} + <div class="table-responsive"> + <table class="table table-striped table-hover"> + <thead> + <tr> + <th scope="col">From</th> + <th scope="col">Latest</th> + <th scope="col">At</th> + </tr> + </thead> + <tbody> + {% for i in messages %} + <tr> + <td><a href="/messages?from={{ i[1] }}">{{ i[0] }}</a></td> + <td><a href="/messages?from={{ i[1] }}">{{ i[2]['message'] }}</a></td> + <td>{{ i[2]['time'] }}</td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + {% else %} - <form action="/sendmsg" method="POST" id="msgform"> - <div class="form-group"> - <hr> - <p class="lead">Reply:</p> - <input type="hidden" name="Id" value="{{ them['id'] }}"> - <input type="hidden" name="Us" value="{{ current_user.id }}"> - <textarea name="Message" class="form-control" form="msgform" required></textarea><br> - <button form="msgform" type="submit" class="btn btn-outline-success">Send</button> - </p> - </form> + <form action="/sendmsg" method="POST" id="msgform"> + <div class="form-group"> + <hr> + <p class="lead">Reply:</p> + <input type="hidden" name="Id" value="{{ them['id'] }}"> + <input type="hidden" name="Us" value="{{ current_user.id }}"> + <textarea name="Message" class="form-control" form="msgform" required></textarea><br> + <button form="msgform" type="submit" class="btn btn-outline-success">Send</button> + </p> + </form> - {% if not messages %} - <p class="lead">No messages.</p> - {% endif %} + {% if not messages %} + <p class="lead">No messages.</p> + {% endif %} - {% for i in messages %} + {% for i in messages %} <hr> <blockquote class="blockquote"> - <p>{{ i['message'] }}</p> - <footer class="blockquote-footer">{{ i['from'] }} - {{ i['time'] }}</footer> + <p>{{ i['message'] }}</p> + <footer class="blockquote-footer">{{ i['from'] }} - {{ i['time'] }}</footer> </blockquote> - {% endfor %} + {% endfor %} - <hr> - <a href="/messages">&lt; back</a> - {% endif %} + <hr> + <a href="/messages">&lt; back</a> + {% endif %} </main> diff --git a/templates/profile.html b/templates/profile.html @@ -6,80 +6,81 @@ <main role="main" class="container cover"> - <h1 class="cover-heading">Diaries by {{ name }}</h1> - <hr> + <h1 class="cover-heading">Diaries by {{ name }}</h1> + <hr> - <div class="container"> - {% if current_user.id == uid %} - <a href="/following" class="btn btn-outline-primary">People you follow</a> - <a href="/changepass" class="btn btn-outline-primary">Change your password</a> - <hr> - {% else %} - <form action="/follow" method="POST" id="followform"> - <input type="hidden" name="Id" value="{{ uid }}"> - {% if is_following %} - <input type="hidden" name="Act" value="unfollow"> - <input type="submit" class="btn btn-primary" value="Following" title="Click to unfollow"> - {% else %} - <input type="hidden" name="Act" value="follow"> - <input type="submit" class="btn btn-outline-primary" value="Follow"> - {% endif %} - </form> - {% endif %} - <hr> - </div> + <div class="container"> + {% if current_user.id == uid %} + <a href="/following" class="btn btn-outline-primary">People you follow</a> + <a href="/changepass" class="btn btn-outline-primary">Change your password</a> + <hr> + {% else %} + <form action="/follow" method="POST" id="followform"> + <input type="hidden" name="Id" value="{{ uid }}"> + {% if is_following %} + <input type="hidden" name="Act" value="unfollow"> + <input type="submit" class="btn btn-primary" value="Following" title="Click to unfollow"> + {% else %} + <input type="hidden" name="Act" value="follow"> + <input type="submit" class="btn btn-outline-primary" value="Follow"> + {% endif %} + </form> + {% endif %} + <hr> + </div> {% include 'gallery.html' %} - {% if current_user.is_active %} - <hr> - <div class="container text-center"> - <a href="/messages?from={{ uid }}" class="btn btn-outline-primary">Send PM</a> - <button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#shoutModal"> - Leave shout - </button> - </div> + {% if current_user.is_active %} + <hr> + <div class="container text-center"> + <a href="/messages?from={{ uid }}" class="btn btn-outline-primary">Send PM</a> + <button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#shoutModal"> + Leave shout + </button> + </div> - <div class="modal fade" id="shoutModal" tabindex="-1" role="dialog" aria-labelledby="shoutModalTitle" aria-hidden="true"> - <div class="modal-dialog modal-dialog-centered" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <h5 class="modal-title" id="shoutModalLongTitle">Leave shout</h5> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"> - <span aria-hidden="true">&times;</span> - </button> - </div> - <div class="modal-body"> - <p>Write shout:</p> - <form action="/sendshout" method="POST" id="shoutform"> - <input type="hidden" name="Id" value="{{ uid }}"> - <input type="hidden" name="Us" value="{{ current_user.id }}"> - <textarea name="Message" class="form-control" form="shoutform" required></textarea> - </form> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button> - <button form="shoutform" type="submit" class="btn btn-outline-success">Shout</button> + <div class="modal fade" id="shoutModal" tabindex="-1" role="dialog" aria-labelledby="shoutModalTitle" aria-hidden="true"> + <div class="modal-dialog modal-dialog-centered" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title" id="shoutModalLongTitle">Leave shout</h5> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">&times;</span> + </button> + </div> + <div class="modal-body"> + <p>Write shout:</p> + <form action="/sendshout" method="POST" id="shoutform"> + <input type="hidden" name="Id" value="{{ uid }}"> + <input type="hidden" name="Us" value="{{ current_user.id }}"> + <textarea name="Message" class="form-control" form="shoutform" required></textarea> + </form> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button> + <button form="shoutform" type="submit" class="btn btn-outline-success">Shout</button> + </div> </div> </div> </div> - </div> - {% endif %} + {% endif %} + + <hr> + <h3>Shoutbox</h3> + {% if not shouts %} + <hr> + <p>No shouts.</p> + {% endif %} - <hr> - <h3>Shoutbox</h3> - {% if not shouts %} - <hr> - <p>No shouts.</p> - {% endif %} - {% for i in shouts %} + {% for i in shouts %} + <hr> + <blockquote class="blockquote"> + <p>{{ i['message'] }}</p> + <footer class="blockquote-footer">{{ i['from'] }} - {{ i['time'] }}</footer> + </blockquote> + {% endfor %} <hr> - <blockquote class="blockquote"> - <p>{{ i['message'] }}</p> - <footer class="blockquote-footer">{{ i['from'] }} - {{ i['time'] }}</footer> - </blockquote> - {% endfor %} - <hr> </main> diff --git a/templates/success.html b/templates/success.html @@ -6,10 +6,10 @@ <main role="main" class="container cover"> - <h1 class="cover-heading">Success.</h1> - <hr> + <h1 class="cover-heading">Success.</h1> + <hr> - <p class="lead">{{ msg }}</p> + <p class="lead">{{ msg }}</p> </main> diff --git a/templates/success_write.html b/templates/success_write.html @@ -6,36 +6,36 @@ <main role="main" class="container cover"> - <h1 class="cover-heading">Story submitted!</h1> - <hr> + <h1 class="cover-heading">Story submitted!</h1> + <hr> - <p class="lead">Thank you for writing your story!</p> + <p class="lead">Thank you for writing your story!</p> - <p class="lead">Your story will be read and approved by someone from the - crew.</p> + <p class="lead">Your story will be read and approved by someone from the + crew.</p> - <p class="lead">Bookmark or copy the following link if you ever wish to delete - your post: </p> + <p class="lead">Bookmark or copy the following link if you ever wish to + delete your post: </p> - <p>{{ request.host_url }}delete?key={{ delkey }}</p> + <p>{{ request.host_url }}delete?key={{ delkey }}</p> - {% if new %} - <p class="lead">Since you've left your email, we've created credentials - for you. This will enable you to send and recieve messages, and have a - profile page.</p> + {% if new %} + <p class="lead">Since you've left your email, we've created credentials for + you. This will enable you to send and recieve messages, and have a profile + page.</p> - <p class="lead">Your email is kept privately and will not be used for - <b>any</b> purposes other than identifying your account in the database. - It's the easiest way for us unfortunately.</p> + <p class="lead">Your email is kept privately and will not be used for + <b>any</b> purposes other than identifying your account in the database. + It's the easiest way for us unfortunately.</p> - <p class="lead">To log in, use your email address and the following password: - <b>{{ new }}</b></p> + <p class="lead">To log in, use your email address and the following + password: <b>{{ new }}</b></p> - <p class="lead">If you wish to delete your account, don't hesitate to contact - us via email.</p> + <p class="lead">If you wish to delete your account, don't hesitate to + contact us via email.</p> - {% endif %} - <p class="lead">You can return to the <a href="/">homepage</a> now.</p> + {% endif %} + <p class="lead">You can return to the <a href="/">homepage</a> now.</p> </main> diff --git a/templates/view.html b/templates/view.html @@ -8,30 +8,36 @@ {% if story %} - <h1 class="cover-heading">{{ story['name'] }} in {{ story['disembarkname'] }}</h1> - <hr> + <h1 class="cover-heading">{{ story['name'] }} in {{ story['disembarkname'] }}</h1> + <hr> - <p>by {{ story['name'] }}, {{ story['date'] }} {{ story['time'] }}</p> - {% if current_user.is_admin %} - <a href="/edit?id={{ story['id'] }}" class="btn btn-sm btn-outline-secondary">Edit</a> - <a href="/dashboard?hideid={{ story['id'] }}" class="btn btn-sm btn-outline-secondary">Hide</a> - <hr> - {% endif %} + <p> + by {{ story['name'] }}, {{ story['date'] }} {{ story['time'] }} + {% if story['city'] %} + <br>in story['city'] + {% endif %} + </p> - {{ story['story']|safe }} + {% if current_user.is_admin %} + <a href="/edit?id={{ story['id'] }}" class="btn btn-sm btn-outline-secondary">Edit</a> + <a href="/dashboard?hideid={{ story['id'] }}" class="btn btn-sm btn-outline-secondary">Hide</a> + <hr> + {% endif %} - <hr> - <a href="/country?id={{ story['disembark'] }}">&lt; back</a> + {{ story['story']|safe }} - {% else %} + <hr> + <a href="/country?id={{ story['disembark'] }}">&lt; back</a> - <h1 class="cover-heading">Error!</h1> + {% else %} - <p class="lead">No story with this story id.</p> + <h1 class="cover-heading">Error!</h1> - <p class="lead">You can return to the <a href="/">homepage</a> now.</p> + <p class="lead">No story with this story id.</p> - {% endif %} + <p class="lead">You can return to the <a href="/">homepage</a> now.</p> + + {% endif %} </main> diff --git a/templates/write.html b/templates/write.html @@ -20,51 +20,51 @@ <main role="main" class="container"> - <form action="/write" method="POST" id="storyform"> - <div class="form-group"> - <p class="lead">Name:<br> - {% if current_user.name %} - <input type="text" class="form-control" name="Name" required value="{{ current_user.name }}"> - {% else %} - <input type="text" class="form-control" name="Name" required placeholder="Name"> - {% endif %} - </p> - - <p class="lead">Country of embarkment:<br> - <select class="form-control" name="Embark" form="storyform" onchange="countryCheck(this, 'embarkother');"> - {% include 'cc.html' %} - </select> - <input type="text" class="form-control" name="EmbarkOther" id="embarkother" style="display: none;" placeholder="Type country here"> - </p> - - <p class="lead">Country of disembarkment:<br> - <select name="Disembark" class="form-control" form="storyform" onchange="countryCheck(this, 'disembarkother');"> - {% include 'cc.html' %} - </select> - <input type="text" class="form-control" name="DisembarkOther" id="disembarkother" style="display: none;" placeholder="Type country here"> - </p> - - <p class="lead">City of the story:<br> - <input type="text" class="form-control" name="City" placeholder="City (optional)"> - </p> - - <p class="lead">Email:<br> - {% if current_user.username %} - <input type="email" class="form-control" name="Email" value="{{ current_user.username }}"> - {% else %} - <input type="email" class="form-control" name="Email" placeholder="Email (optional)"> - {% endif %} - </p> - - <input type="text" name="42" placeholder="Yeah sure" style="display: none;"> - - <p class="lead">Write your story:<br> - <textarea class="form-control" id="storytext" name="Story" form="storyform" required></textarea> - </p> - - <input type="submit" class="btn btn-outline-primary" value="Submit"> - </div> - </form> + <form action="/write" method="POST" id="storyform"> + <div class="form-group"> + <p class="lead">Name:<br> + {% if current_user.name %} + <input type="text" class="form-control" name="Name" required value="{{ current_user.name }}"> + {% else %} + <input type="text" class="form-control" name="Name" required placeholder="Name"> + {% endif %} + </p> + + <p class="lead">Country of embarkment:<br> + <select class="form-control" name="Embark" form="storyform" onchange="countryCheck(this, 'embarkother');"> + {% include 'cc.html' %} + </select> + <input type="text" class="form-control" name="EmbarkOther" id="embarkother" style="display: none;" placeholder="Type country here"> + </p> + + <p class="lead">Country of disembarkment:<br> + <select name="Disembark" class="form-control" form="storyform" onchange="countryCheck(this, 'disembarkother');"> + {% include 'cc.html' %} + </select> + <input type="text" class="form-control" name="DisembarkOther" id="disembarkother" style="display: none;" placeholder="Type country here"> + </p> + + <p class="lead">City of the story:<br> + <input type="text" class="form-control" name="City" placeholder="City (optional)"> + </p> + + <p class="lead">Email:<br> + {% if current_user.username %} + <input type="email" class="form-control" name="Email" value="{{ current_user.username }}"> + {% else %} + <input type="email" class="form-control" name="Email" placeholder="Email (optional)"> + {% endif %} + </p> + + <input type="text" name="42" placeholder="Yeah sure" style="display: none;"> + + <p class="lead">Write your story:<br> + <textarea class="form-control" id="storytext" name="Story" form="storyform" required></textarea> + </p> + + <input type="submit" class="btn btn-outline-primary" value="Submit"> + </div> + </form> </main>