diff --git a/evap/staff/templates/staff_course_form.html b/evap/staff/templates/staff_course_form.html index 4b65c963ff..02d4d83abd 100644 --- a/evap/staff/templates/staff_course_form.html +++ b/evap/staff/templates/staff_course_form.html @@ -6,7 +6,9 @@ {{ block.super }}

{% if course_form.instance.id %} - {{ course.name }} ({{ course.semester.name }}) + + {{ course.name }} ({{ course.semester.name }}) + {% else %} {% translate 'Create course' %} {% endif %} diff --git a/evap/staff/templates/staff_evaluation_form.html b/evap/staff/templates/staff_evaluation_form.html index 89d298c7fc..e5cf44518b 100644 --- a/evap/staff/templates/staff_evaluation_form.html +++ b/evap/staff/templates/staff_evaluation_form.html @@ -12,11 +12,13 @@ {% endif %}

- {% if evaluation_form.instance.id %} - {{ evaluation.full_name }} ({{ evaluation.course.semester.name }}) - {% else %} - {% translate 'Create evaluation' %} - {% endif %} + + {% if evaluation_form.instance.id %} + {{ evaluation.full_name }} ({{ evaluation.course.semester.name }}) + {% else %} + {% translate 'Create evaluation' %} + {% endif %} +

{% if evaluation_form.instance.id %}
diff --git a/evap/staff/templates/staff_semester_view_evaluation.html b/evap/staff/templates/staff_semester_view_evaluation.html index f6dfc312a8..874fb579b8 100644 --- a/evap/staff/templates/staff_semester_view_evaluation.html +++ b/evap/staff/templates/staff_semester_view_evaluation.html @@ -196,6 +196,11 @@ {% translate 'Copy evaluation' %} +
  • + + {% translate 'Copy name to clipboard' %} + +
  • {% translate 'Merge with other evaluation' %} diff --git a/evap/static/ts/src/base-template.ts b/evap/static/ts/src/base-template.ts index 536cbd61be..35fce33a35 100644 --- a/evap/static/ts/src/base-template.ts +++ b/evap/static/ts/src/base-template.ts @@ -11,3 +11,24 @@ document.addEventListener("shown.bs.modal", e => { autofocusEl.focus(); } }); + +document.addEventListener("click", e => { + if (!e.target) { + return; + } + const modalEl = e.target as HTMLElement; + if (!modalEl.hasAttribute("data-copy-on-click")) { + return; + } + const copy_string = modalEl.getAttribute("data-copy-on-click")?.toString(); + if (copy_string) { + navigator.clipboard.writeText(copy_string); + // console.log("copied"); + // console.log(modalEl.getAttributeNames()); + // console.log(modalEl.getAttribute("data-bs-original-title")) + // if (modalEl.hasAttribute("data-bs-original-title")) { + // modalEl.setAttribute("data-bs-original-title", "Copied to clipboard"); + // console.log("data-bs-original-title"); + // } + } +});