From 10a1239df7e108abfc90d0bfbf22bbb0461e3004 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 19 Jan 2012 22:05:28 +0530 Subject: [PATCH] everyone can have a license; groups admin --- pandora/padma.jsonc | 11 +++++++++- pandora/user/models.py | 4 ++++ pandora/user/views.py | 1 + static/js/pandora/infoView.padma.js | 28 ++++++++++++++---------- static/js/pandora/usersDialog.js | 33 +++++++++++++++++------------ 5 files changed, 52 insertions(+), 25 deletions(-) diff --git a/pandora/padma.jsonc b/pandora/padma.jsonc index 717e3a03..add5e834 100644 --- a/pandora/padma.jsonc +++ b/pandora/padma.jsonc @@ -59,7 +59,8 @@ //{"id": "year", "title": "Years", "type": "integer"}, {"id": "features", "title": "Features", "type": "string"}, {"id": "director", "title": "Directors", "type": "string"}, - {"id": "cinematographer", "title": "Cinematographers", "type": "string"} + {"id": "cinematographer", "title": "Cinematographers", "type": "string"}, + {"id": "license", "title": "License", "type": "string"} ], /* An itemKey must have the following properties: @@ -386,6 +387,14 @@ "type": "integer", "columnWidth": 60 }, + { + "id": "license", + "title": "License", + "type": ["string"], + "columnWidth": 120, + "autocomplete": true, + "filter": true + }, { "id": "rightslevel", "title": "Rights Level", diff --git a/pandora/user/models.py b/pandora/user/models.py index 61fb0274..4658f5bd 100644 --- a/pandora/user/models.py +++ b/pandora/user/models.py @@ -38,6 +38,8 @@ class SessionData(models.Model): objects = managers.SessionDataManager() + groupssort = models.CharField(default=None,blank=True,null=True, max_length=255) + def __unicode__(self): return u"%s" % self.session_key @@ -92,8 +94,10 @@ class SessionData(models.Model): self.username = self.user.username self.level = self.user.get_profile().level self.firstseen = self.user.date_joined + self.groupssort = ''.join([g.name for g in self.user.groups.all()]) else: self.level = 0 + self.groupssort = None self.parse_data() super(SessionData, self).save(*args, **kwargs) diff --git a/pandora/user/views.py b/pandora/user/views.py index e5125ee5..60e6e234 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -427,6 +427,7 @@ def order_query(qs, sort): 'browser': 'browser', 'email': 'user__email', 'firstseen': 'firstseen', + 'groups': 'groupssort', 'ip': 'ip', 'lastseen': 'lastseen', 'level': 'level', diff --git a/static/js/pandora/infoView.padma.js b/static/js/pandora/infoView.padma.js index ae0552a2..0f3ed88d 100644 --- a/static/js/pandora/infoView.padma.js +++ b/static/js/pandora/infoView.padma.js @@ -168,21 +168,25 @@ pandora.ui.infoView = function(data) { Ox.Editable({ clickLink: pandora.clickLink, editable: isEditable, - placeholder: formatLight('unknown'), + maxHeight: Infinity, + placeholder: formatLight('No description'), tooltip: isEditable ? 'Doubleclick to edit' : '', type: 'textarea', - value: data.description || '' + value: data.description || '', + //width: 300 }) .bindEvent({ submit: function(event) { editMetadata('description', event.value); } }) + .css(css) ) .appendTo($text); } - var list_keys = ['language', 'topic', 'director', 'cinematographer', 'features', 'groups']; + var listKeys = ['language', 'topic', 'director', 'cinematographer', 'features', 'groups', + 'license']; $('