fix padma.jsonc and adjust whats needed to get it running

This commit is contained in:
j 2011-12-05 14:48:59 +01:00
parent b855c153e0
commit c930383b32
12 changed files with 93 additions and 45 deletions

View file

@ -74,10 +74,9 @@ class Annotation(models.Model):
if l['id'] == id: if l['id'] == id:
return l return l
return {} return {}
private = get_layer(self.layer).get('private') private = get_layer(self.layer).get('private', False)
if not self.clip and not private or \ if not private:
(self.clip and not private and \ if not self.clip or self.start != self.clip.start or self.end != self.clip.end:
self.start != self.clip.start or self.end != self.clip.end):
self.clip, created = Clip.get_or_create(self.item, self.start, self.end) self.clip, created = Clip.get_or_create(self.item, self.start, self.end)
super(Annotation, self).save(*args, **kwargs) super(Annotation, self).save(*args, **kwargs)

View file

@ -107,6 +107,11 @@ def update_static():
ox.net.saveUrl(url, "%s.gz"%path) ox.net.saveUrl(url, "%s.gz"%path)
os.system('gunzip "%s.gz"' % path) os.system('gunzip "%s.gz"' % path)
#poster script
if not os.path.exists(settings.ITEM_POSTER):
os.symlink(settings.ITEM_POSTER.replace('poster', 'oxdb_poster'),
settings.ITEM_POSTER)
def init(): def init():
load_config() load_config()
thread.start_new_thread(reloader_thread, ()) thread.start_new_thread(reloader_thread, ())

View file

@ -29,7 +29,9 @@ def index(request):
def embed(request, id): def embed(request, id):
context = RequestContext(request, {'settings': settings}) context = RequestContext(request, {
'settings': settings
})
return render_to_response('embed.html', context) return render_to_response('embed.html', context)

View file

