VRFS-657 force user to accept terms when joining an existing session
This commit is contained in:
parent
0dfd122316
commit
62fb0820b0
|
|
@ -5,6 +5,7 @@
|
|||
context.JK = context.JK || {};
|
||||
context.JK.SessionList = function(app) {
|
||||
var logger = context.JK.logger;
|
||||
var termsDialog;
|
||||
var LATENCY = {
|
||||
GOOD : {description: "GOOD", style: "latency-green", min: 0.0, max: 20.0},
|
||||
MEDIUM : {description: "MEDIUM", style: "latency-yellow", min: 20.0, max: 40.0},
|
||||
|
|
@ -116,7 +117,6 @@
|
|||
latency_style: latencyStyle,
|
||||
sortScore: latencyInfo.sortScore,
|
||||
play_url: "TODO",
|
||||
join_url: "/#/session/" + session.id,
|
||||
join_link_display_style: "block" // showJoinLink ? "block" : "none"
|
||||
};
|
||||
|
||||
|
|
@ -132,10 +132,26 @@
|
|||
}
|
||||
});
|
||||
if (!insertedEarly) {
|
||||
return $(tbGroup).append(row);
|
||||
$(tbGroup).append(row);
|
||||
|
||||
// wire up the Join Link to the T&Cs dialog
|
||||
var $parentRow = $('tr[id=' + session.id + ']', tbGroup);
|
||||
$('#join-link', $parentRow).click(function(evt) {
|
||||
openTerms(session.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function openTerms(sessionId) {
|
||||
termsDialog = new context.JK.TermsDialog(app, sessionId, onTermsAccepted);
|
||||
termsDialog.initialize();
|
||||
app.layout.showDialog('terms');
|
||||
}
|
||||
|
||||
function onTermsAccepted(sessionId) {
|
||||
context.location = '#/session/' + sessionId;
|
||||
}
|
||||
|
||||
function events() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
(function(context,$) {
|
||||
|
||||
"use strict";
|
||||
|
||||
context.JK = context.JK || {};
|
||||
context.JK.TermsDialog = function(app, sessionId, callback) {
|
||||
|
||||
var logger = context.JK.logger;
|
||||
|
||||
function events() {
|
||||
$('#btn-accept-terms').click(function(evt) {
|
||||
callback(sessionId);
|
||||
});
|
||||
|
||||
$('#btn-cancel-terms').click(function(evt) {
|
||||
app.layout.closeDialog('terms');
|
||||
});
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
events();
|
||||
}
|
||||
|
||||
this.initialize = initialize;
|
||||
|
||||
};
|
||||
})(window,jQuery);
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
</a>
|
||||
</td>
|
||||
<td class="noborder" style="text-align:center; vertical-align:middle;">
|
||||
<a id="join-link" href="{join_url}" style="display:{join_link_display_style};">
|
||||
<a id="join-link" style="display:{join_link_display_style};">
|
||||
<%= image_tag "content/icon_join.png", :size => "19x22" %>
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<!-- Terms Dialog -->
|
||||
<div class="dialog" layout="dialog" layout-id="terms" style="max-width:550px;">
|
||||
<div class="content-head">
|
||||
<%= image_tag "content/icon_add.png", {:width => 19, :height => 19, :class => 'content-icon' } %>
|
||||
<h1>Terms and Conditions</h1>
|
||||
</div>
|
||||
<div class="dialog-inner">
|
||||
<span>
|
||||
I agree that intellectual property ownership of any musical works created during this session shall be governed by the terms of the <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" target="_blank">Creative Commons CC BY-NC-SA license</a> in accordance with the <a rel="external" href="http://www.jamkazam.com/corp/terms" target="_blank">JamKazam Terms of Service</a>.
|
||||
</span>
|
||||
<br clear="left" /><br />
|
||||
<div class="left">
|
||||
<a id="btn-cancel-terms" layout-action="close" class="button-orange">CANCEL</a>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a id="btn-accept-terms" layout-action="close" class="button-orange">ACCEPT</a>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
<%= render "faders" %>
|
||||
<%= render "vu_meters" %>
|
||||
<%= render "ftue" %>
|
||||
<%= render "terms" %>
|
||||
<%= render "sidebar" %>
|
||||
<%= render "createSession" %>
|
||||
<%= render "findSession" %>
|
||||
|
|
|
|||
Loading…
Reference in New Issue