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;
226 margin-bottom: 120px;
230 text-decoration: none;
234 .button input:hover, .gohome:hover {
245 text-decoration: none;
252 text-decoration: none;
297 <h1>Registration and Proposal Submission</h1>
300 <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>
302 <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>
304 <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>
306 <p>Duljina sažetka ne može prelaziti 2000 znakova.</p>
310 <div class="root" ng:controller="Registration" ng:init="$window.$root = this;">
313 <div id="participant">
314 <h2>Contact Information</h2>
315 <div class="labelTop">
316 <div class="input input4">First name</div>
317 <div class="input input4">Surname</div>
319 <div style="clear: both">
320 <input class="input4" name="registration.person.name" ng:required>
321 <input class="input4" name="registration.person.surname" ng:required>
323 <div class="labelTop">
324 <div class="input input5">Institution</div>
326 <div style="clear: both">
327 <input class="input5" name="registration.person.inst">
329 <div class="labelTop">
330 <div class="input input5">Address</div>
332 <div style="clear: both">
333 <input class="input5" name="registration.person.address1" ng:required>
335 <div class="labelTop">
336 <div class="input input6">City</div>
337 <div class="input input6">ZIP</div>
338 <div class="input input6">Country</div>
340 <div style="clear: both">
341 <input class="input6" name="registration.person.city" ng:required>
342 <input class="input6" name="registration.person.zip">
343 <input class="input6" name="registration.person.country">
345 <div class="labelTop">
346 <div class="input input4">E-mail</div>
347 <div class="input input4">Phone number</div>
349 <div style="clear: both">
350 <input class="input4" name="registration.person.email" ng:validate="email" ng:required>
351 <input class="input4" name="registration.person.phone">
356 <div id="submission" ng:show="registration.type != 'symposium'">
358 <h2>Registration Type</h2>
359 <label><input type="radio" name="registration.type" value="participant" ng:required>Attendance with no presentation</label>
360 <label><input type="radio" name="registration.type" value="sparticipant" ng:required>Symposium participant</label>
361 <label><input type="radio" name="registration.type" value="symposium" ng:required>Symposium organizer</label>
362 <label><input type="radio" name="registration.type" value="lecture" ng:required>Oral presentation</label>
363 <label><input type="radio" name="registration.type" value="poster" ng:required>Poster presentation</label>
364 <label><input type="radio" name="registration.type" value="round" ng:required>Round table discussion</label>
368 <!-- dodano za syposium participants -->
369 <div ng:show="registration.type == 'sparticipant'">
371 <label for="registration.symposium.title">Topic:</label>
372 <input class="input1" name="registration.symposium.title" ng:required>
376 <div id="work" ng:show="registration.type != 'participant' && registration.type != 'sparticipant'">
377 <div ng:show="registration.type == 'symposium'">
380 <label for="registration.symposium.title">Topic:</label>
381 <input class="input1" name="registration.symposium.title" ng:required>
382 <label>Organizer:</label>
383 <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>
384 <div class="clear" ng:repeat="organizer in registration.symposium.organizers">
385 <input class="input2" name="organizer.name" ng:required>
386 <input class="input2" name="organizer.surname" ng:required>
387 <input class="input3" name="organizer.inst" >
388 <input class="input2" name="organizer.email" ng:required ng:validate="email">
389 <a href="" ng:click="registration.symposium.organizers.$remove(organizer)">X</a>
391 <a class="addPerson" href="" ng:click="registration.symposium.organizers.$add()">Add another organizer</a>
392 <label>Summary (2000 characters max.)</label>
393 <textarea class="input1" name="registration.symposium.abstract" rows="10" ng:validate="max_length:2000" ng:required></textarea>
396 <div ng:show="symposium">
397 <label class="list">List of already submitted papers for symposium {{registration.symposium.title}}</label>
399 <li ng:repeat="w in symposium.works">
400 <a ng:show="registration.$id != w.$id" href="#{{w.$id}}" >{{w.title}}</a>
401 <b ng:show="registration.$id == w.$id">{{w.title}}</b>
406 <div ng:show="registration.type">
408 <h2 ng:show="registration.type == 'symposium'">Symposia paper ({{registration.symposium.work_nr}})</h2>
409 <h2 ng:show="registration.type == 'lecture'">Oral Presentation Sumbission</h2>
410 <h2 ng:show="registration.type == 'poster'">Poster Presentation Sumbission</h2>
411 <h2 ng:show="registration.type == 'round'">Round Table Disscussion Sumbission</h2>
414 <label>Title:</label>
415 <input class="input1" name="registration.work.title" ng:required>
416 <label>Authors</label>
418 <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>
420 <div class="clear" ng:repeat="author in registration.work.authors">
421 <input class="input2" name="author.name" ng:required>
422 <input class="input2" name="author.surname" ng:required>
423 <input class="input3" name="author.inst" >
424 <input class="input2" name="author.email" ng:required ng:validate="email">
425 <a href="" ng:click="registration.work.authors.$remove(author)">X</a>
427 <a class="addPerson" href="" ng:click="registration.work.authors.$add()">Add another author</a>
430 <label>Abstract (2000 characters max.):</label>
431 <textarea class="input1" name="registration.work.abstract" rows="10" ng:validate="max_length:2000" ng:required></textarea>
434 </div> <!-- ng:show="registration.type" -->
437 <div class="button" ng:show="! last_saved.$equals(registration) && $invalidWidgets.visible() == 0">
438 <input type="submit" value="Save" ng:click="save();" ng:show="! last_saved.$equals(registration) && $invalidWidgets.visible() == 0">
441 <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.
447 <div style="margin-bottom: 40px" ng:show="registration.$id && last_saved.$equals(registration)">
448 <div class="saved" ng:show="registration.type == 'participant' || registration.type == 'sparticipant'">
449 <span class="saved2">{{registration.person.name}} {{registration.person.surname}}</span> you finished your registration successfully.
450 <span class="saved3">Registration ID: {{registration.$id}}.</span>
453 <div class="saved" ng:show="registration.type != 'participant' && registration.type != 'sparticipant'">
454 You finished your registration successfully.
456 <span class="saved3">Submitted paper: <b>{{registration.work.title}}</b></span>
457 <span class="saved3">Registration ID: {{registration.$id}}.</span>
461 Please review your data, correct and save if needed (just start typing and Save button will show automatically).
465 Registration ID: {{registration.$id}}. You can bookmark this page and review it later.
468 <div class="button" ng:show="registration.$id && registration.type != 'participant' && registration.type != 'sparticipant' && last_saved.$equals(registration)">
469 <input type="reset" value="Submit another paper" ng:click="reset()">
471 <div class="gohome"><a href="http://psihologija.ffzg.hr/drzb2011/">Go to conference home page</a></div>
474 <div class="button2" ng:show="registration.$id && registration.type != 'participant' && registration.type != 'sparticipant' && last_saved.$equals(registration)">
475 <input type="reset" value="Submit another paper" ng:click="reset()">
476 <div class="gohome"><a href="http://psihologija.ffzg.hr/drzb2011/">Go to conference home page</a></div>
480 <div class="footer"></div>
483 <div ng:show="registration.$id">
484 Permalink to <a href="#{{registration.$id}}">DRZB2011 registration</a> which you can bookmark
488 <input type=checkbox name=debug style="float: right; clear: both">
489 <pre ng:show="debug">
491 dirty={{! last_saved.$equals(registration)}} invalid={{$invalidWidgets.visible()}}
493 registration = {{registration}}
495 last_saved = {{last_saved}}
499 symposium = {{symposium}}
502 registration.$id={{registration.$id}}