# HG changeset patch # User cavaliet # Date 1402993533 -7200 # Node ID 8f77cf71ab020584723c5db5fa33a25c3999ab8a # Parent 73f19fa4f9978e393828038ebe6722b268563dce commit the venv update (django and dependancies) in the good head diff -r 73f19fa4f997 -r 8f77cf71ab02 .hgignore --- a/.hgignore Fri Nov 16 18:12:05 2012 +0100 +++ b/.hgignore Tue Jun 17 10:25:33 2014 +0200 @@ -26,4 +26,8 @@ syntax: regexp ^web/hdalab/\.htaccess$ syntax: regexp -^\.settings$ \ No newline at end of file +^\.settings$ +syntax: regexp +^run$ +syntax: regexp +^src/hdabo/config\.py$ \ No newline at end of file diff -r 73f19fa4f997 -r 8f77cf71ab02 .settings/org.eclipse.core.resources.prefs --- a/.settings/org.eclipse.core.resources.prefs Fri Nov 16 18:12:05 2012 +0100 +++ b/.settings/org.eclipse.core.resources.prefs Tue Jun 17 10:25:33 2014 +0200 @@ -1,48 +1,48 @@ eclipse.preferences.version=1 encoding//data/villes.csv=ISO-8859-1 -encoding//web/hdabo/forms.py=utf-8 -encoding//web/hdabo/management/commands/clean_tags.py=utf-8 -encoding//web/hdabo/management/commands/diff_csv.py=utf-8 -encoding//web/hdabo/management/commands/import_csv.py=utf-8 -encoding//web/hdabo/management/commands/import_tag_popularity.py=utf-8 -encoding//web/hdabo/management/commands/query_wikipedia.py=utf-8 -encoding//web/hdabo/management/utils.py=utf-8 -encoding//web/hdabo/migrations/0001_initial.py=utf-8 -encoding//web/hdabo/migrations/0002_backport_hdabo_sf.py=utf-8 -encoding//web/hdabo/migrations/0003_update_redirection.py=utf-8 -encoding//web/hdabo/migrations/0005_auto__chg_field_datasheet_organisation.py=utf-8 -encoding//web/hdabo/models.py=utf-8 -encoding//web/hdabo/search/french_whoosh_backend.py=utf-8 -encoding//web/hdabo/tests/models.py=utf-8 -encoding//web/hdabo/utils.py=utf-8 -encoding//web/hdabo/views.py=utf-8 -encoding//web/hdabo/wp_utils.py=utf-8 -encoding//web/hdalab/__init__.py=utf-8 +encoding//src/hdabo/forms.py=utf-8 +encoding//src/hdabo/management/commands/clean_tags.py=utf-8 +encoding//src/hdabo/management/commands/diff_csv.py=utf-8 +encoding//src/hdabo/management/commands/import_csv.py=utf-8 +encoding//src/hdabo/management/commands/import_tag_popularity.py=utf-8 +encoding//src/hdabo/management/commands/query_wikipedia.py=utf-8 +encoding//src/hdabo/management/utils.py=utf-8 +encoding//src/hdabo/migrations/0001_initial.py=utf-8 +encoding//src/hdabo/migrations/0002_backport_hdabo_sf.py=utf-8 +encoding//src/hdabo/migrations/0003_update_redirection.py=utf-8 +encoding//src/hdabo/migrations/0005_auto__chg_field_datasheet_organisation.py=utf-8 +encoding//src/hdabo/models.py=utf-8 +encoding//src/hdabo/search/french_whoosh_backend.py=utf-8 +encoding//src/hdabo/tests/models.py=utf-8 +encoding//src/hdabo/utils.py=utf-8 +encoding//src/hdabo/views.py=utf-8 +encoding//src/hdabo/wp_utils.py=utf-8 +encoding//src/hdalab/__init__.py=utf-8 +encoding//src/hdalab/manage.py=utf-8 +encoding//src/hdalab/management/commands/export_tags_csv.py=utf-8 +encoding//src/hdalab/management/commands/export_wpcategory_csv.py=utf-8 +encoding//src/hdalab/management/commands/fill_tag_years.py=utf-8 +encoding//src/hdalab/management/commands/geojson_transform.py=utf-8 +encoding//src/hdalab/management/commands/import_hda_insee_csv.py=utf-8 +encoding//src/hdalab/management/commands/import_hdabo_db.py=utf-8 +encoding//src/hdalab/management/commands/import_insee_csv.py=utf-8 +encoding//src/hdalab/management/commands/query_category_inclusion.py=utf-8 +encoding//src/hdalab/management/commands/query_dbpedia.py=utf-8 +encoding//src/hdalab/management/commands/query_geo_inclusion.py=utf-8 +encoding//src/hdalab/management/commands/query_wikipedia_category.py=utf-8 +encoding//src/hdalab/management/utils.py=utf-8 +encoding//src/hdalab/migrations/0001_initial.py=utf-8 +encoding//src/hdalab/migrations/0002_dataviz.py=utf-8 +encoding//src/hdalab/migrations/0003_hdasession.py=utf-8 +encoding//src/hdalab/migrations/0005_rename_end_year.py=utf-8 +encoding//src/hdalab/migrations/0006_dbpedia_fields_one_to_one.py=utf-8 +encoding//src/hdalab/migrations/0007_geographic_inclusion.py=utf-8 +encoding//src/hdalab/migrations/0008_datasheet_insee.py=utf-8 +encoding//src/hdalab/models/dataviz.py=utf-8 +encoding//src/hdalab/settings.py=utf-8 +encoding//src/hdalab/urls.py=utf-8 +encoding//src/hdalab/utils.py=utf-8 +encoding//src/hdalab/views/ajax.py=utf-8 +encoding//src/hdalab/views/pages.py=utf-8 encoding//web/hdalab/config.py=utf-8 -encoding//web/hdalab/manage.py=utf-8 -encoding//web/hdalab/management/commands/export_tags_csv.py=utf-8 -encoding//web/hdalab/management/commands/export_wpcategory_csv.py=utf-8 encoding//web/hdalab/management/commands/fill_country_codes.py=utf-8 -encoding//web/hdalab/management/commands/fill_tag_years.py=utf-8 -encoding//web/hdalab/management/commands/geojson_transform.py=utf-8 -encoding//web/hdalab/management/commands/import_hda_insee_csv.py=utf-8 -encoding//web/hdalab/management/commands/import_hdabo_db.py=utf-8 -encoding//web/hdalab/management/commands/import_insee_csv.py=utf-8 -encoding//web/hdalab/management/commands/query_category_inclusion.py=utf-8 -encoding//web/hdalab/management/commands/query_dbpedia.py=utf-8 -encoding//web/hdalab/management/commands/query_geo_inclusion.py=utf-8 -encoding//web/hdalab/management/commands/query_wikipedia_category.py=utf-8 -encoding//web/hdalab/management/utils.py=utf-8 -encoding//web/hdalab/migrations/0001_initial.py=utf-8 -encoding//web/hdalab/migrations/0002_dataviz.py=utf-8 -encoding//web/hdalab/migrations/0003_hdasession.py=utf-8 -encoding//web/hdalab/migrations/0005_rename_end_year.py=utf-8 -encoding//web/hdalab/migrations/0006_dbpedia_fields_one_to_one.py=utf-8 -encoding//web/hdalab/migrations/0007_geographic_inclusion.py=utf-8 -encoding//web/hdalab/migrations/0008_datasheet_insee.py=utf-8 -encoding//web/hdalab/models/dataviz.py=utf-8 -encoding//web/hdalab/settings.py=utf-8 -encoding//web/hdalab/urls.py=utf-8 -encoding//web/hdalab/utils.py=utf-8 -encoding//web/hdalab/views/ajax.py=utf-8 -encoding//web/hdalab/views/pages.py=utf-8 diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/.htaccess.mod_python.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/.htaccess.mod_python.tmpl Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,11 @@ +SetHandler python-program +PythonHandler ldt.core.handlers.modpython +SetEnv DJANGO_SETTINGS_MODULE ldtplatform.settings +PythonInterpreter platform +PythonOption django.root /~wakimd/platform/ldtplatform +PythonOption virtualenv.activate_path /iridata/users/wakimd/Env/Efculture/bin/activate_this.py +PythonDebug on +PythonPath "['/iridata/users/wakimd/Env/Efculture/lib/python2.6/sites-packages'] + sys.path" +Header set Pragma "no-cache" +Header set Cache-Control "no-cache" +Header set Expires "-1" diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/.htaccess.mod_wsgi.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/.htaccess.mod_wsgi.tmpl Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,20 @@ + +SetEnv DJANGO_SETTINGS_MODULE hdabo.settings +SetEnv PROJECT_PATH /Users/ymh/dev/workspace/hdabo/web +SetEnv PYTHON_PATH /Users/ymh/dev/workspace/hdabo/virtualenv/web/env/hdabo/lib/python2.6/site-packages:/Applications/Dev/eclipse/plugins/org.python.pydev.debug_2.2.0.2011062419/pysrc/ +SetEnv PYDEV_DEBUG False + +Options ExecCGI FollowSymLinks +SetHandler wsgi-script + +#if defined in global definition +#defined with WSGIDaemonProcess +#WSGIProcessGroup platform + +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^(.*)$ /~ymh/hdabo/hdabo/modwsgi.wsgi/$1 [QSA,PT,L] + +Header set Pragma "no-cache" +Header set Cache-Control "no-cache" +Header set Expires "-1" diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/__init__.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,16 @@ +VERSION = (2, 13, 0, "final", 0) + + +def get_version(): + version = '%s.%s' % (VERSION[0], VERSION[1]) + if VERSION[2]: + version = '%s.%s' % (version, VERSION[2]) + if VERSION[3:] == ('alpha', 0): + version = '%s pre-alpha' % version + else: + if VERSION[3] != 'final': + version = '%s %s %s' % (version, VERSION[3], VERSION[4]) + return version + + +__version__ = get_version() diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/admin.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/admin.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,16 @@ +from django.contrib import admin +from hdabo.models import (Author, Datasheet, DocumentFormat, Domain, Organisation, + Tag, TagCategory, TaggedSheet, TimePeriod) + + +admin.site.register(Author) +admin.site.register(Datasheet) +admin.site.register(DocumentFormat) +admin.site.register(Domain) +admin.site.register(Organisation) +admin.site.register(Tag) +admin.site.register(TagCategory) +admin.site.register(TaggedSheet) +admin.site.register(TimePeriod) + + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/config.py.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/config.py.tmpl Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,47 @@ +import os + +BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/" +BASE_URL = '/~ymh/hdabo/' +WEB_URL = 'http://localhost' + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/home/media/media.lawrence.com/media/" +MEDIA_ROOT = os.path.abspath(BASE_DIR + "../static/media/") + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash. +# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" +MEDIA_URL = BASE_URL + "static/media/" + +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/home/media/media.lawrence.com/static/" +STATIC_ROOT = os.path.abspath(BASE_DIR + "../static/site/") + +# URL prefix for static files. +# Example: "http://media.lawrence.com/static/" +STATIC_URL = BASE_URL + "static/site/" + +# Additional locations of static files +STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': 'hdabo', # Or path to database file if using sqlite3. + 'USER': 'iri', # Not used with sqlite3. + 'PASSWORD': 'iri', # Not used with sqlite3. + 'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '5432', # Set to empty string for default. Not used with sqlite3. + } +} + +HAYSTACK_SEARCH_ENGINE = 'whoosh' +HAYSTACK_WHOOSH_PATH = os.path.abspath(BASE_DIR + "../index/").rstrip("/")+"/" + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/context_processors.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/context_processors.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,5 @@ +import hdabo + +def version(request): + return { 'VERSION': hdabo.get_version() } + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/django_wsgi.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/django_wsgi.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,9 @@ +import os + +import django.core.handlers.wsgi + +application = django.core.handlers.wsgi.WSGIHandler() + +if os.environ.get('PYDEV_DEBUG', "False").lower() in ["true", "1", "t"]: + import pydevd #@UnresolvedImport + pydevd.settrace(suspend=False) diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/fixtures/.keepme diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/fixtures/datasheet_10.yaml.bz2 Binary file src/hdabo/fixtures/datasheet_10.yaml.bz2 has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/fixtures/datasheet_347.yaml.bz2 Binary file src/hdabo/fixtures/datasheet_347.yaml.bz2 has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/fixtures/datasheet_all.yaml.bz2 Binary file src/hdabo/fixtures/datasheet_all.yaml.bz2 has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/fixtures/initial_data.yaml.bz2 Binary file src/hdabo/fixtures/initial_data.yaml.bz2 has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/forms.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/forms.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +from django import forms +from django.db.models.query import QuerySet + + +class SortedMultipleChoiceField(forms.ModelMultipleChoiceField): + def clean(self, value): + queryset = super(SortedMultipleChoiceField, self).clean(value) + if value is None or not isinstance(queryset, QuerySet): + return queryset + object_list = dict(( + (unicode(key), value) + for key, value in queryset.in_bulk(value).iteritems())) + return [object_list[unicode(pk)] for pk in value] diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/management/__init__.py diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/management/commands/__init__.py diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/management/commands/clean_tags.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/management/commands/clean_tags.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +''' +Created on Jun 20, 2012 + +@author: ymh +''' +from django.core.management.base import NoArgsCommand +from django.core.management.color import no_style +from django.db import transaction,connection +from django.db.models import Count +from hdabo.models import Tag +from hdabo.utils import show_progress +from optparse import make_option +import math +import sys + + +class Command(NoArgsCommand): + ''' + remove orphan tags and merge duplicates (the key is the dbpedia uri) + ''' + + + def handle_noargs(self, **options): + ''' + do the work + ''' + + # merge duplicate tags + cursor = connection.cursor() + cursor.execute("select label, dbpedia_uri from hdabo_tag group by label,dbpedia_uri having count(label) > 1") + + for label,_ in cursor: + qs = Tag.objects.filter(label=label).annotate(num_ds=Count('datasheet')).order_by('-num_ds') + ref_tag = None + for t in qs: + print("label : %d : %s, num_ds: %d"%(t.id,t.label, t.num_ds)) + if ref_tag is None: + ref_tag = t + else: + for ts in t.taggedsheet_set.all(): + pass + print("changing tag %d to %d" %(ts.tag.id, ref_tag.id) ) + ts.tag = ref_tag + ts.save() + + # remove ophans tags + + orphans_tags = Tag.objects.annotate(num_ds=Count('datasheet')).filter(num_ds=0) + + print("nb Orphans : %d" % orphans_tags.count()) + + #delete + orphans_tags.delete() + + \ No newline at end of file diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/management/commands/diff_csv.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/management/commands/diff_csv.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +''' +Created on May 25, 2011 + +@author: ymh +''' +#Auteur,Chemin,Comment,Controle,Datcre,Datmaj,Desc,Domaine,Format,ID,Insee,Org,Org_Home,OrgID,Periode1,Periode2,Periode3,Satut,Sousdom,Tag,Theme2,Theme3,Titre,Url,Vignette,Ville +#"Auteur","Chemin","Comment","Controle","Datcre","Datmaj","Desc","Domaine","Format","ID","Insee","Org","Org_Home","OrgID","Periode1","Periode2","Periode3","Satut","Sousdom","Tag","Theme2","Theme3","Titre","Url","Vignette","Ville", + +from django.core.management.base import BaseCommand, CommandError +from django.db import transaction +from hdabo.models import Datasheet +from optparse import make_option +import csv +import math +import sys + +class Command(BaseCommand): + ''' + Command to diff datasheets content from csv content + ''' + args = '' + options = '[--do-delete] [--encoding] [--delimiter] [--dialect]' + help = """Import of a csv file for hdabo +Options: + --do-delete : ignore existing datasheets + --encoding : files encoding. default to latin-1 + --delimiter : scv delimiter + --dialect : csv dialect + --fieldnames : csv columns + """ + + option_list = BaseCommand.option_list + ( + make_option('--encoding', + action='store', + type='string', + dest='encoding', + default="latin-1", + help='fix the file encoding. default to latin-1'), + make_option('--delimiter', + action='store', + type='string', + dest='delimiter', + default=";", + help='csv file delimiter'), + make_option('--dialect', + action='store', + type='string', + dest='dialect', + default="excel", + help='csv dialect'), + make_option('--fieldnames', + action='store', + type='string', + dest='fieldnames', + default=None, + help='fields list (comma separated)'), + make_option('--do-delete', + action='store_true', + dest='do_delete', + default=False, + help='delete datasheets'), + + ) + + def show_progress(self, current_line, total_line, width): + + percent = (float(current_line) / float(total_line)) * 100.0 + + marks = math.floor(width * (percent / 100.0)) + spaces = math.floor(width - marks) + + loader = '[' + ('=' * int(marks)) + (' ' * int(spaces)) + ']' + + sys.stdout.write("%s %d%% %d/%d\r" % (loader, percent, current_line - 1, total_line - 1)) #takes the header into account + if percent >= 100: + sys.stdout.write("\n") + sys.stdout.flush() + + + + def handle(self, *args, **options): + + if len(args) == 0: + raise CommandError("Gives at lat one csv file to import") + + self.encoding = options.get('encoding', "latin-1") + self.do_delete = options.get('do_delete', False) + fieldnames = options.get('fieldnames', None) + + for csv_path in args: + print "Processing %s " % (csv_path) + with open(csv_path, 'rU') as csv_file: + + # get the number of lines if necessary + for i, l in enumerate(csv_file): #@UnusedVariable + pass + total_line = i + 1 + if fieldnames: + total_line = total_line + 1 + csv_file.seek(0) + + delimiter = options.get('delimiter', ";") + if delimiter == "TAB" or delimiter == "\\t": + delimiter = '\t' + + dr_kwargs = {'delimiter':delimiter} + if fieldnames is not None: + dr_kwargs['fieldnames'] = [f.strip() for f in fieldnames.split(",")] + dialect = options.get('dialect', "excel") + if dialect is not None: + dr_kwargs['dialect'] = dialect + + reader = csv.DictReader(csv_file, **dr_kwargs) + + ids = [] + + for row in reader: + line_num = reader.line_num if fieldnames is None else reader.line_num + 1 + self.show_progress(line_num, total_line, 60) + def safe_decode(val, encoding): + if val: + return val.decode(encoding) + else: + return val + + row = dict([(safe_decode(key, self.encoding), safe_decode(value, self.encoding)) for key, value in row.items()]) + + ids.append(row['ID']) + + qs = Datasheet.objects.exclude(hda_id__in = ids).order_by("hda_id") + + qs_count = qs.count() + + if qs_count == 0: + print("No datasheet to delete : exit") + return + + print("The following datasheets are in the database and not in the csv file") + for i,ds in enumerate(qs): + print("%*d- %4s : %s" % (len(str(qs_count+1)), i+1, ds.hda_id, ds.title.strip() if ds.title is not None else "")) + + + if self.do_delete: + print("deleting datasheets") + qs.delete() + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/management/commands/import_csv.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/management/commands/import_csv.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,267 @@ +# -*- coding: utf-8 -*- +''' +Created on May 25, 2011 + +@author: ymh +''' +#Auteur,Chemin,Comment,Controle,Datcre,Datmaj,Desc,Domaine,Format,ID,Insee,Org,Org_Home,OrgID,Periode1,Periode2,Periode3,Satut,Sousdom,Tag,Theme2,Theme3,Titre,Url,Vignette,Ville +#"Auteur","Chemin","Comment","Controle","Datcre","Datmaj","Desc","Domaine","Format","ID","Insee","Org","Org_Home","OrgID","Periode1","Periode2","Periode3","Satut","Sousdom","Tag","Theme2","Theme3","Titre","Url","Vignette","Ville", + +from django.core.management.base import BaseCommand, CommandError +from django.db import transaction +from hdabo.models import (Author, Datasheet, DocumentFormat, Domain, Organisation, + Tag, TaggedSheet, TimePeriod, Location) +from hdabo.wp_utils import normalize_tag +from optparse import make_option +import csv +import datetime +import math +import sys + +class Command(BaseCommand): + ''' + Command to import csvfile + ''' + args = '' + options = '[--ignore-existing] [--lines] [--encoding]' + help = """Import of a csv file for hdabo +Options: + --ignore-existing : ignore existing datasheets + --lines : max number of lines to load (for each file). 0 means all. + --encoding : files encoding. default to latin-1""" + + option_list = BaseCommand.option_list + ( + make_option('--encoding', + action='store', + type='string', + dest='encoding', + default="latin-1", + help='fix the file encoding. default to latin-1'), + make_option('--delimiter', + action='store', + type='string', + dest='delimiter', + default=";", + help='csv file delimiter'), + make_option('--dialect', + action='store', + type='string', + dest='dialect', + default="excel", + help='csv dialect'), + make_option('--fieldnames', + action='store', + type='string', + dest='fieldnames', + default=None, + help='fields list (comma separated)'), + make_option('--lines', + action='store', + type='int', + dest='lines', + default=0, + help='Number of lines to read. 0 means all.'), + make_option('--ignore-existing', + action='store_true', + dest='ignore_existing', + default=False, + help='force insertion'), + + ) + + def show_progress(self, current_line, total_line, width): + + percent = (float(current_line) / float(total_line)) * 100.0 + + marks = math.floor(width * (percent / 100.0)) + spaces = math.floor(width - marks) + + loader = '[' + ('=' * int(marks)) + (' ' * int(spaces)) + ']' + + sys.stdout.write("%s %d%% %d/%d\r" % (loader, percent, current_line - 1, total_line - 1)) #takes the header into account + if percent >= 100: + sys.stdout.write("\n") + sys.stdout.flush() + + + def create_domain_period(self, row_value, klass, school_period): + res_list = [] + if not row_value: + return res_list + for label_str in [dstr.strip() for dstr in row_value.split('\x0b')]: + if label_str: + res_obj, created = klass.objects.get_or_create(label=label_str, school_period=school_period, defaults={"label":label_str, "school_period":school_period}) #@UnusedVariable + res_list.append(res_obj) + return res_list + + def create_datasheet(self, row): + + if self.ignore_existing and Datasheet.objects.filter(hda_id=row[u"ID"]).count() > 0: + return + + author_str = row[u'Auteur'] + if author_str: + author_array = author_str.split(" ") + if len(author_array) == 0: + firstname = "" + lastname = "" + elif len(author_array) == 1: + firstname = "" + lastname = author_array[0] + elif len(author_array) == 2: + firstname = author_array[0] + lastname = author_array[1] + + author, created = Author.objects.get_or_create(hda_id=author_str, defaults={"firstname":firstname, "lastname":lastname}) #@UnusedVariable + else: + author = None + + org_str = row[u"Org"] + if org_str: + url_str = row[u'Org_Home'] + if url_str is not None: + url_str = url_str.strip() + org, created = Organisation.objects.get_or_create(hda_id=org_str, defaults={"name":org_str, "website" : url_str}) #@UnusedVariable + else: + org = None + + town_str = row[u"Ville"] + if town_str: + insee_str = row[u'Insee'].strip() if row[u'Insee'] else row[u'Insee'] + if len(insee_str) > 5: + insee_str = "" + loc, created = Location.objects.get_or_create(insee=insee_str, defaults={"name": town_str, "insee": insee_str}) #@UnusedVariable + else: + loc = None + + format_str = row[u"Format"] + if format_str: + format, created = DocumentFormat.objects.get_or_create(label=format_str, defaults={"label": format_str}) #@UnusedVariable + else: + format = None + + domains = self.create_domain_period(row[u"Domaine"], Domain, Domain.DOMAIN_PERIOD_DICT[u'Global']) + + primary_periods = self.create_domain_period(row[u"Periode1"], TimePeriod, TimePeriod.TIME_PERIOD_DICT[u'Primaire']) + college_periods = self.create_domain_period(row[u"Periode2"], TimePeriod, TimePeriod.TIME_PERIOD_DICT[u'Collège']) + highschool_periods = self.create_domain_period(row[u"Periode3"], TimePeriod, TimePeriod.TIME_PERIOD_DICT[u'Lycée']) + + primary_themes = self.create_domain_period(row[u"Sousdom"], Domain, Domain.DOMAIN_PERIOD_DICT[u'Primaire']) + college_themes = self.create_domain_period(row[u"Theme2"], Domain, Domain.DOMAIN_PERIOD_DICT[u'Collège']) + highschool_themes = self.create_domain_period(row[u"Theme3"], Domain, Domain.DOMAIN_PERIOD_DICT[u'Lycée']) + + url = row[u"Url"] + if url is not None: + url = url.strip() + + datasheet = Datasheet.objects.create( + hda_id=row[u"ID"], + author=author, + organisation=org, + title=row[u"Titre"], + description=row[u"Desc"], + url=url, + town=loc, + format=format, + original_creation_date=datetime.datetime.strptime(row[u"Datcre"], "%d/%m/%Y").date(), + original_modification_date=datetime.datetime.strptime(row[u"Datmaj"], "%d/%m/%Y").date(), + validated=False + ) + + datasheet.save() + + datasheet.set_domains(domains) + datasheet.set_primary_periods(primary_periods) + datasheet.set_college_periods(college_periods) + datasheet.set_highschool_periods(highschool_periods) + datasheet.set_primary_themes(primary_themes) + datasheet.set_college_themes(college_themes) + datasheet.set_highschool_themes(highschool_themes) + + + if row[u'Tag']: + for i, tag in enumerate([t.strip() for t in row[u'Tag'].split(u";")]): + if len(tag) == 0: + continue + tag_label = normalize_tag(tag) + tag_obj = None + for t in Tag.objects.filter(label__iexact=tag_label): + if tag_obj is None or t.url_status != Tag.TAG_URL_STATUS_DICT['null_result']: + tag_obj = t + if tag_obj.url_status != Tag.TAG_URL_STATUS_DICT['null_result']: + break + + if tag_obj is None: + tag_obj = Tag(label=tag_label, original_label=tag) + tag_obj.save() + + tagged_ds = TaggedSheet(datasheet=datasheet, tag=tag_obj, original_order=i + 1, order=i + 1) + tagged_ds.save() + + + def handle(self, *args, **options): + + if len(args) == 0: + raise CommandError("Gives at lat one csv file to import") + + self.encoding = options.get('encoding', "latin-1") + lines = options.get('lines', 0) + self.ignore_existing = options.get('ignore_existing', False) + fieldnames = options.get('fieldnames', None) + + transaction.commit_unless_managed() + transaction.enter_transaction_management() + transaction.managed(True) + + try: + for csv_path in args: + try: + print "Processing %s " % (csv_path) + with open(csv_path, 'rU') as csv_file: + + # get the number of lines if necessary + if not lines: + for i, l in enumerate(csv_file): #@UnusedVariable + pass + total_line = i + 1 + if fieldnames: + total_line = total_line + 1 + csv_file.seek(0) + else: + total_line = lines + 1 + + delimiter = options.get('delimiter', ";") + if delimiter == "TAB" or delimiter == "\\t": + delimiter = '\t' + + dr_kwargs = {'delimiter':delimiter} + if fieldnames is not None: + dr_kwargs['fieldnames'] = [f.strip() for f in fieldnames.split(",")] + dialect = options.get('dialect', "excel") + if dialect is not None: + dr_kwargs['dialect'] = dialect + + reader = csv.DictReader(csv_file, **dr_kwargs) + + for j, row in enumerate(reader): + if lines and j >= lines: + break + line_num = reader.line_num if fieldnames is None else reader.line_num + 1 + self.show_progress(line_num, total_line, 60) + def safe_decode(val, encoding): + if val: + return val.decode(encoding) + else: + return val + + row = dict([(safe_decode(key, self.encoding), safe_decode(value, self.encoding)) for key, value in row.items()]) + self.create_datasheet(row) + + transaction.commit() + except Exception: + transaction.rollback() + raise + finally: + print('') + finally: + transaction.leave_transaction_management() diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/management/commands/import_tag_popularity.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/management/commands/import_tag_popularity.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,150 @@ +# -*- coding: utf-8 -*- +''' +Created on Jun 17, 2011 + +@author: ymh + +command to import tag popularity + +''' + +from django.core.management.base import BaseCommand, CommandError +from hdabo.models import Tag +from hdabo.utils import normalize +from optparse import make_option +import csv +import math +import sys + + +class Command(BaseCommand): + ''' + Command to import csvfile + ''' + args = '' + options = '[--ignore-existing] [--lines] [--encoding]' + help = """Import of a tag popularity file for hdabo +Options: + --ignore-existing : ignore existing datasheets + --lines : max number of lines to load (for each file). 0 means all. + --encoding : files encoding. default to latin-1""" + + option_list = BaseCommand.option_list + ( + make_option('--encoding', + action='store', + type='string', + dest='encoding', + default="latin-1", + help='fix the file encoding. default to latin-1'), + make_option('--delimiter', + action='store', + type='string', + dest='delimiter', + default=";", + help='csv file delimiter'), + make_option('--dialect', + action='store', + type='string', + dest='dialect', + default="excel", + help='csv dialect'), + make_option('--fieldnames', + action='store', + type='string', + dest='fieldnames', + default="label,popularity", + help='fields list (comma separated)'), + make_option('--lines', + action='store', + type='int', + dest='lines', + default=0, + help='Number of lines to read. 0 means all.'), + make_option('--preserve', + action='store_true', + dest='preserve', + default=False, + help='preserve'), + + + ) + + def show_progress(self, current_line, total_line, width): + + percent = (float(current_line) / float(total_line)) * 100.0 + + marks = math.floor(width * (percent / 100.0)) + spaces = math.floor(width - marks) + + loader = '[' + ('=' * int(marks)) + (' ' * int(spaces)) + ']' + + sys.stdout.write("%s %d%% %d/%d\r" % (loader, percent, current_line - 1, total_line - 1)) #takes the header into account + if percent >= 100: + sys.stdout.write("\n") + sys.stdout.flush() + + def handle(self, *args, **options): + + if len(args) == 0: + raise CommandError("Give one csv file to import") + elif len(args) > 1: + raise CommandError("Only one file can be imported") + + self.encoding = options.get('encoding', "latin-1") + lines = options.get('lines', 0) + fieldnames = options.get('fieldnames', "label,popularity") + + csv_path = args[0] + + print("Processing %s " % (csv_path)) + + with open(csv_path, 'rU') as csv_file: + # get the number of lines if necessary + if not lines: + for i, l in enumerate(csv_file): #@UnusedVariable + pass + total_line = i + 1 + if fieldnames: + total_line = total_line + 1 + csv_file.seek(0) + else: + total_line = lines + 1 + + delimiter = options.get('delimiter', ";") + if delimiter == "TAB" or delimiter == "\\t": + delimiter = '\t' + dr_kwargs = {'delimiter':delimiter} + if fieldnames is not None: + dr_kwargs['fieldnames'] = [f.strip() for f in fieldnames.split(",")] + dialect = options.get('dialect', "excel") + if dialect is not None: + dr_kwargs['dialect'] = dialect + + if not options.get('preserve',False): + Tag.objects.update(popularity=0) + + reader = csv.DictReader(csv_file, **dr_kwargs) + + for j, row in enumerate(reader): + if lines and j >= lines: + break + line_num = reader.line_num if fieldnames is None else reader.line_num + 1 + self.show_progress(line_num, total_line, 60) + def safe_decode(val, encoding): + if val: + return val.decode(encoding) + else: + return val + + row = dict([(safe_decode(key, self.encoding), safe_decode(value, self.encoding)) for key, value in row.items()]) + + label = normalize(row['label'].strip()) + popularity_str = row['popularity'] + + if not label or not popularity_str: + continue + + + for tag in Tag.objects.filter(normalized_label=label): + tag.popularity = tag.popularity + int(row['popularity']) + tag.save() diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/management/commands/order_tags.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/management/commands/order_tags.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,81 @@ +''' +Created on Jun 7, 2011 + +@author: ymh +''' + +from django.core.management.base import NoArgsCommand +from django.core.management.color import no_style +from django.db import transaction +from hdabo.models import Datasheet +from hdabo.wp_utils import reorder_datasheet_tags +from hdabo.utils import show_progress +from optparse import make_option +import math +import sys + + +class Command(NoArgsCommand): + ''' + Command to calculate the order of tags based on indexation + recalculate all tags. Will ask for confirmation + ''' + + args = '' + options = '-f : force ' + help = "calculate the order of tags based on indexation recalculate all tags. Will ask for confirmation" + + option_list = NoArgsCommand.option_list + ( + make_option('-f', '--force', + action='store_true', + dest='force', + default=False, + help='force reordering of all datasheets'), + make_option('--noinput', + action='store_true', + dest='no_input', + default=False, + help='no input'), + ) + + + def handle_noargs(self, **options): + + self.style = no_style() + + interactive = options.get('interactive', True) and not options.get('no_input', False) + force = options.get('force', True) + + if interactive: + confirm = raw_input("""You have requested to recalculate the index order of all the tags. +This will process all the tags in %s datasheets. Are you sure you want to do this ? + Type 'yes' to continue, or 'no' to cancel: """ % ("all" if force else "not validated")) + else: + confirm = 'yes' + + if confirm != "yes": + print "Tag reordering cancelled" + return + + if force: + queryset = Datasheet.objects.all() + else: + queryset = Datasheet.objects.filter(validated=False, manual_order=False) + total = queryset.count() + + transaction.commit_unless_managed() + transaction.enter_transaction_management() + transaction.managed(True) + + try: + for i, ds in enumerate(queryset): + show_progress(i + 1, total, ds.title, 60) + reorder_datasheet_tags(ds) + transaction.commit() + except: + transaction.rollback() + raise + finally: + transaction.leave_transaction_management() + + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/management/commands/query_wikipedia.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/management/commands/query_wikipedia.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- +''' +Created on Jun 7, 2011 + +@author: ymh +''' + +from django.conf import settings +from django.core.management.base import NoArgsCommand +from django.core.management.color import no_style +from hdabo.models import Tag +from hdabo.wp_utils import process_tag +from optparse import make_option +from wikitools import wiki +import math +import sys + + + +class Command(NoArgsCommand): + ''' + query and update wikipedia for tag title. + ''' + options = '' + help = """query and update wikipedia for tag title.""" + + option_list = NoArgsCommand.option_list + ( + make_option('--force', + action='store_true', + dest='force', + default=False, + help='force all tags to be updated, not only those not yet processed'), + make_option('--random', + action='store_true', + dest='random', + default=False, + help='randomize query on tags'), + make_option('--site', + action='store', + type='string', + dest='site_url', + default="http://fr.wikipedia.org/w/api.php", + help='the url for the wikipedia site'), + make_option('--limit', + action='store', + type='int', + dest='limit', + default= -1, + help='number of tag to process'), + make_option('--start', + action='store', + type='int', + dest='start', + default=0, + help='number of tag to ignore'), + ) + + def __is_homonymie(self, page_dict): + for cat in page_dict.get(u"categories", []): + if u'Catégorie:Homonymie' in cat.get(u"title", u"") or u'Category:Disambiguation pages' in cat.get(u"title", u""): + return True + return False + + def show_progress(self, current_line, total_line, label, width): + + percent = (float(current_line) / float(total_line)) * 100.0 + + marks = math.floor(width * (percent / 100.0)) + spaces = math.floor(width - marks) + + loader = u'[' + (u'=' * int(marks)) + (u' ' * int(spaces)) + u']' + + sys.stdout.write(u"%s %d%% %d/%d - %r\r" % (loader, percent, current_line - 1, total_line - 1, label[:50].rjust(50))) #takes the header into account + if percent >= 100: + sys.stdout.write("\n") + sys.stdout.flush() + + def handle_noargs(self, **options): + + self.style = no_style() + + interactive = options.get('interactive', True) + + verbosity = int(options.get('verbosity', '1')) + + force = options.get('force', False) + + limit = options.get("limit", -1) + start = options.get("start", 0) + + site_url = options.get('site_url', settings.WIKIPEDIA_API_URL) + + random = options.get('random', False) + + if verbosity > 2: + print "option passed : " + repr(options) + + if force and interactive: + confirm = raw_input("""You have requested to query and replace the wikipedia information for all datasheets. +Are you sure you want to do this ? + Type 'yes' to continue, or 'no' to cancel: """) + else: + confirm = 'yes' + + if confirm != "yes": + print "wikipedia query cancelled" + return + + if force: + queryset = Tag.objects.all() + else: + queryset = Tag.objects.filter(url_status=None) + + if random: + queryset = queryset.order_by("?") + else: + queryset = queryset.order_by("label") + + if limit >= 0: + queryset = queryset[start:limit] + else: + queryset = queryset[start:] + + + if verbosity > 2 : + print "Tag Query is %s" % (queryset.query) + + site = wiki.Wiki(site_url) #@UndefinedVariable + + + count = queryset.count() + if verbosity > 1: + print "Processing %d tags" % (count) + + + + for i, tag in enumerate(queryset): + + if verbosity > 1: + print "processing tag %s (%d/%d)" % (tag.label, i + 1, count) + else: + self.show_progress(i + 1, count, tag.label, 60) + + process_tag(site, tag, verbosity) + + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/management/utils.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/management/utils.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +''' +Created on Feb 2, 2012 + +@author: ymh +''' + +import cStringIO +import csv +import codecs + +class UnicodeWriter: + """ + A CSV writer which will write rows to CSV file "f", + which is encoded in the given encoding. + """ + + def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds): + # Redirect output to a queue + self.queue = cStringIO.StringIO() + self.writer = csv.writer(self.queue, dialect=dialect, **kwds) + self.stream = f + self.encoder = codecs.getincrementalencoder(encoding)() + + def writerow(self, row): + self.writer.writerow([unicode(s).encode("utf-8") for s in row]) + # Fetch UTF-8 output from the queue ... + data = self.queue.getvalue() + data = data.decode("utf-8") + # ... and reencode it into the target encoding + data = self.encoder.encode(data) + # write to the target stream + self.stream.write(data) + # empty queue + self.queue.truncate(0) + + def writerows(self, rows): + for row in rows: + self.writerow(row) diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/migrations/0001_initial.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/migrations/0001_initial.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,436 @@ +#@PydevCodeAnalysisIgnore +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Adding model 'Organisation' + db.create_table('hdabo_organisation', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('hda_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=512)), + ('name', self.gf('django.db.models.fields.CharField')(max_length=512)), + ('location', self.gf('django.db.models.fields.CharField')(max_length=512, null=True, blank=True)), + ('website', self.gf('django.db.models.fields.CharField')(max_length=2048, null=True, blank=True)), + )) + db.send_create_signal('hdabo', ['Organisation']) + + # Adding model 'Author' + db.create_table('hdabo_author', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('hda_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=512)), + ('lastname', self.gf('django.db.models.fields.CharField')(max_length=512, null=True, blank=True)), + ('firstname', self.gf('django.db.models.fields.CharField')(max_length=512, null=True, blank=True)), + )) + db.send_create_signal('hdabo', ['Author']) + + # Adding model 'TimePeriod' + db.create_table('hdabo_timeperiod', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('label', self.gf('django.db.models.fields.CharField')(max_length=512)), + ('school_period', self.gf('django.db.models.fields.IntegerField')()), + )) + db.send_create_signal('hdabo', ['TimePeriod']) + + # Adding unique constraint on 'TimePeriod', fields ['label', 'school_period'] + db.create_unique('hdabo_timeperiod', ['label', 'school_period']) + + # Adding model 'Domain' + db.create_table('hdabo_domain', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('label', self.gf('django.db.models.fields.CharField')(max_length=512)), + ('school_period', self.gf('django.db.models.fields.IntegerField')()), + )) + db.send_create_signal('hdabo', ['Domain']) + + # Adding unique constraint on 'Domain', fields ['label', 'school_period'] + db.create_unique('hdabo_domain', ['label', 'school_period']) + + # Adding model 'DocumentFormat' + db.create_table('hdabo_documentformat', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('label', self.gf('django.db.models.fields.CharField')(unique=True, max_length=512)), + )) + db.send_create_signal('hdabo', ['DocumentFormat']) + + # Adding model 'TagCategory' + db.create_table('hdabo_tagcategory', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('label', self.gf('django.db.models.fields.CharField')(unique=True, max_length=512)), + )) + db.send_create_signal('hdabo', ['TagCategory']) + + # Adding model 'Tag' + db.create_table('hdabo_tag', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('label', self.gf('django.db.models.fields.CharField')(max_length=1024, db_index=True)), + ('normalized_label', self.gf('django.db.models.fields.CharField')(max_length=1024, db_index=True)), + ('original_label', self.gf('django.db.models.fields.CharField')(max_length=1024)), + ('alias', self.gf('django.db.models.fields.CharField')(max_length=1024, null=True, blank=True)), + ('category', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.TagCategory'], null=True, blank=True)), + ('wikipedia_url', self.gf('django.db.models.fields.URLField')(max_length=2048, null=True, blank=True)), + ('wikipedia_pageid', self.gf('django.db.models.fields.BigIntegerField')(null=True, blank=True)), + ('url_status', self.gf('django.db.models.fields.IntegerField')(default=None, null=True, blank=True)), + ('dbpedia_uri', self.gf('django.db.models.fields.URLField')(max_length=2048, null=True, blank=True)), + ('popularity', self.gf('django.db.models.fields.IntegerField')(default=0, db_index=True)), + )) + db.send_create_signal('hdabo', ['Tag']) + + # Adding unique constraint on 'Tag', fields ['label', 'original_label', 'url_status'] + db.create_unique('hdabo_tag', ['label', 'original_label', 'url_status']) + + # Adding model 'Location' + db.create_table('hdabo_location', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('name', self.gf('django.db.models.fields.CharField')(max_length=512)), + ('insee', self.gf('django.db.models.fields.CharField')(unique=True, max_length=5)), + )) + db.send_create_signal('hdabo', ['Location']) + + # Adding model 'Datasheet' + db.create_table('hdabo_datasheet', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('hda_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=512)), + ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Author'], null=True, blank=True)), + ('organisation', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Organisation'])), + ('title', self.gf('django.db.models.fields.CharField')(max_length=2048)), + ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), + ('url', self.gf('django.db.models.fields.URLField')(max_length=2048, null=True, blank=True)), + ('town', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Location'], null=True, blank=True)), + ('format', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.DocumentFormat'], null=True, blank=True)), + ('original_creation_date', self.gf('django.db.models.fields.DateField')()), + ('original_modification_date', self.gf('django.db.models.fields.DateField')()), + ('modification_datetime', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), + ('validation_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), + ('validated', self.gf('django.db.models.fields.BooleanField')(default=False, db_index=True)), + ('validator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)), + ('manual_order', self.gf('django.db.models.fields.BooleanField')(default=False, db_index=True)), + )) + db.send_create_signal('hdabo', ['Datasheet']) + + # Adding model 'TaggedSheet' + db.create_table('hdabo_taggedsheet', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datasheet', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Datasheet'])), + ('tag', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Tag'])), + ('original_order', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('order', self.gf('django.db.models.fields.IntegerField')(default=0, db_index=True)), + ('index_note', self.gf('django.db.models.fields.FloatField')(default=0.0, db_index=True)), + ('wikipedia_revision_id', self.gf('django.db.models.fields.BigIntegerField')(null=True, blank=True)), + )) + db.send_create_signal('hdabo', ['TaggedSheet']) + + # Adding model 'Datasheet_domains' + db.create_table('hdabo_datasheet_domains', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datasheet', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Datasheet'])), + ('sort_value', self.gf('django.db.models.fields.IntegerField')()), + ('domain', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Domain'])), + )) + db.send_create_signal('hdabo', ['Datasheet_domains']) + + # Adding model 'Datasheet_highschool_periods' + db.create_table('hdabo_datasheet_highschool_periods', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datasheet', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Datasheet'])), + ('sort_value', self.gf('django.db.models.fields.IntegerField')()), + ('timeperiod', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.TimePeriod'])), + )) + db.send_create_signal('hdabo', ['Datasheet_highschool_periods']) + + # Adding model 'Datasheet_highschool_themes' + db.create_table('hdabo_datasheet_highschool_themes', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datasheet', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Datasheet'])), + ('sort_value', self.gf('django.db.models.fields.IntegerField')()), + ('domain', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Domain'])), + )) + db.send_create_signal('hdabo', ['Datasheet_highschool_themes']) + + # Adding model 'Datasheet_college_periods' + db.create_table('hdabo_datasheet_college_periods', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datasheet', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Datasheet'])), + ('sort_value', self.gf('django.db.models.fields.IntegerField')()), + ('timeperiod', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.TimePeriod'])), + )) + db.send_create_signal('hdabo', ['Datasheet_college_periods']) + + # Adding model 'Datasheet_college_themes' + db.create_table('hdabo_datasheet_college_themes', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datasheet', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Datasheet'])), + ('sort_value', self.gf('django.db.models.fields.IntegerField')()), + ('domain', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Domain'])), + )) + db.send_create_signal('hdabo', ['Datasheet_college_themes']) + + # Adding model 'Datasheet_primary_periods' + db.create_table('hdabo_datasheet_primary_periods', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datasheet', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Datasheet'])), + ('sort_value', self.gf('django.db.models.fields.IntegerField')()), + ('timeperiod', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.TimePeriod'])), + )) + db.send_create_signal('hdabo', ['Datasheet_primary_periods']) + + # Adding model 'Datasheet_primary_themes' + db.create_table('hdabo_datasheet_primary_themes', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datasheet', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Datasheet'])), + ('sort_value', self.gf('django.db.models.fields.IntegerField')()), + ('domain', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Domain'])), + )) + db.send_create_signal('hdabo', ['Datasheet_primary_themes']) + + + def backwards(self, orm): + + # Removing unique constraint on 'Tag', fields ['label', 'original_label', 'url_status'] + db.delete_unique('hdabo_tag', ['label', 'original_label', 'url_status']) + + # Removing unique constraint on 'Domain', fields ['label', 'school_period'] + db.delete_unique('hdabo_domain', ['label', 'school_period']) + + # Removing unique constraint on 'TimePeriod', fields ['label', 'school_period'] + db.delete_unique('hdabo_timeperiod', ['label', 'school_period']) + + # Deleting model 'Organisation' + db.delete_table('hdabo_organisation') + + # Deleting model 'Author' + db.delete_table('hdabo_author') + + # Deleting model 'TimePeriod' + db.delete_table('hdabo_timeperiod') + + # Deleting model 'Domain' + db.delete_table('hdabo_domain') + + # Deleting model 'DocumentFormat' + db.delete_table('hdabo_documentformat') + + # Deleting model 'TagCategory' + db.delete_table('hdabo_tagcategory') + + # Deleting model 'Tag' + db.delete_table('hdabo_tag') + + # Deleting model 'Location' + db.delete_table('hdabo_location') + + # Deleting model 'Datasheet' + db.delete_table('hdabo_datasheet') + + # Deleting model 'TaggedSheet' + db.delete_table('hdabo_taggedsheet') + + # Deleting model 'Datasheet_domains' + db.delete_table('hdabo_datasheet_domains') + + # Deleting model 'Datasheet_highschool_periods' + db.delete_table('hdabo_datasheet_highschool_periods') + + # Deleting model 'Datasheet_highschool_themes' + db.delete_table('hdabo_datasheet_highschool_themes') + + # Deleting model 'Datasheet_college_periods' + db.delete_table('hdabo_datasheet_college_periods') + + # Deleting model 'Datasheet_college_themes' + db.delete_table('hdabo_datasheet_college_themes') + + # Deleting model 'Datasheet_primary_periods' + db.delete_table('hdabo_datasheet_primary_periods') + + # Deleting model 'Datasheet_primary_themes' + db.delete_table('hdabo_datasheet_primary_themes') + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'hdabo.author': { + 'Meta': {'object_name': 'Author'}, + 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet': { + 'Meta': {'object_name': 'Datasheet'}, + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Author']", 'null': 'True', 'blank': 'True'}), + 'college_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'college_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_themes']", 'to': "orm['hdabo.Domain']"}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'domains': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_domains']", 'to': "orm['hdabo.Domain']"}), + 'format': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.DocumentFormat']", 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'highschool_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'highschool_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_themes']", 'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manual_order': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'modification_datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'organisation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Organisation']"}), + 'original_creation_date': ('django.db.models.fields.DateField', [], {}), + 'original_modification_date': ('django.db.models.fields.DateField', [], {}), + 'primary_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'primary_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_themes']", 'to': "orm['hdabo.Domain']"}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['hdabo.Tag']", 'through': "orm['hdabo.TaggedSheet']", 'symmetrical': 'False'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), + 'town': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Location']", 'null': 'True', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'validated': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'validation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'validator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet_college_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_college_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_domains': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_domains'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_highschool_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_highschool_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_primary_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_primary_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.documentformat': { + 'Meta': {'object_name': 'DocumentFormat'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.domain': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'Domain'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.location': { + 'Meta': {'object_name': 'Location'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '5'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}) + }, + 'hdabo.organisation': { + 'Meta': {'object_name': 'Organisation'}, + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'website': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.tag': { + 'Meta': {'unique_together': "(('label', 'original_label', 'url_status'),)", 'object_name': 'Tag'}, + 'alias': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TagCategory']", 'null': 'True', 'blank': 'True'}), + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'normalized_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'original_label': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'popularity': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'url_status': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), + 'wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'wikipedia_url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.tagcategory': { + 'Meta': {'object_name': 'TagCategory'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.taggedsheet': { + 'Meta': {'object_name': 'TaggedSheet'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_note': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'original_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Tag']"}), + 'wikipedia_revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'hdabo.timeperiod': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'TimePeriod'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + } + } + + complete_apps = ['hdabo'] diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/migrations/0002_backport_hdabo_sf.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/migrations/0002_backport_hdabo_sf.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,231 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Adding field 'Tag.alternative_label' + db.add_column('hdabo_tag', 'alternative_label', self.gf('django.db.models.fields.CharField')(max_length=1024, null=True, blank=True), keep_default=False) #@UndefinedVariable + + # Adding field 'Tag.created_at' + db.add_column('hdabo_tag', 'created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime.utcnow, blank=True), keep_default=False) #@UndefinedVariable + + # Adding field 'Tag.alternative_wikipedia_url' + db.add_column('hdabo_tag', 'alternative_wikipedia_url', self.gf('django.db.models.fields.URLField')(max_length=2048, null=True, blank=True), keep_default=False) #@UndefinedVariable + + # Adding field 'Tag.alternative_wikipedia_pageid' + db.add_column('hdabo_tag', 'alternative_wikipedia_pageid', self.gf('django.db.models.fields.BigIntegerField')(null=True, blank=True), keep_default=False) #@UndefinedVariable + + # Adding field 'TaggedSheet.created_at' + db.add_column('hdabo_taggedsheet', 'created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime.utcnow, blank=True), keep_default=False) #@UndefinedVariable + + + def backwards(self, orm): + + # Deleting field 'Tag.alternative_label' + db.delete_column('hdabo_tag', 'alternative_label') #@UndefinedVariable + + # Deleting field 'Tag.created_at' + db.delete_column('hdabo_tag', 'created_at') #@UndefinedVariable + + # Deleting field 'Tag.alternative_wikipedia_url' + db.delete_column('hdabo_tag', 'alternative_wikipedia_url') #@UndefinedVariable + + # Deleting field 'Tag.alternative_wikipedia_pageid' + db.delete_column('hdabo_tag', 'alternative_wikipedia_pageid') #@UndefinedVariable + + # Deleting field 'TaggedSheet.created_at' + db.delete_column('hdabo_taggedsheet', 'created_at') #@UndefinedVariable + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'hdabo.author': { + 'Meta': {'object_name': 'Author'}, + 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet': { + 'Meta': {'object_name': 'Datasheet'}, + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Author']", 'null': 'True', 'blank': 'True'}), + 'college_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'college_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_themes']", 'to': "orm['hdabo.Domain']"}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'domains': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_domains']", 'to': "orm['hdabo.Domain']"}), + 'format': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.DocumentFormat']", 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'highschool_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'highschool_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_themes']", 'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manual_order': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'modification_datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'organisation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Organisation']"}), + 'original_creation_date': ('django.db.models.fields.DateField', [], {}), + 'original_modification_date': ('django.db.models.fields.DateField', [], {}), + 'primary_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'primary_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_themes']", 'to': "orm['hdabo.Domain']"}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['hdabo.Tag']", 'through': "orm['hdabo.TaggedSheet']", 'symmetrical': 'False'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), + 'town': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Location']", 'null': 'True', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'validated': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'validation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'validator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet_college_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_college_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_domains': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_domains'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_highschool_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_highschool_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_primary_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_primary_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.documentformat': { + 'Meta': {'object_name': 'DocumentFormat'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.domain': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'Domain'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.location': { + 'Meta': {'object_name': 'Location'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '5'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}) + }, + 'hdabo.organisation': { + 'Meta': {'object_name': 'Organisation'}, + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'website': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.tag': { + 'Meta': {'unique_together': "(('label', 'original_label', 'url_status'),)", 'object_name': 'Tag'}, + 'alias': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TagCategory']", 'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'normalized_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'original_label': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'popularity': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'url_status': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), + 'wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'wikipedia_url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.tagcategory': { + 'Meta': {'object_name': 'TagCategory'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.taggedsheet': { + 'Meta': {'object_name': 'TaggedSheet'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_note': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'original_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Tag']"}), + 'wikipedia_revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'hdabo.timeperiod': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'TimePeriod'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + } + } + + complete_apps = ['hdabo'] diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/migrations/0003_update_redirection.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/migrations/0003_update_redirection.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,221 @@ +# encoding: utf-8 +from south.v2 import DataMigration +from hdabo import utils, wp_utils +import sys +from wikitools import wiki + +class Migration(DataMigration): + + def forwards(self, orm): + queryset = orm.Tag.objects.filter(url_status=1, alternative_label=None) + queryset_count = queryset.count() + + sys.stdout.write("Processing %d tags\n" % (queryset_count)) + sys.stdout.flush() + site = wiki.Wiki("http://fr.wikipedia.org/w/api.php") #@UndefinedVariable + + + for i,tag in enumerate(queryset): + utils.show_progress(i+1, queryset_count, tag.label, 50) + wp_res = wp_utils.query_wikipedia_title(site, pageid=tag.wikipedia_pageid) + tag.alternative_label = wp_res['alternative_label'] + tag.alternative_wikipedia_url = wp_res['alternative_wikipedia_url'] + tag.alternative_wikipedia_pageid = wp_res['alternative_pageid'] + tag.save() + + sys.stdout.write("\n") + sys.stdout.flush() + + + def backwards(self, orm): + pass + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'hdabo.author': { + 'Meta': {'object_name': 'Author'}, + 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet': { + 'Meta': {'object_name': 'Datasheet'}, + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Author']", 'null': 'True', 'blank': 'True'}), + 'college_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'college_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_themes']", 'to': "orm['hdabo.Domain']"}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'domains': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_domains']", 'to': "orm['hdabo.Domain']"}), + 'format': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.DocumentFormat']", 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'highschool_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'highschool_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_themes']", 'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manual_order': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'modification_datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'organisation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Organisation']"}), + 'original_creation_date': ('django.db.models.fields.DateField', [], {}), + 'original_modification_date': ('django.db.models.fields.DateField', [], {}), + 'primary_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'primary_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_themes']", 'to': "orm['hdabo.Domain']"}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['hdabo.Tag']", 'through': "orm['hdabo.TaggedSheet']", 'symmetrical': 'False'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), + 'town': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Location']", 'null': 'True', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'validated': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'validation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'validator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet_college_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_college_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_domains': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_domains'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_highschool_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_highschool_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_primary_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_primary_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.documentformat': { + 'Meta': {'object_name': 'DocumentFormat'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.domain': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'Domain'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.location': { + 'Meta': {'object_name': 'Location'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '5'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}) + }, + 'hdabo.organisation': { + 'Meta': {'object_name': 'Organisation'}, + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'website': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.tag': { + 'Meta': {'unique_together': "(('label', 'original_label', 'url_status'),)", 'object_name': 'Tag'}, + 'alias': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TagCategory']", 'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'normalized_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'original_label': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'popularity': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'url_status': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}), + 'wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'wikipedia_url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + }, + 'hdabo.tagcategory': { + 'Meta': {'object_name': 'TagCategory'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.taggedsheet': { + 'Meta': {'object_name': 'TaggedSheet'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_note': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'original_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Tag']"}), + 'wikipedia_revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'hdabo.timeperiod': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'TimePeriod'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + } + } + + complete_apps = ['hdabo'] diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/migrations/0004_index_tag.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/migrations/0004_index_tag.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,238 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Adding index on 'Tag', fields ['wikipedia_pageid'] + db.create_index('hdabo_tag', ['wikipedia_pageid']) + + # Adding index on 'Tag', fields ['wikipedia_url'] + db.create_index('hdabo_tag', ['wikipedia_url']) + + # Adding index on 'Tag', fields ['alternative_wikipedia_url'] + db.create_index('hdabo_tag', ['alternative_wikipedia_url']) + + # Adding index on 'Tag', fields ['url_status'] + db.create_index('hdabo_tag', ['url_status']) + + # Adding index on 'Tag', fields ['dbpedia_uri'] + db.create_index('hdabo_tag', ['dbpedia_uri']) + + # Adding index on 'Tag', fields ['alternative_wikipedia_pageid'] + db.create_index('hdabo_tag', ['alternative_wikipedia_pageid']) + + + def backwards(self, orm): + + # Removing index on 'Tag', fields ['alternative_wikipedia_pageid'] + db.delete_index('hdabo_tag', ['alternative_wikipedia_pageid']) + + # Removing index on 'Tag', fields ['dbpedia_uri'] + db.delete_index('hdabo_tag', ['dbpedia_uri']) + + # Removing index on 'Tag', fields ['url_status'] + db.delete_index('hdabo_tag', ['url_status']) + + # Removing index on 'Tag', fields ['alternative_wikipedia_url'] + db.delete_index('hdabo_tag', ['alternative_wikipedia_url']) + + # Removing index on 'Tag', fields ['wikipedia_url'] + db.delete_index('hdabo_tag', ['wikipedia_url']) + + # Removing index on 'Tag', fields ['wikipedia_pageid'] + db.delete_index('hdabo_tag', ['wikipedia_pageid']) + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'hdabo.author': { + 'Meta': {'object_name': 'Author'}, + 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet': { + 'Meta': {'object_name': 'Datasheet'}, + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Author']", 'null': 'True', 'blank': 'True'}), + 'college_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'college_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_themes']", 'to': "orm['hdabo.Domain']"}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'domains': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_domains']", 'to': "orm['hdabo.Domain']"}), + 'format': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.DocumentFormat']", 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'highschool_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'highschool_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_themes']", 'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manual_order': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'modification_datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'organisation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Organisation']"}), + 'original_creation_date': ('django.db.models.fields.DateField', [], {}), + 'original_modification_date': ('django.db.models.fields.DateField', [], {}), + 'primary_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'primary_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_themes']", 'to': "orm['hdabo.Domain']"}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['hdabo.Tag']", 'through': "orm['hdabo.TaggedSheet']", 'symmetrical': 'False'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), + 'town': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Location']", 'null': 'True', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'validated': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'validation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'validator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet_college_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_college_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_domains': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_domains'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_highschool_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_highschool_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_primary_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_primary_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.documentformat': { + 'Meta': {'object_name': 'DocumentFormat'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.domain': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'Domain'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.location': { + 'Meta': {'object_name': 'Location'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '5'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}) + }, + 'hdabo.organisation': { + 'Meta': {'object_name': 'Organisation'}, + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'website': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.tag': { + 'Meta': {'unique_together': "(('label', 'original_label', 'url_status'),)", 'object_name': 'Tag'}, + 'alias': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TagCategory']", 'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'normalized_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'original_label': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'popularity': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'url_status': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.tagcategory': { + 'Meta': {'object_name': 'TagCategory'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.taggedsheet': { + 'Meta': {'object_name': 'TaggedSheet'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_note': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'original_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Tag']"}), + 'wikipedia_revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'hdabo.timeperiod': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'TimePeriod'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + } + } + + complete_apps = ['hdabo'] diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/migrations/0005_auto__chg_field_datasheet_organisation.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/migrations/0005_auto__chg_field_datasheet_organisation.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,208 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Changing field 'Datasheet.organisation' + db.alter_column('hdabo_datasheet', 'organisation_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.Organisation'], null=True)) + + + def backwards(self, orm): + + # User chose to not deal with backwards NULL issues for 'Datasheet.organisation' + raise RuntimeError("Cannot reverse this migration. 'Datasheet.organisation' and its values cannot be restored.") + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 6, 21, 18, 18, 22, 503161)'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 6, 21, 18, 18, 22, 503032)'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'hdabo.author': { + 'Meta': {'object_name': 'Author'}, + 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet': { + 'Meta': {'object_name': 'Datasheet'}, + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Author']", 'null': 'True', 'blank': 'True'}), + 'college_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'college_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_college_themes']", 'to': "orm['hdabo.Domain']"}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'domains': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_domains']", 'to': "orm['hdabo.Domain']"}), + 'format': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.DocumentFormat']", 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'highschool_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'highschool_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_highschool_themes']", 'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manual_order': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'modification_datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'organisation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Organisation']", 'null': 'True'}), + 'original_creation_date': ('django.db.models.fields.DateField', [], {}), + 'original_modification_date': ('django.db.models.fields.DateField', [], {}), + 'primary_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_periods_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_periods']", 'to': "orm['hdabo.TimePeriod']"}), + 'primary_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_themes_datasheets'", 'symmetrical': 'False', 'through': "orm['hdabo.Datasheet_primary_themes']", 'to': "orm['hdabo.Domain']"}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['hdabo.Tag']", 'through': "orm['hdabo.TaggedSheet']", 'symmetrical': 'False'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), + 'town': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Location']", 'null': 'True', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'validated': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'validation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'validator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.datasheet_college_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_college_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_domains': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_domains'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_highschool_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_highschool_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.datasheet_primary_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TimePeriod']"}) + }, + 'hdabo.datasheet_primary_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Domain']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.documentformat': { + 'Meta': {'object_name': 'DocumentFormat'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.domain': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'Domain'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + }, + 'hdabo.location': { + 'Meta': {'object_name': 'Location'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '5'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}) + }, + 'hdabo.organisation': { + 'Meta': {'object_name': 'Organisation'}, + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'website': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.tag': { + 'Meta': {'unique_together': "(('label', 'original_label', 'url_status'),)", 'object_name': 'Tag'}, + 'alias': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.TagCategory']", 'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'normalized_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'original_label': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'popularity': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'url_status': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'hdabo.tagcategory': { + 'Meta': {'object_name': 'TagCategory'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + 'hdabo.taggedsheet': { + 'Meta': {'object_name': 'TaggedSheet'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Datasheet']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_note': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'original_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['hdabo.Tag']"}), + 'wikipedia_revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'hdabo.timeperiod': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'TimePeriod'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + } + } + + complete_apps = ['hdabo'] diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/migrations/0006_auto__add_user__chg_field_datasheet_validator.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/migrations/0006_auto__add_user__chg_field_datasheet_validator.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,250 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding model 'User' + db.create_table('auth_user', ( + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('password', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('last_login', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), + ('is_superuser', self.gf('django.db.models.fields.BooleanField')(default=False)), + ('username', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), + ('first_name', self.gf('django.db.models.fields.CharField')(max_length=30, blank=True)), + ('last_name', self.gf('django.db.models.fields.CharField')(max_length=30, blank=True)), + ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, blank=True)), + ('is_staff', self.gf('django.db.models.fields.BooleanField')(default=False)), + ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)), + ('date_joined', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), + )) + db.send_create_signal(u'hdabo', ['User']) + + # Adding M2M table for field groups on 'User' + m2m_table_name = db.shorten_name('auth_user_groups') + db.create_table(m2m_table_name, ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('user', models.ForeignKey(orm[u'hdabo.user'], null=False)), + ('group', models.ForeignKey(orm[u'auth.group'], null=False)) + )) + db.create_unique(m2m_table_name, ['user_id', 'group_id']) + + # Adding M2M table for field user_permissions on 'User' + m2m_table_name = db.shorten_name('auth_user_user_permissions') + db.create_table(m2m_table_name, ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('user', models.ForeignKey(orm[u'hdabo.user'], null=False)), + ('permission', models.ForeignKey(orm[u'auth.permission'], null=False)) + )) + db.create_unique(m2m_table_name, ['user_id', 'permission_id']) + + + # Changing field 'Datasheet.validator' + db.alter_column(u'hdabo_datasheet', 'validator_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['hdabo.User'], null=True)) + + def backwards(self, orm): + # Deleting model 'User' + db.delete_table('auth_user') + + # Removing M2M table for field groups on 'User' + db.delete_table(db.shorten_name('auth_user_groups')) + + # Removing M2M table for field user_permissions on 'User' + db.delete_table(db.shorten_name('auth_user_user_permissions')) + + + # Changing field 'Datasheet.validator' + db.alter_column(u'hdabo_datasheet', 'validator_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)) + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + u'hdabo.author': { + 'Meta': {'object_name': 'Author'}, + 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + u'hdabo.datasheet': { + 'Meta': {'object_name': 'Datasheet'}, + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Author']", 'null': 'True', 'blank': 'True'}), + 'college_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_periods_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_college_periods']", 'to': u"orm['hdabo.TimePeriod']"}), + 'college_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'college_themes_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_college_themes']", 'to': u"orm['hdabo.Domain']"}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'domains': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_domains']", 'to': u"orm['hdabo.Domain']"}), + 'format': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.DocumentFormat']", 'null': 'True', 'blank': 'True'}), + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + 'highschool_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_periods_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_highschool_periods']", 'to': u"orm['hdabo.TimePeriod']"}), + 'highschool_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'highschool_themes_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_highschool_themes']", 'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manual_order': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'modification_datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'organisation': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Organisation']", 'null': 'True'}), + 'original_creation_date': ('django.db.models.fields.DateField', [], {}), + 'original_modification_date': ('django.db.models.fields.DateField', [], {}), + 'primary_periods': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_periods_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_primary_periods']", 'to': u"orm['hdabo.TimePeriod']"}), + 'primary_themes': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'primary_themes_datasheets'", 'symmetrical': 'False', 'through': u"orm['hdabo.Datasheet_primary_themes']", 'to': u"orm['hdabo.Domain']"}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['hdabo.Tag']", 'through': u"orm['hdabo.TaggedSheet']", 'symmetrical': 'False'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '2048'}), + 'town': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Location']", 'null': 'True', 'blank': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'validated': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'validation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'validator': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.User']", 'null': 'True', 'blank': 'True'}) + }, + u'hdabo.datasheet_college_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.TimePeriod']"}) + }, + u'hdabo.datasheet_college_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_college_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.datasheet_domains': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_domains'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.datasheet_highschool_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.TimePeriod']"}) + }, + u'hdabo.datasheet_highschool_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_highschool_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.datasheet_primary_periods': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_periods'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}), + 'timeperiod': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.TimePeriod']"}) + }, + u'hdabo.datasheet_primary_themes': { + 'Meta': {'ordering': "['sort_value']", 'object_name': 'Datasheet_primary_themes'}, + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + 'domain': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Domain']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'sort_value': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.documentformat': { + 'Meta': {'object_name': 'DocumentFormat'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + u'hdabo.domain': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'Domain'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.location': { + 'Meta': {'object_name': 'Location'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '5'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}) + }, + u'hdabo.organisation': { + 'Meta': {'object_name': 'Organisation'}, + 'hda_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'website': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + u'hdabo.tag': { + 'Meta': {'unique_together': "(('label', 'original_label', 'url_status'),)", 'object_name': 'Tag'}, + 'alias': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'alternative_wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.TagCategory']", 'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'dbpedia_uri': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'normalized_label': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}), + 'original_label': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'popularity': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'url_status': ('django.db.models.fields.IntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'wikipedia_pageid': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'wikipedia_url': ('django.db.models.fields.URLField', [], {'db_index': 'True', 'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + u'hdabo.tagcategory': { + 'Meta': {'object_name': 'TagCategory'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '512'}) + }, + u'hdabo.taggedsheet': { + 'Meta': {'object_name': 'TaggedSheet'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'datasheet': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Datasheet']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_note': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'original_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['hdabo.Tag']"}), + 'wikipedia_revision_id': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + u'hdabo.timeperiod': { + 'Meta': {'unique_together': "(('label', 'school_period'),)", 'object_name': 'TimePeriod'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '512'}), + 'school_period': ('django.db.models.fields.IntegerField', [], {}) + }, + u'hdabo.user': { + 'Meta': {'object_name': 'User', 'db_table': "'auth_user'"}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + } + } + + complete_apps = ['hdabo'] \ No newline at end of file diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/migrations/__init__.py diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/models.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/models.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,404 @@ +# -*- coding: utf-8 -*- + +from django.conf import settings +from django.contrib.auth.models import User +from django.db import models +from hdabo.utils import Property, normalize +import datetime + + + +class SortedModelManager(models.Manager): + use_for_related_fields = True + def get_query_set(self): + qs = super(SortedModelManager, self).get_query_set() + if getattr(self, 'through', None) is not None and getattr(self.through, 'Meta', None) is not None and getattr(self.through.Meta, 'ordering', None) is not None: + qs = qs.order_by(*[self.through._meta.db_table + "." + f for f in self.through.Meta.ordering]) + return qs + + +class Organisation(models.Model): + hda_id = models.CharField(max_length=512, unique=True, blank=False, null=False) + name = models.CharField(max_length=512, unique=False, blank=False, null=False) + location = models.CharField(max_length=512, unique=False, blank=True, null=True) + website = models.CharField(max_length=2048, unique=False, blank=True, null=True) + +class Author(models.Model): + hda_id = models.CharField(max_length=512, unique=True, blank=False, null=False) + lastname = models.CharField(max_length=512, unique=False, blank=True, null=True) + firstname = models.CharField(max_length=512, unique=False, blank=True, null=True) + +class TimePeriod(models.Model): + TIME_PERIOD_CHOICES = ( + (1, u'Primaire'), + (2, u'Collège'), + (3, u'Lycée'), + ) + TIME_PERIOD_DICT = { + u'Primaire': 1, + u'Collège': 2, + u'Lycée': 3, + } + label = models.CharField(max_length=512, unique=False, blank=False, null=False) + school_period = models.IntegerField(choices=TIME_PERIOD_CHOICES) + + objects = SortedModelManager() + + class Meta: + unique_together = ("label", "school_period") + + def __unicode__(self): + return unicode(self.label) + +class Domain(models.Model): + DOMAIN_PERIOD_CHOICES = ( + (0, u'Global'), + (1, u'Primaire'), + (2, u'Collège'), + (3, u'Lycée'), + ) + DOMAIN_PERIOD_DICT = { + u'Global': 0, + u'Primaire': 1, + u'Collège': 2, + u'Lycée': 3, + } + label = models.CharField(max_length=512, unique=False, blank=False, null=False) + school_period = models.IntegerField(choices=DOMAIN_PERIOD_CHOICES) + + objects = SortedModelManager() + + class Meta: + unique_together = ("label", "school_period") + + def __unicode__(self): + return unicode(self.label) + + +class DocumentFormat(models.Model): + label = models.CharField(max_length=512, unique=True, blank=False, null=False) + + def __unicode__(self): + return unicode(self.label) + +class TagCategory(models.Model): + label = models.CharField(max_length=512, unique=True, blank=False, null=False) + + def __unicode__(self): + return unicode(self.label) + + class Meta: + verbose_name_plural = "TagCategories" + +class Tag(models.Model): + TAG_URL_STATUS_CHOICES = ( + (0, "null_result"), + (1, "redirection"), + (2, "homonyme"), + (3, "match"), + (4, "unsematized"), + ) + + TAG_URL_STATUS_DICT = { + "null_result":0, + "redirection":1, + "homonyme":2, + "match":3, + "unsemantized":4, + } + + label = models.CharField(max_length=1024, unique=False, blank=False, null=False, db_index=True) + alternative_label = models.CharField(max_length=1024, unique=False, blank=True, null=True) + normalized_label = models.CharField(max_length=1024, unique=False, blank=False, null=False, db_index=True, editable=False) + created_at = models.DateTimeField(auto_now_add=True) + original_label = models.CharField(max_length=1024, unique=False, blank=False, null=False, editable=False) + alias = models.CharField(max_length=1024, unique=False, blank=True, null=True) + category = models.ForeignKey(TagCategory, null=True, blank=True) + wikipedia_url = models.URLField(max_length=2048, blank=True, null=True, db_index=True) + wikipedia_pageid = models.BigIntegerField(unique=False, blank=True, null=True, db_index=True) + alternative_wikipedia_url = models.URLField(max_length=2048, blank=True, null=True, db_index=True) + alternative_wikipedia_pageid = models.BigIntegerField(unique=False, blank=True, null=True, db_index=True) + url_status = models.IntegerField(choices=TAG_URL_STATUS_CHOICES, blank=True, null=True, default=None, db_index=True) + dbpedia_uri = models.URLField(max_length=2048, blank=True, null=True, db_index=True) + popularity = models.IntegerField(blank=False, null=False, default=0, db_index=True) + + @Property + def url_status_text(): #@NoSelf + def fget(self): + return self.TAG_URL_STATUS_CHOICES[self.url_status][1] + + return locals() + + def save(self, *args, **kwargs): + self.normalized_label = normalize(self.label) + super(Tag, self).save(*args, **kwargs) + + class Meta: + unique_together = (('label', 'original_label', 'url_status'),) + +class Location(models.Model): + name = models.CharField(max_length=512, unique=False, blank=False, null=False) + insee = models.CharField(max_length=5, unique=True, blank=False, null=False) + + def __unicode__(self): + return unicode("%s : %s" % (self.name, self.insee)) + + +def generate_m2m_setter(m2m_field_name): + + def set_m2m_field(self, list): + + m2m_manager = getattr(self, m2m_field_name) + m2m_manager.clear() + + through_klass = set_m2m_field.cache.get('through_klass', None) + if through_klass is None: + field = getattr(self.__class__, m2m_field_name) + through_klass = field.through + set_m2m_field.cache['through_klass'] = through_klass + for f in through_klass._meta.fields: + if isinstance(f, models.ForeignKey) and f.name != "datasheet": + set_m2m_field.cache['target_obj_field_name'] = f.name + break + target_obj_field_name = set_m2m_field.cache['target_obj_field_name'] + + for i, obj in enumerate(list): + kwargs = { + 'datasheet': self, + 'sort_value' : i, + target_obj_field_name: obj + } + new_rel = through_klass(**kwargs) + new_rel.save() + set_m2m_field.cache = {} + + return set_m2m_field + + +class Datasheet(models.Model): + hda_id = models.CharField(max_length=512, unique=True, blank=False, null=False) + author = models.ForeignKey(Author, null=True, blank=True, serialize=False) + organisation = models.ForeignKey(Organisation, serialize=False, null=True) + title = models.CharField(max_length=2048, unique=False, blank=False, null=False, serialize=False) + description = models.TextField(blank=True, null=True, serialize=False) + url = models.URLField(max_length=2048, blank=True, null=True, serialize=False) + domains = models.ManyToManyField(Domain, limit_choices_to={'school_period':Domain.DOMAIN_PERIOD_DICT[u'Global']}, related_name="datasheets", through="Datasheet_domains", serialize=False) + primary_periods = models.ManyToManyField(TimePeriod, limit_choices_to={'school_period':TimePeriod.TIME_PERIOD_DICT[u'Primaire']}, related_name="primary_periods_datasheets", through="Datasheet_primary_periods", serialize=False) + college_periods = models.ManyToManyField(TimePeriod, limit_choices_to={'school_period':TimePeriod.TIME_PERIOD_DICT[u'Collège']}, related_name="college_periods_datasheets", through="Datasheet_college_periods", serialize=False) + highschool_periods = models.ManyToManyField(TimePeriod, limit_choices_to={'school_period':TimePeriod.TIME_PERIOD_DICT[u'Lycée']}, related_name="highschool_periods_datasheets", through="Datasheet_highschool_periods", serialize=False) + primary_themes = models.ManyToManyField(Domain, limit_choices_to={'school_period':Domain.DOMAIN_PERIOD_DICT[u'Primaire']}, related_name="primary_themes_datasheets", through="Datasheet_primary_themes", serialize=False) + college_themes = models.ManyToManyField(Domain, limit_choices_to={'school_period':Domain.DOMAIN_PERIOD_DICT[u'Collège']}, related_name="college_themes_datasheets", through="Datasheet_college_themes", serialize=False) + highschool_themes = models.ManyToManyField(Domain, limit_choices_to={'school_period':Domain.DOMAIN_PERIOD_DICT[u'Lycée']}, related_name="highschool_themes_datasheets", through="Datasheet_highschool_themes", serialize=False) + town = models.ForeignKey(Location, null=True, blank=True, serialize=False) + format = models.ForeignKey(DocumentFormat, null=True, blank=True, serialize=False) + original_creation_date = models.DateField(serialize=False) + original_modification_date = models.DateField(serialize=False) + modification_datetime = models.DateTimeField(auto_now=True, serialize=False) + validation_date = models.DateTimeField(null=True, blank=True, serialize=False) + validated = models.BooleanField(default=False, db_index=True) + validator = models.ForeignKey(User, null=True, blank=True, serialize=False) + manual_order = models.BooleanField(default=False, db_index=True, serialize=False) + tags = models.ManyToManyField(Tag, through='TaggedSheet', serialize=False) + + def natural_key(self): + return self.hda_id + + def validate(self, user): + self.validation_date = datetime.datetime.now() + self.validated = True + self.validator = user + self.save() + + def unvalidate(self): + self.validation_date = datetime.datetime.min + self.validated = False + self.validator = None + self.save() + + + set_domains = generate_m2m_setter("domains") + + @Property + def domains_list(): #@NoSelf + def fget(self): + return [d.label for d in self.domains.all()] + + return locals() + + @Property + def domains_text(): #@NoSelf + def fget(self): + return "; ".join(self.domains_list) + + return locals() + + + set_primary_periods = generate_m2m_setter("primary_periods") + + @Property + def primary_periods_list(): #@NoSelf + def fget(self): + return [d.label for d in self.primary_periods.all()] + + return locals() + + + @Property + def primary_periods_text(): #@NoSelf + def fget(self): + return "; ".join(self.primary_periods_list) + + return locals() + + set_college_periods = generate_m2m_setter("college_periods") + + @Property + def college_periods_list(): #@NoSelf + def fget(self): + return [d.label for d in self.college_periods.all()] + + return locals() + + @Property + def college_periods_text(): #@NoSelf + def fget(self): + return "; ".join(self.college_periods_list) + + return locals() + + set_highschool_periods = generate_m2m_setter("highschool_periods") + + @Property + def highschool_periods_list(): #@NoSelf + def fget(self): + return [d.label for d in self.highschool_periods.all()] + + return locals() + + @Property + def highschool_periods_text(): #@NoSelf + def fget(self): + return "; ".join(self.highschool_periods_list) + + return locals() + + set_primary_themes = generate_m2m_setter("primary_themes") + + @Property + def primary_themes_list(): #@NoSelf + def fget(self): + return [d.label for d in self.primary_themes.all()] + + return locals() + + + @Property + def primary_themes_text(): #@NoSelf + def fget(self): + return "; ".join(self.primary_themes_list) + + return locals() + + set_college_themes = generate_m2m_setter("college_themes") + + @Property + def college_themes_list(): #@NoSelf + def fget(self): + return [d.label for d in self.college_themes.all()] + + return locals() + + @Property + def college_themes_text(): #@NoSelf + def fget(self): + return "; ".join(self.college_themes_list) + + return locals() + + set_highschool_themes = generate_m2m_setter("highschool_themes") + + @Property + def highschool_themes_list(): #@NoSelf + def fget(self): + return [d.label for d in self.highschool_themes.all()] + + return locals() + + @Property + def highschool_themes_text(): #@NoSelf + def fget(self): + return "; ".join(self.highschool_themes_list) + + return locals() + + @Property + def town_text(): #@NoSelf + def fget(self): + return self.town.name if self.town else "" + + return locals() + + @Property + def tags_text(): #@NoSelf + def fget(self): + return "; ".join([t.label for t in self.tags.all()]) + + return locals() + + @models.permalink + def get_absolute_url(self): + return ('display_datasheet', (), { + 'ds_id': self.hda_id + }) + + +class TaggedSheet(models.Model): + datasheet = models.ForeignKey(Datasheet) + tag = models.ForeignKey(Tag) + created_at = models.DateTimeField(auto_now_add=True) + original_order = models.IntegerField(null=False, blank=False, default=0) + order = models.IntegerField(null=False, blank=False, default=0, db_index=True) + index_note = models.FloatField(null=False, blank=False, default=0.0, db_index=True) + wikipedia_revision_id = models.BigIntegerField(unique=False, blank=True, null=True) + + @Property + def wikipedia_verion_permalink(): #@NoSelf + def fget(self): + return settings.WIKIPEDIA_VERSION_PERMALINK_TEMPLATE % (unicode(self.wikipedia_revision_id)) + + return locals() + + +class SortedDatasheetLink(models.Model): + datasheet = models.ForeignKey(Datasheet, db_index=True, null=False, blank=False) + sort_value = models.IntegerField(null=False, blank=False) + + class Meta: + abstract = True + ordering = ['sort_value'] + + +class Datasheet_domains(SortedDatasheetLink): + domain = models.ForeignKey(Domain, db_index=True, null=False, blank=False) + +class Datasheet_highschool_periods(SortedDatasheetLink): + timeperiod = models.ForeignKey(TimePeriod, db_index=True, null=False, blank=False) + +class Datasheet_highschool_themes(SortedDatasheetLink): + domain = models.ForeignKey(Domain, db_index=True, null=False, blank=False) + +class Datasheet_college_periods(SortedDatasheetLink): + timeperiod = models.ForeignKey(TimePeriod, db_index=True, null=False, blank=False) + +class Datasheet_college_themes(SortedDatasheetLink): + domain = models.ForeignKey(Domain, db_index=True, null=False, blank=False) + +class Datasheet_primary_periods(SortedDatasheetLink): + timeperiod = models.ForeignKey(TimePeriod, db_index=True, null=False, blank=False) + +class Datasheet_primary_themes(SortedDatasheetLink): + domain = models.ForeignKey(Domain, db_index=True, null=False, blank=False) + + + + \ No newline at end of file diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/modwsgi.wsgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/modwsgi.wsgi Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,34 @@ +import os, sys, site + +def application(environ, start_response): + + global g_env_set + + if 'g_env_set' not in globals() or not g_env_set: + os.environ.setdefault('DJANGO_SETTINGS_MODULE',environ['DJANGO_SETTINGS_MODULE']) + + prev_sys_path = list(sys.path) + + sys.path.append(environ['PROJECT_PATH']) + for path in environ.get('PYTHON_PATH',"").split(os.pathsep): + if path: + site.addsitedir(path) + + new_sys_path = [] + for item in list(sys.path): + if item not in prev_sys_path and item not in new_sys_path: + new_sys_path.append(item) + sys.path.remove(item) + sys.path[:0] = new_sys_path + g_env_set = True + + import django.core.handlers.wsgi + + _application = django.core.handlers.wsgi.WSGIHandler() + + if environ.get('PYDEV_DEBUG', "False").lower() in ["true", "1", "t"]: + import pydevd #@UnresolvedImport + pydevd.settrace(suspend=False) + + return _application(environ, start_response) + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/search/__init__.py diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/search/french_whoosh_backend.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/search/french_whoosh_backend.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- +''' + +Adaptation of Haystack' Swoosh backend with french snowball stemming + +Created on May 31, 2011 + +@author: ymh +''' + +from django.conf import settings +from django.db.models.loading import get_model +from haystack.backends.whoosh_backend import ( + SearchBackend as WhooshSearchBackend, SearchQuery as WhooshSearchQuery) +from haystack.constants import ID, DJANGO_CT, DJANGO_ID +from haystack.exceptions import SearchBackendError +from haystack.models import SearchResult +from whoosh.analysis import (default_pattern, stem, RegexTokenizer, + LowercaseFilter, StopFilter, PyStemmerFilter) +from whoosh.fields import (ID as WHOOSH_ID, Schema, IDLIST, TEXT, KEYWORD, + NUMERIC, BOOLEAN, DATETIME, NGRAM, NGRAMWORDS) + +BACKEND_NAME = 'french_whoosh' + +STOP_WORDS = [ u"a", u"afin", u"ai", u"ainsi", u"après", u"attendu", u"au", +u"aujourd", u"auquel", u"aussi", u"autre", u"autres", u"aux", u"auxquelles", +u"auxquels", u"avait", u"avant", u"avec", u"avoir", u"c", u"car", u"ce", +u"ceci", u"cela", u"celle", u"celles", u"celui", u"cependant", u"certain", +u"certaine", u"certaines", u"certains", u"ces", u"cet", u"cette", u"ceux", +u"chez", u"ci", u"combien", u"comme", u"comment", u"concernant", u"contre", +u"d", u"dans", u"je", u"de", u"jusqu", u"debout", u"jusque", u"dedans", u"l", +u"dehors", u"la", u"delà", u"laquelle", u"depuis", u"le", u"derrière", +u"lequel", u"des", u"les", u"desquelles", u"lesquelles", u"desquels", +u"lesquels", u"dessous", u"leur", u"dessus", u"leurs", u"devant", u"lorsque", +u"devers", u"lui", u"devra", u"là", u"divers", u"ma", u"diverse", u"mais", +u"diverses", u"malgré", u"doit", u"me", u"donc", u"merci", u"dont", u"mes", +u"du", u"mien", u"duquel", u"mienne", u"durant", u"miennes", u"dès", u"miens", +u"elle", u"moi", u"elles", u"moins", u"en", u"mon", u"entre", u"moyennant", +u"environ", u"même", u"est", u"mêmes", u"et", u"n", u"etc", u"ne", u"etre", +u"ni", u"eux", u"non", u"excepté", u"nos", u"hormis", u"notre", u"hors", +u"nous", u"hélas", u"néanmoins", u"hui", u"nôtre", u"il", u"nôtres", u"ils", +u"on", u"j", u"out", u"ou", u"soit", u"outre", u"son", u"où", u"sont", u"par", +u"sous", u"parmi", u"suivant", u"partant", u"sur", u"pas", u"ta", u"passé", +u"te", u"pendant", u"tes", u"plein", u"tien", u"plus", u"tienne", u"plusieurs", +u"tiennes", u"pour", u"tiens", u"pourquoi", u"toi", u"proche", u"ton", u"près", +u"tous", u"puisque", u"tout", u"qu", u"toute", u"quand", u"toutes", u"que", +u"tu", u"quel", u"un", u"quelle", u"une", u"quelles", u"va", u"quels", u"vers", +u"qui", u"voici", u"quoi", u"voilà", u"quoique", u"vos", u"revoici", u"votre", +u"revoilà", u"vous", u"s", u"vu", u"sa", u"vôtre", u"sans", u"vôtres", +u"sauf", u"y", u"se", u"à", u"selon", u"ça", u"seront", u"ès", u"ses", +u"été", u"si", u"être", u"sien", u"ô", u"sienne", u"siennes", u"siens", +u"sinon", u"soi"] + +def FrenchStemmingAnalyzer(expression=default_pattern, stoplist=STOP_WORDS, + minsize=2, maxsize=None, gaps=False, stemfn=stem, + ignore=None, cachesize=50000): + """Composes a RegexTokenizer with a lower case filter, an optional stop + filter, and a stemming filter. + + >>> ana = StemmingAnalyzer() + >>> [token.text for token in ana(u"Testing is testing and testing")] + [u"test", u"test", u"test"] + + :param expression: The regular expression pattern to use to extract tokens. + :param stoplist: A list of stop words. Set this to None to disable + the stop word filter. + :param minsize: Words smaller than this are removed from the stream. + :param maxsize: Words longer that this are removed from the stream. + :param gaps: If True, the tokenizer *splits* on the expression, rather + than matching on the expression. + :param ignore: a set of words to not stem. + :param cachesize: the maximum number of stemmed words to cache. The larger + this number, the faster stemming will be but the more memory it will + use. + """ + + ret = RegexTokenizer(expression=expression, gaps=gaps) + chain = ret | LowercaseFilter() + if stoplist is not None: + chain = chain | StopFilter(stoplist=stoplist, minsize=minsize, + maxsize=maxsize) + return chain | PyStemmerFilter(lang="french", ignore=ignore, cachesize=cachesize) +FrenchStemmingAnalyzer.__inittypes__ = dict(expression=unicode, gaps=bool, + stoplist=list, minsize=int, maxsize=int) + + +class SearchBackend(WhooshSearchBackend): + ''' + Adaptation of Haystack' Swoosh backend with french snowball stemming + ''' + + def build_schema(self, fields): + schema_fields = { + ID: WHOOSH_ID(stored=True, unique=True), + DJANGO_CT: WHOOSH_ID(stored=True), + DJANGO_ID: WHOOSH_ID(stored=True), + } + # Grab the number of keys that are hard-coded into Haystack. + # We'll use this to (possibly) fail slightly more gracefully later. + initial_key_count = len(schema_fields) + content_field_name = '' + + for field_name, field_class in fields.items(): #@UnusedVariable + if field_class.is_multivalued: + if field_class.indexed is False: + schema_fields[field_class.index_fieldname] = IDLIST(stored=True, field_boost=field_class.boost) + else: + schema_fields[field_class.index_fieldname] = KEYWORD(stored=True, commas=True, scorable=True, field_boost=field_class.boost) + elif field_class.field_type in ['date', 'datetime']: + schema_fields[field_class.index_fieldname] = DATETIME(stored=field_class.stored) + elif field_class.field_type == 'integer': + schema_fields[field_class.index_fieldname] = NUMERIC(stored=field_class.stored, type=int, field_boost=field_class.boost) + elif field_class.field_type == 'float': + schema_fields[field_class.index_fieldname] = NUMERIC(stored=field_class.stored, type=float, field_boost=field_class.boost) + elif field_class.field_type == 'boolean': + # Field boost isn't supported on BOOLEAN as of 1.8.2. + schema_fields[field_class.index_fieldname] = BOOLEAN(stored=field_class.stored) + elif field_class.field_type == 'ngram': + schema_fields[field_class.index_fieldname] = NGRAM(minsize=3, maxsize=15, stored=field_class.stored, field_boost=field_class.boost) + elif field_class.field_type == 'edge_ngram': + schema_fields[field_class.index_fieldname] = NGRAMWORDS(minsize=2, maxsize=15, stored=field_class.stored, field_boost=field_class.boost) + else: + schema_fields[field_class.index_fieldname] = TEXT(stored=True, analyzer=FrenchStemmingAnalyzer(), field_boost=field_class.boost) + + if field_class.document is True: + content_field_name = field_class.index_fieldname + + # Fail more gracefully than relying on the backend to die if no fields + # are found. + if len(schema_fields) <= initial_key_count: + raise SearchBackendError("No fields were found in any search_indexes. Please correct this before attempting to search.") + + return (content_field_name, Schema(**schema_fields)) + + def _process_results(self, raw_page, highlight=False, query_string='', spelling_query=None, result_class=None): + if not self.site: + from haystack import site + else: + site = self.site + + results = [] + + # It's important to grab the hits first before slicing. Otherwise, this + # can cause pagination failures. + hits = len(raw_page) + + if result_class is None: + result_class = SearchResult + + facets = {} + spelling_suggestion = None + indexed_models = site.get_indexed_models() + + for doc_offset, raw_result in enumerate(raw_page): + score = raw_page.score(doc_offset) or 0 + app_label, model_name = raw_result[DJANGO_CT].split('.') + additional_fields = {} + model = get_model(app_label, model_name) + + if model and model in indexed_models: + for key, value in raw_result.items(): + index = site.get_index(model) + string_key = str(key) + + if string_key in index.fields and hasattr(index.fields[string_key], 'convert'): + # Special-cased due to the nature of KEYWORD fields. + if index.fields[string_key].is_multivalued: + if value is None or len(value) is 0: + additional_fields[string_key] = [] + else: + additional_fields[string_key] = value.split(',') + else: + additional_fields[string_key] = index.fields[string_key].convert(value) + else: + additional_fields[string_key] = self._to_python(value) + + del(additional_fields[DJANGO_CT]) + del(additional_fields[DJANGO_ID]) + + if highlight: + from whoosh.highlight import highlight, ContextFragmenter, UppercaseFormatter + sa = FrenchStemmingAnalyzer() + terms = [term.replace('*', '') for term in query_string.split()] + + additional_fields['highlighted'] = { + self.content_field_name: [highlight(additional_fields.get(self.content_field_name), terms, sa, ContextFragmenter(terms), UppercaseFormatter())], + } + + result = result_class(app_label, model_name, raw_result[DJANGO_ID], score, searchsite=self.site, **additional_fields) + results.append(result) + else: + hits -= 1 + + if getattr(settings, 'HAYSTACK_INCLUDE_SPELLING', False): + if spelling_query: + spelling_suggestion = self.create_spelling_suggestion(spelling_query) + else: + spelling_suggestion = self.create_spelling_suggestion(query_string) + + return { + 'results': results, + 'hits': hits, + 'facets': facets, + 'spelling_suggestion': spelling_suggestion, + } + +class SearchQuery(WhooshSearchQuery): + pass + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/search/sites.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/search/sites.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,7 @@ +''' +Created on May 27, 2011 + +@author: ymh +''' +import haystack +haystack.autodiscover() diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/search_indexes.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/search_indexes.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,24 @@ +''' +Created on May 30, 2011 + +@author: ymh +''' + +#from haystack import site +#from haystack.indexes import SearchIndex, CharField +from haystack import indexes +from hdabo.models import Datasheet + +class DatasheetIndex(indexes.SearchIndex, indexes.Indexable): + ''' + The search index for the datasheet + ''' + text = indexes.CharField(document=True, use_template=True) + hda_id = indexes.CharField(model_attr='hda_id', indexed=True, stored=True) + title = indexes.CharField(model_attr='title', indexed=True, stored=True, boost=2.0) + description = indexes.CharField(model_attr='description', indexed=True, stored=True, boost=1.0) + + def get_model(self): + return Datasheet + +#site.register(Datasheet, DatasheetIndex) diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/settings.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/settings.py Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,147 @@ +# Django settings for hdabo project. + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@example.com'), +) + +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': '', # Or path to database file if using sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + } +} + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# On Unix systems, a value of None will cause Django to use the same +# timezone as the operating system. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# If you set this to False, Django will not format dates, numbers and +# calendars according to the current locale +USE_L10N = True + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/home/media/media.lawrence.com/media/" +MEDIA_ROOT = '' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash. +# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" +MEDIA_URL = '' + +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/home/media/media.lawrence.com/static/" +STATIC_ROOT = '' + +# URL prefix for static files. +# Example: "http://media.lawrence.com/static/" +STATIC_URL = '/static/site' + +# Additional locations of static files +STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +# List of finder classes that know how to find static files in +# various locations. +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', +) + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '1anp2v#36%z(pahi5ytghik&-eg8t96)&$t)b%i=7@%=)u$pyn' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', +# 'django.template.loaders.eggs.Loader', +) + +# List of processors used by RequestContext to populate the context. +# Each one should be a callable that takes the request object as its +# only parameter and returns a dictionary to add to the context. +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.static', + 'django.contrib.messages.context_processors.messages', + 'hdabo.context_processors.version', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', +) + +ROOT_URLCONF = 'hdabo.urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +INSTALLED_APPS = ( + 'south', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django.contrib.admin', + 'django_extensions', + 'haystack', + 'hdabo', +) + + +WIKIPEDIA_API_URL = "http://fr.wikipedia.org/w/api.php" +WIKIPEDIA_VERSION_PERMALINK_TEMPLATE = "http://fr.wikipedia.org/w/index.php?oldid=%s" +DBPEDIA_URI_TEMPLATE = "http://dbpedia.org/resource/%s" + +SEARCH_STAR_CHARACTER = "*" +PAGINATION_DEFAULT_NB_BY_PAGE = 50 + +from hdabo.config import * #@UnusedWildImport + +if 'LOGIN_REDIRECT_URL' not in locals(): + LOGIN_REDIRECT_URL = BASE_URL + "hdabo" +if 'LOGIN_URL' not in locals(): + LOGIN_URL = BASE_URL + "hdabo/accounts/login" + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/.keepme diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/.keepme diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/.keepme diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/nyroModal.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/static/hdabo/css/nyroModal.css Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,102 @@ +.nyroModalBg { + position: fixed; + overflow: hidden; + top: 0; + left: 0; + height: 100%; + width: 100%; + background: #000; + opacity: 0.7; +} +.nmReposition { + position: absolute; +} +.nyroModalCloseButton { + top: -13px; + right: -13px; + width: 12px; + height: 12px; + text-indent: -9999em; + background: url(../img/close_nm.gif); +} +.nyroModalTitle { + top: -26px; + left: 0; + margin: 0; + font-size: 1.1em; + color: #ddd; +} +.nyroModalCont { + position: absolute; + border: 4px solid #777; + margin: 25px; + background: #fff; +} +.nyroModalCont iframe { + width: 600px; + height: 400px; +} +.nyroModalError { + border: 4px solid red; + color: red; + width: 250px; + height: 250px; +} +.nyroModalError div { + min-width: 0; + min-height: 0; + padding: 10px; +} +.nyroModalLink, .nyroModalDom, .nyroModalForm, .nyroModalFormFile { + position: relative; + padding: 10px; + min-height: 250px; + min-width: 250px; + max-width: 1000px; +} +.nyroModalImage, .nyroModalSwf, .nyroModalIframe, .nyroModalIframeForm { + position: relative; + overflow: hidden; +} +.nyroModalHidden { + left: -9999em; + top: -9999em; +} +.nyroModalLoad { + position: absolute; + width: 100px; + height: 100px; + background: #fff url(../img/ajax-loader-43x43.gif) no-repeat center; + padding: 0; +} +.nyroModalPrev, .nyroModalNext { + outline: none; + position: absolute; + top: 0; + height: 60%; + width: 150px; + min-height: 50px; + max-height: 300px; + cursor: pointer; + text-indent: -9999em; + background: transparent url('data:image/gif;base64,AAAA') left 20% no-repeat; +} +.nyroModalImage .nyroModalPrev, .nyroModalImage .nyroModalNext { + height: 100%; + width: 40%; + max-height: none; +} +.nyroModalPrev { + left: 0; +} +.nyroModalPrev:hover { + background-image: url(../img/prev.gif); +} +.nyroModalNext { + right: 0; + background-position: right 20%; +} +.nyroModalNext:hover { + background-position: right 20%; + background-image: url(../img/next.gif); +} \ No newline at end of file diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-icons_222222_256x240.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-icons_222222_256x240.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-icons_2e83ff_256x240.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-icons_2e83ff_256x240.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-icons_454545_256x240.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-icons_454545_256x240.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-icons_888888_256x240.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-icons_888888_256x240.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/images/ui-icons_cd0a0a_256x240.png Binary file src/hdabo/static/hdabo/css/smoothness/images/ui-icons_cd0a0a_256x240.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/smoothness/jquery-ui-1.8.13.custom.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/static/hdabo/css/smoothness/jquery-ui-1.8.13.custom.css Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,578 @@ +/* + * jQuery UI CSS Framework 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Arial,Verdana,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial,Verdana,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Resizable 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; + /* http://bugs.jqueryui.com/ticket/7233 + - Resizable: resizable handles fail to work in IE if transparent and content overlaps + */ + background-image:url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=); +} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Accordion 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } +/* + * jQuery UI Autocomplete 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.13 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* + * jQuery UI Slider 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* + * jQuery UI Tabs 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* + * jQuery UI Datepicker 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* + * jQuery UI Progressbar 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/css/style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/static/hdabo/css/style.css Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,419 @@ +@charset "UTF-8"; + +body { + + font-family: Arial, Helvetica, sans serif; + font-size: 12px; + color: #4F5155; + margin: 5px; + padding: 0px; + min-width:750px; + text-align: justify; +} +body p { + margin: 2px; +} + +a img,a:link img, a:active img, a:visited img, a:hover img { + border:0px; +} + + +a:link +{ + color: #50a4a3; + text-decoration: none; + font-family: Arial, Helvetica, sans-serif; + /*font-weight: bold;*/ +} + +a:hover +{ + color: #50a4a3; + text-decoration: none; + font-family: Arial, Helvetica, sans-serif; + /*border-bottom-width: 1px; + border-bottom-style: dashed; + border-bottom-color: #2c8084; + font-weight: bold;*/ +} +a:visited { + color: #50a4a3; + font-family: Arial, Helvetica, sans-serif; + /*font-weight: bold;*/ +} + +.hda_blue{ + /*color: #97fefd;*/ + color: #86e6e5; +} + + +#header +{ + padding: .2em; + border-bottom: 1px solid gray; + border-left: 1px solid gray; +} + +#header a +{ + text-decoration: none; +} + + +#header_left +{ + padding: 0px; + max-width: 8em; + font-size: 30px; + font-weight : bold; + text-align: left; + text-transform: uppercase; +} + +#header_left p +{ + margin: 0px; +} + + +#header_left a:hover, #header_left a:visited, #header_left a:link, #header_left a:active, #header_left a:focus +{ + color: #4F5155; + text-decoration: none; +} + + +#header_right +{ + text-align: right; +} + +#header_right a:link +{ + text-decoration: none; + color: white; +} + +#header_right a:hover +{ + text-decoration: none; + color: white; +} + +#header_right a:visited { + text-decoration: none; + color: white; +} + + +#footer +{ + clear: both; + margin: 0; + padding: .5em; + /*background-color: #ddd;*/ + border-top: 1px solid gray; +} + +.version +{ + text-align: right; + color: white; + font-size:9px; +} + +.version:hover +{ + color: #2c8084; + text-decoration: none; + font-weight: bold; + border-bottom-width: 0px; + border-bottom-style: none; +} + +.small +{ + font-size:9px; +} + +.footer_img +{ + float: left; +} + +.footer_img img +{ + padding-left: 10px; + padding-right: 10px; +} + +.footer_img a +{ + color: white; +} + +.footer_img a:link +{ + color: white; +} + +.footer_img a:hover +{ + color: white; +} + +.footer_img a:visited +{ + color: white; +} + + +#home_links +{ + line-height: 150% +} + +#search_form_div { + text-align: center; + padding: 10px; + margin: 10px 10px; + margin-bottom: 30px; + background-color:#ececec; + border: 1px solid #7E7E7E +} + +#search_form ul { + list-style-type: none; + margin: 0; + padding: 0; +} + +#search_form ul li { + display: inline; +} + +#toolbar { + margin-top: 2px; + margin-bottom: 2px; + border-bottom: 2px solid #707070; + padding-top : 0px; + padding-bottom : 0px; +} +#toolbar ul{ + padding-left : 0px; + padding-right : 0px; + padding-top : 0px; + padding-bottom : 0px; + margin-left : 0px; + margin-right : 0px; + margin-top: 5px; + margin-bottom: 5px; +} +#toolbar ul li{ + display: inline; + padding-left : 10px; + padding-right : 10px; + padding-top : 0px; + padding-bottom : 0px; +} + +#inner_content { + padding: 5px 0px 50px 0px; +} + +#loginstate { + text-align: right; +} + +.projectscontentstitle { + color: #949494; + font-family: Verdana; + font-weight: lighter; + font-size: 2.0em; + font-style: normal; + text-align: left; +} + + +#loginstate a, #loginstate a:hover, #loginstate a:visited, #loginstate a:link, #loginstate a:active { + color:#0063DC; + margin-right:4px; + text-decoration:none; +} + +#loginstate a:hover{ + text-decoration: underline; +} + +#loginstate ul { + margin:0; + padding:0; + float: left; +} +#loginstate li{ + display: inline; + padding:0; + margin:0; +} +#loginstate #user{ + color: #000000; + font-weight: bold; + margin-right:4px; +} +#loginstate ul .usertool a, +#loginstate ul .usertool a:link, +#loginstate ul .usertool a:visited { + color:#0063DC; + text-decoration:none; +} + +#loginstate ul .usertool a:hover { + color:#0063DC; + text-decoration:underline; +} + +.errorlist +{ + color: red; + font-size:12px; +} + +tr.hdabooddline { + background: #d8d8d8; + /*background: #d6d7f6;*/ +} +tr.hdaboevenline { + background: white; + /*background: #e6e6e6;*/ +} +tr.hdabooddline:hover, tr.hdaboevenline:hover { + background: lightblue; + /*background: #e6e6e6;*/ +} + +tr.hdabosimpleoddline { + background: #e4e4e4; + /*background: #d6d7f6;*/ +} +tr.hdabosimpleevenline { + background: white; + /*background: #e6e6e6;*/ +} + +#count_nav_top, +#count_nav_bottom { + text-align: right; +} +#count_nav_bottom p, +#count_nav_top p { + font-size: 12px; + font-weight : bold; +} + +#tag_table { + width: 100%; + border-spacing: 0px; +} +#tag_table td, th { + /*border: thin solid #6495ed;*/ + padding: 3px; +} +.updown_td { + width: 12px; +} + +.sheet_title { + font-size: 14px; +} + +.complete_sheet { + margin-left: 5px; + margin-right: 5px; +} +.left_sheet { + width: 38%; + float: left; +} +.left_sheet p { + margin-bottom: 5px; +} +.right_sheet { + width: 60%; + /*margin-left: 5px;*/ + float: right; +} + +.large_25 { + width: 25px; +} +.text_centered { + text-align: center; +} +.hand_cursor, .reset_wp_info, .remove_wp_link, .remove_tag_from_list { + cursor: pointer; +} +.updown_td { + cursor: n-resize; +} + +tr.dragged_row td { + color: yellow; + background-color: black; +} + +#all_tags_table { + min-width: 600px; + border-spacing: 0px; +} +#all_tags_table td, th { + /*border: thin solid #6495ed;*/ + padding: 3px; +} + +/* styles for the 4 types of STATUS*/ +.null_result { + color: #000000; +} +.redirection { + color: #0000ff; + font-weight: bold; + font-style: italic; +} +.homonyme { + color: #000000; + font-weight: bold; +} +.match { + color: #0000ff; + font-weight: bold; +} + +#tags_actions span { + margin-left: 5px; +} + +#loginform_div { + margin-left: 10px; +} + +#login_fields_list, #submitcontent-buttons-login { + margin: 10px 0px; +} + +#search_results { + margin-left: 10px; +} + +.result_counter { + color: #C6C6C6; +} + +#search_prev_next { + margin-top: 20px; +} + +#page_number { + text-align: right; +} \ No newline at end of file diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/.keepme diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/arrow_green_right.png Binary file src/hdabo/static/hdabo/img/arrow_green_right.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/arrow_right.png Binary file src/hdabo/static/hdabo/img/arrow_right.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/arrow_up_down.png Binary file src/hdabo/static/hdabo/img/arrow_up_down.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/clock_arrow.png Binary file src/hdabo/static/hdabo/img/clock_arrow.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/favicon.ico Binary file src/hdabo/static/hdabo/img/favicon.ico has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/indicator.gif Binary file src/hdabo/static/hdabo/img/indicator.gif has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/logo_IRI_footer.png Binary file src/hdabo/static/hdabo/img/logo_IRI_footer.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/red_cross.png Binary file src/hdabo/static/hdabo/img/red_cross.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/sort-asc.png Binary file src/hdabo/static/hdabo/img/sort-asc.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/sort-desc.png Binary file src/hdabo/static/hdabo/img/sort-desc.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/sort-descending.png Binary file src/hdabo/static/hdabo/img/sort-descending.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/tag_remove.png Binary file src/hdabo/static/hdabo/img/tag_remove.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/img/wikipedia_search.png Binary file src/hdabo/static/hdabo/img/wikipedia_search.png has changed diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/js/.keepme diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/js/hdabo.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/static/hdabo/js/hdabo.js Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,366 @@ +// -*- coding: utf-8 -*- +function init_tags_events() +{ + // Tag simple operations : activate/unactivate wp link, reset wp info, remove wp link, remove tag from list + $(".reset_wp_info").click(function(e){ + if(confirm("Confirmez-vous le rétablissement du label original de ce tag ?")){ + update_tag(this); + } + }); + $(".remove_wp_link").click(function(e){ + if(confirm("Confirmez-vous le suppression du lien Wikipédia pour le tag \"" + $(this).attr('alt') + "\" ?")){ + update_tag(this); + } + }); + $(".remove_tag_from_list").click(function(){ + if(confirm("Confirmez-vous la suppression du tag \"" + $(this).attr('alt') + "\" de la liste courante ?")){ + update_tag(this); + } + }); + + // Wikipedia search management (autocompletion and save changes) + $.editable.addInputType('autocomplete', { + element : $.editable.types.text.element, + plugin : function(settings, original) { + $('input', this).autocomplete(settings.autocomplete); + } + }); + $(".wikipediatag").editable(modify_tag_url, { + indicator : "", + type : "autocomplete", + tooltip : "Cliquer pour éditer...", + onblur : "submit", + submitdata: { + csrfmiddlewaretoken:global_csrf_token, + datasheet_id:$('#datasheet_id').val(), + num_page:$('#num_page').val(), + nb_by_page:$('#nb_by_page').val(), + sort:$('#sort').val(), + searched:$('#searched_str').val() + }, + callback : function(value, settings) { + $('#tag_table_container').html(value); + init_tags_events(); + }, + onerror: function(settings, original, jqXHR) { + resp = $.parseJSON(jqXHR.responseText); + alert(resp.message); + original.reset(); + }, + autocomplete : { + source: function( request, response ) { + $.ajax({ + url: "http://fr.wikipedia.org/w/api.php", + dataType: "jsonp", + data: { + action: "opensearch", + limit: "20", + namespace: "0", + format: "json", + search: request.term + }, + success: function( data ) { + response( $.map( data[1], function( item ) { + return { + label: item, + value: item + } + })); + } + }); + }, + minLength: 2, + open: function() { + $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" ); + }, + close: function() { + $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" ); + } + } + }); + + // Update alias management + $(".tag_alias").editable(update_tag_alias_url, { + indicator : "", + type : "text", + placeholder:"", + tooltip : "Cliquer pour éditer...", + onblur : "submit", + submitdata: { + csrfmiddlewaretoken:global_csrf_token, + datasheet_id:$('#datasheet_id').val(), + num_page:$('#num_page').val(), + nb_by_page:$('#nb_by_page').val(), + sort:$('#sort').val(), + searched:$('#searched_str').val() + }, + callback : function(value, settings) { + $('#tag_table_container').html(value); + init_tags_events(); + } + }); + + // Tag categories management + $(".tag_category").editable(update_tag_category_url, { + indicator : "", + type : "select", + data : categories_list, + placeholder:"", + tooltip : "Cliquer pour éditer...", + onblur : "submit", + submitdata: { + csrfmiddlewaretoken:global_csrf_token, + datasheet_id:$('#datasheet_id').val(), + num_page:$('#num_page').val(), + nb_by_page:$('#nb_by_page').val(), + sort:$('#sort').val(), + searched:$('#searched_str').val() + }, + callback : function(value, settings) { + $('#tag_table_container').html(value); + init_tags_events(); + } + }); + + // Tag table drag and drop + $("#tag_table").tableDnD({ + onDragClass: "dragged_row", + onDrop: function(table, row){ + old_order = row.id; + $($(row).children()[1]).html(""); + rows = table.tBodies[0].rows; + nb_rows = rows.length; + for(var i=1; i= 1.5, "json" adds a callback so we don't specify dataType + //dataType: 'json', + success: function(msg, textStatus, XMLHttpRequest) { + $('#tag_table_container').html(msg); + init_tags_events(); + } + }); + } + } + }, + dragHandle: "updown_td" + }); +} + +function init_datasheet_events() +{ + var select_done = false; + // Wikipedia search management (new tag) + $("#wp_search").autocomplete({ + source: function( request, response ) { + $.ajax({ + url: "http://fr.wikipedia.org/w/api.php", + dataType: "jsonp", + data: { + action: "opensearch", + limit: "20", + namespace: "0", + format: "json", + search: request.term + }, + success: function( data ) { + response( $.map( data[1], function( item ) { + return { + label: item, + value: item + } + })); + } + }); + }, + select: function(event, ui) { + // Since the event still did not update wp_search's val, we force it. + $("#wp_search").val(ui.item.label); + select_done = true; + $("#ok_search").click(); + }, + minLength: 2, + open: function() { + $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" ); + }, + close: function() { + $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" ); + } + }); + $('#wp_search').keyup(function(e){ + if((e.keyCode==13) && ($("#wp_search").val()!="") && (select_done==false)){ + add_tag($("#wp_search").val()); + } + select_done = false; + }); + $("#ok_search").click(function(){ + if($("#wp_search").val()!=""){ + add_tag($("#wp_search").val()); + } + }); + $("#tags_sort").click(function(e){ + e.preventDefault(); + if(confirm("Confirmez-vous le tri des tags ?")) { + reorder_tags(); + } + }); + // Validate sheet management : the radiobutton name has is "'gr_validated' + datasheet.hda_id" + $("#validated").click(function(e){ + e.preventDefault(); + // We count the number of tags. It has to be between 5 and 25 + var nb_tags = $('#tag_table tr').length - 1; + if(nb_tags<5 || nb_tags>25){ + alert("Cette fiche n'est pas validable : elle doit contenir entre 5 et 25 tags."); + } + else{ + if(confirm("Confirmez-vous la validation de cette fiche ? Elle contient " + nb_tags + " tags.")){ + window.location = validate_datasheet_url + "/" + $('#datasheet_id').val() + "/true"; + } + } + }); + $("#not_validated").click(function(e){ + e.preventDefault(); + if(confirm("Confirmez-vous l'invalidation de cette fiche ?")){ + window.location = validate_datasheet_url + "/" + $('#datasheet_id').val() + "/false"; + } + }); +} + +function update_tag(btn) +{ + new_checked = false; + if ($(btn).is(".remove_tag_from_list")) { + var url = remove_tag_from_list_url; + var id_tag = $(btn).attr('id'); + } + else if ($(btn).is(".reset_wp_info")) { + var url = reset_wp_info_url; + var id_tag = $(btn).html(); + $(btn).html(""); + } + else if ($(btn).is(".remove_wp_link")) { + var url = remove_wp_link_url; + var id_tag = $(btn).attr('id'); + } + + // 2 cases : + // - ordered tag for one datasheet : $('#datasheet_id') is not null + // - all tags list : $('#datasheet_id') is null and $('#num_page') and $('#nb_by_page') are not null + $.ajax({ + url: url, + type: 'POST', + data: {csrfmiddlewaretoken:global_csrf_token, + datasheet_id:$('#datasheet_id').val(), + num_page:$('#num_page').val(), + nb_by_page:$('#nb_by_page').val(), + sort:$('#sort').val(), + searched:$('#searched_str').val(), + tag_id:id_tag, + activated:new_checked + }, + // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType + //dataType: 'json', + success: function(msg, textStatus, XMLHttpRequest) { + $('#tag_table_container').html(msg); + init_tags_events(); + }, + error: function(jqXHR, textStatus, errorThrown) { + resp = $.parseJSON(jqXHR.responseText); + alert(resp.message); + $(btn).html(id_tag); + } + }); +} + +function tag_up_down(arrow) +{ + if ($(arrow).is(".up")) { + mv = "u"; + } else { + mv = "d"; + } + var url = tag_up_down_url; + var id_tag = $(arrow).attr('id'); + // This indicates the position (from 0) of the tag in the list. NB : it is different from the TagSheet.order in the database. + var pos_tag = $(arrow).attr('pos'); + $.ajax({ + url: url, + type: 'POST', + data: {csrfmiddlewaretoken:global_csrf_token, + datasheet_id:$('#datasheet_id').val(), + tag_id:id_tag, + move:mv, + tag_pos:pos_tag + }, + // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType + //dataType: 'json', + success: function(msg, textStatus, XMLHttpRequest) { + $('#tag_table_container').html(msg); + init_tags_events(); + } + }); +} + +function add_tag(tag_label) +{ + $("#ok_search").html(""); + var url = add_tag_url; + $.ajax({ + url: url, + type: 'POST', + data: {csrfmiddlewaretoken:global_csrf_token, + datasheet_id:$('#datasheet_id').val(), + value:tag_label + }, + // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType + //dataType: 'json', + success: function(msg, textStatus, XMLHttpRequest) { + $('#tag_table_container').html(msg); + init_tags_events(); + // And scroll to the bottom + $("html").animate({ scrollTop: $(document).height() }, 500); + }, + error: function(jqXHR, textStatus, errorThrown) { + resp = $.parseJSON(jqXHR.responseText); + alert(resp.message); + }, + complete: function(){ + // We empty the input and hide the ok button + $("#wp_search").val(""); + $("#ok_search").html("OK"); + } + }); +} + +function reorder_tags() { + $('#tags_sort').attr("disabled", "disabled"); + var tag_sort_old_src = $("#tags_sort").attr("src"); + $("#tags_sort").attr("src",static_url+"hdabo/img/indicator.gif"); + $.ajax({ + url: reorder_tag_datasheet_url, + type: 'POST', + data: { + csrfmiddlewaretoken:global_csrf_token, + datasheet_id:$('#datasheet_id').val() + }, + success: function(msg, textStatus, XMLHttpRequest) { + $('#tag_table_container').html(msg); + init_tags_events(); + // And scroll to the bottom + $("html").animate({ scrollTop: $(document).height() }, 500); + }, + complete: function(){ + $("#tags_sort").attr("src",tag_sort_old_src); + $('#tags_sort').removeAttr("disabled"); + } + }); +} + diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/js/jquery-ui.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/static/hdabo/js/jquery-ui.min.js Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,784 @@ +/*! + * jQuery UI 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.13", +keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus(); +b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this, +"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection", +function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth, +outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b); +return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e= +0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= +false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +;/* + * jQuery UI Position 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, +left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= +k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= +m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= +d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= +a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), +g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +;/* + * jQuery UI Draggable 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= +this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper= +this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); +this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a); +this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b= +d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop", +a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== +a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a= +{left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&& +d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a= +this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions= +{width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+ +d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!="hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"), +10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height- +this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&& +d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], +this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1];h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left< +g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"); +this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.13"}); +d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert});h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver= +0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs= +c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a, +true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver= +0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor= +a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable"); +if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= +i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); +var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a= +false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"}); +this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= +{width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis]; +if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing= +false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height); +c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size, +d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidthb.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width= +a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b= +this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left- +c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this, +arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement, +element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.13"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})}; +if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"), +p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options, +c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName), +g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"), +10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0, +top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h; +g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left: +0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position")); +if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&& +!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost== +"string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid; +var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b, +10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +;/* + * jQuery UI Selectable 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), +selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, +c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", +c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= +this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a=== +"disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&& +!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, +left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; +this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= +document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); +return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], +e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); +c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): +this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, +dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, +toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); +if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), +this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b= +this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f= +d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")|| +0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out", +a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h- +f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g- +this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this, +this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop", +a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); +a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); +if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", +function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a= +this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"); +this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); +b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); +a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ +c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; +if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); +if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(), +e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight|| +e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false", +"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.13", +animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/); +f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide", +paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); +;/* + * jQuery UI Autocomplete 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g= +false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!= +a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)}; +this.menu=d("
    ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&& +a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"); +d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&& +b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source= +this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, +"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); +(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", +-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); +this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b, +this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| +this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| +this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,f=d.primary&&d.secondary,e=[];if(d.primary||d.secondary){if(this.options.text)e.push("ui-button-text-icon"+(f?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){e.push(f?"ui-button-icons-only": +"ui-button-icon-only");this.hasTitle||b.attr("title",c)}}else e.push("ui-button-text-only");b.addClass(e.join(" "))}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, +destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); +;/* + * jQuery UI Dialog 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, +position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ +b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), +h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", +e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); +a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== +b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+= +1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== +f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
    ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, +function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", +handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, +originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", +f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): +[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); +if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): +e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= +this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- +b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.13",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), +create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(), +height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); +b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(a.range==="min"||a.range==="max"?" ui-slider-range-"+a.range:""))}for(var j=c.length;j"); +this.handles=c.add(d(e.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle", +g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!b.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");i=b._start(g,l);if(i===false)return}break}m=b.options.step;i=b.options.values&&b.options.values.length? +(h=b.values(l)):(h=b.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=b._valueMin();break;case d.ui.keyCode.END:h=b._valueMax();break;case d.ui.keyCode.PAGE_UP:h=b._trimAlignValue(i+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(i-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===b._valueMax())return;h=b._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===b._valueMin())return;h=b._trimAlignValue(i- +m);break}b._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(g,k);b._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); +return this},_mouseCapture:function(b){var a=this.options,c,f,e,j,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(a.range===true&&this.values(1)===a.min){g+=1;e=d(this.handles[g])}if(this._start(b,g)===false)return false; +this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();a=e.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-e.width()/2,top:b.pageY-a.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var a= +this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;if(this.orientation==="horizontal"){a= +this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a); +c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var f;if(this.options.values&&this.options.values.length){f=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>f||a===1&&c1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max}, +_refreshValue:function(){var b=this.options.range,a=this.options,c=this,f=!this._animateOff?a.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},a.animate); +if(h===1)c.range[f?"animate":"css"]({width:e-g+"%"},{queue:false,duration:a.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},a.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:a.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1, +1)[f?"animate":"css"]({width:e+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.13"})})(jQuery); +;/* + * jQuery UI Tabs 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& +e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= +d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| +(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= +this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); +if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); +this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ +g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", +function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; +this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= +-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; +d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= +d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, +e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); +j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); +if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, +this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, +load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, +"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, +url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.13"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k'))}function N(a){return a.delegate("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a", +"mouseout",function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).delegate("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a","mouseover",function(){if(!d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); +d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==B)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.13"}});var z=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)}, +_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a, +b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('
    '))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", +function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker); +if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f==""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]); +return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a); +if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d(''); +this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/ +2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a, +"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled= +false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled= +true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false; +for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a); +d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");H(b.settings,c?c.apply(a,[a,b]):{});b.lastVal= +null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos= +null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0], +top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover"); +c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"); +a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]}, +_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e- +g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst= +null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, +_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): +0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear= +false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay= +d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a); +else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b= +a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort, +g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!= +c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames, +h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear|| +a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? +new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a)); +n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m, +g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&& +a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
    '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
    ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),C=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='
    '+(/all|left/.test(t)&&x==0?c? +f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'
    ';var D=j?'":"";for(t=0;t<7;t++){var q=(t+h)%7;D+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}y+=D+"";D=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, +D);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;D=l?6:Math.ceil((t+D)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q";var R=!j?"":'";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],F=q.getMonth()!=g,L=F&&!K||!I[0]||k&&qo;R+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}y+=R+""}g++;if(g>11){g=0;m++}y+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(q)+""+(F&&!C?" ":L?''+q.getDate()+ +"":''+q.getDate()+"")+"
    "+(l?""+(i[0]>0&&G==i[1]-1?'
    ':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': +"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
    ',o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)? +r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+= +(h||!(j&&l)?" ":"")+o;k+="
    ";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a, +"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a, +b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!= +"string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay)); +return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&& +arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.13";window["DP_jQuery_"+z]=d})(jQuery); +;/* + * jQuery UI Progressbar 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
    ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* +this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.13"})})(jQuery); +;/* + * jQuery UI Effects 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], +16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, +a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= +a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", +"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, +0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, +211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, +d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easding:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})}; +f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this, +[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.13",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}); +c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c, +a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments); +a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%", +"pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d* +((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/= +e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/= +e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ +e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); +;/* + * jQuery UI Effects Fade 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Fold 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], +10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); +;/* + * jQuery UI Effects Highlight 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Pulsate 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); +b.dequeue()})})}})(jQuery); +; \ No newline at end of file diff -r 73f19fa4f997 -r 8f77cf71ab02 src/hdabo/static/hdabo/js/jquery.jeditable.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hdabo/static/hdabo/js/jquery.jeditable.js Tue Jun 17 10:25:33 2014 +0200 @@ -0,0 +1,546 @@ +/* + * Jeditable - jQuery in place edit plugin + * + * Copyright (c) 2006-2009 Mika Tuupola, Dylan Verheul + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + * + * Project home: + * http://www.appelsiini.net/projects/jeditable + * + * Based on editable by Dylan Verheul : + * http://www.dyve.net/jquery/?editable + * + */ + +/** + * Version 1.7.2-dev + * + * ** means there is basic unit tests for this parameter. + * + * @name Jeditable + * @type jQuery + * @param String target (POST) URL or function to send edited content to ** + * @param Hash options additional options + * @param String options[method] method to use to send edited content (POST or PUT) ** + * @param Function options[callback] Function to run after submitting edited content ** + * @param String options[name] POST parameter name of edited content + * @param String options[id] POST parameter name of edited div id + * @param Hash options[submitdata] Extra parameters to send when submitting edited content. + * @param String options[type] text, textarea or select (or any 3rd party input type) ** + * @param Integer options[rows] number of rows if using textarea ** + * @param Integer options[cols] number of columns if using textarea ** + * @param Mixed options[height] 'auto', 'none' or height in pixels ** + * @param Mixed options[width] 'auto', 'none' or width in pixels ** + * @param String options[loadurl] URL to fetch input content before editing ** + * @param String options[loadtype] Request type for load url. Should be GET or POST. + * @param String options[loadtext] Text to display while loading external content. + * @param Mixed options[loaddata] Extra parameters to pass when fetching content before editing. + * @param Mixed options[data] Or content given as paramameter. String or function.** + * @param String options[indicator] indicator html to show when saving + * @param String options[tooltip] optional tooltip text via title attribute ** + * @param String options[event] jQuery event such as 'click' of 'dblclick' ** + * @param String options[submit] submit button value, empty means no button ** + * @param String options[cancel] cancel button value, empty means no button ** + * @param String options[cssclass] CSS class to apply to input form. 'inherit' to copy from parent. ** + * @param String options[style] Style to apply to input form 'inherit' to copy from parent. ** + * @param String options[select] true or false, when true text is highlighted ?? + * @param String options[placeholder] Placeholder text or html to insert when element is empty. ** + * @param String options[onblur] 'cancel', 'submit', 'ignore' or function ?? + * + * @param Function options[onsubmit] function(settings, original) { ... } called before submit + * @param Function options[onreset] function(settings, original) { ... } called before reset + * @param Function options[onerror] function(settings, original, xhr) { ... } called on error + * + * @param Hash options[ajaxoptions] jQuery Ajax options. See docs.jquery.com. + * + */ + +(function($) { + + $.fn.editable = function(target, options) { + + if ('disable' == target) { + $(this).data('disabled.editable', true); + return; + } + if ('enable' == target) { + $(this).data('disabled.editable', false); + return; + } + if ('destroy' == target) { + $(this) + .unbind($(this).data('event.editable')) + .removeData('disabled.editable') + .removeData('event.editable'); + return; + } + + var settings = $.extend({}, $.fn.editable.defaults, {target:target}, options); + + /* setup some functions */ + var plugin = $.editable.types[settings.type].plugin || function() { }; + var submit = $.editable.types[settings.type].submit || function() { }; + var buttons = $.editable.types[settings.type].buttons + || $.editable.types['defaults'].buttons; + var content = $.editable.types[settings.type].content + || $.editable.types['defaults'].content; + var element = $.editable.types[settings.type].element + || $.editable.types['defaults'].element; + var reset = $.editable.types[settings.type].reset + || $.editable.types['defaults'].reset; + var callback = settings.callback || function() { }; + var onedit = settings.onedit || function() { }; + var onsubmit = settings.onsubmit || function() { }; + var onreset = settings.onreset || function() { }; + var onerror = settings.onerror || reset; + + /* Show tooltip. */ + if (settings.tooltip) { + $(this).attr('title', settings.tooltip); + } + + settings.autowidth = 'auto' == settings.width; + settings.autoheight = 'auto' == settings.height; + + return this.each(function() { + + /* Save this to self because this changes when scope changes. */ + var self = this; + + /* Inlined block elements lose their width and height after first edit. */ + /* Save them for later use as workaround. */ + var savedwidth = $(self).width(); + var savedheight = $(self).height(); + + /* Save so it can be later used by $.editable('destroy') */ + $(this).data('event.editable', settings.event); + + /* If element is empty add something clickable (if requested) */ + if (!$.trim($(this).html())) { + $(this).html(settings.placeholder); + } + + $(this).bind(settings.event, function(e) { + + /* Abort if element is disabled. */ + if (true === $(this).data('disabled.editable')) { + return; + } + + /* Prevent throwing an exeption if edit field is clicked again. */ + if (self.editing) { + return; + } + + /* Abort if onedit hook returns false. */ + if (false === onedit.apply(this, [settings, self])) { + return; + } + + /* Prevent default action and bubbling. */ + e.preventDefault(); + e.stopPropagation(); + + /* Remove tooltip. */ + if (settings.tooltip) { + $(self).removeAttr('title'); + } + + /* Figure out how wide and tall we are, saved width and height. */ + /* Workaround for http://dev.jquery.com/ticket/2190 */ + if (0 == $(self).width()) { + settings.width = savedwidth; + settings.height = savedheight; + } else { + if (settings.width != 'none') { + settings.width = + settings.autowidth ? $(self).width() : settings.width; + } + if (settings.height != 'none') { + settings.height = + settings.autoheight ? $(self).height() : settings.height; + } + } + + /* Remove placeholder text, replace is here because of IE. */ + if ($(this).html().toLowerCase().replace(/(;|"|\/)/g, '') == + settings.placeholder.toLowerCase().replace(/(;|"|\/)/g, '')) { + $(this).html(''); + } + + self.editing = true; + self.revert = $(self).html(); + $(self).html(''); + + /* Create the form object. */ + var form = $('
    '); + + /* Apply css or style or both. */ + if (settings.cssclass) { + if ('inherit' == settings.cssclass) { + form.attr('class', $(self).attr('class')); + } else { + form.attr('class', settings.cssclass); + } + } + + if (settings.style) { + if ('inherit' == settings.style) { + form.attr('style', $(self).attr('style')); + /* IE needs the second line or display wont be inherited. */ + form.css('display', $(self).css('display')); + } else { + form.attr('style', settings.style); + } + } + + /* Add main input element to form and store it in input. */ + var input = element.apply(form, [settings, self]); + + /* Set input content via POST, GET, given data or existing value. */ + var input_content; + + if (settings.loadurl) { + var t = setTimeout(function() { + input.disabled = true; + content.apply(form, [settings.loadtext, settings, self]); + }, 100); + + var loaddata = {}; + loaddata[settings.id] = self.id; + if ($.isFunction(settings.loaddata)) { + $.extend(loaddata, settings.loaddata.apply(self, [self.revert, settings])); + } else { + $.extend(loaddata, settings.loaddata); + } + $.ajax({ + type : settings.loadtype, + url : settings.loadurl, + data : loaddata, + async : false, + success: function(result) { + window.clearTimeout(t); + input_content = result; + input.disabled = false; + } + }); + } else if (settings.data) { + input_content = settings.data; + if ($.isFunction(settings.data)) { + input_content = settings.data.apply(self, [self.revert, settings]); + } + } else { + input_content = self.revert; + } + content.apply(form, [input_content, settings, self]); + + input.attr('name', settings.name); + + /* Add buttons to the form. */ + buttons.apply(form, [settings, self]); + + /* Add created form to self. */ + $(self).append(form); + + /* Attach 3rd party plugin if requested. */ + plugin.apply(form, [settings, self]); + + /* Focus to first visible form element. */ + $(':input:visible:enabled:first', form).focus(); + + /* Highlight input contents when requested. */ + if (settings.select) { + input.select(); + } + + /* discard changes if pressing esc */ + input.keydown(function(e) { + if (e.keyCode == 27) { + e.preventDefault(); + reset.apply(form, [settings, self]); + } + }); + + /* Discard, submit or nothing with changes when clicking outside. */ + /* Do nothing is usable when navigating with tab. */ + var t; + if ('cancel' == settings.onblur) { + input.blur(function(e) { + /* Prevent canceling if submit was clicked. */ + t = setTimeout(function() { + reset.apply(form, [settings, self]); + }, 500); + }); + } else if ('submit' == settings.onblur) { + input.blur(function(e) { + /* Prevent double submit if submit was clicked. */ + t = setTimeout(function() { + form.submit(); + }, 200); + }); + } else if ($.isFunction(settings.onblur)) { + input.blur(function(e) { + settings.onblur.apply(self, [input.val(), settings]); + }); + } else { + input.blur(function(e) { + /* TODO: maybe something here */ + }); + } + + form.submit(function(e) { + + if (t) { + clearTimeout(t); + } + + /* Do no submit. */ + e.preventDefault(); + + /* Call before submit hook. */ + /* If it returns false abort submitting. */ + if (false !== onsubmit.apply(form, [settings, self])) { + /* Custom inputs call before submit hook. */ + /* If it returns false abort submitting. */ + if (false !== submit.apply(form, [settings, self])) { + + /* Check if given target is function */ + if ($.isFunction(settings.target)) { + var str = settings.target.apply(self, [input.val(), settings]); + $(self).html(str); + self.editing = false; + callback.apply(self, [self.innerHTML, settings]); + /* TODO: this is not dry */ + if (!$.trim($(self).html())) { + $(self).html(settings.placeholder); + } + } else { + /* Add edited content and id of edited element to POST. */ + var submitdata = {}; + submitdata[settings.name] = input.val(); + submitdata[settings.id] = self.id; + /* Add extra data to be POST:ed. */ + if ($.isFunction(settings.submitdata)) { + $.extend(submitdata, settings.submitdata.apply(self, [self.revert, settings])); + } else { + $.extend(submitdata, settings.submitdata); + } + + /* Quick and dirty PUT support. */ + if ('PUT' == settings.method) { + submitdata['_method'] = 'put'; + } + + /* Show the saving indicator. */ + $(self).html(settings.indicator); + + /* Defaults for ajaxoptions. */ + var ajaxoptions = { + type : 'POST', + data : submitdata, + dataType: 'html', + url : settings.target, + success : function(result, status) { + if (ajaxoptions.dataType == 'html') { + $(self).html(result); + } + self.editing = false; + callback.apply(self, [result, settings]); + if (!$.trim($(self).html())) { + $(self).html(settings.placeholder); + } + }, + error : function(xhr, status, error) { + onerror.apply(form, [settings, self, xhr]); + } + }; + + /* Override with what is given in settings.ajaxoptions. */ + $.extend(ajaxoptions, settings.ajaxoptions); + $.ajax(ajaxoptions); + + } + } + } + + /* Show tooltip again. */ + $(self).attr('title', settings.tooltip); + + return false; + }); + }); + + /* Privileged methods */ + this.reset = function(form) { + /* Prevent calling reset twice when blurring. */ + if (this.editing) { + /* Before reset hook, if it returns false abort reseting. */ + if (false !== onreset.apply(form, [settings, self])) { + $(self).html(self.revert); + self.editing = false; + if (!$.trim($(self).html())) { + $(self).html(settings.placeholder); + } + /* Show tooltip again. */ + if (settings.tooltip) { + $(self).attr('title', settings.tooltip); + } + } + } + }; + }); + + }; + + + $.editable = { + types: { + defaults: { + element : function(settings, original) { + var input = $(''); + $(this).append(input); + return(input); + }, + content : function(string, settings, original) { + $(':input:first', this).val(string); + }, + reset : function(settings, original) { + original.reset(this); + }, + buttons : function(settings, original) { + var form = this; + if (settings.submit) { + /* If given html string use that. */ + if (settings.submit.match(/>$/)) { + var submit = $(settings.submit).click(function() { + if (submit.attr("type") != "submit") { + form.submit(); + } + }); + /* Otherwise use button with given string as text. */ + } else { + var submit = $('