VRFS-1442 refresh session band list each time entering step3
This commit is contained in:
parent
868ca0b476
commit
e834a1dfd6
|
|
@ -443,6 +443,16 @@
|
|||
});
|
||||
}
|
||||
|
||||
function getBands(userId) {
|
||||
var url = "/api/users/" + userId + "/bands";
|
||||
return $.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: url,
|
||||
processData:false
|
||||
});
|
||||
}
|
||||
|
||||
function getSession(id) {
|
||||
var url = "/api/sessions/" + id;
|
||||
return $.ajax({
|
||||
|
|
|
|||
|
|
@ -215,6 +215,17 @@
|
|||
}
|
||||
|
||||
function beforeShowStep3() {
|
||||
rest.getBands(context.JK.currentUserId)
|
||||
.done(function(result) {
|
||||
var options = $("#session-band-list");
|
||||
options.empty();
|
||||
options.append($("<option />").val('').text('No'));
|
||||
$.each(result, function(idx, item) {
|
||||
options.append($("<option />").attr('value',item.id).text(item.name));
|
||||
});
|
||||
context.JK.dropdown($bandList);
|
||||
})
|
||||
.fail(app.ajaxError)
|
||||
}
|
||||
|
||||
function beforeShowStep4() {
|
||||
|
|
|
|||
|
|
@ -242,9 +242,6 @@
|
|||
<h3 class="session-band-list-header">Is this a band session?</h3>
|
||||
<select id="session-band-list">
|
||||
<option value="">No</option>
|
||||
<% current_user.bands.each do |band| %>
|
||||
<option value="<%= band.id %>"><%= band.name[0..64] %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
<div class="clearall"></div>
|
||||
<h3 class="session-language-list-header">What language will be spoken?</h3>
|
||||
|
|
|
|||
Loading…
Reference in New Issue