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

61 行
2.7KB

  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. {% for resource in resources %}
  20. <div class="col-md-4 col-sm-6 py-3">
  21. <div class="card text-dark bg-{{type}} mb-3">
  22. <div class="card-body">
  23. {% if resource['type'] == 'tool' %}
  24. <a href="{{ url_for('tool.show_tool', tool_id=resource['id']) }}">
  25. <h3 class="card-title text-center text-dark">{{ resource['name'] }}</h3>
  26. </a>
  27. {% elif resource['type'] == 'practice' %}
  28. <a href="{{ url_for('practice.show_practice', practice_id=resource['id']) }}">
  29. <h3 class="card-title text-center text-dark">{{ resource['name'] }}</h3>
  30. </a>
  31. {% elif resource['type'] == 'publisher' %}
  32. <a href="{{ url_for('publisher.show_publisher', publisher_id=resource['id']) }}">
  33. <h3 class="card-title text-center text-dark">{{ resource['name'] }}</h3>
  34. </a>
  35. {% endif %}
  36. <p class="card-text">
  37. {{ resource['description']|truncate(100) }}
  38. </p>
  39. {% if current_user.is_authenticated %}
  40. {% if resource['type'] == 'tool' %}
  41. <a href="{{ url_for('tool.edit_tool', tool_id=resource['id']) }}">
  42. <span class="badge bg-dark">Edit</span>
  43. </a>
  44. {% elif resource['type'] == 'practice' %}
  45. <a href="{{ url_for('practice.edit_practice', practice_id=resource['id']) }}">
  46. <span class="badge bg-dark">Edit</span>
  47. </a>
  48. {% elif resource['type'] == 'publisher' %}
  49. <a href="{{ url_for('publisher.edit_publisher', publisher_id=resource['id']) }}">
  50. <span class="badge bg-dark">Edit</span>
  51. </a>
  52. {% endif %}
  53. {% endif %}
  54. </div>
  55. </div>
  56. </div>
  57. {% endfor %}
  58. </div>
  59. {% endblock %}