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

resources.html 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. {% endif %}
  32. <p class="card-text">
  33. {{ resource['description']|truncate(100) }}
  34. </p>
  35. {% if current_user.is_authenticated %}
  36. {% if resource['type'] == 'tool' %}
  37. <a href="{{ url_for('tool.edit_tool', tool_id=resource['id']) }}">
  38. <span class="badge bg-dark">Edit</span>
  39. </a>
  40. {% endif %}
  41. {% if resource['type'] == 'practice' %}
  42. <a href="{{ url_for('practice.edit_practice', practice_id=resource['id']) }}">
  43. <span class="badge bg-dark">Edit</span>
  44. </a>
  45. {% endif %}
  46. {% endif %}
  47. </div>
  48. </div>
  49. </div>
  50. {% endfor %}
  51. </div>
  52. {% endblock %}