new UI/URL handling (intermediate state)

This commit is contained in:
rolux 2011-09-23 10:44:54 +00:00
commit 41134b5eb1
30 changed files with 1213 additions and 741 deletions

View file

@ -6,13 +6,13 @@
"canSeeFiles": {"guest": -1, "member": -1, "staff": 3, "admin": 4}
},
"clipKeys": [
{"id": "clip:text", "title": "Clip Text", "type": "string"},
{"id": "clip:position", "title": "Clip Position", "type": "float"},
{"id": "clip:duration", "title": "Clip Duration", "type": "float"},
{"id": "clip:hue", "title": "Clip Hue", "type": "hue"},
{"id": "clip:saturation", "title": "Clip Saturation", "type": "float"},
{"id": "clip:lightness", "title": "Clip Lightness", "type": "float"},
{"id": "clip:volume", "title": "Clip Volume", "type": "float"}
{"id": "clip:text", "title": "Text", "type": "string"},
{"id": "clip:position", "title": "Position", "type": "float"},
{"id": "clip:duration", "title": "Duration", "type": "float"},
{"id": "clip:hue", "title": "Hue", "type": "hue"},
{"id": "clip:saturation", "title": "Saturation", "type": "float"},
{"id": "clip:lightness", "title": "Lightness", "type": "float"},
{"id": "clip:volume", "title": "Volume", "type": "float"}
],
"groups": [
{"id": "director", "title": "Director", "type": "string"},
@ -29,7 +29,7 @@
],
"itemKeys": [
{
"id": "all",
"id": "*",
"title": "All",
"type": "text",
"find": true
@ -543,7 +543,13 @@
"preferences": {},
"ui": {
"annotationsSize": 256,
"find": {"index": -1, "key": "", "value": ""},
"columns": {
"Colors": {
"columns": ["title", "director", "country", "year", "hue", "saturation", "brightness"],
"columnWidth": {}
}
},
"find": {"conditions": [], "operator": "&"},
"groups": [
{"id": "director", "sort": [{"key": "items", "operator": "-"}]},
{"id": "country", "sort": [{"key": "items", "operator": "-"}]},
@ -555,20 +561,15 @@
"icons": "posters",
"infoIconSize": 256,
"item": "",
"itemSort": [{"key": "clip:position", "operator": ""}],
"itemView": "info",
"list": "",
"lists": {
"": {
"columns": ["title", "director", "country", "year", "language", "runtime", "genre"],
"columnWidth": {},
"listView": "grid",
"selected": [],
"sort": [
{"key": "director", "operator": ""}
]
}
},
"query": {"conditions": [], "operator": ""},
"listColumns": ["title", "director", "country", "year", "language", "runtime", "genre"],
"listColumnWidth": {},
"listSelection": [],
"listSort": [{"key": "director", "operator": ""}],
"listView": "grid",
"lists": {},
"section": "items",
"showAnnotations": true,
"showControls": true,
@ -586,8 +587,8 @@
}
},
"showSidebar": true,
"showSitePosters": false,
"sidebarSize": 256,
"sitePage": "home",
"theme": "modern",
"videoPoints": {},
"videoScale": "fit",

View file

@ -23,10 +23,10 @@ def parseCondition(condition):
}
...
'''
k = condition.get('key', 'all')
k = condition.get('key', '*')
k = {'id': 'itemId'}.get(k, k)
if not k:
k = 'all'
k = '*'
v = condition['value']
op = condition.get('operator')
if not op:
@ -192,7 +192,7 @@ class ItemManager(Manager):
return QuerySet(self.model)
def filter_list(self, qs, l, user):
if l != "all":
if l != "*":
l = l.split(":")
only_public = True
if not user.is_anonymous():

View file

@ -499,7 +499,7 @@ class Item(models.Model):
elif key['type'] == 'layer':
qs = Annotation.objects.filter(layer__name=i, item=self).order_by('start')
save(i, '\n'.join([l.value for l in qs]))
elif i != 'all' and i not in self.facet_keys:
elif i != '*' and i not in self.facet_keys:
value = self.get(i)
if isinstance(value, list):
value = u'\n'.join(value)

View file

@ -50,6 +50,7 @@ urlpatterns += patterns('',
(r'^[A-Z0-9].*$', 'app.views.index'),
(r'^[a-z0-9].+$', 'app.views.index'),
(r'^$', 'app.views.index'),
(r'^.*$', 'app.views.index'),
)
urlpatterns += patterns('django.views.generic.simple',