* VRFS-2913 - allow /client to be accessed without being logged in
This commit is contained in:
parent
631491c4a2
commit
d6df68a8ff
|
|
@ -105,9 +105,11 @@
|
|||
}
|
||||
|
||||
function renderAccount() {
|
||||
app.user().done(function() {
|
||||
rest.getUserDetail()
|
||||
.done(populateAccount)
|
||||
.error(app.ajaxError)
|
||||
.done(populateAccount)
|
||||
.error(app.ajaxError)
|
||||
})
|
||||
}
|
||||
|
||||
function navToScheduledSessions() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
(function(context,$) {
|
||||
|
||||
"use strict";
|
||||
context.JK = context.JK || {};
|
||||
context.JK.LoginRequiredDialog = function(app) {
|
||||
var logger = context.JK.logger;
|
||||
var $dialog = null;
|
||||
var dialogId = 'login-required-dialog';
|
||||
|
||||
function beforeShow(data) {
|
||||
}
|
||||
|
||||
function afterShow(data) {
|
||||
}
|
||||
|
||||
function afterHide() {
|
||||
}
|
||||
|
||||
function events() {
|
||||
$dialog.find('.go-to-jamtracks').click(function() {
|
||||
app.layout.closeDialog(dialogId)
|
||||
context.location.href = $(this).attr('href')
|
||||
})
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
|
||||
var dialogBindings = {
|
||||
'beforeShow' : beforeShow,
|
||||
'afterShow' : afterShow,
|
||||
'afterHide': afterHide
|
||||
};
|
||||
|
||||
app.bindDialog(dialogId, dialogBindings);
|
||||
|
||||
$dialog = $('#' + dialogId);
|
||||
|
||||
events();
|
||||
}
|
||||
|
||||
this.initialize = initialize;
|
||||
};
|
||||
|
||||
return this;
|
||||
})(window,jQuery);
|
||||
|
|
@ -127,6 +127,9 @@
|
|||
|
||||
var clientPreferencesDialog = new JK.ClientPreferencesDialog(app);
|
||||
clientPreferencesDialog.initialize();
|
||||
|
||||
var loginRequiredDialog = new JK.LoginRequiredDialog(app);
|
||||
loginRequiredDialog.initialize();
|
||||
}
|
||||
|
||||
// wait 10 seconds
|
||||
|
|
|
|||
|
|
@ -57,9 +57,11 @@
|
|||
})
|
||||
.fail(function(xhr, textStatus, errorMessage) {
|
||||
if (xhr.status === 404) {
|
||||
logger.warn("unable to list active sessions (404)")
|
||||
// swallow 404
|
||||
}
|
||||
else {
|
||||
logger.warn("unable to list active sessions")
|
||||
app.ajaxError(xhr, textStatus, errorMessage);
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
context.JK.HomeScreen = function(app) {
|
||||
var logger = context.JK.logger;
|
||||
var isFtueComplete = false;
|
||||
var $screen = null;
|
||||
|
||||
function beforeShow(data) {
|
||||
}
|
||||
|
|
@ -86,9 +87,20 @@
|
|||
var screenBindings = { 'beforeShow': beforeShow };
|
||||
app.bindScreen('home', screenBindings);
|
||||
events();
|
||||
$screen = $('.screen[layout-id="home"]')
|
||||
|
||||
$('.profile').on('click', function() {
|
||||
$screen.find('.profile').on('click', function() {
|
||||
var $destination = $('[layout-id="profile"]');
|
||||
if(!context.JK.currentUserId && !$destination.is('.no-login-required')) {
|
||||
// if there is no user and login is required, then stop user from clicknig through
|
||||
app.layout.showDialog('login-required-dialog')
|
||||
}
|
||||
else
|
||||
{
|
||||
context.location = '/client#/profile/' + context.JK.currentUserId;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class JamTrackUtils
|
|||
@rest.getShoppingCarts().done(this.displayCartIcon)
|
||||
|
||||
displayCartIcon: (carts) =>
|
||||
cartLink = $("a[href='" + "/client#/shoppingCart" + "']")
|
||||
cartLink = $("#header-shopping-cart")
|
||||
if carts.length > 0
|
||||
cartLink.removeClass("hidden")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -132,6 +132,9 @@
|
|||
logger.error("Unexpected ajax error: " + textStatus + ", msg:" + errorMessage);
|
||||
app.notify({title: "Oops!", text: "What you were looking for is gone now."});
|
||||
}
|
||||
else if(jqXHR.status === 403) {
|
||||
logger.debug("not logged in");
|
||||
}
|
||||
else if (jqXHR.status === 422) {
|
||||
logger.error("Unexpected ajax error: " + textStatus + ", msg: " + errorMessage + ", response: " + jqXHR.responseText);
|
||||
// present a nicer message
|
||||
|
|
@ -282,20 +285,37 @@
|
|||
|
||||
var hash = context.location.hash;
|
||||
|
||||
var screen = 'home'
|
||||
try {
|
||||
context.RouteMap.parse(hash);
|
||||
var location = context.RouteMap.parse(hash);
|
||||
screen = location.page.substring(1); // remove leading slash
|
||||
}
|
||||
catch (e) {
|
||||
logger.debug("ignoring bogus screen name: %o", hash)
|
||||
hash = null;
|
||||
}
|
||||
|
||||
var url = '/client#/home';
|
||||
|
||||
var $destination = $('[layout-id="' + screen + '"]');
|
||||
|
||||
if(!context.JK.currentUserId && !$destination.is('.no-login-required')) {
|
||||
logger.debug("not logged in so redirected to login from screen: " + screen)
|
||||
var redirectPath= '?redirect-to=' + encodeURIComponent(JK.locationPath());
|
||||
if(gon.isNativeClient) {
|
||||
window.location.href = '/signin' + redirectPath;
|
||||
}
|
||||
else {
|
||||
window.location.href = '/' + redirectPath;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var url = '/client#/' + screen;
|
||||
if (hash) {
|
||||
url = hash;
|
||||
}
|
||||
|
||||
logger.debug("Changing screen to " + url);
|
||||
logger.debug("jamkazam: Changing screen to " + url + " (hash=" + hash + ")") ;
|
||||
context.location = url;
|
||||
}
|
||||
|
||||
|
|
@ -377,7 +397,11 @@
|
|||
app.notify({title: "Unable to Load User", text: "You should reload the page."})
|
||||
});
|
||||
}
|
||||
} // if userDeferred
|
||||
}
|
||||
else {
|
||||
userDeferred = new $.Deferred();
|
||||
userDeferred.reject('not_logged_in');
|
||||
}
|
||||
|
||||
$(document).triggerHandler('JAMKAZAM_READY', {app:app})
|
||||
|
||||
|
|
|
|||
|
|
@ -415,8 +415,15 @@
|
|||
}
|
||||
|
||||
var destination = $(evt.currentTarget).attr('layout-link');
|
||||
var destinationType = $('[layout-id="' + destination + '"]').attr("layout");
|
||||
var $destination = $('[layout-id="' + destination + '"]');
|
||||
|
||||
var destinationType = $destination.attr("layout");
|
||||
if (destinationType === "screen") {
|
||||
if(!context.JK.currentUserId && !$destination.is('.no-login-required')) {
|
||||
// there is no user, and this item does not support 'no-login', so warn user
|
||||
showDialog('login-required-dialog');
|
||||
return;
|
||||
}
|
||||
context.location = '/client#/' + destination;
|
||||
} else if (destinationType === "dialog") {
|
||||
showDialog(destination);
|
||||
|
|
@ -548,7 +555,7 @@
|
|||
var accepted = screenEvent(previousScreen, 'beforeHide', data);
|
||||
if(accepted === false) return;
|
||||
|
||||
logger.debug("Changing screen to " + currentScreen);
|
||||
logger.debug("layout: changing screen to " + currentScreen);
|
||||
|
||||
$(document).triggerHandler(EVENTS.SCREEN_CHANGED, {previousScreen: previousScreen, newScreen: currentScreen})
|
||||
|
||||
|
|
@ -695,6 +702,7 @@
|
|||
return null;
|
||||
}
|
||||
logger.debug("opening dialog: " + dialog)
|
||||
|
||||
var $overlay = $('.dialog-overlay')
|
||||
|
||||
if (opts.sizeOverlayToContent) {
|
||||
|
|
@ -727,6 +735,12 @@
|
|||
|
||||
function panelHeaderClicked(evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
if(!context.JK.currentUserId) {
|
||||
showDialog('login-required-dialog');
|
||||
return false;
|
||||
}
|
||||
|
||||
expandedPanel = $(evt.currentTarget).closest('[layout="panel"]').attr("layout-id");
|
||||
layout();
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@
|
|||
})
|
||||
.fail(function() {
|
||||
isLoading = false;
|
||||
app.ajaxError();
|
||||
app.ajaxError(arguments);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -1375,7 +1375,9 @@
|
|||
|
||||
events();
|
||||
|
||||
populate();
|
||||
app.user().done(function(){
|
||||
populate();
|
||||
})
|
||||
};
|
||||
|
||||
this.initialize = initialize;
|
||||
|
|
|
|||
|
|
@ -1054,7 +1054,7 @@
|
|||
|
||||
context.JK.GenreSelectorHelper.render('#create-session-genre');
|
||||
|
||||
inviteMusiciansUtil.loadFriends();
|
||||
//inviteMusiciansUtil.loadFriends();
|
||||
|
||||
context.JK.dropdown($screen.find('#session-musician-access'));
|
||||
context.JK.dropdown($screen.find('#session-fans-access'));
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
var notificationPanel = null;
|
||||
var chatPanel = null;
|
||||
var me = null;
|
||||
var $sidebar = null;
|
||||
|
||||
function initializeSearchPanel() {
|
||||
$('#search_text_type').change(function() {
|
||||
|
|
@ -39,7 +40,9 @@
|
|||
function initializeFriendsPanel() {
|
||||
|
||||
$('#sidebar-search-header').hide();
|
||||
refreshFriends();
|
||||
app.user().done(function() {
|
||||
refreshFriends();
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -406,11 +409,24 @@
|
|||
me = this;
|
||||
invitationDialog = invitationDialogInstance;
|
||||
textMessageDialog = textMessageDialogInstance;
|
||||
events();
|
||||
initializeSearchPanel();
|
||||
initializeFriendsPanel();
|
||||
initializeChatPanel();
|
||||
initializeNotificationsPanel();
|
||||
$sidebar = $('#sidebar-div')
|
||||
app.user()
|
||||
.done(function() {
|
||||
events();
|
||||
initializeSearchPanel();
|
||||
initializeFriendsPanel();
|
||||
initializeChatPanel();
|
||||
initializeNotificationsPanel();
|
||||
})
|
||||
.fail(function(arg1) {
|
||||
if(arg1 == "not_logged_in") {
|
||||
$('#search-input').attr('disabled', 'disabled')
|
||||
$('.sidebar .invite-friend-row').click(function() {
|
||||
app.layout.showDialog('login-required-dialog')
|
||||
});
|
||||
$sidebar.addClass('not-logged-in')
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
this.refreshFriends = refreshFriends;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@
|
|||
background-repeat: no-repeat;
|
||||
background-position: bottom left;
|
||||
border: 1px solid $translucent1;
|
||||
|
||||
&.not-logged-in {
|
||||
opacity:0.6;
|
||||
}
|
||||
}
|
||||
.homecard.createsession {
|
||||
background-image: url(/assets/content/bkg_home_create.jpg);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@
|
|||
|
||||
background-color: $ColorElementPrimary;
|
||||
|
||||
&.not-logged-in {
|
||||
opacity:0.6;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
#login-required-dialog {
|
||||
|
||||
width:455px;
|
||||
|
||||
p {
|
||||
margin:0 0 20px 0;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
margin-top:20px;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
class ApiGenresController < ApiController
|
||||
|
||||
# have to be signed in currently to see this screen
|
||||
before_filter :api_signed_in_user
|
||||
|
||||
respond_to :json
|
||||
|
||||
def index
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
class ApiInstrumentsController < ApiController
|
||||
|
||||
# have to be signed in currently to see this screen
|
||||
before_filter :api_signed_in_user
|
||||
|
||||
respond_to :json
|
||||
|
||||
def index
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@ module SessionsHelper
|
|||
!current_user.nil?
|
||||
end
|
||||
|
||||
def logged_in_not_logged_in_class
|
||||
signed_in? ? "logged-in" : "not-logged-in"
|
||||
end
|
||||
|
||||
def current_user=(user)
|
||||
@current_user = user
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
|
||||
<!-- shopping cart -->
|
||||
<% if Rails.application.config.jam_tracks_available %>
|
||||
<a href="/client#/shoppingCart" class="header-shopping-cart">
|
||||
<img id="header-shopping-cart" src="/assets/content/shopping-cart.png"/>
|
||||
<a id="header-shopping-cart" href="/client#/shoppingCart" class="header-shopping-cart hidden">
|
||||
<img src="/assets/content/shopping-cart.png"/>
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.screen layout="screen" layout-id="home"
|
||||
.screen.no-login-required layout="screen" layout-id="home"
|
||||
-if Rails.configuration.show_jamblaster_notice
|
||||
#jamblaster-notice
|
||||
a href='https://www.youtube.com/watch?v=gAJAIHMyois' rel="external"
|
||||
|
|
@ -15,23 +15,23 @@
|
|||
/ individual spells span those spaces
|
||||
-if @nativeClient
|
||||
.grid layout-grid="2x12"
|
||||
.homecard.createsession layout-grid-columns="4" layout-grid-position="0,0" layout-grid-rows="1" layout-link="createSession" type="createSession"
|
||||
.homecard.createsession layout-grid-columns="4" layout-grid-position="0,0" layout-grid-rows="1" layout-link="createSession" type="createSession" class="#{logged_in_not_logged_in_class}"
|
||||
h2 create session
|
||||
.homebox-info
|
||||
/! 4 friends online, 2 currently in sessions
|
||||
.homecard.findsession layout-grid-columns="4" layout-grid-position="4,0" layout-grid-rows="1" layout-link="findSession" type="findSession"
|
||||
.homecard.findsession layout-grid-columns="4" layout-grid-position="4,0" layout-grid-rows="1" layout-link="findSession" type="findSession" class="#{logged_in_not_logged_in_class}"
|
||||
h2 find session
|
||||
.homebox-info
|
||||
/! 1 session invitation, 19 public sessions active
|
||||
.homecard.feed layout-grid-columns="4" layout-grid-position="8,0" layout-grid-rows="1" layout-link="feed"
|
||||
.homecard.feed layout-grid-columns="4" layout-grid-position="8,0" layout-grid-rows="1" layout-link="feed" class="#{logged_in_not_logged_in_class}"
|
||||
h2 feed
|
||||
.homebox-info
|
||||
/! 4 friends online, 2 currently in sessions
|
||||
.homecard.musicians layout-grid-columns=small_tile_size layout-grid-position=column_positions[0] layout-grid-rows="1" layout-link="musicians"
|
||||
.homecard.musicians layout-grid-columns=small_tile_size layout-grid-position=column_positions[0] layout-grid-rows="1" layout-link="musicians" class="#{logged_in_not_logged_in_class}"
|
||||
h2 musicians
|
||||
.homebox-info
|
||||
/! 5 followers, 3 following
|
||||
.homecard.bands layout-grid-columns=small_tile_size layout-grid-position=column_positions[1] layout-grid-rows="1" layout-link="bands"
|
||||
.homecard.bands layout-grid-columns=small_tile_size layout-grid-position=column_positions[1] layout-grid-rows="1" layout-link="bands" class="#{logged_in_not_logged_in_class}"
|
||||
h2 bands
|
||||
.homebox-info
|
||||
/! 1 session invitation, 19 public sessions active
|
||||
|
|
@ -40,33 +40,33 @@
|
|||
h2 jamtracks
|
||||
.homebox-info
|
||||
/! 5 followers, 3 following
|
||||
.homecard.profile layout-grid-columns=small_tile_size layout-grid-position=column_positions[3] layout-grid-rows="1"
|
||||
.homecard.profile layout-grid-columns=small_tile_size layout-grid-position=column_positions[3] layout-grid-rows="1" class="#{logged_in_not_logged_in_class}"
|
||||
h2 profile
|
||||
.homebox-info
|
||||
/! 5 followers, 3 following
|
||||
.homecard.account layout-grid-columns=small_tile_size layout-grid-position=column_positions[4] layout-grid-rows="1" layout-link="account"
|
||||
.homecard.account layout-grid-columns=small_tile_size layout-grid-position=column_positions[4] layout-grid-rows="1" layout-link="account" class="#{logged_in_not_logged_in_class}"
|
||||
h2 account
|
||||
.homebox-info
|
||||
/! free service level
|
||||
-else
|
||||
.grid layout-grid="2x12"
|
||||
.homecard.createsession layout-grid-columns="4" layout-grid-position="0,0" layout-grid-rows="1" layout-link="createSession" type="createSession"
|
||||
.homecard.createsession layout-grid-columns="4" layout-grid-position="0,0" layout-grid-rows="1" layout-link="createSession" type="createSession" class="#{logged_in_not_logged_in_class}"
|
||||
h2 create session
|
||||
.homebox-info
|
||||
/! 4 friends online, 2 currently in sessions
|
||||
.homecard.findsession layout-grid-columns="4" layout-grid-position="4,0" layout-grid-rows="1" layout-link="findSession" type="findSession"
|
||||
.homecard.findsession layout-grid-columns="4" layout-grid-position="4,0" layout-grid-rows="1" layout-link="findSession" type="findSession" class="#{logged_in_not_logged_in_class}"
|
||||
h2 find session
|
||||
.homebox-info
|
||||
/! 1 session invitation, 19 public sessions active
|
||||
.homecard.feed layout-grid-columns="4" layout-grid-position="8,0" layout-grid-rows="1" layout-link="feed"
|
||||
.homecard.feed layout-grid-columns="4" layout-grid-position="8,0" layout-grid-rows="1" layout-link="feed" class="#{logged_in_not_logged_in_class}"
|
||||
h2 feed
|
||||
.homebox-info
|
||||
/! 4 friends online, 2 currently in sessions
|
||||
.homecard.musicians layout-grid-columns=small_tile_size layout-grid-position=column_positions[0] layout-grid-rows="1" layout-link="musicians"
|
||||
.homecard.musicians layout-grid-columns=small_tile_size layout-grid-position=column_positions[0] layout-grid-rows="1" layout-link="musicians" class="#{logged_in_not_logged_in_class}"
|
||||
h2 musicians
|
||||
.homebox-info
|
||||
/! 5 followers, 3 following
|
||||
.homecard.bands layout-grid-columns=small_tile_size layout-grid-position=column_positions[1] layout-grid-rows="1" layout-link="bands"
|
||||
.homecard.bands layout-grid-columns=small_tile_size layout-grid-position=column_positions[1] layout-grid-rows="1" layout-link="bands" class="#{logged_in_not_logged_in_class}"
|
||||
h2 bands
|
||||
.homebox-info
|
||||
-if jamtracks
|
||||
|
|
@ -75,11 +75,11 @@
|
|||
h2 jamtracks
|
||||
.homebox-info
|
||||
/! 5 followers, 3 following
|
||||
.homecard.profile layout-grid-columns=small_tile_size layout-grid-position=column_positions[3] layout-grid-rows="1"
|
||||
.homecard.profile layout-grid-columns=small_tile_size layout-grid-position=column_positions[3] layout-grid-rows="1" class="#{logged_in_not_logged_in_class}"
|
||||
h2 profile
|
||||
.homebox-info
|
||||
/! 5 followers, 3 following
|
||||
.homecard.account layout-grid-columns=small_tile_size layout-grid-position=column_positions[4] layout-grid-rows="1" layout-link="account"
|
||||
.homecard.account layout-grid-columns=small_tile_size layout-grid-position=column_positions[4] layout-grid-rows="1" layout-link="account" class="#{logged_in_not_logged_in_class}"
|
||||
h2 account
|
||||
.homebox-info
|
||||
/! free service level
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%div{ layout: 'screen', :'layout-id' => 'jamtrack', id: 'jamtrackScreen', :class => 'screen secondary'}
|
||||
%div{ layout: 'screen', :'layout-id' => 'jamtrack', id: 'jamtrackScreen', :class => 'screen secondary no-login-required'}
|
||||
.content
|
||||
.content-head
|
||||
.content-icon= image_tag("content/icon_jamtracks.png", {:height => 19, :width => 19})
|
||||
|
|
|
|||
|
|
@ -108,20 +108,7 @@
|
|||
JK.currentUserName = null;
|
||||
JK.currentUserMusician = null;
|
||||
JK.currentUserAdmin = false;
|
||||
|
||||
// you need to be logged in to use this part of the interface.
|
||||
// save original URL, and redirect to the home page
|
||||
logger.debug("redirecting back to / because not logged in")
|
||||
|
||||
var redirectPath= '?redirect-to=' + encodeURIComponent(JK.locationPath());
|
||||
if(gon.isNativeClient) {
|
||||
window.location.href = '/signin' + redirectPath;
|
||||
}
|
||||
else {
|
||||
window.location.href = '/' + redirectPath;
|
||||
}
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
// Some things can't be initialized until we're connected. Put them here.
|
||||
|
|
@ -288,6 +275,8 @@
|
|||
JK.ClientUpdateInstance.check()
|
||||
|
||||
JK.app.initialRouting();
|
||||
|
||||
|
||||
JK.hideCurtain(300);
|
||||
}
|
||||
|
||||
|
|
@ -303,10 +292,10 @@
|
|||
|
||||
JK.RecordingUtils.init();
|
||||
|
||||
// Let's get things rolling...
|
||||
if (JK.currentUserId) {
|
||||
JK.app.initialize();
|
||||
|
||||
JK.app.initialize();
|
||||
// Let's get things rolling...
|
||||
if (JK.currentUserId) {
|
||||
|
||||
JK.JamServer.registerMessageCallback(JK.MessageType.CLIENT_UPDATE, function(header, payload) {
|
||||
// do a client update early check upon initialization
|
||||
|
|
@ -314,7 +303,7 @@
|
|||
});
|
||||
|
||||
|
||||
JK.TickDuration('.feed-entry.music-session-history-entry .inprogress .tick-duration');
|
||||
JK.TickDuration('.feed-entry.music-session-history-entry .inprogress .tick-duration');
|
||||
|
||||
JK.JamServer.connect() // singleton here defined in JamServer.js
|
||||
.done(function() {
|
||||
|
|
@ -327,6 +316,9 @@
|
|||
// this ensures that there is always a CurrentSessionModel, even if it's for a non-active session
|
||||
JK.CurrentSessionModel = new JK.SessionModel(JK.app, JK.JamServer, window.jamClient, null);
|
||||
}
|
||||
else {
|
||||
_initAfterConnect(false);
|
||||
}
|
||||
|
||||
JK.bindHoverEvents();
|
||||
})
|
||||
|
|
|
|||
|
|
@ -34,3 +34,4 @@
|
|||
= render 'dialogs/adjustGearSpeedDialog'
|
||||
= render 'dialogs/openJamTrackDialog'
|
||||
= render 'dialogs/openBackingTrackDialog'
|
||||
= render 'dialogs/loginRequiredDialog'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
.dialog.dialog-overlay-sm layout='dialog' layout-id='login-required-dialog' id='login-required-dialog'
|
||||
.content-head
|
||||
= image_tag "content/icon_alert.png", {:width => 24, :height => 24, :class => 'content-icon' }
|
||||
h1 Login Required
|
||||
|
||||
.dialog-inner
|
||||
p
|
||||
a href="/signup" Sign Up
|
||||
| or
|
||||
a href="/signin" Sign In
|
||||
| to access most functionality on this page.
|
||||
p
|
||||
| However, you can browse for
|
||||
a class="go-to-jamtracks" href='/client#/jamtrack' JamTracks
|
||||
| without logging in.
|
||||
br
|
||||
.clearall
|
||||
.buttons
|
||||
.right
|
||||
a.button-orange class='btnClose' layout-action='close' CLOSE
|
||||
|
|
@ -60,19 +60,6 @@ describe ApiJamTracksController do
|
|||
json["next"].should be_nil
|
||||
json["jamtracks"].length.should == 2
|
||||
end
|
||||
|
||||
it "lists owned tracks" do
|
||||
get :downloads
|
||||
response.should be_success
|
||||
json = JSON.parse(response.body)
|
||||
json['downloads'].should have(0).items
|
||||
|
||||
right = JamTrackRight.create(:user=>@user, :jam_track=>@jam_track)
|
||||
get :downloads
|
||||
response.should be_success
|
||||
json = JSON.parse(response.body)
|
||||
json['downloads'].should have(1).items
|
||||
end
|
||||
|
||||
it "finds a download" do
|
||||
#get "/download/#{right.id}/"
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ describe "Authentication", :js => true, :type => :feature, :capybara_feature =>
|
|||
find('.userinfo .sign-out a').trigger(:click)
|
||||
|
||||
end
|
||||
it { find('h1', text: 'Play music together over the Internet as if in the same room') }
|
||||
# after logging out, we keep you at /client
|
||||
it { find('#profile a.signin', text: 'Sign Up') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ describe "In a Session", :js => true, :type => :feature, :capybara_feature => tr
|
|||
sign_in_poltergeist finder
|
||||
visit "/client#/findSession"
|
||||
expect(page).to have_selector('#no-active-sessions') # verify private session is not found
|
||||
sign_out_poltergeist(validate: true)
|
||||
#sign_out_poltergeist(validate: true)
|
||||
visit "/"
|
||||
should_be_at_root
|
||||
end
|
||||
in_client(user) do
|
||||
set_session_access :public
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ describe "Profile Menu", :js => true, :type => :feature, :capybara_feature => tr
|
|||
click_link 'Sign Out'
|
||||
end
|
||||
|
||||
it { should_be_at_root }
|
||||
it { should_be_at_logged_out_client }
|
||||
end
|
||||
|
||||
describe "Download App link" do
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ describe "signin" do
|
|||
click_button "SIGN IN"
|
||||
end
|
||||
|
||||
find('h1', text: 'Play music together over the Internet as if in the same room')
|
||||
should_be_at_logged_out_client
|
||||
end
|
||||
|
||||
# if a cookie with the default domain is found with another, delete the one with the default domain
|
||||
|
|
@ -201,7 +201,7 @@ describe "signin" do
|
|||
click_button "SIGN IN"
|
||||
end
|
||||
|
||||
find('h1', text: 'Play music together over the Internet as if in the same room')
|
||||
should_be_at_logged_out_client
|
||||
|
||||
delete_called.should be_true
|
||||
end
|
||||
|
|
@ -211,6 +211,23 @@ describe "signin" do
|
|||
sign_in_poltergeist(user)
|
||||
|
||||
sign_out_poltergeist
|
||||
|
||||
wait_until_curtain_gone
|
||||
|
||||
# musicians homecard should be disabled
|
||||
find('.homecard.musicians.not-logged-in').trigger(:click)
|
||||
find('h1', text: 'Login Required')
|
||||
find('.btnClose').trigger(:click)
|
||||
|
||||
# profile homecard should be disabled (this one is handled in homeScreen.js instead of in layout.js)
|
||||
find('.homecard.profile.not-logged-in').trigger(:click)
|
||||
find('h1', text: 'Login Required')
|
||||
find('.btnClose').trigger(:click)
|
||||
|
||||
# sidebar should be disabled
|
||||
find('[layout-id="panelSearch"] [layout-panel="expanded"] [layout-panel="header"]').trigger(:click)
|
||||
find('h1', text: 'Login Required')
|
||||
find('.btnClose').trigger(:click)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ end
|
|||
def sign_out_poltergeist(options = {})
|
||||
open_user_dropdown
|
||||
click_link 'Sign Out'
|
||||
should_be_at_signin if options[:validate]
|
||||
should_be_at_logged_out_client if options[:validate]
|
||||
end
|
||||
|
||||
def open_user_dropdown
|
||||
|
|
@ -221,6 +221,11 @@ def should_be_at_signin
|
|||
find('h1', text: 'sign in or register')
|
||||
end
|
||||
|
||||
def should_be_at_logged_out_client
|
||||
find('#profile a.signin', text: 'Sign Up')
|
||||
find('.musicians.not-logged-in')
|
||||
end
|
||||
|
||||
def leave_music_session_sleep_delay
|
||||
# add a buffer to ensure WSG has enough time to expire
|
||||
sleep_dur = (Rails.application.config.websocket_gateway_connect_time_stale_browser +
|
||||
|
|
|
|||
Loading…
Reference in New Issue