From baa7d290c726a1079aee645f7a04827972652b1f Mon Sep 17 00:00:00 2001 From: rekt-hard <72449192+rekt-hard@users.noreply.github.com> Date: Tue, 9 Mar 2021 09:04:32 +0100 Subject: [PATCH] zammad contact form (#156) --- .../js/invenio_theme_tugraz/theme.js | 18 ++++++++++++++++++ .../templates/invenio_theme_tugraz/header.html | 2 +- .../templates/invenio_theme_tugraz/index.html | 6 +++++- .../templates/invenio_theme_tugraz/navbar.html | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) 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 @@

{{_ ("Need help?")}}

- + {{_ ("Contact us")}}
diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/navbar.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/navbar.html index 96e101b..7f3976f 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/navbar.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/navbar.html @@ -116,4 +116,4 @@ - \ No newline at end of file +