fix padma.jsonc and adjust whats needed to get it running
This commit is contained in:
parent
b855c153e0
commit
c930383b32
12 changed files with 93 additions and 45 deletions
|
@ -74,10 +74,9 @@ class Annotation(models.Model):
|
|||
if l['id'] == id:
|
||||
return l
|
||||
return {}
|
||||
private = get_layer(self.layer).get('private')
|
||||
if not self.clip and not private or \
|
||||
(self.clip and not private and \
|
||||
self.start != self.clip.start or self.end != self.clip.end):
|
||||
private = get_layer(self.layer).get('private', False)
|
||||
if not private:
|
||||
if not self.clip or self.start != self.clip.start or self.end != self.clip.end:
|
||||
self.clip, created = Clip.get_or_create(self.item, self.start, self.end)
|
||||
|
||||
super(Annotation, self).save(*args, **kwargs)
|
||||
|
|
|
@ -107,6 +107,11 @@ def update_static():
|
|||
ox.net.saveUrl(url, "%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():
|
||||
load_config()
|
||||
thread.start_new_thread(reloader_thread, ())
|
||||
|
|
|
@ -29,7 +29,9 @@ def index(request):
|
|||
|
||||
|
||||
def embed(request, id):
|
||||
context = RequestContext(request, {'settings': settings})
|
||||
context = RequestContext(request, {
|
||||
'settings': settings
|
||||
})
|
||||
return render_to_response('embed.html', context)
|
||||
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ attrs = {
|
|||
'lightness': models.FloatField(default=0, 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),
|
||||
}
|
||||
public_layers = [l['id']
|
||||
|
|
|
@ -6,26 +6,26 @@ from django.conf.urls.defaults import *
|
|||
|
||||
urlpatterns = patterns("item.views",
|
||||
#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
|
||||
(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(?P<position>\d+)\.png$', 'timeline'),
|
||||
(r'^(?P<id>[A-Z0-9].*)/timeline(?P<size>\d+)p\.png$', 'timeline_overview'),
|
||||
|
||||
#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
|
||||
(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
|
||||
(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
|
||||
(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].+)/poster\.jpg$', 'siteposter'),
|
||||
(r'^(?P<id>[A-Z0-9].+)/frameposter(?P<position>\d+).jpg$', 'poster_frame'),
|
||||
(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].*)/poster\.jpg$', 'siteposter'),
|
||||
(r'^(?P<id>[A-Z0-9].*)/frameposter(?P<position>\d+).jpg$', 'poster_frame'),
|
||||
|
||||
(r'^random$', 'random_annotation'),
|
||||
)
|
||||
|
|
|
@ -15,16 +15,16 @@
|
|||
"capabilities": {
|
||||
// "canClickMap": {"friend": true, "staff": true, "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},
|
||||
"canEditMetadata": {"staff": true, "admin": true},
|
||||
"canEditSitePages": {"staff": true, "admin": true},
|
||||
"canEditUsers": {"admin": true},
|
||||
"canPlayClips": {"guest": 2, "member": 2, "friend": 4, "staff": 4, "admin": 4},
|
||||
"canPlayVideo": {"guest": 1, "member": 1, "friend": 4, "staff": 4, "admin": 4},
|
||||
"canPlayClips": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
|
||||
"canPlayVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
|
||||
"canSeeDebugMenu": {"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}
|
||||
},
|
||||
/*
|
||||
|
@ -43,10 +43,12 @@
|
|||
// fixme: either this, or filter: true in itemKeys, but not both
|
||||
"filters": [
|
||||
{"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": "language", "title": "Language", "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": "producer", "title": "Producer", "type": "string"},
|
||||
{"id": "cinematographer", "title": "Cinematographer", "type": "string"},
|
||||
|
@ -104,6 +106,13 @@
|
|||
"find": true,
|
||||
"sort": "person"
|
||||
},
|
||||
{
|
||||
"id": "name",
|
||||
"title": "Name",
|
||||
"type": ["string"],
|
||||
"autocomplete": true,
|
||||
"find": true
|
||||
},
|
||||
{
|
||||
"id": "collection",
|
||||
"title": "Collection",
|
||||
|
@ -147,6 +156,24 @@
|
|||
"filter": 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",
|
||||
"title": "Genre",
|
||||
|
@ -198,25 +225,25 @@
|
|||
"columnWidth": 90
|
||||
},
|
||||
{
|
||||
"id": "location",
|
||||
"id": "locations",
|
||||
"title": "Locations",
|
||||
"type": "layer",
|
||||
"find": true
|
||||
},
|
||||
{
|
||||
"id": "keyword",
|
||||
"id": "keywords",
|
||||
"title": "Keywords",
|
||||
"type": "layer",
|
||||
"find": true
|
||||
},
|
||||
{
|
||||
"id": "description",
|
||||
"id": "descriptions",
|
||||
"title": "Descriptions",
|
||||
"type": "layer",
|
||||
"find": true
|
||||
},
|
||||
{
|
||||
"id": "transcript",
|
||||
"id": "transcripts",
|
||||
"title": "Transcripts",
|
||||
"type": "layer",
|
||||
"find": true
|
||||
|
@ -357,10 +384,10 @@
|
|||
"type": "enum",
|
||||
"columnWidth": 90,
|
||||
"format": {"type": "ColorLevel", "args": [
|
||||
["Public", "Relaxed", "Regular", "Restricted", "Private"]
|
||||
["Public", "Restricted", "Private"]
|
||||
]},
|
||||
"sortOperator": "+",
|
||||
"values": ["Public", "Relaxed", "Regular", "Restricted", "Private", "Unknown"]
|
||||
"values": ["Public", "Restricted", "Private", "Unknown"]
|
||||
}
|
||||
],
|
||||
"itemName": {
|
||||
|
@ -379,26 +406,25 @@
|
|||
],
|
||||
"layers": [
|
||||
{
|
||||
"id": "location",
|
||||
"id": "locations",
|
||||
"title": "Locations",
|
||||
"type": "location",
|
||||
"overlap": true,
|
||||
"private": true
|
||||
"overlap": true
|
||||
},
|
||||
{
|
||||
"id": "keyword",
|
||||
"id": "keywords",
|
||||
"title": "Keywords",
|
||||
"overlap": true,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"id": "description",
|
||||
"id": "descriptions",
|
||||
"title": "Descriptions",
|
||||
"type": "text",
|
||||
"overlay": true
|
||||
},
|
||||
{
|
||||
"id": "transcript",
|
||||
"id": "transcripts",
|
||||
"title": "Transcripts",
|
||||
"type": "text",
|
||||
"overlay": true
|
||||
|
@ -467,16 +493,16 @@
|
|||
"clipsColumns": 2,
|
||||
"columns": {
|
||||
"Colors": {
|
||||
"columns": ["title", "director", "country", "year", "hue", "saturation", "brightness"],
|
||||
"columns": ["title", "director", "location", "collection", "hue", "saturation", "brightness"],
|
||||
"columnWidth": {}
|
||||
}
|
||||
},
|
||||
"filters": [
|
||||
{"id": "director", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "country", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "year", "sort": [{"key": "name", "operator": "-"}]},
|
||||
{"id": "language", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "source", "sort": [{"key": "items", "operator": "-"}]}
|
||||
{"id": "source", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "collection", "sort": [{"key": "name", "operator": "-"}]},
|
||||
{"id": "category", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "location", "sort": [{"key": "items", "operator": "-"}]}
|
||||
],
|
||||
"filtersSize": 176,
|
||||
"find": {"conditions": [], "operator": "&"},
|
||||
|
@ -486,7 +512,7 @@
|
|||
"itemFind": {"conditions": [], "operator": "&"},
|
||||
"itemSort": [{"key": "position", "operator": "+"}],
|
||||
"itemView": "info",
|
||||
"listColumns": ["title", "director", "country", "year", "language", "duration", "source"],
|
||||
"listColumns": ["title", "director", "location", "collection", "language", "duration", "source"],
|
||||
"listColumnWidth": {},
|
||||
"listSelection": [],
|
||||
"listSort": [{"key": "director", "operator": "+"}],
|
||||
|
|
|
@ -185,8 +185,8 @@ VIDEO_PREFIX=''
|
|||
#SESSION_COOKIE_DOMAIN=*.example.com"
|
||||
|
||||
SCRIPT_ROOT = normpath(join(PROJECT_ROOT, '..', 'scripts'))
|
||||
#copy scripts and adjust to customize
|
||||
ITEM_POSTER = join(SCRIPT_ROOT, 'oxdb_poster')
|
||||
#change script to customize
|
||||
ITEM_POSTER = join(SCRIPT_ROOT, 'poster')
|
||||
#ITEM_POSTER = join(SCRIPT_ROOT, 'padma_poster')
|
||||
ITEM_ICON = join(SCRIPT_ROOT, 'item_icon')
|
||||
LIST_ICON = join(SCRIPT_ROOT, 'list_icon')
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<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/js/embed/pandora.js"></script>
|
||||
</head>
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
<link rel="icon" href="/static/png/icon64.png" sizes="48x48"/>
|
||||
<meta name="application-name" content="{{settings.SITENAME}}"/>
|
||||
<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/js/pandora.js"></script>
|
||||
</head>
|
||||
|
|
|
@ -15,6 +15,14 @@ class LayerAlias(models.Model):
|
|||
def __unicode__(self):
|
||||
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):
|
||||
url = models.CharField(max_length=255, unique=True)
|
||||
target = models.CharField(max_length=255)
|
||||
|
|
|
@ -222,7 +222,7 @@ def get_ui(user_ui, user=None):
|
|||
pos = Position.objects.get(list=l, section=section)
|
||||
created = False
|
||||
except Position.DoesNotExist:
|
||||
pos = Position(list=l, section=section, user=user)
|
||||
pos = Position(list=l, section=section, user=l.user)
|
||||
pos.save()
|
||||
created = True
|
||||
else:
|
||||
|
|
|
@ -18,7 +18,7 @@ pandora.ui.filesView = function(options, self) {
|
|||
self.$toolbar = Ox.Bar({
|
||||
size: 24
|
||||
});
|
||||
|
||||
/*
|
||||
self.$userSelect = Ox.Select({
|
||||
items: [
|
||||
{id: 'admin', title: 'Admin', disabled: true},
|
||||
|
@ -36,7 +36,7 @@ pandora.ui.filesView = function(options, self) {
|
|||
margin: '4px'
|
||||
})
|
||||
.appendTo(self.$toolbar);
|
||||
|
||||
*/
|
||||
self.$ignoreButton = Ox.Button({
|
||||
disabled: 'true',
|
||||
title: 'Ignore Selected Files...'
|
||||
|
|
Loading…
Reference in a new issue