From d4305e491ea6b4632e5576188be9813dcbe518d7 Mon Sep 17 00:00:00 2001 From: yomguy Date: Mon, 14 Feb 2011 13:46:31 +0100 Subject: [PATCH] fix json from current relative url, add player to edit mode, cleanup --- telemeta/htdocs/timeside/src/controller.js | 2 +- telemeta/htdocs/timeside/src/markermap.js | 2 +- .../collection_detail_edit.html | 17 ++- .../mediaitem_detail_edit.html | 128 ++++++++++++++++-- telemeta/web/base.py | 7 +- 5 files changed, 137 insertions(+), 19 deletions(-) diff --git a/telemeta/htdocs/timeside/src/controller.js b/telemeta/htdocs/timeside/src/controller.js index 9a1be290..f7d13f0c 100644 --- a/telemeta/htdocs/timeside/src/controller.js +++ b/telemeta/htdocs/timeside/src/controller.js @@ -78,7 +78,7 @@ TimeSide(function($N) { var me = this; $.ajax({ type: "POST", - url: 'http://localhost:9000/json/', + url: '/json/', contentType: "application/json", data: data2send, dataType: "json", diff --git a/telemeta/htdocs/timeside/src/markermap.js b/telemeta/htdocs/timeside/src/markermap.js index cae91762..82357080 100644 --- a/telemeta/htdocs/timeside/src/markermap.js +++ b/telemeta/htdocs/timeside/src/markermap.js @@ -437,7 +437,7 @@ TimeSide(function($N, $J) { $.ajax({ type: "POST", - url: 'http://localhost:9000/json/', + url: '/json/', contentType: "application/json", data: data2send, success: function(){ diff --git a/telemeta/templates/telemeta_default/collection_detail_edit.html b/telemeta/templates/telemeta_default/collection_detail_edit.html index 73c80221..d1b369c9 100644 --- a/telemeta/templates/telemeta_default/collection_detail_edit.html +++ b/telemeta/templates/telemeta_default/collection_detail_edit.html @@ -4,6 +4,14 @@ {% block head_title %}{% trans "Collection" %}{{collection|prepend:': '}} - {{ block.super }}{% endblock %} +{% block stylesheets %} +{{ block.super }} + + + +{% endblock %} +{% block extra_javascript %} +{% endblock %} {% if collection %} @@ -14,11 +22,12 @@ {% block content %}

Collection: {{ collection }}

-
{% csrf_token %} - {{ formset }} - - + + {{ formset }} +
+ +
{% endblock %} {% else %} diff --git a/telemeta/templates/telemeta_default/mediaitem_detail_edit.html b/telemeta/templates/telemeta_default/mediaitem_detail_edit.html index 1d099886..c88b2c44 100644 --- a/telemeta/templates/telemeta_default/mediaitem_detail_edit.html +++ b/telemeta/templates/telemeta_default/mediaitem_detail_edit.html @@ -7,34 +7,146 @@ {% block stylesheets %} {{ block.super }} - - -{% endblock %} -{% block extra_javascript %} + + + {% endblock %} + {% block extra_javascript %} + + + + + + {% endblock %} + {% if item %} {% block submenu %}
+ Dublin Core
{% endblock %} {% block content %} -

Item : {{ item }}

+
+ + {% if item.file %} +
+ Minimize +
+
+
+
+ Maximize +
+
+
+
+
+ + +
+
+
+
+
+ +
+
+
+
+
+
+ + + +
+ +
+ + + + + + + {% for analyser in analysers %} + + + + + + {% endfor %} +
PropertyValueUnit
+ {{ analyser.name }} + + {{ analyser.value }} + + {{ analyser.unit }} +
+
+ +
+
+ {% if audio_export_enabled %} +
+

{% trans "Download:" %} + {% for format in export_formats %} + {{ format.name }} + {% endfor %}

+
+ {% endif %} + +
+ {% endif %}
-
{% csrf_token %} + {% csrf_token %} + {{ formset }} - - +
+ +
+
{% endblock %} + {% else %}

No such item

{% endif %} diff --git a/telemeta/web/base.py b/telemeta/web/base.py index 490a56f7..95a7ce8b 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -181,7 +181,7 @@ class WebView(object): }) def item_analyze(self, item): - public_id = item.public_id + public_id = str(item.public_id) analyze_file = public_id + '.xml' if self.cache.exists(analyze_file): @@ -375,7 +375,7 @@ class WebView(object): if func and value and value != "0": try: res = func(value) - if len(res) > 2: + if len(res) > 2: collections, items, value = res else: collections, items = res @@ -599,9 +599,6 @@ class WebView(object): def del_marker(request, public_id): m = MediaItemMarker.objects.get(public_id=public_id) m.delete() -# m = MediaItemMarker.objects.filter(public_id=public_id) -# for marker in m: -# marker.delete() @jsonrpc_method('telemeta.get_markers') def get_markers(request, item_id): -- 2.39.5