diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-07-14 06:18:13 -0400 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-07-14 06:18:13 -0400 |
commit | 93cb735370c48c3102fdb10e744f7c95d6c0f7c9 (patch) | |
tree | 6b9fff4d4cc9e7593b090b864fa9afffa78e7abc /src/data | |
parent | fe6d45474a2024fb362ee59f7a38f827283ac0c4 (diff) |
add: Fancy voting.
Current vote is displayed in bold text.
Let user change vote.
Diffstat (limited to 'src/data')
-rw-r--r-- | src/data/templates/quotes.hbs | 10 | ||||
-rw-r--r-- | src/data/templates/vote.hbs | 12 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/data/templates/quotes.hbs b/src/data/templates/quotes.hbs index 71732ab..92cf114 100644 --- a/src/data/templates/quotes.hbs +++ b/src/data/templates/quotes.hbs @@ -1,21 +1,13 @@ {{#*inline "heading"}} Sortér etter <a href="quotes.jsp?order=date">dato</a> | <a href="quotes.jsp?order=score">score</a> {{/inline}} - {{#*inline "page"}} {{#each quotes}} - <br> <a href="/view_quote?id={{id}}">#{{id}}</a>, lagt til av {{author}}<br> Dato: {{date}}, Score: <span id="v{{id}}"> -{{score}} (fra {{votes}}), Vote: <font size="-1"> - <a href="javascript:vote({{id}},1)">1</a> - <a href="javascript:vote({{id}},2)">2</a> - <a href="javascript:vote({{id}},3)">3</a> - <a href="javascript:vote({{id}},4)">4</a> - <a href="javascript:vote({{id}},5)">5</a></font></span>, - +{{~> vote~}} <form method="post" style="display: inline;"action="http://www.vidarholen.net/contents/rage/index.php"><input type="hidden" name="irc" value="{{content}}"/><input type="submit" class="ragebutton" value="Rage it"/></form><br> <br> <br> diff --git a/src/data/templates/vote.hbs b/src/data/templates/vote.hbs index 135fa2f..9aff608 100644 --- a/src/data/templates/vote.hbs +++ b/src/data/templates/vote.hbs @@ -1,3 +1,9 @@ -{{#with quote}} -{{score}} (fra {{votes}}) -{{/with}} +{{score}} (fra {{votes}}), Vote: <font size="-1"> +{{#each vote_options}} +{{#if is_user_vote}} +<b>{{value}}</b> +{{else}} +<a href="javascript:vote({{../id}},{{value}})">{{value}}</a> +{{/if}} +{{/each}} +</font></span> |