Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

152 lines
7.0KB

  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="/tools?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="/tools?practice={{practice[0]}}">{{ practice[1] }}</a>
  42. </li>
  43. {% endfor %}
  44. </ul>
  45. </div>
  46. </div>
  47. </div>
  48. {% endif %}
  49. </div>
  50. <div class="row">
  51. {% if languages_filter %}
  52. <div class="col-sm-6 d-md-block d-sm-none d-none">
  53. <div class="filter-title">Scripting languages</div>
  54. <ul class="filter-items">
  55. {% for language in languages_filter %}
  56. <li {% if request.args.get('scriptingLanguage') == language %} class="fw-bold"{% endif %}>
  57. <a href="/tools?scriptingLanguage={{language}}">{{ language }}</a>
  58. </li>
  59. {% endfor %}
  60. </ul>
  61. </div>
  62. <div class="d-md-none accordion">
  63. <div class="accordion-item">
  64. <div class="filter-title accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#filter-language">Scripting language</div>
  65. <div class="accordion-body">
  66. <ul id="filter-language" class="collapse filter-items">
  67. {% for language in languages_filter %}
  68. <li {% if request.args.get('scriptingLanguage') == language %} class="fw-bold"{% endif %}>
  69. <a href="/tools?scriptingLanguage={{language}}">{{ language }}</a>
  70. </li>
  71. {% endfor %}
  72. </ul>
  73. </div>
  74. </div>
  75. </div>
  76. {% endif %}
  77. {% if licenses_filter %}
  78. <div class="col-sm-6 d-md-block d-sm-none d-none">
  79. <div class="filter-title">License</div>
  80. <ul class="filter-items">
  81. {% for license in licenses_filter %}
  82. <li {% if request.args.get('license') == license %} class="fw-bold"{% endif %}>
  83. <a href="/tools?license={{license}}">{{ license }}</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-license">License</div>
  91. <div class="accordion-body">
  92. <ul id="filter-license" class="collapse filter-items">
  93. {% for license in licenses_filter %}
  94. <li {% if request.args.get('license') == license %} class="fw-bold"{% endif %}>
  95. <a href="/tools?license={{license}}">{{ license }}</a>
  96. </li>
  97. {% endfor %}
  98. </ul>
  99. </div>
  100. </div>
  101. </div>
  102. {% endif %}
  103. </div>
  104. </div>
  105. </div>
  106. <div class="col-md-8 col-lg-9">
  107. <div id="resource-boxes" class="row">
  108. {% for resource in resources %}
  109. <div id="resource" class="col-md-4 col-sm-6 py-3">
  110. <div class="card text-dark bg-{{type}} mb-3">
  111. <div class="card-body">
  112. {% if resource['type'] == 'tool' %}
  113. <a href="{{ url_for('tool.show_tool', tool_id=resource['id']) }}">
  114. <h3 class="card-title text-center text-dark">{{ resource['name'] }}</h3>
  115. </a>
  116. {% elif resource['type'] == 'practice' %}
  117. <a href="{{ url_for('practice.show_practice', practice_id=resource['id']) }}">
  118. <h3 class="card-title text-center text-dark">{{ resource['name'] }}</h3>
  119. </a>
  120. {% elif resource['type'] == 'book' %}
  121. <a href="{{ url_for('book.show_book', book_id=resource['id']) }}">
  122. <h3 class="card-title text-center text-dark">{{ resource['name'] }}</h3>
  123. </a>
  124. {% endif %}
  125. <p class="card-text">
  126. {{ resource['description']|truncate(100) }}
  127. </p>
  128. {% if current_user.is_authenticated %}
  129. {% if resource['type'] == 'tool' %}
  130. <a href="{{ url_for('tool.edit_tool', tool_id=resource['id']) }}">
  131. <span class="badge bg-dark">Edit</span>
  132. </a>
  133. {% elif resource['type'] == 'practice' %}
  134. <a href="{{ url_for('practice.edit_practice', practice_id=resource['id']) }}">
  135. <span class="badge bg-dark">Edit</span>
  136. </a>
  137. {% elif resource['type'] == 'book' %}
  138. <a href="{{ url_for('book.edit_book', book_id=resource['id']) }}">
  139. <span class="badge bg-dark">Edit</span>
  140. </a>
  141. {% endif %}
  142. {% endif %}
  143. </div>
  144. </div>
  145. </div>
  146. {% endfor %}
  147. </div>
  148. </div>
  149. </div>
  150. {% endblock %}