+ },
+ load_symposium: function() {
+ var self = this;
+ if ( self.registration.type != 'symposium' ) return;
+
+ var s_id = self.registration.$id;
+ if ( self.registration.symposium ) s_id = self.registration.symposium.$id;
+
+ if ( self.symposium && self.symposium.$id == s_id ) {
+ console.debug('load_symposium ', s_id, ' allready loaded');
+ return;
+ }
+
+ self.symposium = angular.copy( self.registration.symposium );
+ self.symposium.works = [];
+ // first registration doesn't have symposium.$id, but we used same $id
+console.debug( 'load_symposium ', s_id, self.symposium );
+
+console.debug( self.$xhr );
+
+ self.$xhr("JSON"
+ , "/" + database + "/_design/symposium/_view/works?callback=JSON_CALLBACK;key=" + s_id
+ , function(code, response){
+console.log('symposium/_view/works', code, response);
+ angular.foreach( response.rows, function(row) {
+ var work = row.value.work;
+ work.$id = row.value.$id; // copy $id so we can select correct one in list
+ self.symposium.works.push( work );
+ } );
+console.debug( 'symposium', self.symposium );
+ }
+ );