list.pug 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. extends ../layout
  2. block content
  3. //- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>'
  4. //- and doesn't prematurely end the script tag.
  5. script(type="text/javascript").
  6. window.data = {
  7. projects: !{JSON.stringify(projects).replace(/\//g, '\\/')},
  8. tags: !{JSON.stringify(tags).replace(/\//g, '\\/')},
  9. notifications: !{JSON.stringify(notifications).replace(/\//g, '\\/')}
  10. };
  11. window.algolia = {
  12. institutions: {
  13. app_id: '#{algolia_app_id}',
  14. api_key: '#{algolia_api_key}'
  15. }
  16. };
  17. .content.content-alt.project-list-page(ng-controller="ProjectPageController")
  18. .container
  19. .announcements(
  20. ng-controller="AnnouncementsController"
  21. ng-class="{ 'announcements-open': ui.isOpen }"
  22. ng-cloak
  23. )
  24. .announcements-backdrop(
  25. ng-if="ui.isOpen"
  26. ng-click="toggleAnnouncementsUI();"
  27. )
  28. a.announcements-btn(
  29. href
  30. ng-if="announcements.length"
  31. ng-click="toggleAnnouncementsUI();"
  32. ng-class="{ 'announcements-btn-open': ui.isOpen, 'announcements-btn-has-new': ui.newItems }"
  33. )
  34. span.announcements-badge(ng-if="ui.newItems") {{ ui.newItems }}
  35. .announcements-body(
  36. ng-if="ui.isOpen"
  37. )
  38. .announcements-scroller
  39. .announcement(
  40. ng-repeat="announcement in announcements | filter:(ui.newItems ? { read: false } : '') track by announcement.id"
  41. )
  42. h2.announcement-header {{ announcement.title }}
  43. p.announcement-description(ng-bind-html="announcement.excerpt")
  44. .announcement-meta
  45. p.announcement-date {{ announcement.date | date:"longDate" }}
  46. a.announcement-link(
  47. ng-href="{{ announcement.url }}"
  48. target="_blank"
  49. ) Read more
  50. div.text-center(
  51. ng-if="ui.newItems > 0 && ui.newItems < announcements.length"
  52. )
  53. a.btn.btn-default.btn-sm(
  54. href
  55. ng-click="showAll();"
  56. ) Show all
  57. .row(ng-cloak)
  58. span(ng-if="projects.length > 0")
  59. aside.col-md-2.col-xs-3
  60. include ./list/side-bar
  61. .col-md-10.col-xs-9
  62. include ./list/notifications
  63. include ./list/project-list
  64. span(ng-if="projects.length === 0")
  65. .col-md-offset-2.col-md-8.col-md-offset-2.col-xs-8
  66. include ./list/empty-project-list
  67. include ./list/modals