diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2016-05-28 20:19:15 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-05-28 20:19:15 +0200 |
| commit | 30d350d10a3e740f4440c469d642f49165ce994c (patch) | |
| tree | 07787121b762f5eacda19b847aafebee9107f6ab /templates | |
| parent | 240da696e2e9c857aa738f685024afc1fc3d8003 (diff) | |
| download | jokevote-30d350d10a3e740f4440c469d642f49165ce994c.tar.gz jokevote-30d350d10a3e740f4440c469d642f49165ce994c.zip | |
add pagination
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/index.html | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/templates/index.html b/templates/index.html index ca8f25b..08d89be 100644 --- a/templates/index.html +++ b/templates/index.html @@ -13,14 +13,14 @@ <h1>Lehrersprüche</h1> <div class="divider"></div> {% for joke in jokes %} - <div class="section row valign-wrapper"> + <div class="row section valign-wrapper"> <form class="col s2 row" action="vote" method="post"> <input type="hidden" name="id" value="{{ joke.id }}"> <button class="btn{% if joke.reports>0 %}-flat{% endif %} col s12" type="submit" name="vote" value="upvote"><i class="material-icons">thumb_up</i> {{ joke.upvotes }}</button> <button class="btn{% if joke.reports>0 %}-flat{% endif %} col s12" type="submit" name="vote" value="downvote"><i class="material-icons">thumb_down</i> {{ joke.downvotes }}</button> </form> - <div class="col s8 {% if joke.reports>0 %}grey-text{% endif %}"> - <p>{{ joke.text|safe }}</p> + <div class="valign col s8 {% if joke.reports>0 %}grey-text{% endif %}"> + {{ joke.text|safe }} </div> <form class="col s2" action="report" method="post"> <input type="hidden" name="id" value="{{ joke.id }}"> @@ -32,8 +32,18 @@ </div> <div class="divider"></div> {% endfor %} - <div class="section row"> - <form class="col s12" action="submit" method="post"> + <div class="section center"> + <ul class="pagination"> + <li{% if currentpage==0 %} class="disabled"{% endif %}><a href="/page/{{ currentpage-1 }}"><i class="material-icons">chevron_left</i></a></li> + {% for page in pages %} + <li{% if currentpage==loop.index0 %} class="active"{% endif %}><a href="/page/{{ loop.index0 }}">{{ loop.index }}</a></li> + {% endfor %} + <li{% if currentpage==loop.length-1 %} class="disabled"{% endif %}><a href="/page/{{ currentpage+1 }}"><i class="material-icons">chevron_right</i></a></li> + </ul> + </div> + <div class="divider"></div> + <div class="section"> + <form action="submit" method="post"> <div class="row valign-wrapper"> <div class="col s8 input-field"> <label for="text">Neuen Spruch hinzufügen</label> |
