diff options
| author | HumairAK <humair88@hotmail.com> | 2016-07-25 08:51:37 +0000 |
|---|---|---|
| committer | HumairAK <humair88@hotmail.com> | 2016-07-25 08:51:37 +0000 |
| commit | 16b2dab8c2a384ccb95fca048414f33daf3925a8 (patch) | |
| tree | 0bb68d1316265431db26bf9ee7d5a0689eb737f7 /views | |
| parent | 1c8e4f255782d756700431a33a8990f514eca698 (diff) | |
added warning message for adding solution while not logged in
Diffstat (limited to 'views')
| -rw-r--r-- | views/user_solutions.hbs | 173 |
1 files changed, 89 insertions, 84 deletions
diff --git a/views/user_solutions.hbs b/views/user_solutions.hbs index b00b098..db17aa6 100644 --- a/views/user_solutions.hbs +++ b/views/user_solutions.hbs @@ -2,102 +2,107 @@ <div class='search solutions-container container'> <div> -<!-- Add Solution button and path --> -<div class="row top-sol"> - <a href="/user/add_solution/{{examID}}/{{qID}}"> - <button class="col-xs-4 col-sm-2 col-md-2 col-lg-2 - col-xs-offset-4 col-sm-offset-5 col-md-offset-2 - col-lg-offset-2 rounded" id="add-solution"> - <h3>Add a solution</h3> - </button> - </a> + {{# if messages.error }} + <section class="alert alert-danger custom-Alert"> + <h5>{{ messages.error }}</h5> + </section> + {{/if}} - <!-- Replace p below with breadcrumbs later --> - <p class="col-xs-12 col-sm-12 col-md-6 show-path"> - CSC148 > Winter 2015 > Question 1 - </p> -</div> + <!-- Add Solution button and path --> + <div class="row top-sol"> + <a href="/user/add_solution/{{examID}}/{{qID}}"> + <button class="col-xs-4 col-sm-2 col-md-2 col-lg-2 + col-xs-offset-4 col-sm-offset-5 col-md-offset-2 + col-lg-offset-2 rounded" id="add-solution"> + <h3>Add a solution</h3> + </button> + </a> -<!-- Solution 1 Example --> -{{#each query}} - <div class="row"> - <section id="sol-" class="col-md-10 col-md-offset-1 rounded"> - <div class="post-info"> - <div class=""> - <img class="img-responsive img-circle user-image" src="/assets/images/misc/user1.jpeg"> - <p class="username">{{this.author}}</p> - </div> + <!-- Replace p below with breadcrumbs later --> + <p class="col-xs-12 col-sm-12 col-md-6 show-path"> + CSC148 > Winter 2015 > Question 1 + </p> + </div> - <div class="pull-right"> - <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> + <!-- Solution 1 Example --> + {{#each query}} + <div class="row"> + <section id="sol-" class="col-md-10 col-md-offset-1 rounded"> + <div class="post-info"> + <div class=""> + <img class="img-responsive img-circle user-image" src="/assets/images/misc/user1.jpeg"> + <p class="username">{{this.author}}</p> </div> - </div> - </div> - <div class="user-sol"> - <h3>Solution</h3> - <p>{{this.text}}</p> - </div> + <div class="pull-right"> + <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> - <div class="comments"> - <h3> - <a data-toggle="collapse" href="#com{{@index}}"> - <span> - {{this.commentCount}} - </span> - comments - <span class="caret"></span> - </a> - </h3> + <div class="user-sol"> + <h3>Solution</h3> + <p>{{this.text}}</p> + </div> - <div id="com{{@index}}" class="panel-collapse collapse"> - <ul class="list-group"> - {{#each this.comments}} - <li class="list-group-item"> - <img src="/assets/images/misc/user3.jpeg" - class="img-responsive img-circle comment-user-img"> - <p class="comment-username"> - <a href="/user_profile"> - {{this.by}} - </a> - , {{this.date}} - </p> - <p class="user-comment">{{this.text}}</p> - </li> - {{/each}} + <div class="comments"> + <h3> + <a data-toggle="collapse" href="#com{{@index}}"> + <span> + {{this.commentCount}} + </span> + comments + <span class="caret"></span> + </a> + </h3> - <form action="/user/comment/submit/{{../examID}}/{{../qID}}/{{this._id}}" method="post"> - <div class="form-group"> - <textarea type="text" - class="form-control" - placeholder="Enter comment" - name="comment"> + <div id="com{{@index}}" class="panel-collapse collapse"> + <ul class="list-group"> + {{#each this.comments}} + <li class="list-group-item"> + <img src="/assets/images/misc/user3.jpeg" + class="img-responsive img-circle comment-user-img"> + <p class="comment-username"> + <a href="/user_profile"> + {{this.by}} + </a> + , {{this.date}} + </p> + <p class="user-comment">{{this.text}}</p> + </li> + {{/each}} - </textarea> - </div> - <input type="hidden" name="_csrf" value="{{../csrfToken }}"> - <button type="submit" class="btn btn-primary">Submit</button> - </form> + <form action="/user/comment/submit/{{../examID}}/{{../qID}}/{{this._id}}" method="post"> + <div class="form-group"> + <textarea type="text" + class="form-control" + placeholder="Enter comment" + name="comment"> - </ul> - </div> + </textarea> + </div> + <input type="hidden" name="_csrf" value="{{../csrfToken }}"> + <button type="submit" class="btn btn-primary">Submit</button> + </form> - </div> - </section> - </div> -{{/each}} + </ul> + </div> + </div> + </section> + </div> + {{/each}} </div> </div> |
