diff --git a/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/theme.js b/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/theme.js index 55ba290..2b7b2b6 100644 --- a/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/theme.js +++ b/invenio_theme_tugraz/assets/semantic-ui/js/invenio_theme_tugraz/theme.js @@ -1,3 +1,21 @@ +import $ from 'jquery'; + +$(function() { + let scriptNode = document.createElement("hidden"); //needed for zammad script + scriptNode.id = "zammad_form_script"; + scriptNode.src = "https://ub-support.tugraz.at/assets/form/form.js"; + document.head.appendChild(scriptNode); + + $.getScript("https://ub-support.tugraz.at/assets/form/form.js", () => { + $('#feedback-form').ZammadForm({ + messageTitle: 'Feedback Form', + messageSubmit: 'Send', + messageThankYou: 'Thank you for your message, (#%s). We will get back to you as quickly as possible!', + modal: true + }); + }); +}); + export function toggleVisibility(id) { var element = document.getElementById(id); var isHided = element.style.display === "none"; diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html index 13194cd..4152f31 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/header.html @@ -69,4 +69,4 @@ {%- include "invenio_theme/breadcrumbs.html" %} {%- endblock breadcrumbs %} #} - \ No newline at end of file + diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/index.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/index.html index d78344a..db3f8ee 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/index.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/index.html @@ -9,6 +9,10 @@ {%- extends config.INVENIO_THEME_TUGRAZ_BASE_TEMPLATE %} +{%- block javascript %} + {{ webpack['invenio-theme-tugraz-js.js'] }} +{%- endblock javascript %} + {%- from "invenio_theme_tugraz/macros/authors.html" import creators -%} {%- block page_body %} @@ -125,7 +129,7 @@