diff --git a/controller/WebController.php b/controller/WebController.php index 0b41b6ecd..cca6e1c54 100644 --- a/controller/WebController.php +++ b/controller/WebController.php @@ -213,18 +213,16 @@ public function invokeFeedbackForm($request) } $feedbackName = $request->getQueryParamPOST('name'); $feedbackEmail = $request->getQueryParamPOST('email'); + $msgSubject = $request->getQueryParamPOST('msgsubject'); $feedbackVocab = $request->getQueryParamPOST('vocab'); - $feedbackVocabEmail = ($feedbackVocab !== null && $feedbackVocab !== '') ? $this->model->getVocabulary($feedbackVocab)->getConfig()->getFeedbackRecipient() : null; - // if the hidden field has been set a value we have found a spam bot // and we do not actually send the message. if ($this->honeypot->validateHoneypot($request->getQueryParamPOST('item-description')) && $this->honeypot->validateHoneytime($request->getQueryParamPOST('user-captcha'), $this->model->getConfig()->getHoneypotTime())) { - $this->sendFeedback($request, $feedbackMsg, $feedbackName, $feedbackEmail, $feedbackVocab, $feedbackVocabEmail); + $this->sendFeedback($request, $feedbackMsg, $msgSubject, $feedbackName, $feedbackEmail, $feedbackVocab, $feedbackVocabEmail); } - echo $template->render( array( 'languages' => $this->languages, @@ -245,27 +243,26 @@ private function createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender) if (!empty($fromEmail)) { $headers .= "Reply-To: $fromName <$fromEmail>\r\n"; } - $service = $this->model->getConfig()->getServiceName(); return $headers . "From: $fromName via $service <$sender>"; } /** * Sends the user entered message through the php's mailer. - * @param string $message only required parameter is the actual message. + * @param string $message content given by user. + * @param string $messageSubject subject line given by user. * @param string $fromName senders own name. * @param string $fromEmail senders email address. * @param string $fromVocab which vocabulary is the feedback related to. */ - public function sendFeedback($request, $message, $fromName = null, $fromEmail = null, $fromVocab = null, $toMail = null) + public function sendFeedback($request, $message, $messageSubject, $fromName = null, $fromEmail = null, $fromVocab = null, $toMail = null) { $toAddress = ($toMail) ? $toMail : $this->model->getConfig()->getFeedbackAddress(); + $messageSubject = "[" . $this->model->getConfig()->getServiceName() . "] " . $messageSubject; if ($fromVocab !== null && $fromVocab !== '') { $message = 'Feedback from vocab: ' . strtoupper($fromVocab) . "
" . $message; } - $envelopeSender = $this->model->getConfig()->getFeedbackEnvelopeSender(); - $subject = $this->model->getConfig()->getServiceName() . " feedback"; // determine the sender address of the message $sender = $this->model->getConfig()->getFeedbackSender(); if (empty($sender)) $sender = $envelopeSender; @@ -273,10 +270,8 @@ public function sendFeedback($request, $message, $fromName = null, $fromEmail = // determine sender name - default to "anonymous user" if not given by user if (empty($fromName)) $fromName = "anonymous user"; - $headers = $this->createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender); $params = empty($envelopeSender) ? '' : "-f $envelopeSender"; - // adding some information about the user for debugging purposes. $message = $message . "

