Gitlab CSE Unil

Commit 4e980d98 authored by M. Chardon's avatar M. Chardon
Browse files

nettoyage divers

parent 71aaf038
......@@ -9,16 +9,7 @@ class AnObjAdmin(admin.ModelAdmin):
list_filter = ('owner',)
admin.site.register(AnObj, AnObjAdmin)
# admin.site.register(AOType)
# class AOSchemaAdmin(BaseSchemaAdmin):
# filter_horizontal = ('ao_types', )
# admin.site.register(AOSchema, AOSchemaAdmin)
# class AOChoiceAdmin(admin.ModelAdmin):
# list_filter = ('schema', )
# admin.site.register(AOChoice, AOChoiceAdmin)
# admin.site.register(AOAttribute)
class AnnotationAdmin(admin.ModelAdmin):
list_filter = ('annotable', )
admin.site.register(Annotation, AnnotationAdmin)
# coding=utf-8
from annotables import AOType, AOSchema, AOChoice, AOAttribute, AnObj, AnObjMembership, EnvParam
from annotables import AnObj, AnObjMembership, EnvParam
from annotations import Annotation
__all__ = (
'AOType', 'AOSchema', 'AOChoice', 'AOAttribute', 'AnObj',
'AnObjMembership', 'Annotation', 'EnvParam'
'AnObj', 'AnObjMembership', 'Annotation', 'EnvParam'
)
......@@ -20,7 +20,8 @@ from eav.models import BaseSchema, BaseAttribute, BaseChoice
from adim_utils.decorators import cache
__all__ = ('AOType', 'AOSchema', 'AOChoice', 'AOAttribute', 'AnObj', 'AnObjMembership', 'EnvParam')
# __all__ = ('AOType', 'AOSchema', 'AOChoice', 'AOAttribute', 'AnObj', 'AnObjMembership', 'EnvParam')
__all__ = ('AnObj', 'AnObjMembership', 'EnvParam')
# code from from uuid._random_getnode()
RANDOM_NODE = random.randrange(0, 1 << 48L) | 0x010000000000L
......@@ -35,50 +36,51 @@ AO_ENVIRON = (
('geomo', 'Géomorpho'),
)
class AOType(models.Model):
name = models.CharField(max_length=128)
title = models.CharField(max_length=512, blank=True, default="")
class Meta:
app_label = "adim"
verbose_name = "Annotable Object Type"
def __unicode__(self):
if self.title:
return u"{} ({})".format(self.title, self.name)
else:
return self.name
class AOSchema(BaseSchema):
ao_types = models.ManyToManyField(AOType, blank=True)
class Meta:
app_label = "adim"
verbose_name = "Annotable Object Schema"
verbose_name_plural = "Annotable Object Schemata"
# AOSchema._meta.get_field_by_name('datatype')[0]._choices += (('image', u'image file'), )
class AOChoice(BaseChoice):
schema = models.ForeignKey(AOSchema, related_name='choices')
class Meta:
app_label = "adim"
verbose_name = "Annotable Object Choice"
class AOAttribute(BaseAttribute):
schema = models.ForeignKey(AOSchema, related_name='attrs')
choice = models.ForeignKey(AOChoice, blank=True, null=True)
#
value_image = models.ImageField(upload_to="ao", blank=True, null=True)
class Meta:
app_label = "adim"
verbose_name = "Annotable Object Attribute"
verbose_name_plural = "Annotable Object Attributes"
# class AOType(models.Model):
# name = models.CharField(max_length=128)
# title = models.CharField(max_length=512, blank=True, default="")
#
# class Meta:
# app_label = "adim"
# verbose_name = "Annotable Object Type"
#
# def __unicode__(self):
# if self.title:
# return u"{} ({})".format(self.title, self.name)
# else:
# return self.name
# class AOSchema(BaseSchema):
# ao_types = models.ManyToManyField(AOType, blank=True)
#
# class Meta:
# app_label = "adim"
# verbose_name = "Annotable Object Schema"
# verbose_name_plural = "Annotable Object Schemata"
#
# # AOSchema._meta.get_field_by_name('datatype')[0]._choices += (('image', u'image file'), )
# class AOChoice(BaseChoice):
# schema = models.ForeignKey(AOSchema, related_name='choices')
#
# class Meta:
# app_label = "adim"
# verbose_name = "Annotable Object Choice"
# class AOAttribute(BaseAttribute):
# schema = models.ForeignKey(AOSchema, related_name='attrs')
# choice = models.ForeignKey(AOChoice, blank=True, null=True)
# #
# value_image = models.ImageField(upload_to="ao", blank=True, null=True)
#
# class Meta:
# app_label = "adim"
# verbose_name = "Annotable Object Attribute"
# verbose_name_plural = "Annotable Object Attributes"
def get_image_path(instance, filename):
......
......@@ -159,11 +159,11 @@ function ($, paper, Signal, config, view, io, tools, attributes, ui, Users, them
});
io.events.annotationsSavedStatusChanged.add(function(data){
console.log("save state", data.status);
//console.log("save state", data.status);
});
io.events.loadingError.add(function(options){
console.error("io::loadingError", options);
//console.error("io::loadingError", options);
});
}
......
......@@ -422,8 +422,6 @@ define([
selectMarqee = null;
}
//$(paper.view.element).css("cursor", "");
var items = [];
paper.project.getSelectedItems().map(function(e){
if (items.indexOf(e) === -1) {
......
......@@ -1674,8 +1674,7 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
});
return removeClass && removeClass.join(" ");
})
.addClass("cursor-tool-"+ toolName);
.addClass("cursor-tool-" + toolName);
}
tools.events.activated.add(onToolActivated);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment