# HG changeset patch
# User cavaliet
# Date 1378305702 -7200
# Node ID 544bc92e6fe7c24d48cba3fd3f9f33f86c5d4116
# Parent cfc090f440d09f3711dc35e01ee90670fceac223
correct and first add subject
diff -r cfc090f440d0 -r 544bc92e6fe7 src/p4l/static/p4l/js/p4l.js
--- a/src/p4l/static/p4l/js/p4l.js Wed Sep 04 16:17:04 2013 +0200
+++ b/src/p4l/static/p4l/js/p4l.js Wed Sep 04 16:41:42 2013 +0200
@@ -10,6 +10,12 @@
app.controller("RecordCtrl", function($scope, Api, context){
$scope.record = Api.record.get({recordId: context.record_id});
$scope.uriLabels = context.uri_labels;
+
+ $scope.addSubject = function() {
+ $scope.record.subjects.push($scope.addSubjectText);
+ $scope.addSubjectText = '';
+ };
+
});
app.config(['$routeProvider', function($routeProvider) {
diff -r cfc090f440d0 -r 544bc92e6fe7 src/p4l/templates/p4l/p4l_home.html
--- a/src/p4l/templates/p4l/p4l_home.html Wed Sep 04 16:17:04 2013 +0200
+++ b/src/p4l/templates/p4l/p4l_home.html Wed Sep 04 16:41:42 2013 +0200
@@ -48,7 +48,7 @@
{% endfor %}
-
+
|
{% empty %}
diff -r cfc090f440d0 -r 544bc92e6fe7 src/p4l/templates/p4l/record_update_form.html
--- a/src/p4l/templates/p4l/record_update_form.html Wed Sep 04 16:17:04 2013 +0200
+++ b/src/p4l/templates/p4l/record_update_form.html Wed Sep 04 16:41:42 2013 +0200
@@ -12,7 +12,7 @@
angular.module("recordApp")
.value('context', {
record_id: "{{record.identifier}}",
- uri_labels: JSON.parse('{{uri_labels | safe}}'),
+ uri_labels: {{uri_labels | safe}},
urls: {
record_api: "{% url 'record-detail' identifier=':recordId' %}".replace("\%3A",":")
}
@@ -42,6 +42,14 @@
- {{uriLabels[subject]}} ({{subject}})
+
@@ -50,8 +58,9 @@
{% endverbatim %}
{% endblock %}
\ No newline at end of file
diff -r cfc090f440d0 -r 544bc92e6fe7 src/p4l/urls.py
--- a/src/p4l/urls.py Wed Sep 04 16:17:04 2013 +0200
+++ b/src/p4l/urls.py Wed Sep 04 16:41:42 2013 +0200
@@ -9,7 +9,7 @@
url(r'^$', RecordListView.as_view(), name='p4l_home'),
url(r'^auth/', include(auth_urls)),
url(r'^record/view/(?P\w+)$', RecordDetailView.as_view(), name='p4l_record_view'),
- url(r'^record/edit/(?P\w+)$', RecordEditView.as_view(), name='p4l_record_edit'),
+ url(r'^record/edit/(?P\w+)$', RecordEditView.as_view(), name='p4l_record_edit'),
url(r'^api/', include('p4l.api.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
diff -r cfc090f440d0 -r 544bc92e6fe7 src/p4l/views.py
--- a/src/p4l/views.py Wed Sep 04 16:17:04 2013 +0200
+++ b/src/p4l/views.py Wed Sep 04 16:41:42 2013 +0200
@@ -113,7 +113,6 @@
template_name = 'p4l/record_update_form.html'
model = Record
slug_field = "identifier"
- slug_url_kwarg = "id"
def get_context_data(self, **kwargs):
context = DetailView.get_context_data(self, **kwargs)