From: Dobrica Pavlinusic Date: Fri, 5 Nov 2010 12:14:23 +0000 (+0100) Subject: Merge branch 'master' of github.com:dpavlin/angular-mojolicious X-Git-Url: http://git.rot13.org/?p=angular-mojolicious.git;a=commitdiff_plain;h=a1d26a06000b2d2d235c64c6bea06a4a1550a4be;hp=aee0665504a089a1c2f7152604b90e03c5862358 Merge branch 'master' of github.com:dpavlin/angular-mojolicious --- diff --git a/.gitmodules b/.gitmodules index f4358d5..1912998 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "public/angular"] path = public/angular url = git://github.com/angular/angular.js.git +[submodule "common/mojo"] + path = common/mojo + url = http://github.com/kraih/mojo.git diff --git a/angular-server.pl b/angular-server.pl index 0a6cd75..e9d33ee 100755 --- a/angular-server.pl +++ b/angular-server.pl @@ -1,10 +1,14 @@ #!/usr/bin/env perl +use lib 'common/mojo/lib'; + use Mojolicious::Lite; use Data::Dump qw(dump); -use Time::HiRes qw(time); +use Time::HiRes; use Clone qw(clone); +sub new_uuid { Time::HiRes::time * 100000 } + # based on # http://docs.getangular.com/REST.Basic # http://angular.getangular.com/data @@ -125,7 +129,7 @@ any [ 'post' ] => '/data/:database/:entity' => sub { my $json = $self->req->json; my $id = $json->{'$id'} # XXX we don't get it back from angular.js || $json->{'_id'} # so we use our version - || Time::HiRes::time(); # FIXME UUID? + || new_uuid; warn "## $id body ",dump($self->req->body, $json); die "no data" unless $data; @@ -182,6 +186,7 @@ Yea baby! + % my $ANGULAR_JS = $ENV{ANGULAR_JS} || ( -e 'public/angular/build/angular.js' ? '/angular/build/angular.js' : '/angular/src/angular-bootstrap.js' ); diff --git a/common/mojo b/common/mojo new file mode 160000 index 0000000..f56f468 --- /dev/null +++ b/common/mojo @@ -0,0 +1 @@ +Subproject commit f56f46879ef7fc32346ca8696270c6d47cb6cc5f diff --git a/public/angular b/public/angular index 9a53200..3b04b48 160000 --- a/public/angular +++ b/public/angular @@ -1 +1 @@ -Subproject commit 9a532002cf490a3e26a827e2eab9c1c3d834e2b8 +Subproject commit 3b04b48b7cc8f19f3e3ee1720188ea58ebb5d204 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 new file mode 100644 index 0000000..b51a39b --- /dev/null +++ b/templates/conference/Symposium.html.ep @@ -0,0 +1,31 @@ + + +
+ +

Prijava simpozija

+ +
+permalink to {{symposium.title}} +
+ + Naslov:
+ + Sazetak:
+
+ +
+[X] + + + + +
+[Add another author] + +
+ + + + Novi simpozij + +
diff --git a/templates/conference/Work.html.ep b/templates/conference/Work.html.ep index 4190fb5..253287d 100644 --- a/templates/conference/Work.html.ep +++ b/templates/conference/Work.html.ep @@ -1,56 +1,109 @@ -
-
-$id={{$id}}
-work.$id={{work.$id}}
-work._id={{work._id}}
-
-
- Simpozij
- Predavanje
+

Prijava rada

+ +
+ +

Vrsta rada:

+ Simpozij + +
+ + +Tema simpozija:
+ +Sažetak:
+
+ +Organizator: +
+[X] + + + + +
+[Add another organizer] + +
+ +
+ + Predavanje
Poster
Okrugli stol
- +[Add another author] +
Naslov:
- + Sazetak:

- + + + + + {{$invalidWidgets.visible()}} errors to fix in submission form +
+ permalink to {{work.title}} +

Debug Information: @@ -95,4 +156,10 @@ Debug Information:
work = {{work}}
master = {{master}}
+
+$id={{$id}}
+work.$id={{work.$id}}
+work._id={{work._id}}
+
+