Debugging information:" . "
Timestamp: " . date(DATE_RFC2822) @@ -284,7 +279,7 @@ public function sendFeedback($request, $message, $fromName = null, $fromEmail = . "
Referer: " . $request->getServerConstant('HTTP_REFERER'); try { - mail($toAddress, $subject, $message, $headers, $params); + mail($toAddress, $messageSubject, $message, $headers, $params); } catch (Exception $e) { header("HTTP/1.0 404 Not Found"); $template = $this->twig->loadTemplate('error-page.twig'); diff --git a/resource/css/styles.css b/resource/css/styles.css index cb28d3dc9..5ec7f9508 100644 --- a/resource/css/styles.css +++ b/resource/css/styles.css @@ -5,6 +5,10 @@ li, td > a { font-size: 14px; } +label { + font-weight: normal; +} + h1, .prefLabel, .prefLabelLang, .notation { font-family: 'Fira Sans', sans-serif; font-size: 24px; @@ -667,7 +671,7 @@ span.xl-pref-label > img { .welcome-box, .right-box, #vocabulary-list { vertical-align: top; } - + .welcome-box { background-color: #ffffff; display: inline-block; @@ -2000,7 +2004,7 @@ body, .versal, h1, h2, h3, p, .versal-bold { margin: 2px 0 0 0; line-height: 30px; } - + .concept-main > .row > .property-label-pref { margin-top: 10px; line-height: 20px; @@ -2022,7 +2026,7 @@ body, .versal, h1, h2, h3, p, .versal-bold { margin: 0; width: 100%; } - + .headerbar-coloured { overflow: hidden; } @@ -2034,7 +2038,7 @@ body, .versal, h1, h2, h3, p, .versal-bold { } @media (max-width: 800px) { - + .twitter-typeahead { width: 100%; } @@ -2103,7 +2107,7 @@ body, .versal, h1, h2, h3, p, .versal-bold { .right-box { display: inline; } - + .voclist-wide > .right-box { left: 0; top: 425px; @@ -2161,12 +2165,12 @@ body, .versal, h1, h2, h3, p, .versal-bold { .frontpage > .welcome-box, .frontpage > .right-box { width: 200px; } - + .voclist #vocabulary-list { margin-left: 20px; width: calc(100% - 225px); } - + .voclist-right #vocabulary-list { margin-left: 20px; width: auto; diff --git a/resource/translations/en/LC_MESSAGES/skosmos.mo b/resource/translations/en/LC_MESSAGES/skosmos.mo index e07013024..a7cf4c9c8 100644 Binary files a/resource/translations/en/LC_MESSAGES/skosmos.mo and b/resource/translations/en/LC_MESSAGES/skosmos.mo differ diff --git a/resource/translations/fi/LC_MESSAGES/skosmos.mo b/resource/translations/fi/LC_MESSAGES/skosmos.mo index 91a1cdb81..f2de39e22 100644 Binary files a/resource/translations/fi/LC_MESSAGES/skosmos.mo and b/resource/translations/fi/LC_MESSAGES/skosmos.mo differ diff --git a/resource/translations/skosmos_en.po b/resource/translations/skosmos_en.po index 2f722e7f0..0ddbf8457 100644 --- a/resource/translations/skosmos_en.po +++ b/resource/translations/skosmos_en.po @@ -839,3 +839,12 @@ msgstr "Search results" msgid "Sidebar listing: list and traverse vocabulary contents by a criterion" msgstr "Sidebar listing: list and traverse vocabulary contents by a criterion" + +msgid "Subject:" +msgstr "Subject:" + +msgid "Write a subject" +msgstr "Write a subject" + +msgid "Select a vocabulary" +msgstr "You can select a vocabulary" diff --git a/resource/translations/skosmos_fi.po b/resource/translations/skosmos_fi.po index 2743438ce..5208799cc 100644 --- a/resource/translations/skosmos_fi.po +++ b/resource/translations/skosmos_fi.po @@ -838,3 +838,12 @@ msgstr "Hakutulokset" msgid "Sidebar listing: list and traverse vocabulary contents by a criterion" msgstr "Sivupalkin lista: listaa ja selaa käsitteitä eri kriteerien mukaan" + +msgid "Subject:" +msgstr "Aihe:" + +msgid "Write a subject" +msgstr "Kirjoita aihe" + +msgid "Select a vocabulary" +msgstr "Voit valita halutessasi sanaston" diff --git a/resource/translations/skosmos_sv.po b/resource/translations/skosmos_sv.po index bd7fc0bcf..4c501d76c 100644 --- a/resource/translations/skosmos_sv.po +++ b/resource/translations/skosmos_sv.po @@ -836,3 +836,12 @@ msgstr "Sökresultat" msgid "Sidebar listing: list and traverse vocabulary contents by a criterion" msgstr "Sidofältlista: ordna och bläddra begrepp efter kriterier" + +msgid "Subject:" +msgstr "Ämne:" + +msgid "Write a subject" +msgstr "Skriv ett ämne" + +msgid "Select a vocabulary" +msgstr "Du kan välja en vokabulär" diff --git a/resource/translations/sv/LC_MESSAGES/skosmos.mo b/resource/translations/sv/LC_MESSAGES/skosmos.mo index e9e13a6dc..ca12018b8 100644 Binary files a/resource/translations/sv/LC_MESSAGES/skosmos.mo and b/resource/translations/sv/LC_MESSAGES/skosmos.mo differ diff --git a/tests/testconfig-fordefaults.ttl b/tests/testconfig-fordefaults.ttl index fba8424b1..78ffc774a 100644 --- a/tests/testconfig-fordefaults.ttl +++ b/tests/testconfig-fordefaults.ttl @@ -28,7 +28,7 @@ skos:prefLabel "Test ontology"@en ; skosmos:arrayClass isothes:ThesaurusArray ; skosmos:defaultLanguage "en"; - skosmos:feedbackRecipient "developer@vocabulary.org"; + skosmos:feedbackRecipient "developer@vocabulary.org"; skosmos:groupClass skos:Collection; skosmos:language "en"; skosmos:showTopConcepts "true"; @@ -48,4 +48,3 @@ mdrtype:THESAURUS a skos:Concept ; mdrtype:ONTOLOGY a skos:Concept ; skos:prefLabel "Онтология"@bg, "Ontologie"@cs, "Ontologi"@da, "Ontologie"@de, "Οντολογία"@el, "Ontology"@en, "Ontoloogia"@et, "Ontologia"@fi, "Ontologie"@fr, "Ontologija"@hr, "Ontológia"@hu, "Ontologia"@it, "Ontoloģija"@lv, "Ontologija"@lt, "Ontoloġija"@mt, "Ontologie"@nl, "Ontologi"@no, "Struktura pojęciowa"@pl, "Ontologia"@pt, "Ontologie"@ro, "Ontológia"@sk, "Ontologija"@sl, "Ontología"@es, "Ontologi"@sv . - diff --git a/view/feedback.twig b/view/feedback.twig index f5869e9be..eb370ff3e 100644 --- a/view/feedback.twig +++ b/view/feedback.twig @@ -19,7 +19,7 @@ {% if vocabList %} {% endif %}

{% trans "feedback_enter_name_email" %}

- -

{% trans %}Name:{% endtrans %}

- -

{% trans %}E-mail:{% endtrans %}

- -

{% trans %}Message:{% endtrans %} *

+

+ + +

+

+ + +

+

+ + +

+ {{ honeypot.generate('item-description', 'user-captcha')|raw }}