From f27cd1e8c9558d5ba20bdfacdfc5162a27837b56 Mon Sep 17 00:00:00 2001 From: yomguy Date: Thu, 14 Apr 2011 13:59:48 +0200 Subject: [PATCH] fix item page title, add autonomous player but we have to make two JS and HTML for it so that the mediaitem_detail and mediaitem_player templates call them both --- telemeta/htdocs/css/telemeta.css | 5 + .../templates/telemeta/mediaitem_player.html | 1 + .../telemeta_default/mediaitem_detail.html | 12 +- .../telemeta_default/mediaitem_player.html | 177 ++++++++++++++++++ telemeta/urls.py | 2 + telemeta/web/base.py | 3 +- 6 files changed, 192 insertions(+), 8 deletions(-) create mode 100644 telemeta/templates/telemeta/mediaitem_player.html create mode 100644 telemeta/templates/telemeta_default/mediaitem_player.html diff --git a/telemeta/htdocs/css/telemeta.css b/telemeta/htdocs/css/telemeta.css index c504d503..3ee4759a 100644 --- a/telemeta/htdocs/css/telemeta.css +++ b/telemeta/htdocs/css/telemeta.css @@ -114,16 +114,19 @@ a img { border: none; } #content_header td{ vertical-align: top; } + #content_header td.rightcol{ text-align:right; white-space:nowrap; /**this implies to stretach righcol to accomodate all the width, UNLESS there is a div.fixedWidthAsPlayer inside td.rightcol (see blow)*/ } + #content_header td.rightcol div.fixedWidthAsPlayer{ width:374px; /*must be width+2*padding, see #rightcol below*/ float:right; white-space:normal; /*to override no-wrap defined in #content_header td.rightcol*/ } + #content_header td.rightcol div.fixedWidthAsPlayer a{ display:inline-block; margin-top:0.5ex; @@ -141,10 +144,12 @@ a img { border: none; } -webkit-border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px; } + #rightcol .analyzer, #rightcol .exporter, .markers { text-align: left; position: relative; } + #rightcol form { width: 360px; margin-top: 5px; diff --git a/telemeta/templates/telemeta/mediaitem_player.html b/telemeta/templates/telemeta/mediaitem_player.html new file mode 100644 index 00000000..2b8b1a1a --- /dev/null +++ b/telemeta/templates/telemeta/mediaitem_player.html @@ -0,0 +1 @@ +{% extends "telemeta_default/mediaitem_player.html" %} diff --git a/telemeta/templates/telemeta_default/mediaitem_detail.html b/telemeta/templates/telemeta_default/mediaitem_detail.html index feef1abf..2cba3efc 100644 --- a/telemeta/templates/telemeta_default/mediaitem_detail.html +++ b/telemeta/templates/telemeta_default/mediaitem_detail.html @@ -2,17 +2,17 @@ {% load telemeta_utils %} {% load i18n %} -{% block head_title %}{% trans "Item" %}- {{ block.super }}{% endblock %} +{% block head_title %}{{ block.super }} - {% trans "Item" %} : {{ item.title }}{% endblock %} {% block stylesheets %} {{ block.super }} - - - {% endblock %} + + +{% endblock %} - {% block extra_javascript %} - +{% block extra_javascript %} + + + +{% block extra_javascript %} + + + +{% endblock %} + +{% if user.is_authenticated and perms.telemeta.change_mediaitem %} + +{% else %} + +{% endif %} + + + + + +{% block content %} + +
+{% if item.file %} + {% if public_access or user.is_staff %} +
+ Minimize +
+
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
+
+  Visualization : + + +
+
+ +
+ +   + Loading... + + +
+ +
+ +
+ + + + + + + +
{% trans "Property" %}{% trans "Value" %}{% trans "Unit" %}
+
+ + + {% if audio_export_enabled %} +
+

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

+
+ {% endif %} + +
+ {% endif %} + {% endif %} + +
+ +{% endblock %} + + + \ No newline at end of file diff --git a/telemeta/urls.py b/telemeta/urls.py index f4fb66c0..7a297449 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -95,6 +95,8 @@ urlpatterns = patterns('', dict(template='telemeta/mediaitem_copy.html'), name="telemeta-item-copy"), url(r'^item/add/$', web_view.item_add, dict(template='telemeta/mediaitem_add.html'), name="telemeta-item-add"), + url(r'^items/(?P[A-Za-z0-9._-]+)/player/$', web_view.item_detail, + dict(template='telemeta/mediaitem_player.html'), name="telemeta-item-player"), # Markers url(r'^markers/(?P[A-Za-z0-9]+)/$', web_view.item_detail, name="telemeta-item-detail-marker"), diff --git a/telemeta/web/base.py b/telemeta/web/base.py index 4db69776..7b796a95 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -295,7 +295,7 @@ class WebView(object): 'previous' : previous, 'next' : next, 'marker': marker_id, 'playlists' : playlists, 'public_access': public_access, 'translations': translations, }) - + def get_public_access(self, access, date_from, date_to): # Rolling publishing date : Public access when time between recorded year # and currant year is over settings value PUBLIC_ACCESS_PERIOD @@ -377,7 +377,6 @@ class WebView(object): return render(request, template, {'item': item, "form": form}) - @method_decorator(permission_required('telemeta.add_mediaitem')) def item_copy(self, request, public_id, template='telemeta/mediaitem_copy.html'): """Show the details of a given item""" -- 2.39.5