Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Render the comments in a table

Roland Geider49566a3dd640
diff --git a/exercises/templates/view.html b/exercises/templates/view.html
index 8846320c6..29cb8781c 100644
--- a/exercises/templates/view.html
+++ b/exercises/templates/view.html
@@ -19,27 +19,41 @@
<p>{{ exercise.description }}</p>
-<p>{% trans "All comments for this exercise" %}:</p>
-
-<ul>
+<table>
+ <thead>
+ <tr>
+ <th colspan="2">{% trans "All comments for this exercise" %}</th>
+ </tr>
+ </thead>
+ <tbody>
{% for comment in exercise.exercisecomment_set.all %}
- <li>
- {% if comment_edit.id == comment.id %}
- <form action="{% url exercises.views.exercise_view exercise.id comment.id %}" method="post">
- {% csrf_token %}
- {{ comment_edit_form.comment }}
- <input type="submit" value="{% trans "Save" %}" />
- </form>
- {% else %}
- <a href="{% url exercises.views.exercisecomment_delete comment.id %}" title="{% trans "Delete" %}">[x]</a>
- <a href="{% url exercises.views.exercise_view exercise.id comment.id %}" title="{% trans "Edit" %}">[e]</a>
- {{ comment }}
- {% endif %}
- </li>
+ <tr>
+ <td>
+ {% if comment_edit.id == comment.id %}
+ <form action="{% url exercises.views.exercise_view exercise.id comment.id %}" method="post">
+ {% csrf_token %}
+ {{ comment_edit_form.comment }}
+ <input type="submit" value="{% trans "Save" %}" />
+ </form>
+ {% else %}
+ {{ comment }}
+ {% endif %}
+ </td>
+ <td class="align-right">
+ <div class="editoptions">
+ <a href="{% url exercises.views.exercisecomment_delete comment.id %}" title="{% trans "Delete" %}">[x]</a>
+ <a href="{% url exercises.views.exercise_view exercise.id comment.id %}" title="{% trans "Edit" %}">[e]</a>
+ </div>
+ </td>
+ </tr>
{% empty %}
- <li>{% trans "Sorry, no comments for this exercise yet!" %}</li>
+ <tr>
+ <td>{% trans "Sorry, no comments for this exercise yet!" %}</td>
+ </tr>
{% endfor %}
</ul>
+ </tbody>
+</table>
<h3>{% trans "Add new comment" %}</h3>
<form action = "{% url exercises.views.exercise_view exercise.id %}"
diff --git a/manager/static/css/yaml401/custom-yaml.css b/manager/static/css/yaml401/custom-yaml.css
index 538913db7..819fa8a75 100644
--- a/manager/static/css/yaml401/custom-yaml.css
+++ b/manager/static/css/yaml401/custom-yaml.css
@@ -23,4 +23,9 @@ tr:hover div.editoptions, tbody tr:hover td div.editoptions
.ym-g10
{
width: 10%;
+}
+
+.align-right
+{
+ text-align: right;
}
\ No newline at end of file