選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

178 行
8.1KB

  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <div class="row">
  4. <div class="col-12 text-center">
  5. <h1>{% block title %}
  6. {{ type|capitalize + 's' }}
  7. {% endblock %}
  8. </h1>
  9. </div>
  10. </div>
  11. <div class="row">
  12. <div class="col-12 text-center">
  13. <p>
  14. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget viverra magna. Nam in ante ultricies purus feugiat vestibulum et ac erat. Donec in sagittis ante. Maecenas non mauris et eros commodo fringilla. Integer accumsan ullamcorper diam, non rhoncus tellus molestie ut. Maecenas finibus pretium dolor ac sagittis.
  15. </p>
  16. </div>
  17. </div>
  18. <div class="row">
  19. <div class="col-md-4 col-lg-3 py-3">
  20. <div class="search-filter-sidebar">
  21. <input class="form-control" id="searchResources" type="text" placeholder="filter by search...">
  22. <div class="row">
  23. {% if practices_filter %}
  24. <div class="col-sm-6 d-md-block d-sm-none d-none">
  25. <div class="filter-title">Practices</div>
  26. <ul class="filter-items">
  27. {% for practice in practices_filter %}
  28. <li {% if request.args.get('practice') == practice[0]|string %} class="fw-bold"{% endif %}>
  29. <a href="/{{type + 's'}}?practice={{practice[0]}}">{{ practice[1] }}</a>
  30. </li>
  31. {% endfor %}
  32. </ul>
  33. </div>
  34. <div class="d-md-none accordion">
  35. <div class="accordion-item">
  36. <div class="filter-title accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#filter-practice">Practices</div>
  37. <div class="accordion-body">
  38. <ul id="filter-practice" class="collapse filter-items">
  39. {% for practice in practices_filter %}
  40. <li {% if request.args.get('practice') == practice[0]|string %} class="fw-bold"{% endif %}>
  41. <a href="/{{type + 's'}}?practice={{practice[0]}}">{{ practice[1] }}</a>
  42. </li>
  43. {% endfor %}
  44. </ul>
  45. </div>
  46. </div>
  47. </div>
  48. {% endif %}
  49. {% if year_filter %}
  50. <div class="col-sm-6 d-md-block d-sm-none d-none">
  51. <div class="filter-title">Year</div>
  52. <ul class="filter-items">
  53. {% for year in year_filter %}
  54. <li {% if request.args.get('year') == year %} class="fw-bold"{% endif %}>
  55. <a href="/books?year={{year}}">{{ year }}</a>
  56. </li>
  57. {% endfor %}
  58. </ul>
  59. </div>
  60. <div class="d-md-none accordion">
  61. <div class="accordion-item">
  62. <div class="filter-title accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#filter-year">Year</div>
  63. <div class="accordion-body">
  64. <ul id="filter-year" class="collapse filter-items">
  65. {% for year in year_filter %}
  66. <li {% if request.args.get('year') == year %} class="fw-bold"{% endif %}>
  67. <a href="/books?year={{year}}">{{ year }}</a>
  68. </li>
  69. {% endfor %}
  70. </ul>
  71. </div>
  72. </div>
  73. </div>
  74. {% endif %}
  75. </div>
  76. <div class="row">
  77. {% if languages_filter %}
  78. <div class="col-sm-6 d-md-block d-sm-none d-none">
  79. <div class="filter-title">Scripting languages</div>
  80. <ul class="filter-items">
  81. {% for language in languages_filter %}
  82. <li {% if request.args.get('scriptingLanguage') == language %} class="fw-bold"{% endif %}>
  83. <a href="/tools?scriptingLanguage={{language}}">{{ language }}</a>
  84. </li>
  85. {% endfor %}
  86. </ul>
  87. </div>
  88. <div class="d-md-none accordion">
  89. <div class="accordion-item">
  90. <div class="filter-title accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#filter-language">Scripting language</div>
  91. <div class="accordion-body">
  92. <ul id="filter-language" class="collapse filter-items">
  93. {% for language in languages_filter %}
  94. <li {% if request.args.get('scriptingLanguage') == language %} class="fw-bold"{% endif %}>
  95. <a href="/tools?scriptingLanguage={{language}}">{{ language }}</a>
  96. </li>
  97. {% endfor %}
  98. </ul>
  99. </div>
  100. </div>
  101. </div>
  102. {% endif %}
  103. {% if licenses_filter %}
  104. <div class="col-sm-6 d-md-block d-sm-none d-none">
  105. <div class="filter-title">License</div>
  106. <ul class="filter-items">
  107. {% for license in licenses_filter %}
  108. <li {% if request.args.get('license') == license %} class="fw-bold"{% endif %}>
  109. <a href="/tools?license={{license}}">{{ license }}</a>
  110. </li>
  111. {% endfor %}
  112. </ul>
  113. </div>
  114. <div class="d-md-none accordion">
  115. <div class="accordion-item">
  116. <div class="filter-title accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#filter-license">License</div>
  117. <div class="accordion-body">
  118. <ul id="filter-license" class="collapse filter-items">
  119. {% for license in licenses_filter %}
  120. <li {% if request.args.get('license') == license %} class="fw-bold"{% endif %}>
  121. <a href="/tools?license={{license}}">{{ license }}</a>
  122. </li>
  123. {% endfor %}
  124. </ul>
  125. </div>
  126. </div>
  127. </div>
  128. {% endif %}
  129. </div>
  130. </div>
  131. </div>
  132. <div class="col-md-8 col-lg-9">
  133. <div id="resource-boxes" class="row">
  134. {% for resource in resources %}
  135. <div id="resource" class="col-md-4 col-sm-6 py-3">
  136. <div class="card text-dark bg-{{type}} mb-3">
  137. <div class="card-body">
  138. {% if resource['type'] == 'tool' %}
  139. <a href="{{ url_for('tool.show_tool', tool_id=resource['id']) }}">
  140. <h3 class="card-title text-center text-dark">{{ resource['name'] }}</h3>
  141. </a>
  142. {% elif resource['type'] == 'practice' %}
  143. <a href="{{ url_for('practice.show_practice', practice_id=resource['id']) }}">
  144. <h3 class="card-title text-center text-dark">{{ resource['name'] }}</h3>
  145. </a>
  146. {% elif resource['type'] == 'book' %}
  147. <a href="{{ url_for('book.show_book', book_id=resource['id']) }}">
  148. <h3 class="card-title text-center text-dark">{{ resource['name'] }}</h3>
  149. </a>
  150. {% endif %}
  151. <p class="card-text">
  152. {{ resource['description']|truncate(100) }}
  153. </p>
  154. {% if current_user.is_authenticated %}
  155. {% if resource['type'] == 'tool' %}
  156. <a href="{{ url_for('tool.edit_tool', tool_id=resource['id']) }}">
  157. <span class="badge bg-dark">Edit</span>
  158. </a>
  159. {% elif resource['type'] == 'practice' %}
  160. <a href="{{ url_for('practice.edit_practice', practice_id=resource['id']) }}">
  161. <span class="badge bg-dark">Edit</span>
  162. </a>
  163. {% elif resource['type'] == 'book' %}
  164. <a href="{{ url_for('book.edit_book', book_id=resource['id']) }}">
  165. <span class="badge bg-dark">Edit</span>
  166. </a>
  167. {% endif %}
  168. {% endif %}
  169. </div>
  170. </div>
  171. </div>
  172. {% endfor %}
  173. </div>
  174. </div>
  175. </div>
  176. {% endblock %}