put directive togethers
authorymh <ymh.work@gmail.com>
Tue, 10 Sep 2013 02:30:23 +0200
changeset 55 a1182b90cbd0
parent 54 9f6e5abc5e74
child 56 cae920b54306
put directive togethers add id to form inputs
src/p4l/static/p4l/js/p4l.js
src/p4l/static/p4l/templates/imprintForm.html
--- a/src/p4l/static/p4l/js/p4l.js	Tue Sep 10 02:01:31 2013 +0200
+++ b/src/p4l/static/p4l/js/p4l.js	Tue Sep 10 02:30:23 2013 +0200
@@ -1,5 +1,4 @@
-
-"use strict";
+//"use strict";
 // initialize the app
 
 var app = angular.module("recordApp", ['ngResource', 'ngRoute', 'pascalprecht.translate'])
@@ -116,19 +115,6 @@
 });
 
 
-
-app.controller("RecordCtrl", function($scope, RecordModel, context){
-    
-    $scope.record = RecordModel.record;
-    $scope.uriLabels = RecordModel.uriLabels;    
-        
-    $scope.submitRecord = function() {
-        $scope.record.$save({recordId: context.record_id});
-    }
-    
-    
-});
-
 app.directive('addSemUri', function(RecordModel, context){
   return {
       restrict: 'E',
@@ -170,7 +156,19 @@
 	    };
       }
     }
-  });
+});
+
+app.controller("RecordCtrl", function($scope, RecordModel, context){
+    
+    $scope.record = RecordModel.record;
+    $scope.uriLabels = RecordModel.uriLabels;    
+        
+    $scope.submitRecord = function() {
+        $scope.record.$save({recordId: context.record_id});
+    }
+    
+    
+});
 
 app.config(['$routeProvider', function($routeProvider) {
 //    $routeProvider.when('/', {controller: 'RecordCtrl', templateUrl: 'partials/record.html'});
--- a/src/p4l/static/p4l/templates/imprintForm.html	Tue Sep 10 02:01:31 2013 +0200
+++ b/src/p4l/static/p4l/templates/imprintForm.html	Tue Sep 10 02:30:23 2013 +0200
@@ -1,10 +1,10 @@
  <form class="well span6">
     <div class="span3 row">
-     <label for="imprint-city">{{'City'|translate}}</label><input type="text" placeholder="{{'City'|translate}}" ng_model="editedObj.imprintCity" name="imprintCity" id="imprint-city" class="span3"/>
-     <label for="imprint-publisher">{{'Publisher'|translate}}</label><input type="text" placeholder="{{'Publisher'|translate}}" ng_model="editedObj.publisher" name="publisher" id="imprint-publisher" class="span3"/>
+     <label for="imprint-city-{{$id}}">{{'City'|translate}}</label><input type="text" placeholder="{{'City'|translate}}" ng_model="editedObj.imprintCity" name="imprintCity" id="imprint-city-{{$id}}" class="span3"/>
+     <label for="imprint-publisher-{{$id}}">{{'Publisher'|translate}}</label><input type="text" placeholder="{{'Publisher'|translate}}" ng_model="editedObj.publisher" name="publisher" id="imprint-publisher-{{$id}}" class="span3"/>
      </div>
      <div class="span3 row">
-     <label for="imprint-date">{{'Date'|translate}}</label><input type="text" placeholder="{{'Date'|translate}}" ng_model="editedObj.imprintDate" name="imprintDate" id="imprint-date" class="span3"/>
-     <label for="imprint-lang">{{'Language'|translate}}</label><input type="text" placeholder="{{'Language'|translate}}" ng_model="editedObj.lang" name="lang" id="imprint-lang" class="span3"/>
+     <label for="imprint-date-{{$id}}">{{'Date'|translate}}</label><input type="text" placeholder="{{'Date'|translate}}" ng_model="editedObj.imprintDate" name="imprintDate" id="imprint-date-{{$id}}" class="span3"/>
+     <label for="imprint-lang-{{$id}}">{{'Language'|translate}}</label><input type="text" placeholder="{{'Language'|translate}}" ng_model="editedObj.lang" name="lang" id="imprint-lang-{{$id}}" class="span3"/>
      </div>
  </form>
\ No newline at end of file