pedagogy: new mobile view and use of css grids for comment display

This commit is contained in:
2019-07-08 02:54:49 +02:00
parent d03835d737
commit 52129d7511
3 changed files with 159 additions and 149 deletions

View File

@ -8,7 +8,6 @@
<span class="fa fa-star pedagogy star-not-checked"></span>
{% endif %}
{% endfor %}
<span class="pedagogy stars-grade grade-text">{{ grade + 1 }}/5</span>
{% else %}
<span class="grade-text"> {% trans %} not rated {% endtrans %} </span>
{% endif %}

View File

@ -138,16 +138,17 @@
{% if object.comments.exists() %}
<h2>{% trans %}Comments{% endtrans %}</h2>
{% for comment in object.comments.order_by("-publish_date").all() %}
<div id="{{ comment.id }}" class="comment">
<div id="{{ comment.id }}" class="comment-container">
<div class="grade-block">
<div class="dif-grade">
<div class="grade-type">
<p>{% trans %}global grade{% endtrans %}</p>
<p>{% trans %}utility{% endtrans %}</p>
<p>{% trans %}interest{% endtrans %}</p>
<p>{% trans %}teaching{% endtrans %}</p>
<p>{% trans %}work load{% endtrans %}</p>
</div>
<div class="grade">
<div class="grade-stars">
<p>{{ display_star(comment.grade_global) }}</p>
<p>{{ display_star(comment.grade_utility) }}</p>
<p>{{ display_star(comment.grade_interest) }}</p>
@ -155,28 +156,35 @@
<p>{{ display_star(comment.grade_work_load) }}</p>
</div>
</div>
<div class="anchor">
<a href="{{ url('pedagogy:uv_detail', uv_id=uv.id) }}#{{ comment.id }}"><i class="fa fa-paragraph"></i></a>
<div class="comment">
<div class="anchor">
<a href="{{ url('pedagogy:uv_detail', uv_id=uv.id) }}#{{ comment.id }}"><i class="fa fa-paragraph"></i></a>
</div>
{{ comment.comment|markdown }}
</div>
{{ comment.comment|markdown }}
{% if comment.is_reported %}
<p class="status-reported">
{% trans %}This comment has been reported{% endtrans %}
</p>
{% endif %}
{% if user.is_owner(comment) %}
<p class="action">
<a href="{{ url('pedagogy:comment_update', comment_id=comment.id) }}">{% trans %}Edit{% endtrans %}</a>
<a href="{{ url('pedagogy:comment_delete', comment_id=comment.id) }}">{% trans %}Delete{% endtrans %}</a>
</p>
{% endif %}
<div class="info">
{% if comment.is_reported %}
<p class="status-reported">
{% trans %}This comment has been reported{% endtrans %}
</p>
{% endif %}
{% if user.is_owner(comment) %}
<p class="actions">
<a href="{{ url('pedagogy:comment_update', comment_id=comment.id) }}">{% trans %}Edit{% endtrans %}</a>
<a href="{{ url('pedagogy:comment_delete', comment_id=comment.id) }}">{% trans %}Delete{% endtrans %}</a>
</p>
{% endif %}
</div>
<div class="comment-end-bar">
<p class="report"><a href="{{ url('pedagogy:comment_report', comment_id=comment.id) }}">{% trans %}Report this comment{% endtrans %}</a></p>
<p class="date-info">{{ comment.publish_date.strftime('%d/%m/%Y') }}</p>
<p class="author-info">{{ user_profile_link(comment.author) }}</p>
<p class="date">{{ comment.publish_date.strftime('%d/%m/%Y') }}</p>
<p class="author">{{ user_profile_link(comment.author) }}</p>
</div>
</div>