Skip to content

Commit

Permalink
changed Uservoice widget to show only when user is signed in
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianot committed Mar 8, 2014
1 parent 98c13c1 commit 92f7e97
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 31 deletions.
45 changes: 18 additions & 27 deletions app/views/shared/_uservoice.html.erb
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@
<!-- <% if user_signed_in? %>
<div id='uservoice'>
<script type="text/javascript">
var uvOptions = {};
(function() {
var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/CqU64j7S3jUTXzgbhFp9oA.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
})();
</script>
</div>
<% end %> -->

<!-- UserVoice JavaScript SDK (only needed once on a page) -->
<script>(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/CqU64j7S3jUTXzgbhFp9oA.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})()</script>

<!-- A tab to launch the Classic Widget -->
<script>
UserVoice = window.UserVoice || [];
UserVoice.push(['showTab', 'classic_widget', {
mode: 'full',
primary_color: '#70ba21',
link_color: '#1eafd7',
default_mode: 'feedback',
forum_id: 147006,
tab_label: 'Feedback & Support',
tab_color: '#70ba21',
tab_position: 'middle-right',
tab_inverted: false
}]);
</script>
<% if user_signed_in? %>
<div id='uservoice'>
<script>
UserVoice = window.UserVoice || [];
UserVoice.push(['showTab', 'classic_widget', {
mode: 'full',
primary_color: '#70ba21',
link_color: '#1eafd7',
default_mode: 'feedback',
forum_id: 147006,
tab_label: 'Feedback & Support',
tab_color: '#70ba21',
tab_position: 'middle-right',
tab_inverted: false
}]);
</script>
</div>
<% end %>
4 changes: 0 additions & 4 deletions spec/acceptance/display_uservoice_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')

feature 'display uservoice' do
pending

context 'user' do
scenario 'can see uservoice' do
Expand All @@ -17,6 +16,3 @@
end
end
end



0 comments on commit 92f7e97

Please sign in to comment.