review prototype form
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 25 Jan 2013 01:41:21 +0000 (02:41 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 25 Jan 2013 11:34:12 +0000 (12:34 +0100)
app/js/app.js
app/js/services.js.ep
app/partials/review.html.ep [new file with mode: 0644]
test/unit/servicesSpec.js

index 0d81180..661be9e 100644 (file)
@@ -8,6 +8,7 @@ angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives',
     $routeProvider.when('/confirmation/:registrationId', {templateUrl: 'partials/confirmation.html', controller: RegistrationCtrl});
     $routeProvider.when('/draft/:registrationId', {templateUrl: 'partials/draft.html', controller: RegistrationCtrl});
     $routeProvider.when('/verified/:registrationId', {templateUrl: 'partials/verified.html', controller: RegistrationCtrl});
+    $routeProvider.when('/review/:registrationId', {templateUrl: 'partials/review.html', controller: RegistrationCtrl});
     $routeProvider.when('/list', {templateUrl: 'partials/list.html', controller: ListCtrl});
     $routeProvider.otherwise({redirectTo: '/registration/'});
   }]);
index 9c0f251..9149a3f 100644 (file)
@@ -68,5 +68,5 @@ angular.module('myApp.services', [ 'ngResource' ]).
        }).
 /* http://jsfiddle.net/asgoth/7bNAd/ */
        value('RegistrationState', function() {
-               return [ 'draft', 'confirmation', 'verified' ];
+               return [ 'draft', 'confirmation', 'verified', 'review' ];
        });
diff --git a/app/partials/review.html.ep b/app/partials/review.html.ep
new file mode 100644 (file)
index 0000000..9b19550
--- /dev/null
@@ -0,0 +1,39 @@
+<h1> Registracija i prijavljivanje izlaganja</h1>
+
+<form ng-controller="RegistrationCtrl" name="RegistrationForm" class="form-horizontal">
+
+<div class="alert" ng-class="info.css_class" ng-show="info.message">
+{{info.message}}
+</div>
+
+<fieldset>
+<legend>
+<%= locale en => 'Review', hr => 'Recenzija' %>
+</legend>
+
+<input class="my-label-input" ng-model="registration.review.person" label="Recenzent" placeholder="Ime Prezime" >
+
+<input class="my-label-input" ng-model="registration.review.note" label="BiljeÅ¡ka" >
+
+<button class="btn btn-primary" ng-click="update(registration, registration.state, '<%= locale en => 'Changes saved', hr => 'Promjene spremljene' %>')" ng-show="RegistrationForm.$dirty">
+<%= locale en => 'Save changes', hr => 'Spremi promjene' %>
+</button>
+
+<div class="well">
+%= include 'registration/view'
+</div>
+
+</div>
+
+% if ( $lang =~ m/-dev/ ) {
+<pre>
+$dirty = {{RegistrationForm.$dirty}}
+$pristine = {{RegistrationForm.$pristine}}
+
+{{registration}}
+</pre>
+% }
+
+</form>
+
+
index 83cdd83..138ffec 100644 (file)
@@ -21,7 +21,7 @@ describe('service', function() {
 
        describe('RegistrationState', function() {
                it('have status', inject(function(RegistrationState) {
-                       expect(RegistrationState().length).toBe(3);
+                       expect(RegistrationState().length).toBe(4);
                }));
        });