From: Dobrica Pavlinusic Date: Tue, 2 Nov 2010 18:43:47 +0000 (+0100) Subject: add Symposium X-Git-Url: http://git.rot13.org/?p=angular-mojolicious.git;a=commitdiff_plain;h=663210273a34c6dc92b255060d4b7713d90f1797 add Symposium --- diff --git a/public/controller/conference/Symposium.js b/public/controller/conference/Symposium.js new file mode 100644 index 0000000..ddb227a --- /dev/null +++ b/public/controller/conference/Symposium.js @@ -0,0 +1,31 @@ +function Symposium($resource){ + this.master = { + type: '', + title: '', + abstract: '', + authors:[ { name:'', surname:'', inst:'', email:'' } ], + }; + this.Symposium = $resource( '/data/conference/Symposium/:_id', { _id:'' } ); + this.reset(); + this.$watch('$location.hashPath', this.hash_change); +} +Symposium.$inject=['$resource']; + +Symposium.prototype = { + hash_change: function() { + var id = this.$location.hashPath; + if ( id ) { + this.symposium = this.Symposium.get({ _id: id }); + } + }, + reset: function() { + console.debug( this.Symposium ); + this.symposium = new this.Symposium( this.master ); + }, + save: function(){ + var l = this.$location; + this.symposium.$save(function(symposium){ + l.hashPath = symposium._id; + }); + } +}; diff --git a/templates/conference/Symposium.html.ep b/templates/conference/Symposium.html.ep index d4c6f06..b51a39b 100644 --- a/templates/conference/Symposium.html.ep +++ b/templates/conference/Symposium.html.ep @@ -4,23 +4,23 @@

Prijava simpozija

-
-permalink to {{work.title}} +
+permalink to {{symposium.title}}
- Naslov:
+ Naslov:
Sazetak:
-
+
-
-[X] +
+[X]
-[Add another author] +[Add another author]
@@ -28,16 +28,4 @@ Novi simpozij -
-Debug Information: -{{$window.location.href}} -
work = {{work}}
-
master = {{master}}
- -
-$id={{$id}}
-work.$id={{work.$id}}
-work._id={{work._id}}
-
-