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