delete subject and update lang
authorcavaliet
Thu, 05 Sep 2013 16:28:59 +0200
changeset 44 65912194e047
parent 43 829d9d4111da
child 45 9dd14a51a2bb
delete subject and update lang
src/p4l/locale/fr/LC_MESSAGES/django.mo
src/p4l/locale/fr/LC_MESSAGES/django.po
src/p4l/static/p4l/js/p4l.js
src/p4l/templates/p4l/record_update_form.html
Binary file src/p4l/locale/fr/LC_MESSAGES/django.mo has changed
--- a/src/p4l/locale/fr/LC_MESSAGES/django.po	Thu Sep 05 15:47:30 2013 +0200
+++ b/src/p4l/locale/fr/LC_MESSAGES/django.po	Thu Sep 05 16:28:59 2013 +0200
@@ -276,3 +276,19 @@
 #: templates/registration/login.html:20 templates/registration/login.html:22
 msgid "Password"
 msgstr "Mot de passe"
+
+#: templates/p4l/record_update_form.html:0
+msgid "Add"
+msgstr "Ajouter"
+
+#: templates/p4l/record_update_form.html:0
+msgid "or"
+msgstr "ou"
+
+#: templates/p4l/record_update_form.html:0
+msgid "Browse"
+msgstr "Parcourir"
+
+#: templates/p4l/record_update_form.html:0
+msgid "Add a new subject"
+msgstr "Ajouter un nouveau sujet"
\ No newline at end of file
--- a/src/p4l/static/p4l/js/p4l.js	Thu Sep 05 15:47:30 2013 +0200
+++ b/src/p4l/static/p4l/js/p4l.js	Thu Sep 05 16:28:59 2013 +0200
@@ -20,6 +20,12 @@
     	$scope.uriLabels[k] = v;
     };
     
+    $scope.removeSubject = function(uri) {
+    	i = $scope.record.subjects.indexOf(uri);
+    	if(i>=0){
+    		$scope.record.subjects.splice(i, 1);
+    	}
+    };
 });
 
 app.config(['$routeProvider', function($routeProvider) {
--- a/src/p4l/templates/p4l/record_update_form.html	Thu Sep 05 15:47:30 2013 +0200
+++ b/src/p4l/templates/p4l/record_update_form.html	Thu Sep 05 16:28:59 2013 +0200
@@ -61,26 +61,26 @@
       <td>{{'subjects' | translate}}</td>
       <td>
           <ul ng-repeat="subject in record.subjects">
-              <li>{{uriLabels[subject]}} <small class="text-muted">({{subject}})</small></li>
+              <li>{{uriLabels[subject]}} <small class="text-muted">({{subject}})</small> <a ng-click='removeSubject(subject)' class="btn btn-default btn-xs"><i class="glyphicon glyphicon-trash"></i></a></li>
           </ul>
           <form class="form-inline" role="form" ng-submit="addSubject()">
 	        <div class="form-group col-md-8">
-	          <input id="id_addSubjectText" ng-model="addSubjectText" class="semantic-tree form-control col-md-10" type="text" placeholder="Add a new subject" required="required"/>
-	          ou 
+	          <input id="id_addSubjectText" ng-model="addSubjectText" class="semantic-tree form-control col-md-10" type="text" placeholder="{{'Add a new subject' | translate}}" required="required"/>
+	          {{'or' | translate}} 
 	          <span id="dialog-link-container-addSubjectText" class="dialog-link-container ui-state-default ui-corner-all">
-	            <a href="#" id="dialog-link-addSubjectText" class="dialog-link" title="Browse">Browse</a>
+	            <a href="#" id="dialog-link-addSubjectText" class="btn dialog-link" title="Browse">{{'Browse' | translate}}</a>
 	          </span>
 	          <span id="dialog-addSubjectText" class="dialog" title="Select term"><span id="term-tree-addSubjectText"></span></span>
 	        </div>
 	        <div class="form-group">
-	          <button type="submit" class="btn btn-primary">Add</button>
+	          <button type="submit" class="btn btn-primary">{{'Add' | translate}}</button>
 	        </div>
 	      </form>
       </td>
     </tr>
     <tr>
         <td>{{'notes' | translate}}</td>
-        <td><textarea id="record-notes-input" ng-model="record.notes"></textarea></td>
+        <td><textarea id="record-notes-input" class="form-control" ng-model="record.notes"></textarea></td>
     </tr>
   </tbody>
 </table>