},
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.category = last.category;
+ 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 );
+console.debug( 'reset', this.registration, this.$location.hashPath, last );
},
save: function(){
var self = this;
},
};
+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';
+}
</script>
</div>
<a class="addPerson" href="" ng:click="registration.symposium.organizers.$add()">Add another organizer</a>
<label>Summary:</label>
- <textarea class="fl1" name="registration.symposium.abstract" rows="5" ></textarea>
+ <textarea class="fl1" name="registration.symposium.abstract" rows="5" ng:validate="max_length:2000"></textarea>
<div ng:show="symposium">
<label>List of already submitted works</label>
<ol>
<label>Summary:</label>
- <textarea class="fl1" name="registration.work.abstract" rows="5"></textarea>
+ <textarea class="fl1" name="registration.work.abstract" rows="5" ng:validate="max_length:2000"></textarea>
</div>
<div ng:show="registration.$id && registration.type == 'symposium'" class="saved">
<i>{{registration.symposium.work_nr}}. {{registration.work.title}}</i> has been submited successfully.<br>
</span>
</div>
+<input type="reset" value="Another work proposal to submit?" ng:click="reset()" ng:show="registration.$id">
<!--
<div ng:show="registration.$id">