Added automatic request support URL when none is specified in the

setting
This commit is contained in:
Massimiliano Assante 2022-03-15 15:29:31 +01:00
parent fa3e559e57
commit af183ee637
4 changed files with 22 additions and 7 deletions

View File

@ -5,11 +5,15 @@ All notable changes to this project will be documented in this file.
This project does not adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). This project does not adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v6.6.0-SNAPSHOT] - 2022-03-17
- Added automatic request support URL when none is specified in the setting
## [v6.5.0] - 2021-12-17 ## [v6.5.0] - 2021-12-17
Added possibility to customise feedback container URL and Label (Report an issue) and its visibility via a checkbox - Added possibility to customise feedback container URL and Label (Report an issue) and its visibility via a checkbox
## [v6.4.0-SNAPSHOT] - 2017-01-24 ## [v6.4.0-SNAPSHOT] - 2017-01-24
First release - First release

View File

@ -1,4 +1,4 @@
# gCube System - Generic Configurable Liferay 6.2 Communiyty Edition GA6 Theme # gCube System - Generic Configurable Liferay 6.2 Community Edition GA6 Theme
## Structure of the project ## Structure of the project

View File

@ -11,7 +11,7 @@
<artifactId>generic-configurable-theme</artifactId> <artifactId>generic-configurable-theme</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>generic-configurable-theme Theme</name> <name>generic-configurable-theme Theme</name>
<version>6.5.0</version> <version>6.6.0-SNAPSHOT</version>
<description> <description>
D4Science Generic Configurable Liferay Theme D4Science Generic Configurable Liferay Theme
</description> </description>

View File

@ -75,12 +75,12 @@
#if ($theme.getSetting("feedback-website-url") !="") #if ($theme.getSetting("feedback-website-url") !="")
#set ($feedback-website-url = $theme.getSetting("feedback-website-url")) #set ($feedback-website-url = $theme.getSetting("feedback-website-url"))
#else #else
#set ($feedback-website-url = "https://support.d4science.org") #set ($feedback-website-url = "")
#end #end
#if ($theme.getSetting("feedback-label") !="") #if ($theme.getSetting("feedback-label") !="")
#set ($feedback-label = $theme.getSetting("feedback-label")) #set ($feedback-label = $theme.getSetting("feedback-label"))
#else #else
#set ($feedback-label = "Report an issue") #set ($feedback-label = "Request Support")
#end #end
<body class="$css_class"> <body class="$css_class">
@ -116,7 +116,18 @@ $theme.include($body_top_include)
</div> </div>
#if($is_signed_in) #if($is_signed_in)
#if ($theme.getSetting("show-feedback-label") == "true") #if ($theme.getSetting("show-feedback-label") == "true")
<div class="feedback-container"><a href="$feedback-website-url" target="_blank"><span>$feedback-label</span><a></div> <div class="feedback-container"><a id="requestSupportAnchor" target="_blank"><span>$feedback-label</span><a></div>
<script>
var supportURL = "${feedback-website-url}";
if (supportURL === "") { //if empty we use the automatic site
let hostname = location.hostname;
let remove = ".d4science.org";
let rprojectName = hostname.replace(remove, '').replaceAll('.','-');
supportURL = "https://support.d4science.org/projects/" + rprojectName + "-support/issues/new";
}
console.log(supportURL);
document.getElementById("requestSupportAnchor").setAttribute("href", supportURL);
</script>
#end #end
#end #end