From f9728e6d8d8b79006b1b37ca99c25ea175b0ff30 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 4 Nov 2010 16:40:45 +0100 Subject: [PATCH] count number of works within symposium --- templates/conference/Work.html.ep | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/templates/conference/Work.html.ep b/templates/conference/Work.html.ep index 1870265..ad11d37 100644 --- a/templates/conference/Work.html.ep +++ b/templates/conference/Work.html.ep @@ -8,7 +8,7 @@ function Work($resource){ title: '', abstract: '', authors:[ { name:'', surname:'', inst:'', email:'' } ], - symposium: { authors: [ {name:'', surname:'', inst:'', email:''} ] }, + symposium: { authors: [ {name:'', surname:'', inst:'', email:'' } ], work_nr: 1, }, }; this.Work = $resource( '/data/conference/Work/:_id', { _id:'' } ); this.reset(); @@ -28,7 +28,12 @@ console.debug( 'hash_change', id, this.work._id ); reset: function() { console.debug( this.Work ); var symposium = null; - if ( this.work && this.work.type == 'symposium' ) symposium = this.work.symposium; + if ( this.work && this.work.type == 'symposium' ) { + symposium = this.work.symposium; + if ( this.work._id ) symposium.work_nr++; + // if is required because reset is called twice -- once with saved records and once with new empty one +console.debug( 'symposium', symposium, this.work ) + } this.work = new this.Work( this.master ); if ( symposium ) { this.work.symposium = symposium; @@ -87,7 +92,7 @@ Organizator:
-

Autori rada

+

Autori {{work.symposium.work_nr}}. rada

[X] -- 2.20.1