You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
5.3 KiB

  1. {% extends "base.html" %} {% load static %}
  2. {% load widget_tweaks %}
  3. {% block content %}
  4. <div id="projects_root">
  5. <section class="hero project-image">
  6. <div class="container">
  7. <div class="columns">
  8. <div class="column is-12">
  9. <h1 class="title is-1 has-text-white">
  10. Hello, {{ user.get_username | title }}.
  11. </h1>
  12. <h2 class="subtitle is-4 has-text-white">
  13. I hope you are having a great day!
  14. </h2>
  15. {% if user.is_superuser %}
  16. <p>
  17. <a class="button is-medium is-primary" @click="isActive=!isActive">
  18. Create Project
  19. </a>
  20. </p>
  21. {% endif %}
  22. </div>
  23. </div>
  24. </div>
  25. </section>
  26. <div class="container">
  27. <div class="columns" style="margin-top:0">
  28. <div class="column is-3">
  29. <aside class="menu">
  30. <p class="menu-label">
  31. Categories
  32. </p>
  33. <ul class="menu-list">
  34. <li>
  35. <a v-bind:class="{active: selectedType == 'All' }" v-on:click="updateSelectedType('All')">All</a>
  36. </li>
  37. <li v-for="t in uniqueProjectTypes">
  38. <a v-bind:class="{active: t == selectedType }" v-on:click="updateSelectedType(t)">[[ t ]]</a>
  39. </li>
  40. </ul>
  41. </aside>
  42. </div>
  43. <div class="column is-9">
  44. <!-- Modal card for creating project. -->
  45. <div class="modal" :class="{ 'is-active': isActive }">
  46. <div class="modal-background"></div>
  47. <div class="modal-card">
  48. <header class="modal-card-head">
  49. <p class="modal-card-title">Create Project</p>
  50. <button class="delete" aria-label="close" @click="isActive=!isActive"></button>
  51. </header>
  52. <form method="post">
  53. {% csrf_token %}
  54. <section class="modal-card-body">
  55. {% for hidden_field in form.hidden_fields %}
  56. {{ hidden_field }}
  57. {% endfor %}
  58. {% for field in form.visible_fields %}
  59. <div class="field">
  60. {{ field.label_tag }}
  61. <div class="control">
  62. {% render_field field class="input select-height" %}
  63. </div>
  64. {% if field.help_text %}
  65. <small class="form-text text-muted">{{ field.help_text }}</small>
  66. {% endif %}
  67. </div>
  68. {% endfor %}
  69. </section>
  70. <footer class="modal-card-foot" style="background-color:#dbdbdb !important;padding:20px !important;">
  71. <button class="button is-primary">Create</button>
  72. <button class="button" @click="isActive=!isActive">Cancel</button>
  73. </footer>
  74. </form>
  75. </div>
  76. </div>
  77. <div class="columns features" v-for="projects in filteredProjects">
  78. <div class="column is-4" v-for="project in projects">
  79. <div class="card is-shady">
  80. <div class="card-image">
  81. <figure class="image is-4by3">
  82. <img v-bind:src="project.image" alt="Placeholder image">
  83. </figure>
  84. </div>
  85. <div class="card-content">
  86. <div class="content">
  87. <h4>
  88. <a v-bind:href="'/projects/' + project.id">[[ project.name ]]</a>
  89. </h4>
  90. <p>
  91. [[ project.description.slice(0, 50) ]]
  92. </p>
  93. </div>
  94. </div>
  95. {% if user.is_superuser %}
  96. <div class="card-footer">
  97. <a v-bind:href="'/projects/' + project.id + '/docs'" class="card-footer-item">Edit</a>
  98. <a href="" class="card-footer-item has-text-danger" style="font-weight:700">Delete</a>
  99. </div>
  100. {% endif %}
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. {% endblock %} {% block footer %}
  109. <script type="text/javascript" src="{% static 'bundle/projects.js' %}"></script>
  110. {% endblock %}