X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=templates%2Fconference%2FRegistration.html.ep;h=21c2ae5617b29ba04194bb106dbfffe134d98995;hb=2393a3b201b612154ae43217b0a5ccf6dca5e530;hp=2bb1f1bc1bd22ef783420ea8883a0590c02dfd22;hpb=1bef098a8105fb52fd80c0f6882db98243d2016e;p=angular-mojolicious.git diff --git a/templates/conference/Registration.html.ep b/templates/conference/Registration.html.ep index 2bb1f1b..21c2ae5 100644 --- a/templates/conference/Registration.html.ep +++ b/templates/conference/Registration.html.ep @@ -5,17 +5,16 @@ if (typeof (console) === 'undefined') console = { debug: function() {} }; // moc function Registration($resource){ this.master = { person: { - name: '', surname: '', inst: '', email: '', + name: '', surname: '', inst: '', email: '' }, - type: '', // just attending + type: 'participant', work: { title: '', abstract: '', - authors:[ { name:'', surname:'', inst:'', email:'' } ], + authors:[ { name:'', surname:'', inst:'', email:'' } ] }, - symposium: { organizers: [ {name:'', surname:'', inst:'', email:'' } ], work_nr: 1, }, + symposium: { organizers: [ {name:'', surname:'', inst:'', email:'' } ], work_nr: 1 } }; - this.last_saved = {}; this.Registration = $resource( '/data/conference/Registration/:id', { id:'' } ); this.Symposium = $resource( '/data/conference/Symposium/:id', { id:'' } ); this.reset(); @@ -45,22 +44,20 @@ console.debug( 'load symposium ', s_id ); }, reset: function() { console.debug( this.Registration ); - var current_symposium = null; - var current_person = null; - if ( this.registration && this.registration.type == 'symposium' ) { - current_symposium = this.registration.symposium; - current_person = this.registration.person; - if ( this.registration.$id ) current_symposium.work_nr++; // only if saved -console.debug( 'current_symposium', current_symposium, this.registration ) + var last = this.registration; + if ( last && last.type == 'symposium' ) { + if ( last.$id ) last.symposium.work_nr++; // only if saved } this.registration = new this.Registration( this.master ); - if ( current_symposium ) { - this.registration.symposium = current_symposium; - this.registration.type = 'symposium'; - this.registration.person = current_person; + if ( last ) { + this.registration.type = last.type; + this.registration.person = last.person; + + if ( last.type == 'symposium' ) + this.registration.symposium = last.symposium; } - this.last_saved = {}; -console.debug( 'reset', current_symposium, this.registration, this.$location.hashPath ); + this.last_saved = angular.copy( this.registration ); // FIXME was: {}; +console.debug( 'reset', this.registration, this.$location.hashPath, last ); }, save: function(){ var self = this; @@ -82,9 +79,14 @@ console.debug('save_symposium', self.symposium ); self.last_saved = angular.copy(registration); }); - }, + } }; +angular.validator.max_length = function(input, len) { + var ok = input.length <= len; +console.debug( 'max_length', ok, input.length, len ); + return ok ? '' : 'must be shorter than '+len+' characters'; +} @@ -260,23 +262,9 @@ input.ng-validation-error {
-
-

Please choose:

- Just attending the conference
- I want to submit a work
-
-
-
-

Choose submittion type:

- Symposia
- Oral presentation
- Poster presentation
- Round table discussion
-
-
-
-

Participant Registration

+
+

Contact Information

First name
Surname
@@ -319,8 +307,21 @@ input.ng-validation-error {
+
+
+

Choose submittion type:

+ + + + + +
+
+ + -
+ +

Symposia Submission

@@ -339,7 +340,7 @@ input.ng-validation-error {
Add another organizer - +
    @@ -350,10 +351,15 @@ input.ng-validation-error {
-

Work no. {{registration.symposium.work_nr}}. in {{registration.symposium.title}}

-

Oral Presentation Sumbission

-

Poster Presentation Sumbission

-

Round Table Disscussion Sumbission

+ + +

Work no. {{registration.symposium.work_nr}}. in {{registration.symposium.title}}

+

Oral Presentation Sumbission

+

Poster Presentation Sumbission

+

Round Table Disscussion Sumbission

+ + +
@@ -372,34 +378,39 @@ input.ng-validation-error { - + + + +
-
- {{registration.symposium.work_nr}}. {{registration.work.title}} has been submited successfully.
+ + + +
Please fill all required fields ({{$invalidWidgets.visible()}} fields left).
- -
- - - - - or go to conference home page.
-
- -
Please fill all required fields ({{$invalidWidgets.visible()}} fields left). + + + +
+
+ Your registration has been submitted successfully. +
+ +
+ {{registration.work.title}} has been submited successfully.
-
-
- Your registration has been submitted successfully.

- Please review your data, correct and save if needed or go to conference home page.

-
+ Please review your data, correct and save if needed or go to conference home page. + +
+ Registration ID: {{registration.$id}}.
You can bookmark this page and review it later. +
+ +
-Debug Information: -{{$window.location.href}} -
-registration = {{registration}}
 
-dirty={{! last_saved.$equals(registration)}}
+
+
+
+dirty={{! last_saved.$equals(registration)}} invalid={{$invalidWidgets.visible()}}
+
+registration = {{registration}}
 
 last_saved = {{last_saved}}
 
@@ -424,4 +436,3 @@ $id={{$id}}
 registration.$id={{registration.$id}}
 
-