From 2e02fcd8c9a1dae445aac18060afc326db31773f Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Fri, 11 Oct 2024 16:53:06 +0200
Subject: [PATCH] "Copy topic" button moved to the topic navigation bar

Closes #96.
---
 owl/templates/admin-edit-topic.html | 1 -
 owl/templates/parts/navigation.html | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/owl/templates/admin-edit-topic.html b/owl/templates/admin-edit-topic.html
index 4020d88..fca64f7 100644
--- a/owl/templates/admin-edit-topic.html
+++ b/owl/templates/admin-edit-topic.html
@@ -41,7 +41,6 @@
 		<p class=buttons>{{ form.submit(class='ok', accesskey='s') }}
 	{% if edit_topic != None %}
 		{{ form.publish(class='ok', disabled=edit_topic.public, title='Publish the topic and notify students.') }}
-		<a class=button accesskey='c' href='{{ url_for('admin_copy_topic', sident=g.course.semester.ident, cident=g.course.ident, tid=edit_topic.tid) }}'>Copy</a>
 	{% endif %}
 		<a class=button accesskey='x' href='{{ url_for('admin_topics', sident=parent_course.semester.ident, cident=parent_course.ident) }}'>Cancel</a>
 	{% if edit_topic != None %}
diff --git a/owl/templates/parts/navigation.html b/owl/templates/parts/navigation.html
index a9f7645..f8da214 100644
--- a/owl/templates/parts/navigation.html
+++ b/owl/templates/parts/navigation.html
@@ -22,6 +22,7 @@
 	{% endif %}
 	{% if g.is_teacher %}
 		{{ nav_button(active == 'edit-topic', 'e', url_for('admin_edit_topic', sident=g.course.semester.ident, cident=g.course.ident, tid=g.topic.tid), 'Edit topic') }}
+		{{ nav_button(active == 'copy-topic', 'c', url_for('admin_copy_topic', sident=g.course.semester.ident, cident=g.course.ident, tid=g.topic.tid), 'Copy topic') }}
 		{% if g.course.student_grading and is_normal_topic %}
 		{{ nav_button(active == 'graders', 'g', url_for('admin_topic_graders', sident=g.course.semester.ident, cident=g.course.ident, tid=g.topic.tid), 'Graders') }}
 		{% endif %}
-- 
GitLab