annotations/icons/list description
This commit is contained in:
parent
b43ea828d9
commit
b1924e3c47
4 changed files with 24 additions and 13 deletions
|
@ -13,20 +13,23 @@ class Layer(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('position', )
|
ordering = ('position', )
|
||||||
|
|
||||||
|
enabled = models.BooleanField(default=True)
|
||||||
|
|
||||||
name = models.CharField(null=True, max_length=255, unique=True)
|
name = models.CharField(null=True, max_length=255, unique=True)
|
||||||
title = models.CharField(null=True, max_length=255)
|
title = models.CharField(null=True, max_length=255)
|
||||||
#text, string, string from list(fixme), event, place, person
|
#text, string, string from list(fixme), date, place, person, pingback,
|
||||||
|
#What about: smart layers? for date, place, person
|
||||||
type = models.CharField(null=True, max_length=255)
|
type = models.CharField(null=True, max_length=255)
|
||||||
|
|
||||||
|
#can this be changed per user?
|
||||||
position = models.IntegerField(default=0)
|
position = models.IntegerField(default=0)
|
||||||
|
|
||||||
overlapping = models.BooleanField(default=True)
|
overlap = models.BooleanField(default=True)
|
||||||
enabled = models.BooleanField(default=True)
|
overlay = models.BooleanField(default=True)
|
||||||
|
|
||||||
enabled = models.BooleanField(default=True)
|
|
||||||
public = models.BooleanField(default=True) #false=users only see there own bins
|
public = models.BooleanField(default=True) #false=users only see there own bins
|
||||||
subtitle = models.BooleanField(default=True) #bis can be displayed as subtitle, only one bin
|
|
||||||
|
|
||||||
find = models.BooleanField(default=True)
|
#find/sort integration
|
||||||
|
find = models.BooleanField(default=True) #true part of find all
|
||||||
#words / item duration(wpm), total words, cuts per minute, cuts, number of annotations, number of annotations/duration
|
#words / item duration(wpm), total words, cuts per minute, cuts, number of annotations, number of annotations/duration
|
||||||
sort = models.CharField(null=True, max_length=255)
|
sort = models.CharField(null=True, max_length=255)
|
||||||
|
|
||||||
|
@ -55,7 +58,7 @@ class Annotation(models.Model):
|
||||||
|
|
||||||
#seconds
|
#seconds
|
||||||
start = models.FloatField(default=-1)
|
start = models.FloatField(default=-1)
|
||||||
stop = models.FloatField(default=-1)
|
end = models.FloatField(default=-1)
|
||||||
|
|
||||||
layer = models.ForeignKey(Layer)
|
layer = models.ForeignKey(Layer)
|
||||||
value = models.TextField()
|
value = models.TextField()
|
||||||
|
@ -74,16 +77,19 @@ class Annotation(models.Model):
|
||||||
else:
|
else:
|
||||||
return self.value
|
return self.value
|
||||||
|
|
||||||
|
def get_id(self):
|
||||||
|
return ox.to32(self.id)
|
||||||
|
|
||||||
def json(self):
|
def json(self):
|
||||||
return {
|
return {
|
||||||
'id': self.id,
|
'id': self.get_id(),
|
||||||
'user': self.user.username,
|
'user': self.user.username,
|
||||||
'start': self.start,
|
'start': self.start,
|
||||||
'stop': self.start,
|
'end': self.end,
|
||||||
'value': self.value,
|
'value': self.value,
|
||||||
'value_html': self.html(),
|
'value_html': self.html(),
|
||||||
'layer': self.layer.name
|
'layer': self.layer.name
|
||||||
}
|
}
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return "%s/%s-%s" %(self.item, self.start, self.stop)
|
return u"%s/%s-%s" %(self.item, self.start, self.end)
|
||||||
|
|
|
@ -10,7 +10,7 @@ import models
|
||||||
from api.actions import actions
|
from api.actions import actions
|
||||||
|
|
||||||
|
|
||||||
def findAnnotation(request):
|
def findAnnotations(request):
|
||||||
'''
|
'''
|
||||||
param data {
|
param data {
|
||||||
fixme
|
fixme
|
||||||
|
@ -29,7 +29,7 @@ def findAnnotation(request):
|
||||||
qs = models.Annotations.objects.filter(item__itemId=data['item'])
|
qs = models.Annotations.objects.filter(item__itemId=data['item'])
|
||||||
response['data']['annotations'] = [a.json() for a in qs]
|
response['data']['annotations'] = [a.json() for a in qs]
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(findAnnotation)
|
actions.register(findAnnotations)
|
||||||
|
|
||||||
|
|
||||||
@login_required_json
|
@login_required_json
|
||||||
|
|
|
@ -652,6 +652,7 @@ class Item(models.Model):
|
||||||
stream.extract_derivatives()
|
stream.extract_derivatives()
|
||||||
self.make_local_posters()
|
self.make_local_posters()
|
||||||
self.make_poster()
|
self.make_poster()
|
||||||
|
self.make_icon()
|
||||||
self.available = True
|
self.available = True
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
|
|
@ -215,6 +215,8 @@ def addList(request):
|
||||||
if not request.user.is_staff and value == 'featured':
|
if not request.user.is_staff and value == 'featured':
|
||||||
value = 'private'
|
value = 'private'
|
||||||
setattr(list, key, value)
|
setattr(list, key, value)
|
||||||
|
elif key == 'description':
|
||||||
|
list.description = data['description']
|
||||||
list.save()
|
list.save()
|
||||||
|
|
||||||
if list.status == 'featured':
|
if list.status == 'featured':
|
||||||
|
@ -313,6 +315,8 @@ def editList(request):
|
||||||
num += 1
|
num += 1
|
||||||
name = data['name'] + ' (%d)' % num
|
name = data['name'] + ' (%d)' % num
|
||||||
list.name = name
|
list.name = name
|
||||||
|
elif key == 'description':
|
||||||
|
list.description = data['description']
|
||||||
|
|
||||||
if 'position' in data:
|
if 'position' in data:
|
||||||
pos, created = models.Position.objects.get_or_create(list=list, user=request.user)
|
pos, created = models.Position.objects.get_or_create(list=list, user=request.user)
|
||||||
|
|
Loading…
Reference in a new issue