participant.blade.php 2.18 KB
Newer Older
Korko's avatar
Korko committed
1
2
3
<script type="text/x-template" id="participant-template">
    <tr class="participant" :id="'participant_'+idx">
        <td class="row">
4
5
            <div class="input-group">
                <span class="input-group-addon counter">@{{ idx+1 }}</span>
6
                <input type="text" :name="'name['+idx+']'" :required="idx < 3" placeholder="@lang('form.name.placeholder')" v-model="name" class="form-control participant-name" />
7
            </div>
Korko's avatar
Korko committed
8
9
        </td>
        <td class="row border-left">
10
            <input type="email" :name="'email['+idx+']'" placeholder="@lang('form.email.placeholder')" v-model="email" class="form-control participant-email" :required="(idx < 3 || name !== '') && (!phone || dearsanta)" />
Korko's avatar
Korko committed
11
12
13
14
15
16
17
        </td>
        <td>
            @lang('form.mail-sms')
        </td>
        <td class="row border-right">
            <div class="input-group">
                <span class="input-group-addon lang" lang="fr">(+33)</span>
18
                <input type='tel' :disabled="smsdisabled" pattern='0?[67]\s?(\d\s?){8}' :maxlength="(phone[0] === undefined || phone[0] === '0') ? 10 : 9" :name="'phone['+idx+']'" placeholder="@lang('form.phone.placeholder')" v-model="phone" class="form-control participant-phone" :required="(idx < 3 || name !== '') && !email" />
Korko's avatar
Korko committed
19
20
            </div>
        </td>
Korko's avatar
Korko committed
21
        <td class="row border-right text-left participant-exclusions-wrapper">
22
23
24
25
            <multiselect :options="participantNames" v-model="exclusions" track-by="value" label="text" placeholder="@lang('form.exclusions.placeholder')" :multiple="true"></multiselect>
            <select style="display:none" :name="'exclusions['+idx+'][]'" multiple>
                <option v-for="participantName in participantNames" :value="participantName.value" :selected="exclusions.find(a => (a.value === participantName.value))"></option>
            </select>
Korko's avatar
Korko committed
26
27
        </td>
        <td class="row participant-remove-wrapper">
28
            <button type="button" class="btn btn-danger participant-remove" :disabled="participants.length <= 3" @click="$emit('delete')">
Korko's avatar
Korko committed
29
30
31
32
33
                <span class="glyphicon glyphicon-minus"></span><span> @lang('form.participant.remove')</span>
            </button>
        </td>
    </tr>
</script>