forked from Archives/Athou_commafeed
uservoice feedback
This commit is contained in:
@@ -33,6 +33,8 @@ public class ApplicationSettings extends AbstractModel {
|
|||||||
private String smtpUserName;
|
private String smtpUserName;
|
||||||
private String smtpPassword;
|
private String smtpPassword;
|
||||||
|
|
||||||
|
private boolean feedbackButton = true;
|
||||||
|
|
||||||
@Column(length = 255)
|
@Column(length = 255)
|
||||||
private String announcement;
|
private String announcement;
|
||||||
|
|
||||||
@@ -133,4 +135,12 @@ public class ApplicationSettings extends AbstractModel {
|
|||||||
this.announcement = announcement;
|
this.announcement = announcement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFeedbackButton() {
|
||||||
|
return feedbackButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFeedbackButton(boolean feedbackButton) {
|
||||||
|
this.feedbackButton = feedbackButton;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,24 @@
|
|||||||
<body>
|
<body>
|
||||||
<wicket:child />
|
<wicket:child />
|
||||||
<wicket:container wicket:id="footer-container"/>
|
<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>
|
</body>
|
||||||
</html>
|
</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.IHeaderResponse;
|
||||||
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
|
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
|
||||||
import org.apache.wicket.markup.head.filter.HeaderResponseContainer;
|
import org.apache.wicket.markup.head.filter.HeaderResponseContainer;
|
||||||
|
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||||
import org.apache.wicket.markup.html.WebPage;
|
import org.apache.wicket.markup.html.WebPage;
|
||||||
|
|
||||||
import com.commafeed.backend.dao.FeedCategoryDAO;
|
import com.commafeed.backend.dao.FeedCategoryDAO;
|
||||||
@@ -55,8 +56,18 @@ public abstract class BasePage extends WebPage {
|
|||||||
@Inject
|
@Inject
|
||||||
ApplicationSettingsService applicationSettingsService;
|
ApplicationSettingsService applicationSettingsService;
|
||||||
|
|
||||||
|
private ApplicationSettings settings;
|
||||||
|
|
||||||
public BasePage() {
|
public BasePage() {
|
||||||
|
settings = applicationSettingsService.get();
|
||||||
add(new HeaderResponseContainer("footer-container", "footer-container"));
|
add(new HeaderResponseContainer("footer-container", "footer-container"));
|
||||||
|
add(new WebMarkupContainer("uservoice") {
|
||||||
|
@Override
|
||||||
|
protected void onConfigure() {
|
||||||
|
super.onConfigure();
|
||||||
|
setVisibilityAllowed(settings.isFeedbackButton());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -78,11 +89,11 @@ public abstract class BasePage extends WebPage {
|
|||||||
response.render(CssHeaderItem.forUrl("css/app.css"));
|
response.render(CssHeaderItem.forUrl("css/app.css"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final ApplicationSettings settings = applicationSettingsService.get();
|
|
||||||
if (StringUtils.isNotBlank(settings.getGoogleAnalyticsTrackingCode())) {
|
if (StringUtils.isNotBlank(settings.getGoogleAnalyticsTrackingCode())) {
|
||||||
Map<String, Object> vars = Maps.newHashMap();
|
Map<String, Object> vars = Maps.newHashMap();
|
||||||
vars.put("trackingCode", settings.getGoogleAnalyticsTrackingCode());
|
vars.put("trackingCode", settings.getGoogleAnalyticsTrackingCode());
|
||||||
WicketUtils.loadJS(response, BasePage.class, "analytics", vars);
|
WicketUtils.loadJS(response, BasePage.class, "analytics", vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,13 @@
|
|||||||
name="allowRegistrations" ng-model="settings.allowRegistrations" />
|
name="allowRegistrations" ng-model="settings.allowRegistrations" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label" for="feedbackButton">Feedback button</label>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="checkbox" id="feedbackButton"
|
||||||
|
name="feedbackButton" ng-model="settings.feedbackButton" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="googleClientId">Google
|
<label class="control-label" for="googleClientId">Google
|
||||||
client ID</label>
|
client ID</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user