Skip to content

Commit 59253f1

Browse files
Add edit buttons for homeworks and projects in cadmin (#146)
* Initial plan * Add edit buttons for homeworks and projects, fix homework actions for open state Co-authored-by: alexeygrigorev <875246+alexeygrigorev@users.noreply.github.com> * Remove mockup file --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexeygrigorev <875246+alexeygrigorev@users.noreply.github.com>
1 parent 54c4c2a commit 59253f1

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cadmin/templates/cadmin/course_admin.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ <h3>Homework</h3>
5353
<a href="{% url 'homework' course.slug hw.slug %}" title="View Public Homework Page" class="ml-2">
5454
<i class="fas fa-external-link-alt"></i>
5555
</a>
56+
<a href="/admin/courses/homework/{{ hw.id }}/change/" title="Edit in Django Admin" class="ml-2">
57+
<i class="fas fa-edit"></i>
58+
</a>
5659
</td>
5760
<td>{{ hw.due_date|date:"Y-m-d" }}</td>
5861
<td>
@@ -72,7 +75,7 @@ <h3>Homework</h3>
7275
{% csrf_token %}
7376
<select class="form-control form-control-sm d-inline-block" style="width: auto;" name="action" id="hw-action-{{ hw.id }}">
7477
<option value="">Select action...</option>
75-
{% if hw.state == 'CL' %}
78+
{% if hw.state == 'OP' or hw.state == 'CL' %}
7679
<option value="{% url 'cadmin_homework_set_correct_answers' course.slug hw.slug %}">Set Correct Answers</option>
7780
<option value="{% url 'cadmin_homework_score' course.slug hw.slug %}">Score</option>
7881
{% endif %}
@@ -118,6 +121,9 @@ <h3>Projects</h3>
118121
<a href="{% url 'project' course.slug proj.slug %}" title="View Public Project Page" class="ml-2">
119122
<i class="fas fa-external-link-alt"></i>
120123
</a>
124+
<a href="/admin/courses/project/{{ proj.id }}/change/" title="Edit in Django Admin" class="ml-2">
125+
<i class="fas fa-edit"></i>
126+
</a>
121127
</td>
122128
<td>
123129
Sub: {{ proj.submission_due_date|date:"Y-m-d" }}<br>

0 commit comments

Comments
 (0)