save draft number
[angular-drzb] / app / partials / registration.html.ep
1 <h1><%= locale
2         en => 'Registration and proposal submission',
3         hr => 'Registracija i prijavljivanje izlaganja'
4 %></h1>
5
6 <div class="intro">
7 %= include( "drzb2013/intro.$lang" );
8 </div>
9
10 <form ng-controller="RegistrationCtrl" name="RegistrationForm" class="span12">
11
12 <fieldset class="controls">
13
14 <legend><%= locale
15         en => 'Registration type',
16         hr => 'Odaberite tip registracije'
17 %></legend>
18
19 <label class="radio"><input type="radio" ng-model="user.registration_type" value="lecture" ><%= locale
20         en => 'Oral presentation',
21         hr => 'Prijava usmenog izlaganja',
22 %></label>
23 <label class="radio"><input type="radio" ng-model="user.registration_type" value="poster" ><%= locale
24         en => 'Poster prezentation',
25         hr => 'Prijava poster prezentacije'
26 %></label>
27 <label class="radio"><input type="radio" ng-model="user.registration_type" value="symposium" ><%= locale
28     en => 'Symposium',
29         hr => 'Prijava simpozija'
30 %></label>
31 <label class="radio"><input type="radio" ng-model="user.registration_type" value="round" ><%= locale
32     en => 'Round table',
33         hr => 'Prijava okruglog stola',
34 %></label>
35 <hr />
36 <label class="radio"><input type="radio" ng-model="user.registration_type" value="participant" ><%= locale
37     en => 'Registration',
38         hr => 'Registracija'
39 %></label>
40 <label class="radio"><input type="radio" ng-model="user.registration_type" value="accomp" ><%= locale
41     en => 'Registration for accompanying persons',
42         hr => 'Registracija za osobe u pratnji' %>
43 </label>
44 </fieldset>
45
46 <fieldset ng-show="user.registration_type">
47
48 <legend><%= locale
49 en => 'Registration - contact information',
50 hr => 'Registracija - kontakt podaci'
51 %></legend>
52
53 % my $Name = locale( en => 'Name', hr => 'Ime' );
54 % my $Surname = locale( en => 'Surname', hr => 'Prezime' );
55 % my $Organization = locale( en => 'Organization', hr => 'Organizacija' );
56 % my $Email = locale( en => 'E-mail', hr => 'E-pošta' );
57
58 <div class="controls-row">
59  <input class="my-input span5" ng-model="user.firstname" placeholder="<%= $Name %>" ng-required="true" />
60  <input class="my-input span5" ng-model="user.surname"   placeholder="<%= $Surname %>" ng-required="true" />
61 </div>
62
63 <div class="controls-row">
64  <input class="my-input span10" ng-model="user.organization" placeholder="<%= $Organization %>" bs-typeahead="organizations" data-items="10" >
65 </div>
66
67 % my $Address = locale en => 'Address', hr => 'Adresa';
68 <div class="controls-row">
69  <input class="my-input span10" ng-model="user.address" placeholder="<%= $Address %>" >
70 </div>
71
72 <div class="controls-row">
73  <input class="my-input span3" ng-model="user.city" placeholder="<%= locale en => 'City', hr => 'Grad' %>" ng-required="true" >
74  <input class="my-input span3" ng-model="user.zip_code" placeholder="<%= locale en => 'ZIP', hr => 'Poštanski br.' %>" >
75  <input class="my-input span4" ng-model="user.country" placeholder="<%= locale en => 'Country', hr => 'Zemlja' %>" >
76 </div>
77
78 <div class="controls-row">
79  <input class="my-input span5" ng-model="user.email" type="email" placeholder="<%= $Email %>" ng-required="true" />
80  <input class="my-input span5" ng-model="user.phone" placeholder="<%= locale en => 'Phone number', hr => 'Tel. broj' %>" />
81 </div>
82
83 <label class="checkbox">
84  <input ng-model="user.student" type="checkbox" ng-change="change_student()">
85  <%= locale 
86 en => 'Check this box if you are student',
87 hr => 'Označite ako ste student' %>
88 </label>
89
90 <div ng-show="! user.student">
91
92 % if ( $lang =~ m/hr/ ) {
93
94 <label class="checkbox">
95  <input ng-model="user.hpd_member" type="checkbox">
96 <%= locale
97 en => 'Check this box if you are HPD member',
98 hr => 'Označite ako ste član HPD-a' %>
99 </label>
100
101 <label class="checkbox">
102 <input type="checkbox" ng-model="user.r1.required">
103 <%= locale
104 en => 'Check this box if you need invoice',
105 hr => 'Trebam R-1 račun' %>
106 </label>
107
108 <div ng-show="user.r1.required">
109 <legend><%= locale
110 en => 'Organization contact details',
111 hr => 'Organizacija koja uplaćuje R-1 račun' %>
112 </legend>
113
114 <input class="my-input span10" ng-model="user.r1.organization" ng-required="user.r1.required" placeholder="<%= $Organization %>" bs-typeahead="organizations" >
115 <input class="my-input span10" ng-model="user.r1.address" ng-required="user.r1.required" placeholder="<%= $Address %>">
116 <input class="my-input span5" ng-model="user.r1.OIB" ng-required="user.r1.required" placeholder="OIB">
117
118 </div><!-- r1.required -->
119
120 % } # $lang ne 'en'
121
122 </div><!-- ! user.student -->
123
124 % my $Yes = locale( en => 'Yes', hr => 'Da' );
125 % my $No  = locale( en => 'No',  hr => 'Ne' );
126
127 <legend>
128 </legend>
129 <strong>
130 <%= locale
131 en => 'Will you join us for the welcome reception?',
132 hr => 'Hoćete li biti na domjenku dobrodošlice?' %>
133 </strong>
134 <label class="radio"><input type="radio" name="user.reception" ng-model="user.reception" value="yes" ng-required="true"><%= $Yes %></label>
135 <label class="radio"><input type="radio" name="user.reception" ng-model="user.reception" value="no"  ng-required="true"><%= $No %></label>
136
137 <div ng-show="! user.student">
138
139 <legend>
140 </legend>
141 <strong>
142 <%= locale
143 en => 'Will you join us for the conference dinner?',
144 hr => 'Hoćete li biti na zajedničkoj večeri?' %>
145 </strong>
146 <%= locale
147 en => 'Dinner is included in the regostration fee.',
148 hr => 'Večera je uključena u kotizaciju.' %>
149 <label class="radio"><input type="radio" name="user.dinner" ng-model="user.dinner" value="yes" ng-required="! user.student && ! user.dinner"><%= $Yes %></label>
150 <label class="radio"><input type="radio" name="user.dinner" ng-model="user.dinner" value="no"  ng-required="! user.student && ! user.dinner"><%= $No %></label>
151
152
153 </div><!-- not student -->
154
155
156 </fieldset><!-- selected registration_type -->
157
158 <fieldset ng-show="has_work">
159
160 <div ng-switch on="work.type">
161 <h2 ng-switch-when="lecture"><%= locale en=>'Oral presentation submission', hr=>'Prijava usmenog izlaganja' %></h2>
162 <h2 ng-switch-when="poster"><%= locale en=>'Poster presentation submission', hr=>'Prijava poster prezentacije' %></h2>
163 <h2 ng-switch-when="symposium"><%= locale en=>'Symposium', hr=>'Prijava teme simpozija' %></h2>
164 <h2 ng-switch-when="round"><%= locale en=>'Round table', hr=>'Prijava teme okruglog stola' %></h2>
165 <b ng-switch-default>Has unknown work type {{work.type}} to submit</b>
166 </div>
167
168 % my $Title = locale( en => 'Title', hr => 'Naslov' );
169
170 % my $WorkTemplate = begin
171         % my $has_h3_note = shift;
172 <div class="controls-row">
173  <input class="span10 my-input" ng-model="work.title" placeholder="<%= $Title %>" ng-required="has_work" />
174 </div>
175
176 % if ( $has_h3_note ) {
177 <h3 ng-show="user.registration_type == 'symposium'">
178 <%= locale
179 en => 'Symposium organizer',
180 hr => 'Organizator simpozija' %>
181 </h3>
182 % }
183
184
185 <div ng-repeat="person in work.persons" class="controls-row">
186         <input class="span2 my-input" ng-model="person.firstname" placeholder="<%= $Name %>" ng-required="has_work" />
187         <input class="span2 my-input" ng-model="person.surname"   placeholder="<%= $Surname %>" ng-required="has_work" />
188         <input class="span4 my-input" ng-model="person.organization" placeholder="<%= $Organization %>" bs-typeahead="organizations" />
189         <input class="span2 my-input" ng-model="person.email" type="email" placeholder="<%= $Email %>" ng-required="has_work" />
190         <div class="span1"><label>&nbsp;</label>
191      <input type="button" class="btn btn-danger" ng-click="removePerson(work.persons,person)" value="<%= locale en => 'delete', hr => 'obriši' %>" />
192     </div>
193 </div>
194 <div class="controls-row">
195 <input type="button" class="btn" ng-click="addPerson(work.persons)" value="<%= locale en=>'add person',hr=>'dodaj osobu' %>" />
196 </div>
197
198 <div class="controls-row">
199 <label class="{{class = abstract_class(work)}}">
200 <%= locale
201 en => 'Abstract ({{abstract_length(work)}}  from max. 2000 characters with spaces)',
202 hr => 'Sažetak ({{abstract_length(work)}}  od maks. 2000 znakova s razmacima)'
203 %>
204 <textarea class="controls-row span11 {{class}}" ng-model="work.abstract" ng-minlength="2" rows="10" cols="80" ng-required="has_work"></textarea>
205 <input type=text ng-maxlength="2000" ng-model="work.abstract_valid" style="display: none" value="{{work.abstract}}">
206 </label>
207 </div>
208
209 % end
210
211 <%= $WorkTemplate->(1) %>
212
213 </fieldset><!-- has_work -->
214
215 <div ng-show="user.registration_type == 'symposium'">
216
217 <h2><%= locale
218 en=>'Submission of works for the symposium {{work.title}}',
219 hr=>'Prijava radova unutar simpozija {{work.title}}' %>
220 </h2>
221
222 <div ng-repeat="work in work.symposium_works" class="control-row">
223
224 <h3><%= locale
225 en=>'{{$index + 1}}. symposium work',
226 hr=>'{{$index + 1}}. rad na simpoziju' %>
227 <a class="btn btn-danger" href="" ng-click="symposium_work_remove($index)" ng-show="$index > 3"><%= locale
228 en => 'delete this symposum work',
229 hr => 'obriši rad na simpoziju' %>
230 </a>
231 </h3>
232
233 <%= $WorkTemplate->(0) %>
234
235 </div><!-- ng-repeat symposium_works  -->
236
237 <a class="btn" href="" ng-click="add_symposium_work(work.symposium_works)"><%= locale
238 en => 'Add one more work to the symposium',
239 hr => 'Dodaj još jedan rad na simpoziju' %>
240 </a>
241
242 </div><!-- user.registration_type == 'symposium' -->
243
244 <button class="controls-row btn btn-primary" ng-click="update(registration)" ng-show="RegistrationForm.$valid"><%= locale en=>'Submit',hr=>'Pošalji' %></button>
245
246 <p class="well" style="color: red" ng-show="! RegistrationForm.$valid">
247 <%= locale
248 en => 'Please fill all required fields correctly. Fields with red border call for your attention.',
249 hr => 'Molimo ispunite sva obavezna polja označena crvenim okvirom.'
250 %>
251 <button class="controls-row btn btn-info" ng-click="update(registration)" ng-show="RegistrationForm.$dirty"><%= locale en=>'Save draft',hr=>'Spremi privremeno' %></button>
252 </p>
253
254 <input style="float:right" title="validation errors" type=checkbox name=debug ng-click="debug = ! debug">
255 <pre ng-show="debug">
256 {{RegistrationForm.$valid}}
257 {{RegistrationForm.$error}}
258 </pre>
259
260 % if ( $lang =~ m/-dev/ ) {
261 <pre class="controls-row">
262 location={{$location.path()}}
263 location={{$location}}
264
265 {{registration}}
266 </pre>
267 % }
268
269 </form>
270