Skip to content

Commit

Permalink
Merge pull request #73 from CottageLabs/feature/survey_banner
Browse files Browse the repository at this point in the history
deactivate banner until further notice
  • Loading branch information
RK206 authored Feb 13, 2025
2 parents ccc8814 + ac30ece commit b65905c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
7 changes: 5 additions & 2 deletions ui/static/js/jct.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jct.messages = {
}
};
jct.banner = {
from: new Date("2025-02-17"),
to: new Date("2025-03-22")
// from: new Date("2025-02-17"),
// to: new Date("2025-03-22")
};

// some convenience shortcuts
Expand All @@ -71,6 +71,9 @@ jct.banner_frag = (pos) => {
if (window.hasOwnProperty("JCT_WIDGET")) {
return banner;
}
if (!jct.banner.from) {
return banner;
}
let now = new Date();
if (now > jct.banner.from && now < jct.banner.to) {
banner = `<div class="col col--1of1 jct_banner_container" id="jct_banner_container_${pos}"><div id="jct_banner">${jct.getText("banner")}</div></div>`;
Expand Down
14 changes: 11 additions & 3 deletions ui/static/js/jct_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,12 @@ jct.messages = {
institution_placeholder: "By ROR or name",
no_affiliation: "No affiliation",
explain: 'Explain this result',
banner: '<a href="https://coalitions.typeform.com/JCT-survey-2025" target="_blank" rel="noopener">Make the JCT work better for you - Take our survey</a>'
banner: `<a href="https://coalitions.typeform.com/JCT-survey-2025" target="_blank" rel="noopener">
<img src="/img/icons/check_green.svg">
Make the JCT work better for you - Take our survey
<svg style="margin-left: 10px" width="16px" height="16px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill="none">
<path fill="#F47115" fill-rule="evenodd" d="M2.293 15.293a1 1 0 101.414 1.414l6-6a1 1 0 000-1.414l-6-6a1 1 0 00-1.414 1.414L7.586 10l-5.293 5.293zm8 0a1 1 0 101.414 1.414l6-6a1 1 0 000-1.414l-6-6a1 1 0 10-1.414 1.414L15.586 10l-5.293 5.293z"/>
</svg></a>`
},
fr: {
journal: "Revue",
Expand All @@ -481,8 +486,8 @@ jct.messages = {
}
};
jct.banner = {
from: new Date("2025-02-17"),
to: new Date("2025-03-22")
// from: new Date("2025-02-17"),
// to: new Date("2025-03-22")
};

// some convenience shortcuts
Expand All @@ -498,6 +503,9 @@ jct.banner_frag = (pos) => {
if (window.hasOwnProperty("JCT_WIDGET")) {
return banner;
}
if (!jct.banner.from) {
return banner;
}
let now = new Date();
if (now > jct.banner.from && now < jct.banner.to) {
banner = `<div class="col col--1of1 jct_banner_container" id="jct_banner_container_${pos}"><div id="jct_banner">${jct.getText("banner")}</div></div>`;
Expand Down

0 comments on commit b65905c

Please sign in to comment.