From 67dc10565fee3a6dddd866b7af41c3154e769328 Mon Sep 17 00:00:00 2001 From: sanj Date: Tue, 13 Jul 2010 00:39:02 +0530 Subject: [PATCH] padma.local -- toward a presentation tool --- lists/views.py | 15 +++- settings.py | 1 + static/css/padmaList.css | 98 +++++++++++++++++++++- static/js/padmaApi.js | 95 ++++++++++++++++++++-- static/js/padmaList.js | 171 ++------------------------------------- static/js/padmaLists.js | 3 +- templates/list.html | 47 ++++++++++- 7 files changed, 251 insertions(+), 179 deletions(-) diff --git a/lists/views.py b/lists/views.py index 8ab2a7b..1c5eac7 100644 --- a/lists/views.py +++ b/lists/views.py @@ -2,6 +2,7 @@ import urllib from django.utils import simplejson from django.http import HttpResponse from django.shortcuts import render_to_response +from settings import PADMA_URL def getHtmlFromUrl(url): try: @@ -20,6 +21,16 @@ def fetchJson(request): else: return HttpResponse("{'error': True}", mimetype="application/javascript") +def fetchSrt(request): + if request.GET['id']: + padmaId = request.GET['id'] + track = request.GET['track'] or 'transcript' + url = "%s%s/export/%s.srt" % (PADMA_URL, padmaId, track,) + srt = getHtmlFromUrl(url) + return HttpResponse(srt) + else: + return HttpResponse("{'error': True}", mimetype="application/javascript") + def index(request): return render_to_response("index.html") @@ -28,4 +39,6 @@ def listDetail(request): rDict = {'listId': request.GET['id'] } return render_to_response("list.html", rDict) else: - return HttpResponse("Please pass me a list id:(") + return HttpResponse("Please pass me a list id") + + diff --git a/settings.py b/settings.py index 6f893a5..3101280 100644 --- a/settings.py +++ b/settings.py @@ -10,6 +10,7 @@ LOGGING_INTERCEPT_REDIRECTS = True LOGGING_LOG_SQL = True LOGGING_SHOW_METRICS = True LOGGING_OUTPUT_ENABLED = True +PADMA_URL = "http://padma.local/" PROJECT_PATH = os.path.dirname(__file__) diff --git a/static/css/padmaList.css b/static/css/padmaList.css index a2c84b4..b797930 100644 --- a/static/css/padmaList.css +++ b/static/css/padmaList.css @@ -1,16 +1,78 @@ -#wrapper { +html, body { + width: 100%; + font-size: 12px; +} + +#wrapper, #floatWrapper { width: 100%; } +#videos { + width: 40%; +} + +.layerResult { + margin-bottom: 2px; + font-size: 10px; +} + +.layerResult.keyword { + background: orange; +} + +.layerResult.description { + background: blue; +} + +.layerResult.transcript { + background: green; +} + +.layerResult.location { + background: purple; +} + +.layerResult a { + color: white; + font-weight: bold; + text-decoration: none; +} + +.layerResult a:hover { + color: lightgrey; +} + +.layerInOut { + color: yellow; + font-weight: bold; +} + +.layerTrack { + font-weight: bold; +} .videoWrapper { border: 1px solid #000; - width: 80%; + width: 100%; min-height: 180px; +/* margin-left: auto; margin-right: auto; +*/ margin-bottom: 15px; } +#playBin { + position: fixed; + height: 96%; + overflow: auto; + left: 45%; + top: 2%; + bottom: 2%; + right: 5%; + border: 1px solid #000; + height: 500px; +} + .videoTitle { font-weight: bold; text-align: center; @@ -21,7 +83,7 @@ } .videoMeta { - clear: left; +/* clear: left; */ } .videoPoster { @@ -40,6 +102,32 @@ display: none; } +.padmaClip { +/* height: 128px; */ + padding: 5px; + margin-bottom: 2px; + background: #ccc; + position: relative; +} + + +.layerImages { + float: left; +} + +.layerControls { + float: left; +} + +.clipImage { + float: left; + width: 128px; + text-align: center; + color: #363636; + font-weight: bold; + margin-right: 6px; + height: 100px; +} #searchDiv { margin-right: 20px; text-align: right; @@ -62,3 +150,7 @@ color: #ccc; clear: both; } + +#results { + z-index: 500; + } diff --git a/static/js/padmaApi.js b/static/js/padmaApi.js index ebf15f2..dc603be 100644 --- a/static/js/padmaApi.js +++ b/static/js/padmaApi.js @@ -1,8 +1,93 @@ -var local_json_url = "/jPadma?url=http://pad.ma"; +//REMOVE tmpl FROM HERE!!! +/* +John Resig's templating utility - http://ejohn.org/blog/javascript-micro-templating/ +Not updated code to resolve issue with single quotes from: http://www.west-wind.com/Weblog/posts/509108.aspx +define templates inside + + + @@ -10,7 +14,7 @@ var listId = "{{ listId|escapejs }}" {% endblock %} {% block body %} -
+ + + +
+
+ +
+ +
+ +




- Search: +
+ Search: +