@ -111,7 +111,7 @@ attrs = {
'lightness': models.FloatField(default=0, db_index=True), 'lightness': models.FloatField(default=0, db_index=True),
'volume': models.FloatField(default=0, null=True, db_index=True), 'volume': models.FloatField(default=0, null=True, db_index=True),
'director': models.CharField(max_length=1000, db_index=True), 'director': models.CharField(max_length=1000, null=True, db_index=True),
'title': models.CharField(max_length=1000, db_index=True), 'title': models.CharField(max_length=1000, db_index=True),
} }
public_layers = [l['id'] public_layers = [l['id']

View file

@ -6,26 +6,26 @@ from django.conf.urls.defaults import *
urlpatterns = patterns("item.views", urlpatterns = patterns("item.views",
#frames #frames
(r'^(?P<id>[A-Z0-9].+)/(?P<size>\d+)p(?P<position>[\d\.]*)\.jpg$', 'frame'), (r'^(?P<id>[A-Z0-9].*)/(?P<size>\d+)p(?P<position>[\d\.]*)\.jpg$', 'frame'),
#timelines #timelines
(r'^(?P<id>[A-Z0-9].+)/timeline(?P<size>\d+)p(?P<position>\d+)\.png$', 'timeline'), (r'^(?P<id>[A-Z0-9].*)/timeline(?P<size>\d+)p(?P<position>\d+)\.png$', 'timeline'),
(r'^(?P<id>[A-Z0-9].+)/timeline(?P<size>\d+)p\.png$', 'timeline_overview'), (r'^(?P<id>[A-Z0-9].*)/timeline(?P<size>\d+)p\.png$', 'timeline_overview'),
#video #video
(r'^(?P<id>[A-Z0-9].+)/(?P<resolution>\d+)p(?P<index>\d*)\.(?P<format>webm|ogv|mp4)$', 'video'), (r'^(?P<id>[A-Z0-9].*)/(?P<resolution>\d+)p(?P<index>\d*)\.(?P<format>webm|ogv|mp4)$', 'video'),
#torrent #torrent
(r'^(?P<id>[A-Z0-9][A-Za-z0-9]+)/torrent/(?P<filename>.*?)$', 'torrent'), (r'^(?P<id>[A-Z0-9].*)/torrent/(?P<filename>.*?)$', 'torrent'),
#icon #icon
(r'^(?P<id>[A-Z0-9].+)/icon(?P<size>\d*)\.jpg$', 'icon'), (r'^(?P<id>[A-Z0-9].*)/icon(?P<size>\d*)\.jpg$', 'icon'),
#poster #poster
(r'^(?P<id>[A-Z0-9].+)/poster(?P<size>\d+)\.jpg$', 'poster'), (r'^(?P<id>[A-Z0-9].*)/poster(?P<size>\d+)\.jpg$', 'poster'),
(r'^(?P<id>[A-Z0-9].+)/siteposter(?P<size>\d*)\.jpg$', 'siteposter'), (r'^(?P<id>[A-Z0-9].*)/siteposter(?P<size>\d*)\.jpg$', 'siteposter'),
(r'^(?P<id>[A-Z0-9].+)/poster\.jpg$', 'siteposter'), (r'^(?P<id>[A-Z0-9].*)/poster\.jpg$', 'siteposter'),
(r'^(?P<id>[A-Z0-9].+)/frameposter(?P<position>\d+).jpg$', 'poster_frame'), (r'^(?P<id>[A-Z0-9].*)/frameposter(?P<position>\d+).jpg$', 'poster_frame'),
(r'^random$', 'random_annotation'), (r'^random$', 'random_annotation'),
) )

View file

@ -15,16 +15,16 @@
"capabilities": { "capabilities": {
// "canClickMap": {"friend": true, "staff": true, "admin": true}, // "canClickMap": {"friend": true, "staff": true, "admin": true},
"canDeleteItems": {"admin": true}, "canDeleteItems": {"admin": true},
"canDownloadVideo": {"guest": 0, "member": 0, "friend": 4, "staff": 4, "admin": 4}, "canDownloadVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canEditFeaturedLists": {"staff": true, "admin": true}, "canEditFeaturedLists": {"staff": true, "admin": true},
"canEditMetadata": {"staff": true, "admin": true}, "canEditMetadata": {"staff": true, "admin": true},
"canEditSitePages": {"staff": true, "admin": true}, "canEditSitePages": {"staff": true, "admin": true},
"canEditUsers": {"admin": true}, "canEditUsers": {"admin": true},
"canPlayClips": {"guest": 2, "member": 2, "friend": 4, "staff": 4, "admin": 4}, "canPlayClips": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canPlayVideo": {"guest": 1, "member": 1, "friend": 4, "staff": 4, "admin": 4}, "canPlayVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canSeeDebugMenu": {"staff": true, "admin": true}, "canSeeDebugMenu": {"staff": true, "admin": true},
"canSeeFiles": {"staff": true, "admin": true}, "canSeeFiles": {"staff": true, "admin": true},
"canSeeItem": {"guest": 3, "member": 3, "friend": 4, "staff": 4, "admin": 4}, "canSeeItem": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canSeeExtraItemViews": {"friend": true, "staff": true, "admin": true} "canSeeExtraItemViews": {"friend": true, "staff": true, "admin": true}
}, },
/* /*
@ -43,10 +43,12 @@
// fixme: either this, or filter: true in itemKeys, but not both // fixme: either this, or filter: true in itemKeys, but not both
"filters": [ "filters": [
{"id": "director", "title": "Director", "type": "string"}, {"id": "director", "title": "Director", "type": "string"},
{"id": "country", "title": "Country", "type": "string"}, {"id": "location", "title": "Location", "type": "string"},
{"id": "year", "title": "Year", "type": "integer"}, {"id": "year", "title": "Year", "type": "integer"},
{"id": "language", "title": "Language", "type": "string"}, {"id": "language", "title": "Language", "type": "string"},
{"id": "source", "title": "Source", "type": "string"}, {"id": "source", "title": "Source", "type": "string"},
{"id": "collection", "title": "Collection", "type": "string"},
{"id": "category", "title": "Category", "type": "string"},
{"id": "writer", "title": "Writer", "type": "string"}, {"id": "writer", "title": "Writer", "type": "string"},
{"id": "producer", "title": "Producer", "type": "string"}, {"id": "producer", "title": "Producer", "type": "string"},
{"id": "cinematographer", "title": "Cinematographer", "type": "string"}, {"id": "cinematographer", "title": "Cinematographer", "type": "string"},
@ -104,6 +106,13 @@
"find": true, "find": true,
"sort": "person" "sort": "person"
}, },
{
"id": "name",
"title": "Name",
"type": ["string"],
"autocomplete": true,
"find": true
},
{ {
"id": "collection", "id": "collection",
"title": "Collection", "title": "Collection",
@ -147,6 +156,24 @@
"filter": true, "filter": true,
"find": true "find": true
}, },
{
"id": "category",
"title": "Category",
"type": ["string"],
"autocomplete": true,
"columnWidth": 180,
"filter": true,
"find": true
},
{
"id": "location",
"title": "Location",
"type": "string",
"autocomplete": true,
"columnWidth": 180,
"filter": true,
"find": true
},
{ {
"id": "genre", "id": "genre",
"title": "Genre", "title": "Genre",
@ -198,25 +225,25 @@
"columnWidth": 90 "columnWidth": 90
}, },
{ {
"id": "location", "id": "locations",
"title": "Locations", "title": "Locations",
"type": "layer", "type": "layer",
"find": true "find": true
}, },
{ {
"id": "keyword", "id": "keywords",
"title": "Keywords", "title": "Keywords",
"type": "layer", "type": "layer",
"find": true "find": true
}, },
{ {
"id": "description", "id": "descriptions",
"title": "Descriptions", "title": "Descriptions",
"type": "layer", "type": "layer",
"find": true "find": true
}, },
{ {
"id": "transcript", "id": "transcripts",
"title": "Transcripts", "title": "Transcripts",
"type": "layer", "type": "layer",
"find": true "find": true
@ -357,10 +384,10 @@
"type": "enum", "type": "enum",
"columnWidth": 90, "columnWidth": 90,
"format": {"type": "ColorLevel", "args": [ "format": {"type": "ColorLevel", "args": [
["Public", "Relaxed", "Regular", "Restricted", "Private"] ["Public", "Restricted", "Private"]
]}, ]},
"sortOperator": "+", "sortOperator": "+",
"values": ["Public", "Relaxed", "Regular", "Restricted", "Private", "Unknown"] "values": ["Public", "Restricted", "Private", "Unknown"]
} }
], ],
"itemName": { "itemName": {
@ -379,26 +406,25 @@
], ],
"layers": [ "layers": [
{ {
"id": "location", "id": "locations",
"title": "Locations", "title": "Locations",
"type": "location", "type": "location",
"overlap": true, "overlap": true
"private": true
}, },
{ {
"id": "keyword", "id": "keywords",
"title": "Keywords", "title": "Keywords",
"overlap": true, "overlap": true,
"type": "text" "type": "text"
}, },
{ {
"id": "description", "id": "descriptions",
"title": "Descriptions", "title": "Descriptions",
"type": "text", "type": "text",
"overlay": true "overlay": true
}, },
{ {
"id": "transcript", "id": "transcripts",
"title": "Transcripts", "title": "Transcripts",
"type": "text", "type": "text",
"overlay": true "overlay": true
@ -467,16 +493,16 @@
"clipsColumns": 2, "clipsColumns": 2,
"columns": { "columns": {
"Colors": { "Colors": {
"columns": ["title", "director", "country", "year", "hue", "saturation", "brightness"], "columns": ["title", "director", "location", "collection", "hue", "saturation", "brightness"],
"columnWidth": {} "columnWidth": {}
} }
}, },
"filters": [ "filters": [
{"id": "director", "sort": [{"key": "items", "operator": "-"}]}, {"id": "director", "sort": [{"key": "items", "operator": "-"}]},
{"id": "country", "sort": [{"key": "items", "operator": "-"}]}, {"id": "source", "sort": [{"key": "items", "operator": "-"}]},
{"id": "year", "sort": [{"key": "name", "operator": "-"}]}, {"id": "collection", "sort": [{"key": "name", "operator": "-"}]},
{"id": "language", "sort": [{"key": "items", "operator": "-"}]}, {"id": "category", "sort": [{"key": "items", "operator": "-"}]},
{"id": "source", "sort": [{"key": "items", "operator": "-"}]} {"id": "location", "sort": [{"key": "items", "operator": "-"}]}
], ],
"filtersSize": 176, "filtersSize": 176,
"find": {"conditions": [], "operator": "&"}, "find": {"conditions": [], "operator": "&"},
@ -486,7 +512,7 @@
"itemFind": {"conditions": [], "operator": "&"}, "itemFind": {"conditions": [], "operator": "&"},
"itemSort": [{"key": "position", "operator": "+"}], "itemSort": [{"key": "position", "operator": "+"}],
"itemView": "info", "itemView": "info",
"listColumns": ["title", "director", "country", "year", "language", "duration", "source"], "listColumns": ["title", "director", "location", "collection", "language", "duration", "source"],
"listColumnWidth": {}, "listColumnWidth": {},
"listSelection": [], "listSelection": [],
"listSort": [{"key": "director", "operator": "+"}], "listSort": [{"key": "director", "operator": "+"}],

View file

@ -185,8 +185,8 @@ VIDEO_PREFIX=''
#SESSION_COOKIE_DOMAIN=*.example.com" #SESSION_COOKIE_DOMAIN=*.example.com"
SCRIPT_ROOT = normpath(join(PROJECT_ROOT, '..', 'scripts')) SCRIPT_ROOT = normpath(join(PROJECT_ROOT, '..', 'scripts'))
#copy scripts and adjust to customize #change script to customize
ITEM_POSTER = join(SCRIPT_ROOT, 'oxdb_poster') ITEM_POSTER = join(SCRIPT_ROOT, 'poster')
#ITEM_POSTER = join(SCRIPT_ROOT, 'padma_poster') #ITEM_POSTER = join(SCRIPT_ROOT, 'padma_poster')
ITEM_ICON = join(SCRIPT_ROOT, 'item_icon') ITEM_ICON = join(SCRIPT_ROOT, 'item_icon')
LIST_ICON = join(SCRIPT_ROOT, 'list_icon') LIST_ICON = join(SCRIPT_ROOT, 'list_icon')

View file

@ -3,6 +3,10 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>{{settings.SITENAME}}</title> <title>{{settings.SITENAME}}</title>
<script>
if (localStorage && !localStorage.OxTheme)
localStorage.OxTheme = '{{settings.CONFIG.user.ui.theme}}';
</script>
<script type="text/javascript" src="/static/oxjs/build/Ox.js"></script> <script type="text/javascript" src="/static/oxjs/build/Ox.js"></script>
<script type="text/javascript" src="/static/js/embed/pandora.js"></script> <script type="text/javascript" src="/static/js/embed/pandora.js"></script>
</head> </head>

View file

@ -8,6 +8,10 @@
<link rel="icon" href="/static/png/icon64.png" sizes="48x48"/> <link rel="icon" href="/static/png/icon64.png" sizes="48x48"/>
<meta name="application-name" content="{{settings.SITENAME}}"/> <meta name="application-name" content="{{settings.SITENAME}}"/>
<meta name="application-url" content="{{base_url}}"/> <meta name="application-url" content="{{base_url}}"/>
<script>
if (localStorage && !localStorage.OxTheme)
localStorage.OxTheme = '{{settings.CONFIG.user.ui.theme}}';
</script>
<script type="text/javascript" src="/static/oxjs/build/Ox.js"></script> <script type="text/javascript" src="/static/oxjs/build/Ox.js"></script>
<script type="text/javascript" src="/static/js/pandora.js"></script> <script type="text/javascript" src="/static/js/pandora.js"></script>
</head> </head>

View file

@ -15,6 +15,14 @@ class LayerAlias(models.Model):
def __unicode__(self): def __unicode__(self):
return u"%s=%s" % (self.old, self.new) return u"%s=%s" % (self.old, self.new)
class ListAlias(models.Model):
old = models.CharField(max_length=255, unique=True)
new = models.CharField(max_length=255)
def __unicode__(self):
return u"%s=%s" % (self.old, self.new)
class Alias(models.Model): class Alias(models.Model):
url = models.CharField(max_length=255, unique=True) url = models.CharField(max_length=255, unique=True)
target = models.CharField(max_length=255) target = models.CharField(max_length=255)

View file

@ -222,7 +222,7 @@ def get_ui(user_ui, user=None):
pos = Position.objects.get(list=l, section=section) pos = Position.objects.get(list=l, section=section)
created = False created = False
except Position.DoesNotExist: except Position.DoesNotExist:
pos = Position(list=l, section=section, user=user) pos = Position(list=l, section=section, user=l.user)
pos.save() pos.save()
created = True created = True
else: else:

View file

@ -18,7 +18,7 @@ pandora.ui.filesView = function(options, self) {
self.$toolbar = Ox.Bar({ self.$toolbar = Ox.Bar({
size: 24 size: 24
}); });
/*
self.$userSelect = Ox.Select({ self.$userSelect = Ox.Select({
items: [ items: [
{id: 'admin', title: 'Admin', disabled: true}, {id: 'admin', title: 'Admin', disabled: true},
@ -36,7 +36,7 @@ pandora.ui.filesView = function(options, self) {
margin: '4px' margin: '4px'
}) })
.appendTo(self.$toolbar); .appendTo(self.$toolbar);
*/
self.$ignoreButton = Ox.Button({ self.$ignoreButton = Ox.Button({
disabled: 'true', disabled: 'true',
title: 'Ignore Selected Files...' title: 'Ignore Selected Files...'