-
Notifications
You must be signed in to change notification settings - Fork 3
/
rides_list.html
89 lines (83 loc) · 4.03 KB
/
rides_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<template name="ridesList">
<div class="container">
<div id="main" class="row row-fluid">
<div class="well-sm text-center">
<h1>Mural de Caronas</h1>
<p class="lead">Barão Geraldo <=> São Paulo em tempo real</p>
</div>
<div id="aside" class="column col-sm-5">
<div class="form-group">
{{#if userProfile.firstName}}
{{#if Session 'editRideId'}}
{{#autoForm collection="Rides" type="update" doc=editRide
id="updateRideForm" resetOnSuccess=true}}
<fieldset>
<legend>Editar carona</legend>
{{> afQuickField name='originAndDestination' options="allowed" noselect=true}}
{{> afQuickField name='departureTime'}}
{{> afQuickField name='availableSeats' class="input-number–noSpinners"}}
{{> afQuickField name='pricePerSeat' class="input-number–noSpinners"}}
</fieldset>
{{> afQuickField name='description' rows=6 placeholder="Descreva coisas como ponto(s) de encontro, tipo de carro, trajeto, tamanho de bagagens, tolerância de atraso, se leva em casa (preferível) ou não, se faz frete, etc."}}
<button type="submit" class="btn btn-primary update-ride">Atualizar carona</button>
{{/autoForm}}
{{else}}
{{#autoForm collection="Rides" type="insert"
id="insertRideForm" resetOnSuccess=false}}
<fieldset>
<legend>Oferecer carona</legend>
<input type="hidden" value="{{currentUser._id}}" name="userId"
required="" data-schema-key="userId">
{{> afQuickField name='originAndDestination' options="allowed" noselect=true}}
{{> afQuickField name='departureTime'}}
{{> afQuickField name='availableSeats' class="input-number–noSpinners"}}
{{> afQuickField name='pricePerSeat' class="input-number–noSpinners"}}
</fieldset>
{{> afQuickField name='description' rows=6 placeholder="Descreva coisas como ponto(s) de encontro, tipo de carro, trajeto, tamanho de bagagens, tolerância de atraso, se leva em casa (preferível) ou não, se faz frete, etc."}}
<button type="submit" class="btn btn-primary">Oferecer carona</button>
{{/autoForm}}
{{/if}}
{{else}}
{{#autoForm collection=Meteor.users schema=Schema.User
type="update" id="updateUserProfileForm"
afFieldInput-noselect=true doc=currentUser}}
{{> afObjectField name='profile'
template='bootstrap3_complete_profile'}}
{{/autoForm}}
{{/if}}
</div>
</div>
<div id="content" class="column col-sm-7">
<legend>Todas as caronas
{{#if userProfile}}
{{#if currentUser.profile.isSubscribed}}
<a href="#" class="subscribed btn btn-default pull-right" role="button"><span class="glyphicon glyphicon-envelope"></span> Assinado</a>
{{else}}
<a href="#" class="subscribable btn btn-default pull-right" role="button"><span class="glyphicon glyphicon-envelope"></span> Assinar por email</a>
{{/if}}
{{/if}}
</legend>
{{#each this}}
{{> ridesItem}}
{{/each}}
</div>
</div>
</div>
</template>
<template name="afObjectField_bootstrap3_complete_profile">
<div class="panel panel-default">
{{#with afFieldLabelText name=this.atts.name}}
<div class="panel-heading">
<h3 class="panel-title">Por favor, complete seu perfil</h3>
</div>
{{/with}}
<div class="panel-body">
{{#if afFieldIsInvalid name=this.atts.name}}
<span class="help-block">{{{afFieldMessage name=this.atts.name}}}</span>
{{/if}}
{{> afQuickFields name=this.atts.name}}
<button type="submit" class="btn btn-primary">
Atualizar perfil</button>
</div>
</div>
</template>