diff --git a/ontology/templates/ontology/_topic_card.html b/ontology/templates/ontology/_topic_card.html new file mode 100644 index 0000000000000000000000000000000000000000..e9b4cd70854659075fbd5671dcc26d4676806d48 --- /dev/null +++ b/ontology/templates/ontology/_topic_card.html @@ -0,0 +1,19 @@ + +<div class="card"> + <div class="card-header"> + <h3>{{ topic }}</h3> + {% if perms.scipost.can_manage_ontology %} + <a href="{% url 'ontology:topic_update' slug=topic.slug %}">Update</a> + {% endif %} + </div> + <div class="card-body"> + {% if topic.tags.all %} + <ul class="list list-inline"> + <li class="list-inline-item"><strong>Tags</strong>:</li> + {% for tag in topic.tags.all %} + <li class="list-inline-item">{{ tag }}</li> + {% endfor %} + </ul> + {% endif %} + </div> +</div> diff --git a/ontology/templates/ontology/topic_detail.html b/ontology/templates/ontology/topic_detail.html index c0d36b83e0afc3cd3b2ac50cc3863b7a2282992e..12d5d926d512d77330ced37782bed02423f3235c 100644 --- a/ontology/templates/ontology/topic_detail.html +++ b/ontology/templates/ontology/topic_detail.html @@ -4,7 +4,6 @@ {% block breadcrumb_items %} {{ block.super }} -<span class="breadcrumb-item"><a href="{% url 'ontology:topics' %}">Topics</a></span> <span class="breadcrumb-item">{{ topic }}</span> {% endblock %} @@ -13,7 +12,7 @@ {% block content %} <div class="row"> <div class="col-12"> - {{ topic }} + {% include 'ontology/_topic_card.html' with topic=topic %} </div> </div> {% endblock content %} diff --git a/ontology/urls.py b/ontology/urls.py index 5a864cb507523610028de9f868e7bbaa0f1a6aeb..14ed0745df6b3a360e44483d64d49f5e4c0e67b8 100644 --- a/ontology/urls.py +++ b/ontology/urls.py @@ -14,7 +14,7 @@ urlpatterns = [ ), url( r'^topic/(?P<slug>[-\w]+)/update/$', - views.TopicCreateView.as_view(), + views.TopicUpdateView.as_view(), name='topic_update' ), url(