mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
uservoice feedback
This commit is contained in:
@@ -33,6 +33,8 @@ public class ApplicationSettings extends AbstractModel {
|
||||
private String smtpUserName;
|
||||
private String smtpPassword;
|
||||
|
||||
private boolean feedbackButton = true;
|
||||
|
||||
@Column(length = 255)
|
||||
private String announcement;
|
||||
|
||||
@@ -133,4 +135,12 @@ public class ApplicationSettings extends AbstractModel {
|
||||
this.announcement = announcement;
|
||||
}
|
||||
|
||||
public boolean isFeedbackButton() {
|
||||
return feedbackButton;
|
||||
}
|
||||
|
||||
public void setFeedbackButton(boolean feedbackButton) {
|
||||
this.feedbackButton = feedbackButton;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,5 +8,24 @@
|
||||
<body>
|
||||
<wicket:child />
|
||||
<wicket:container wicket:id="footer-container"/>
|
||||
<wicket:container wicket:id="uservoice">
|
||||
<script>(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/XYpTZZteqS4lHvgrTXeA.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})()</script>
|
||||
<script>
|
||||
UserVoice = window.UserVoice || [];
|
||||
UserVoice.push(['showTab', 'classic_widget', {
|
||||
mode: 'full',
|
||||
default_mode: 'feedback',
|
||||
primary_color: '#000',
|
||||
link_color: '#007dbf',
|
||||
forum_id: 204509,
|
||||
support_tab_name: 'Contact',
|
||||
feedback_tab_name: 'Feedback',
|
||||
tab_label: 'Feedback',
|
||||
tab_color: '#7e72db',
|
||||
tab_position: 'bottom-right',
|
||||
tab_inverted: false
|
||||
}]);
|
||||
</script>
|
||||
</wicket:container>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.apache.wicket.markup.head.CssHeaderItem;
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
|
||||
import org.apache.wicket.markup.head.filter.HeaderResponseContainer;
|
||||
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||
import org.apache.wicket.markup.html.WebPage;
|
||||
|
||||
import com.commafeed.backend.dao.FeedCategoryDAO;
|
||||
@@ -55,8 +56,18 @@ public abstract class BasePage extends WebPage {
|
||||
@Inject
|
||||
ApplicationSettingsService applicationSettingsService;
|
||||
|
||||
private ApplicationSettings settings;
|
||||
|
||||
public BasePage() {
|
||||
settings = applicationSettingsService.get();
|
||||
add(new HeaderResponseContainer("footer-container", "footer-container"));
|
||||
add(new WebMarkupContainer("uservoice") {
|
||||
@Override
|
||||
protected void onConfigure() {
|
||||
super.onConfigure();
|
||||
setVisibilityAllowed(settings.isFeedbackButton());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,11 +89,11 @@ public abstract class BasePage extends WebPage {
|
||||
response.render(CssHeaderItem.forUrl("css/app.css"));
|
||||
}
|
||||
|
||||
final ApplicationSettings settings = applicationSettingsService.get();
|
||||
if (StringUtils.isNotBlank(settings.getGoogleAnalyticsTrackingCode())) {
|
||||
Map<String, Object> vars = Maps.newHashMap();
|
||||
vars.put("trackingCode", settings.getGoogleAnalyticsTrackingCode());
|
||||
WicketUtils.loadJS(response, BasePage.class, "analytics", vars);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user