From 47b76981dbf7cba2f25e8c270ac9158319fd7d2d Mon Sep 17 00:00:00 2001 From: yomguy Date: Mon, 2 Apr 2012 11:13:17 +0200 Subject: [PATCH] add simple player for clean iframe, fix sandbox for django 1.4 --- example/sandbox_sqlite/settings.py | 28 +++++++++-- telemeta/htdocs/css/telemeta.css | 34 ++++++------- .../telemeta/mediaitem_player_simple.html | 49 +++++++++++++++++++ telemeta/urls.py | 2 + 4 files changed, 92 insertions(+), 21 deletions(-) create mode 100644 telemeta/templates/telemeta/mediaitem_player_simple.html diff --git a/example/sandbox_sqlite/settings.py b/example/sandbox_sqlite/settings.py index 5ff93f3e..d7e1b862 100644 --- a/example/sandbox_sqlite/settings.py +++ b/example/sandbox_sqlite/settings.py @@ -61,11 +61,30 @@ if not os.path.exists(MEDIA_ROOT): # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/media/' -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = 'http://localhost/django/media/' +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/home/media/media.lawrence.com/static/" +STATIC_ROOT = '/data/telemeta/static/' + +# URL prefix for static files. +# Example: "http://media.lawrence.com/static/" +STATIC_URL = '/static/' + +# Additional locations of static files +STATICFILES_DIRS = ( +# Put strings here, like "/home/html/static" or "C:/www/django/static". +# Always use forward slashes, even on Windows. +# Don't forget to use absolute paths, not relative paths. +) +# List of finder classes that know how to find static files in +# various locations. +STATICFILES_FINDERS = ( +'django.contrib.staticfiles.finders.FileSystemFinder', +'django.contrib.staticfiles.finders.AppDirectoriesFinder', +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', +) # Make this unique, and don't share it with anybody. SECRET_KEY = 'a8l7%06wr2k+3=%#*#@#rvop2mmzko)44%7k(zx%lls^ihm9^5' @@ -102,6 +121,7 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.admin', + 'django.contrib.staticfiles', 'django_extensions', 'telemeta', 'jsonrpc', diff --git a/telemeta/htdocs/css/telemeta.css b/telemeta/htdocs/css/telemeta.css index f4bda641..d1a4dae9 100644 --- a/telemeta/htdocs/css/telemeta.css +++ b/telemeta/htdocs/css/telemeta.css @@ -87,7 +87,7 @@ a img { border: none; } color: #6a0307; font-weight: bold; display: inline; - font-size: 120%; + font-size: 120%; } #content h3 { color: #6a0307; @@ -167,12 +167,12 @@ a img { border: none; } } #collection_player { - background: transparent; + background: transparent; /* background-image: url(../images/grid_bg.png); */ } #collection_player .title { - padding: 2px 5px 7px 5px; + padding: 2px 5px 7px 5px; } @@ -207,7 +207,7 @@ a img { border: none; } overflow-y: scroll; width: 100%; } - + .analyzer-title { background-color: #f2f2f2; @@ -476,24 +476,24 @@ form.login .submit { /* Drop Down Menus */ -.clear {clear:both} +.clear {clear:both} #nav { margin:0; padding:0; list-style:none; -} +} /* make the LI display inline */ /* it's position relative so that position absolute */ /* can be used in submenu */ #nav li { -display:inline-block; +display:inline-block; position:relative; z-index:500; } - + /* this is the parent menu */ #nav li a { display:block; @@ -519,16 +519,16 @@ color:#FFF; background-color: #6a0307; color: #FFF; } - + #nav ul li { width:100px; float:left; border-bottom:0px solid #fff; } - + /* display block will make the link fill the whole area of LI */ #nav ul a { - display:block; + display:block; height:15px; padding: 5px 5px; font-size: 11px; @@ -541,7 +541,7 @@ color:#FFF; border-top-right-radius: 0px 0px; border-bottom-width: 0px; } - + #nav ul a:hover { background-color: #FFF ; color: #6a0307 ; @@ -851,12 +851,12 @@ table.listing tbody tr.odd { background-color: #f7f7f7 } table.listing tbody tr:hover { background: #f7f8fa !important } table td.error { - color: red; + color: red; font-weight: bold; } .infos li.error{ - color: red; + color: red; font-weight: bold; font-size: 110%; } @@ -918,7 +918,7 @@ img.align-left { #module-set .module h3 { color: #FFF; font-size: 1.1em; - font-weight: bold; + font-weight: bold; } #module-set .module a:hover { @@ -1076,7 +1076,7 @@ a.image-link { -moz-border-radius: 1ex;-webkit-border-radius: 1ex;border-radius: 1ex; background-image: url('../images/ok.png'); } -.markerdiv{ +.markerdiv{ border: 1px solid #aaaaaa; margin-bottom: 1ex; -moz-border-radius: 1e; @@ -1137,7 +1137,7 @@ a.image-link { } .icon_edit{ - background-image: url('../images/edit_page.png'); + background-image: url('../images/edit_page.png'); } .icon_copy{ background-image: url('../images/copy_page.png'); diff --git a/telemeta/templates/telemeta/mediaitem_player_simple.html b/telemeta/templates/telemeta/mediaitem_player_simple.html new file mode 100644 index 00000000..f7a3cee9 --- /dev/null +++ b/telemeta/templates/telemeta/mediaitem_player_simple.html @@ -0,0 +1,49 @@ +{% extends "telemeta/mediaitem_detail.html" %} +{% load telemeta_utils %} +{% load i18n %} + + +{% block stylesheets %} +{{ block.super }} + +{% endblock %} + +{% block title %}{% endblock %} +{% block title_buttons %}{% endblock %} + +{% block layout %} +{% block content %} +
+{% if item.file %} + {% if public_access or user.is_staff %} +
+
+
+
+
+
+ +
+ {% endif %} +{% endif %} +
+ +{% endblock content%} +{% endblock layout %} + +{% block footer %}{% endblock %} diff --git a/telemeta/urls.py b/telemeta/urls.py index b2b9ec63..96192ba9 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -112,6 +112,8 @@ urlpatterns = patterns('', dict(template='telemeta/mediaitem_add.html'), name="telemeta-item-add"), url(r'^archives/items/(?P[A-Za-z0-9._-]+)/player/(?P[0-9]+)x(?P[0-9]+)/$', item_view.item_detail, dict(template='telemeta/mediaitem_player.html'), name="telemeta-item-player"), + url(r'^archives/items/(?P[A-Za-z0-9._-]+)/player/(?P[0-9]+)x(?P[0-9]+)/simple/$', item_view.item_detail, + dict(template='telemeta/mediaitem_player_simple.html'), name="telemeta-item-player-simple"), url(r'^archives/items/(?P[A-Za-z0-9._-]+)/performances/$', item_view.item_performances_edit, dict(template='telemeta/mediaitem_performances_edit.html'), name="telemeta-item-performances_edit"), url(r'^archives/items/(?P[A-Za-z0-9._-]+)/keywords/$', item_view.item_keywords_edit, -- 2.39.5