Skip to content

Commit

Permalink
SAK-29538 : Help links causes 404
Browse files Browse the repository at this point in the history
I18n upgrade
  • Loading branch information
frasese committed Jun 29, 2015
1 parent 48bf977 commit faa451a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class FeedbackTool extends HttpServlet {
private SiteService siteService = null;

private final String[] DYNAMIC_PROPERTIES = { "help_tooltip", "overview", "technical_setup_instruction", "report_technical_tooltip", "short_technical_description",
"suggest_feature_tooltip", "feature_description", "technical_instruction", "error"};
"suggest_feature_tooltip", "feature_description", "technical_instruction", "error", "help_home"};

// In entitybroker you can't have slashes in IDs so we need to escape them.
public static final String FORWARD_SLASH = "FORWARD_SLASH";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ suggest_feature_label=Suggest a new feature
title=Contact us about any problems or suggestions for improvement
more=more info
overview=This page allows you to report problems with, or suggest improvements to, {0}.
help_1=If you cannot find the answer in the
help_2=Help pages
help_3= then please choose the most relevant section below to get in touch with the appropriate people.
help_home=If you cannot find the answer in the <a href="'{'helpPagesUrl'}'" target="'{'helpPagesTarget'}'" title="Click on this to view the {0} Help Site">Help pages</a> then please choose the most relevant section below to get in touch with the appropriate people.
report=Report
technical_setup_instruction=To enable technical feedback, your {0} \
administrator needs to add the 'feedback.technicalAddress' property to \
Expand All @@ -38,7 +36,7 @@ content_instruction=Use this page to report a problem or issue with this site's
<li>permission denied errors or access problems</li>\
<li>issues with dates in calendar</li>\
</ul>
technical_instruction=Assuming you cannot find the answer in the <a href=\\"/portal/help/\\" target=\\"_blank\\">{0} help pages</a>, \
technical_instruction=Assuming you cannot find the answer in the <a href="'{'helpPagesUrl'}'" target="_blank">{0} help pages</a>, \
then you may use this page to ask for support or report a technical problem. \
Examples of such queries include: \
<ul>\
Expand Down
4 changes: 1 addition & 3 deletions feedback/src/webapp/WEB-INF/templates/home.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{{translate 'overview'}}
</div>
<div id="feedback-help-wrapper" class="instruction">
<span>{{translate 'help_1'}}</span>
<a href="{{helpPagesUrl}}" target="{{helpPagesTarget}}" title="{{translate 'help_tooltip'}}">{{translate 'help_2'}}</a>
<span>{{translate 'help_3'}}</span>
<span>{{translate 'help_home' helpPagesUrl=helpPagesUrl helpPagesTarget=helpPagesTarget}}</span>
</div>
<div id="feedback-technical-setup-instruction" class="information">
{{translate 'technical_setup_instruction'}}
Expand Down
2 changes: 1 addition & 1 deletion feedback/src/webapp/WEB-INF/templates/technical.handlebars
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h2 id="feedback-title">{{translate 'title'}}</h2>
<div id="feedback-overview" class="instruction">{{translate 'technical_instruction'}}</div>
<div id="feedback-overview" class="instruction">{{translate 'technical_instruction' helpPagesUrl=helpPagesUrl}}</div>
<form id="feedback-form" action="/direct/feedback/{{siteId}}/{{url}}" method="POST">
<div id="feedback-mandatory-instruction" class="instruction">{{translate 'mandatory_instruction'}}</div>
<fieldset>
Expand Down
2 changes: 1 addition & 1 deletion feedback/src/webapp/js/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
} else if (TECHNICAL === state) {

feedback.utils.renderTemplate(state, { plugins : feedback.getPluginList(), screenWidth: screen.width, screenHeight: screen.height, oscpu: navigator.oscpu, windowWidth: window.outerWidth,
windowHeight: window.outerHeight, siteExists: feedback.siteExists, url: url, siteId: feedback.siteId, siteUpdaters: feedback.siteUpdaters, loggedIn: loggedIn, technicalToAddress: feedback.technicalToAddress, contactName: feedback.contactName }, 'feedback-content');
windowHeight: window.outerHeight, siteExists: feedback.siteExists, url: url, siteId: feedback.siteId, siteUpdaters: feedback.siteUpdaters, loggedIn: loggedIn, technicalToAddress: feedback.technicalToAddress, contactName: feedback.contactName, helpPagesUrl: feedback.helpPagesUrl }, 'feedback-content');

$(document).ready(function () {

Expand Down
11 changes: 9 additions & 2 deletions feedback/src/webapp/js/feedbackutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@
document.getElementById(output).innerHTML = template(data);
};

Handlebars.registerHelper('translate', function (key) {
return new Handlebars.SafeString(feedback.i18n[key]);
Handlebars.registerHelper('translate', function (key, options) {
var ret = feedback.i18n[key];
if(options != undefined) {
for (var prop in options.hash) {
ret = ret.replace('{'+prop+'}', options.hash[prop]);
}
}

return new Handlebars.SafeString(ret);
});

}) (jQuery);

0 comments on commit faa451a

Please sign in to comment.