aboutsummaryrefslogtreecommitdiff
path: root/views/user_solutions.hbs
diff options
context:
space:
mode:
authorHumairAK <humair88@hotmail.com>2016-07-24 21:48:06 +0000
committerHumairAK <humair88@hotmail.com>2016-07-24 21:48:06 +0000
commit2f819f8f2cfa5d2c5613f1f3d8b47b6a36331659 (patch)
tree0c79fab94eadf50566ea968c59a3cc9da314df63 /views/user_solutions.hbs
parenta0e04574545c4f2751c01c5919c34f6f99bc21ad (diff)
Added voting to front end
Diffstat (limited to 'views/user_solutions.hbs')
-rw-r--r--views/user_solutions.hbs20
1 files changed, 12 insertions, 8 deletions
diff --git a/views/user_solutions.hbs b/views/user_solutions.hbs
index 598e63d..b00b098 100644
--- a/views/user_solutions.hbs
+++ b/views/user_solutions.hbs
@@ -19,7 +19,6 @@
</div>
<!-- Solution 1 Example -->
-
{{#each query}}
<div class="row">
<section id="sol-" class="col-md-10 col-md-offset-1 rounded">
@@ -30,13 +29,18 @@
</div>
<div class="pull-right">
- <div class="upvoting">
- <button class="upvote"><img src="/assets/images/up_arrow.png"></button>
- <p class="upvote num-upvotes">{{this.votes}}</p>
- </div>
- <div class="downvoting">
- <button class="downvote"><img src="/assets/images/down_arrow.png"></button>
- <p class=" downvote num-downvotes">-1</p>
+ <div class="voting">
+ <form action="/user/solution/vote/{{../examID}}/{{../qID}}/{{this._id}}" method="post">
+ <input type="hidden" name="vote" value="up"/>
+ <button class="upvote" type="submit"><img src="/assets/images/up_arrow.png"></button>
+ <input type="hidden" name="_csrf" value="{{../csrfToken }}">
+ </form>
+ <form action="/user/solution/vote/{{../examID}}/{{../qID}}/{{this._id}}" method="post">
+ <input type="hidden" name="vote" value="down"/>
+ <button class="downvote"><img src="/assets/images/down_arrow.png"></button>
+ <input type="hidden" name="_csrf" value="{{../csrfToken }}">
+ </form>
+ <p class="num-votes">{{this.votes}}</p>
</div>
</div>
</div>