VRFS-3245 : Render optional controls
* If new member is wanted, show play commitment and touring option * If paid gigs, show amount and gig minimum * Works largely through class names.
This commit is contained in:
parent
8d73ef6aac
commit
a4317a532b
|
|
@ -69,10 +69,30 @@
|
|||
} else {
|
||||
$("#btn-band-setup-back").removeClass("hidden")
|
||||
$("#btn-band-setup-next").removeClass("hidden").html("SAVE & FINISH")
|
||||
}
|
||||
}
|
||||
renderOptionalControls()
|
||||
}
|
||||
|
||||
function is_new_record() {
|
||||
function renderOptionalControls(e) {
|
||||
if(e){e.stopPropagation()}
|
||||
|
||||
// Is new member selected?
|
||||
if ($('input[name="add_new_members"]:checked').val()=="yes") {
|
||||
$(".new-member-dependent").removeClass("hidden")
|
||||
} else {
|
||||
$(".new-member-dependent").addClass("hidden")
|
||||
}
|
||||
|
||||
// Is paid gigs selected?
|
||||
if ($('input[name="paid_gigs"]:checked').val()=="yes") {
|
||||
$(".paid-gigs-dependent").removeClass("hidden")
|
||||
} else {
|
||||
$(".paid-gigs-dependent").addClass("hidden")
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isNewBand() {
|
||||
return bandId==null || typeof(bandId)=='undefined' || bandId.length == 0;
|
||||
}
|
||||
|
||||
|
|
@ -118,8 +138,6 @@
|
|||
$("#gig-minimum").val("0.0")
|
||||
resetGenres();
|
||||
|
||||
//renderCurrentPage();$(".band-step").addClass("hidden")
|
||||
|
||||
$(friendInput)
|
||||
.unbind('blur')
|
||||
.attr("placeholder", "Looking up friends...")
|
||||
|
|
@ -171,7 +189,7 @@
|
|||
|
||||
function buildBand() {
|
||||
var band = {};
|
||||
band.id = (is_new_record()) ? null : bandId;
|
||||
band.id = (isNewBand()) ? null : bandId;
|
||||
band.name = $("#band-name").val();
|
||||
band.website = $("#band-website").val();
|
||||
band.biography = $("#band-biography").val();
|
||||
|
|
@ -217,7 +235,7 @@
|
|||
unbindNavButtons()
|
||||
var band = buildBand()
|
||||
|
||||
var saveBandFn = (is_new_record()) ? rest.createBand : rest.updateBand
|
||||
var saveBandFn = (isNewBand()) ? rest.createBand : rest.updateBand
|
||||
saveBandFn(band)
|
||||
.done(function (response) {
|
||||
saveInvitations()
|
||||
|
|
@ -277,7 +295,7 @@
|
|||
function afterShow(data) {
|
||||
inviteMusiciansUtil.loadFriends();
|
||||
|
||||
if (!is_new_record()) {
|
||||
if (!isNewBand()) {
|
||||
$("#band-change-photo").html('Upload band photo.');
|
||||
$('.band-photo').removeClass("hidden")
|
||||
|
||||
|
|
@ -344,7 +362,8 @@
|
|||
loadCities(band.city);
|
||||
});
|
||||
});
|
||||
;
|
||||
|
||||
renderOptionalControls();
|
||||
|
||||
});
|
||||
}
|
||||
|
|
@ -572,6 +591,8 @@
|
|||
$('div[layout-id="band/setup"] .btn-facebook-invitation').click(function () {
|
||||
invitationDialog.showFacebookDialog();
|
||||
});
|
||||
|
||||
$('#band-setup').on('ifToggled', 'input[type="radio"].dependent-master', renderOptionalControls);
|
||||
|
||||
$(friendInput).focus(function() { $(this).val(''); })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,31 +106,31 @@
|
|||
label.strong-label for="new-member"
|
||||
| We want to add a new member
|
||||
a.help help-topic="profile-interests-virtual-band" [?]
|
||||
td
|
||||
td.new-member-dependent
|
||||
label for="desired-experience"
|
||||
| Desired Experience
|
||||
a.select-desired-experience select
|
||||
td
|
||||
td.new-member-dependent
|
||||
label for="play-commitment" Play Commitment
|
||||
td
|
||||
td.new-member-dependent
|
||||
label for="touring-option" Touring Option
|
||||
tr
|
||||
td
|
||||
.radio-field
|
||||
input#new-member-yes.iradio-inline type="radio" name="add_new_members" value='yes'
|
||||
input#new-member-yes.iradio-inline.dependent-master type="radio" name="add_new_members" value='yes'
|
||||
label for='new-member-yes' Yes
|
||||
.radio-field
|
||||
input#new-member-no.iradio-inline type="radio" name="add_new_members" value='no'
|
||||
input#new-member-no.iradio-inline.dependent-master type="radio" name="add_new_members" value='no'
|
||||
label for='new-member-no' No
|
||||
td
|
||||
td.new-member-dependent
|
||||
#desired-experience-label None specified
|
||||
td
|
||||
td.new-member-dependent
|
||||
select#play-commitment.easydropdown name="play_commitment"
|
||||
option value="1" Infrequent
|
||||
option value="2" Once a Week
|
||||
option value="3" 2-3 Times Per Week
|
||||
option value="4" 4+ Times Per Week
|
||||
td
|
||||
td.new-member-dependent
|
||||
select#touring-option.easydropdown name="touring_option"
|
||||
option value="yes" Yes
|
||||
option value="no" No
|
||||
|
|
@ -139,21 +139,21 @@
|
|||
label.strong-label for="paid-gigs"
|
||||
| We want to play paid gigs
|
||||
a.help help-topic="profile-interests-paid-gigs" [?]
|
||||
td
|
||||
td.paid-gigs-dependent
|
||||
label for="hourly-rate" Hourly Rate:
|
||||
td
|
||||
td.paid-gigs-dependent
|
||||
label for="gig-minimum" Gig Minimum:
|
||||
tr
|
||||
td
|
||||
.radio-field
|
||||
input#paid-gigs-yes.iradio-inline type="radio" name="paid_gigs" value='yes'
|
||||
input#paid-gigs-yes.iradio-inline.dependent-master type="radio" name="paid_gigs" value='yes'
|
||||
label for="paid-gigs-yes" Yes
|
||||
.radio-field
|
||||
input#paid-gigs-no.iradio-inline type="radio" name="paid_gigs" value='no'
|
||||
input#paid-gigs-no.iradio-inline.dependent-master type="radio" name="paid_gigs" value='no'
|
||||
label for="paid-gigs-no" No
|
||||
td
|
||||
td.paid-gigs-dependent
|
||||
input#hourly-rate type="number" name="hourly_rate"
|
||||
td
|
||||
td.paid-gigs-dependent
|
||||
input#gig-minimum type="number" name="gig_minimum"
|
||||
tr
|
||||
td
|
||||
|
|
|
|||
Loading…
Reference in New Issue