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