diff options
Diffstat (limited to 'views')
| -rw-r--r-- | views/user_solutions.hbs | 138 |
1 files changed, 83 insertions, 55 deletions
diff --git a/views/user_solutions.hbs b/views/user_solutions.hbs index abf1117..598e63d 100644 --- a/views/user_solutions.hbs +++ b/views/user_solutions.hbs @@ -1,73 +1,101 @@ <main id="solutions-main"> <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> +<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> +<!-- 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 --> + <!-- 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> - {{#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> +<!-- Solution 1 Example --> - <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> - </div> - </div> +{{#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 class="user-sol"> - <h3>Solution</h3> - <p>{{this.text}}</p> + <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> + </div> + </div> - <div class="comments"> - <h3><a data-toggle="collapse" href="#com1"><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="com1" 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> - </ul> - </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> - </section> - </div> - {{/each}} + <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"> + + </textarea> + </div> + <input type="hidden" name="_csrf" value="{{../csrfToken }}"> + <button type="submit" class="btn btn-primary">Submit</button> + </form> + </ul> + </div> + </div> + </section> </div> +{{/each}} + + +</div> </div> </main> |
