pedagogy: functional but basic uv comment system

This commit is contained in:
2019-06-16 17:02:45 +02:00
parent b7c2da53fe
commit 5003e57338
7 changed files with 116 additions and 10 deletions

View File

@ -13,7 +13,7 @@
{% endif %}
{% for uv in object_list %}
<p>
{{ uv.code }}
<a href="{{ url('pedagogy:uv_detail', uv_id=uv.id) }}">{{ uv.code }}</a>
{% if user.is_owner(uv) -%}
<a href="{{ url('pedagogy:uv_update', uv_id=uv.id) }}">{% trans %}Edit{% endtrans %}</a>
<a href="{{ url('pedagogy:uv_delete', uv_id=uv.id) }}">{% trans %}Delete{% endtrans %}</a>

View File

@ -10,4 +10,27 @@
<p>{{ object.program|markdown }}</p>
<p>{{ object.skills|markdown }}</p>
<p>{{ object.key_concepts|markdown }}</p>
{% if object.comments.exists() %}
<h2>{% trans %}Comments{% endtrans %}</h2>
{% for comment in object.comments.all() %}
<p>{{ comment.grade_global }}</p>
<p>{{ comment.grade_utility }}</p>
<p>{{ comment.grade_interest }}</p>
<p>{{ comment.grade_teaching }}</p>
<p>{{ comment.grade_work_load }}</p>
<p>{{ comment.comment }}</p>
{% if user.is_owner(comment) %}
<p><a href="{{ url('pedagogy:comment_edit', comment_id=comment.id) }}">{% trans %}Edit{% endtrans %}</a></p>
<p><a href="{{ url('pedagogy:comment_delete', comment_id=comment.id) }}">{% trans %}Delete{% endtrans %}</a></p>
{% endif %}
{% endfor %}
{% endif %}
<h2>{% trans %}Leave comment{% endtrans %}</h2>
<form action="{{ url('pedagogy:uv_detail', uv_id=object.id) }}" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Comment{% endtrans %}" /></p>
</form>
{% endblock %}