image_share.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <head>
  2. <title>image_share</title>
  3. </head>
  4. <body>
  5. {{> image_add_form }}
  6. <nav class="navbar navbar-default navbar-fixed-top">
  7. <div class="container">
  8. {{> loginButtons }}
  9. </div>
  10. </nav>
  11. <div class="container">
  12. <h1>Welcome to image share {{ username }} !</h1>
  13. {{> images}}
  14. </div>
  15. </body>
  16. <template name="image_add_form">
  17. <div class="modal fade" id="image_add_form">
  18. <div class="modal-dialog">
  19. <div class="modal-content">
  20. <div class="modal-header">
  21. <div class="modal-title"></div>
  22. </div>
  23. <div class="modal-body">
  24. <form class="js-add-image">
  25. <input type="text" name="img_src" />
  26. <br /><input type="text" name="img_alt" />
  27. <button class="btn btn-success">save</button>
  28. </form>
  29. </div>
  30. <div class="modal-footer">
  31. <button class="btn btn-warning" data-dismiss="modal">cancel</button>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <template name="images">
  38. {{#if currentUser }}
  39. <button class="btn btn-success js-show-image-form">add image</button>
  40. {{/if}}
  41. {{#if filtering_images }}
  42. <h2>Showing images by user {{ getFilterUser }}. <a href="#" class="js-unset-image-filter">Show all images</a></h2>
  43. {{/if}}
  44. <div class="row">
  45. {{#each images}}
  46. <div class="col-xs-12 col-md-3" id="{{_id}}">
  47. <div class="thumbnail">
  48. <img class="thumbnail-img js-image" src="{{img_src}}" alt="{{img_alt}}" />
  49. <div class="caption">
  50. <h3>Rating: {{ rating }}</h3>
  51. <p>{{ img_alt }}</p>
  52. <p>User: <a href="#" class="js-set-image-filter">{{ getUser createdBy }}</a></p>
  53. <p>{{> starsRating mutable=true class="js-rate-image" id=image_id }}</p>
  54. <button class="js-del-image btn btn-warning">delete</button>
  55. </div>
  56. </div>
  57. </div> <!-- / col -->
  58. {{/each}}
  59. </div> <!-- / row -->
  60. </template>