diff options
author | Raphael Kabo <mail@raphaelkabo.com> | 2022-11-14 09:54:06 +0000 |
---|---|---|
committer | Raphael Kabo <mail@raphaelkabo.com> | 2022-11-14 09:59:06 +0000 |
commit | c2964f7626193b040acbffac5dd76dcf449d55fb (patch) | |
tree | d9e281f83aa0caa8a16b0dc56c42dbb854d09d2e /views/event.handlebars | |
parent | 256d6ef79ef2e843763b0450efcac71bd40d8368 (diff) |
feat: specify number of attendees in party
Diffstat (limited to 'views/event.handlebars')
-rwxr-xr-x | views/event.handlebars | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/views/event.handlebars b/views/event.handlebars index 9b5f3e2..8c7e2e8 100755 --- a/views/event.handlebars +++ b/views/event.handlebars @@ -128,7 +128,7 @@ {{#if eventData.usersCanAttend}} <div class="card mb-4" id="eventAttendees"> - <h5 class="card-header">Attendees {{#if eventAttendees}}({{eventAttendees.length}}){{/if}} + <h5 class="card-header">Attendees {{#if eventAttendees}}({{numberOfAttendees}}){{/if}} <div class="btn-group" role="group" aria-label="Attendance controls"> {{#unless noMoreSpots}} <button type="button" id="attendEvent" class="btn btn-success" data-event-id="{{eventData.id}}"><i class="fas fa-user-plus"></i> Add me</button> @@ -174,6 +174,12 @@ </div> </div> <div class="form-group"> + <label for="attendeeName">How many people in your party?</label> + <div class="form-group"> + <input type="number" class="form-control" id="attendeeNumber" name="attendeeNumber" value="1" data-validation="required number" > + </div> + </div> + <div class="form-group"> <label for="attendeeEmail">Your email (optional)</label> <p class="form-text small">If you provide your email, you will receive updates to the event.</p> <div class="form-group"> @@ -576,6 +582,9 @@ axios.post('/attendee/provision', {}, { params: { eventID }}) .then((response) => { modal.find('#removalPassword').val(response.data.removalPassword); + modal.find('#attendeeNumber') + .attr('data-validation-allowing', `range[1;${response.data.freeSpots}]`) + .attr('data-validation-error-msg', `Please enter a number between 1 and ${response.data.freeSpots}`); modal.modal(); }) .catch((error) => { |