3 if (typeof (console) === 'undefined') console = { debug: function() {} }; // mock console.debug
5 function Registration($resource){
8 name: '', surname: '', inst: '', email: ''
14 authors:[ { name:'', surname:'', inst:'', email:'' } ]
16 symposium: { organizers: [ {name:'', surname:'', inst:'', email:'' } ], work_nr: 1 }
18 this.Registration = $resource( '/data/conference/Registration/:id', { id:'' } );
19 this.Symposium = $resource( '/data/conference/Symposium/:id', { id:'' } );
21 this.$watch('$location.hashPath', this.hash_change);
23 Registration.$inject=['$resource'];
25 Registration.prototype = {
26 hash_change: function() {
27 var id = this.$location.hashPath;
28 console.debug( 'hash_change', id, this.registration.$id );
29 if ( id != this.registration.$id ) {
32 this.registration = this.Registration.get({ id: id }, function(registration) {
33 self.last_saved = angular.copy(registration);
34 if ( registration.type == 'symposium' ) {
35 var s_id = registration.symposium.$id || registration.$id;
36 // first registration doesn't have symposium.$id, but we used same $id
37 console.debug( 'load symposium ', s_id );
38 self.symposium = self.Symposium.get({ id: s_id });
46 console.debug( this.Registration );
47 var last = this.registration;
48 if ( last && last.type == 'symposium' ) {
49 if ( last.$id ) last.symposium.work_nr++; // only if saved
51 this.registration = new this.Registration( this.master );
53 this.registration.type = last.type;
54 this.registration.person = last.person;
56 if ( last.type == 'symposium' )
57 this.registration.symposium = last.symposium;
59 this.last_saved = angular.copy( this.registration ); // FIXME was: {};
60 console.debug( 'reset', this.registration, this.$location.hashPath, last );
64 this.registration.$save(function(registration){
65 self.$location.hashPath = registration.$id;
67 // save symposium to separate resource
68 if ( registration.type == 'symposium' ) {
69 if ( ! self.symposium ) {
70 self.registration.symposium.$id = registration.$id; // reuse $id of first work for symposium
71 self.symposium = new self.Symposium( registration.symposium );
72 self.symposium.works = [];
74 registration.work.$id = registration.$id; // preserve $id
75 self.symposium.works[ registration.symposium.work_nr - 1 ] = registration.work;
76 console.debug('save_symposium', self.symposium );
77 self.symposium.$save();
80 self.last_saved = angular.copy(registration);
85 angular.validator.max_length = function(input, len) {
86 var ok = input.length <= len;
87 console.debug( 'max_length', ok, input.length, len );
88 return ok ? '' : 'must be shorter than '+len+' characters';
94 <style type="text/css">
116 /* margin-bottom: 6px; */
120 text-decoration: none;
122 background: url(http://mjesec.ffzg.hr/drzb2011/images/kvadrat.gif) no-repeat left;
123 border-bottom: 1px solid #CCC;
129 border-bottom: 2px solid #D74F25;
130 border-bottom: 1px solid #46d0fe;
187 input, textarea, .gohome {
190 border: solid 1px #dedede;
195 input:focus, textarea:focus
201 /* border: 1px solid #46d0fe; */
204 .ng-validation-error {
205 border: 1px solid #FF6666;
206 border: 1px solid #EDC8BC;
207 border: 1px solid #FF9966;
208 border: 1px solid #EAB3A2;
209 border: 1px solid #D74F25;
210 border: 1px solid #DC6844;
211 border: 1px solid #DE7F61;
230 text-decoration: none;
234 .button input:hover, .gohome:hover {
241 border: 1px solid #d74f25;
251 text-decoration: none;
258 text-decoration: none;
299 border: 1px solid #ccc;
305 <h1>Registration and Proposal Submission</h1>
308 <p>Svi sudionici skupa, bez obzira na to jesu li izlagači, suautori ili slušači, trebaju prijaviti svoje sudjelovanje kroz sustav elektroničke prijave.</p>
310 <p>Sažetak izlaganja/postera prijavljuje samo prvi autor, odnosno onaj autor koji će rad izložiti. Ostali suautori prilikom prijave na skup ne trebaju prijaviti sažetak, nego se samo registrirati.</p>
312 <p>Organizatori simpozija/okruglog stola prijavljuju i sažetak simpozija i/ili okruglog stola, i sažetak svakog pripadajućeg rada. Autori radova unutar simpozija ne prijavljuju pojedinačno svoje sažetke.</p>
314 <p>Duljina sažetka ne može prelaziti 2000 znakova.</p>
316 <p>Jedna osoba može biti autor u najviše tri rada, pri čemu na samo jednom može biti prvi ili jedini autor.</p>
321 <div class="root" ng:controller="Registration" ng:init="$window.$root = this;">
324 <div ng:show="last_saved.$id || symposium">
325 <h2>{{registration.person.name}} {{registration.person.surname}}</h2>
329 <div id="participant" ng:show="! last_saved.$id && ! symposium">
330 <h2>Contact Information</h2>
331 <div class="labelTop">
332 <div class="input input4">First name</div>
333 <div class="input input4">Surname</div>
335 <div style="clear: both">
336 <input class="input4" name="registration.person.name" ng:required>
337 <input class="input4" name="registration.person.surname" ng:required>
339 <div class="labelTop">
340 <div class="input input5">Institution</div>
342 <div style="clear: both">
343 <input class="input5" name="registration.person.inst">
345 <div class="labelTop">
346 <div class="input input5">Address</div>
348 <div style="clear: both">
349 <input class="input5" name="registration.person.address1" ng:required>
351 <div class="labelTop">
352 <div class="input input6">City</div>
353 <div class="input input6">ZIP</div>
354 <div class="input input6">Country</div>
356 <div style="clear: both">
357 <input class="input6" name="registration.person.city" ng:required>
358 <input class="input6" name="registration.person.zip">
359 <input class="input6" name="registration.person.country">
361 <div class="labelTop">
362 <div class="input input4">E-mail</div>
363 <div class="input input4">Phone number</div>
365 <div style="clear: both">
366 <input class="input4" name="registration.person.email" ng:validate="email" ng:required>
367 <input class="input4" name="registration.person.phone">
372 <div id="submission" ng:show="registration.type != 'symposium' && ! last_saved.$id">
374 <h2>Registration Type</h2>
375 <label><input type="radio" name="registration.type" value="participant" ng:required>Attendance with no presentation</label>
376 <label><input type="radio" name="registration.type" value="sparticipant" ng:required>Symposium participant</label>
377 <label><input type="radio" name="registration.type" value="symposium" ng:required>Symposium organizer</label>
378 <label><input type="radio" name="registration.type" value="lecture" ng:required>Oral presentation</label>
379 <label><input type="radio" name="registration.type" value="poster" ng:required>Poster presentation</label>
380 <label><input type="radio" name="registration.type" value="round" ng:required>Round table discussion</label>
384 <!-- dodano za syposium participants -->
385 <div ng:show="registration.type == 'sparticipant' && ! last_saved.$id">
387 <label for="registration.sympattend">Topic:</label>
388 <input class="input1" name="registration.sympattend" ng:required>
392 <div id="work" ng:show="registration.type != 'participant' && registration.type != 'sparticipant'">
393 <div ng:show="registration.type == 'symposium' && ! last_saved.$id && registration.symposium.work_nr < 2">
396 <label for="registration.symposium.title">Topic:</label>
397 <input class="input1" name="registration.symposium.title" ng:required>
398 <label>Organizer:</label>
399 <div class="input input2">First name</div><div class="input input2">Surname</div><div class="input input3">Institution</div><div class="input input2">E-mail</div>
400 <div class="clear" ng:repeat="organizer in registration.symposium.organizers">
401 <input class="input2" name="organizer.name" ng:required>
402 <input class="input2" name="organizer.surname" ng:required>
403 <input class="input3" name="organizer.inst" >
404 <input class="input2" name="organizer.email" ng:required ng:validate="email">
405 <a href="" ng:click="registration.symposium.organizers.$remove(organizer)">X</a>
407 <a class="addPerson" href="" ng:click="registration.symposium.organizers.$add()">Add another organizer</a>
408 <label>Summary (2000 characters max.)</label>
409 <textarea class="input1" name="registration.symposium.abstract" rows="10" ng:validate="max_length:2000" ng:required></textarea>
413 <div ng:show="registration.type && ! last_saved.$id">
415 <div ng:show="symposium">
416 <b>Symposium:</b> {{registration.symposium.title}}
418 <label>Submitted papers for this symposium:</label>
420 <li ng:repeat="w in symposium.works">
421 <a ng:show="registration.$id != w.$id" href="#{{w.$id}}" >{{w.title}}</a>
422 <b ng:show="registration.$id == w.$id">{{w.title}}</b>
427 <h2 ng:show="registration.type == 'symposium'">Add Symposia Paper ({{registration.symposium.work_nr}})</h2>
428 <h2 ng:show="registration.type == 'lecture'">Oral Presentation Sumbission</h2>
429 <h2 ng:show="registration.type == 'poster'">Poster Presentation Sumbission</h2>
430 <h2 ng:show="registration.type == 'round'">Round Table Disscussion Sumbission</h2>
433 <label>Title:</label>
434 <input class="input1" name="registration.work.title" ng:required>
435 <label>Authors</label>
437 <div class="input input2">First name</div><div class="input input2">Surname</div><div class="input input3">Institution</div><div class="input input2">E-mail</div>
439 <div class="clear" ng:repeat="author in registration.work.authors">
440 <input class="input2" name="author.name" ng:required>
441 <input class="input2" name="author.surname" ng:required>
442 <input class="input3" name="author.inst" >
443 <input class="input2" name="author.email" ng:required ng:validate="email">
444 <a href="" ng:click="registration.work.authors.$remove(author)">X</a>
446 <a class="addPerson" href="" ng:click="registration.work.authors.$add()">Add another author</a>
449 <label>Abstract (2000 characters max.):</label>
450 <textarea class="input1" name="registration.work.abstract" rows="10" ng:validate="max_length:2000" ng:required></textarea>
453 </div> <!-- ng:show="registration.type" -->
456 <div class="button" ng:show="! last_saved.$equals(registration) && $invalidWidgets.visible() == 0">
457 <input type="submit" value="Save" ng:click="save();" ng:show="! last_saved.$equals(registration) && $invalidWidgets.visible() == 0">
460 <div ng:show="$invalidWidgets.visible() > 0" style="color:red; margin-top: 20px">Please fill all required fields correctly ({{$invalidWidgets.visible()}} fields left). Red colored fields call for your attention.
466 <div style="margin-bottom: 40px" ng:show="registration.$id && last_saved.$equals(registration)">
469 <input type="checkbox" name="last_saved.$id"> Hide submitted registration
472 <div class="saved" ng:show="registration.type == 'participant' || registration.type == 'sparticipant'">
473 <span class="saved2">Your registration has been submitted successfully!</span>
475 <span ng:show="registration.sympattend">You will participate in the symosium <b>"{{registration.sympattend}}"</b><br><br><br></span>
476 <span class="saved3">
477 Thank you. We look forward to seeing you at the conference<br><br>
478 .. Kotizacija upute ..
482 <div class="saved" ng:show="registration.type != 'participant' && registration.type != 'sparticipant'">
483 <span class="saved2">You submitted the paper successfully! <br><br></span>
485 <b>Paper title</b>: {{registration.work.title}} <br><br>
486 <div ng:show="symposium">
487 <b>Symposium:</b> {{registration.symposium.title}}
489 <label>Already submitted papers for this symposium:</label>
491 <li ng:repeat="w in symposium.works">
493 <a ng:show="registration.$id != w.$id" href="#{{w.$id}}" >{{w.title}}</a>
495 <span ng:show="registration.$id != w.$id">{{w.title}}</span>
496 <b ng:show="registration.$id == w.$id">{{w.title}}</b>
502 <div class="button button2" ng:show="registration.$id && registration.type != 'participant' && registration.type != 'sparticipant' && last_saved.$equals(registration)">
503 You can <input type="reset" value="Submit another paper" ng:click="reset()"> or <a href="http://psihologija.ffzg.hr/drzb2011/">just leave</a> this page. <br><br> ... conference fee ... instructions ...<br><br>
507 Registration ID: {{registration.$id}}. You can bookmark this page and review it later.
512 <div class=""><a href="http://psihologija.ffzg.hr/drzb2011/">Go to conference home page</a></div>
516 <div class="button2" ng:show="registration.$id && registration.type != 'participant' && registration.type != 'sparticipant' && last_saved.$equals(registration)">
517 <input type="reset" value="Submit another paper" ng:click="reset()">
518 <div class="gohome"><a href="http://psihologija.ffzg.hr/drzb2011/">Go to conference home page</a></div>
522 <div class="footer"></div>
525 <div ng:show="registration.$id">
526 Permalink to <a href="#{{registration.$id}}">DRZB2011 registration</a> which you can bookmark
530 <input type=checkbox name=debug style="float: right; clear: both">
531 <pre ng:show="debug">
533 dirty={{! last_saved.$equals(registration)}} invalid={{$invalidWidgets.visible()}}
535 registration = {{registration}}
537 last_saved = {{last_saved}}
541 symposium = {{symposium}}
544 registration.$id={{registration.$id}}