# HG changeset patch # User rougeronj # Date 1355494359 -3600 # Node ID 011f05e0e961512bf01cf60d0b6c7ac217e2e05a # Parent b0ff679933562d190920a18e7a6f25febe41d247# Parent 9bd66b69effcadeb1fb421529b836814911c80aa Merge with 9bd66b69effcadeb1fb421529b836814911c80aa diff -r b0ff67993356 -r 011f05e0e961 .DS_Store Binary file .DS_Store has changed diff -r b0ff67993356 -r 011f05e0e961 .hgtags --- a/.hgtags Thu Dec 06 14:39:14 2012 +0100 +++ b/.hgtags Fri Dec 14 15:12:39 2012 +0100 @@ -134,3 +134,8 @@ a05ad02125c58e419fcbd52475c9f39be35f576e V01.35 a774af5e10f40b65dd1ec748ad36e9ed4e9a294e V01.36 89e3320ac56c863333e3e5317d1c7fced478cc05 V01.36 +a6a37775a76dd0a1aa56b61172ada2422fd99b14 V01.37 +5a9f718115d38140a9dcd4ba8d650a1de13f6aa0 V01.38 +0897d4ffdbc96f9cfb4b9c9b6e4f27dbebf8331a V01.39 +7fa1389a1d1da6f78f1509733874baf13647e960 V01.40 +57bb8c9fe1ff60b3a3e5d21a647e724b8cb18a45 V01.41 diff -r b0ff67993356 -r 011f05e0e961 .settings/org.eclipse.core.resources.prefs --- a/.settings/org.eclipse.core.resources.prefs Thu Dec 06 14:39:14 2012 +0100 +++ b/.settings/org.eclipse.core.resources.prefs Fri Dec 14 15:12:39 2012 +0100 @@ -1,41 +1,42 @@ -eclipse.preferences.version=1 -encoding//src/ldt/ldt/core/migrations/0001_initial.py=utf-8 -encoding//src/ldt/ldt/core/migrations/0002_auto__del_owner.py=utf-8 -encoding//src/ldt/ldt/indexation/backends/elasticsearch_backend.py=utf-8 -encoding//src/ldt/ldt/indexation/highlighter.py=utf-8 -encoding//src/ldt/ldt/indexation/models.py=utf-8 -encoding//src/ldt/ldt/indexation/query_parser.py=utf-8 -encoding//src/ldt/ldt/indexation/search_indexes.py=utf-8 -encoding//src/ldt/ldt/indexation/tests.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0001_initial.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0002_auto__add_field_media_mimetype_field__chg_field_media_external_src_url.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0003_auto__chg_field_project_owner.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0004_auto__add_field_project_description.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0005_add_permissions.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0006_auto__add_field_media_image.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0007_auto__add_field_content_image__del_field_media_image.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0008_auto__add_field_project_image.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0009_auto__chg_field_content_image__chg_field_project_image.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0010_auto__add_annotationstat.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0011_gen_stat_annotation.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0012_auto__add_field_content_last_annotated.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0013_auto__add_field_content_front_project__chg_field_content_last_annotate.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0014_auto__del_annotationstat__chg_field_content_last_annotated.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0015_auto__add_contentstat__del_field_content_last_annotated__del_field_con.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0016_one_to_one_stat_annotation.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0017_correct_image_path.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0018_auto__chg_field_content_iri_id__chg_field_project_ldt_id__chg_field_au.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0019_recalculate_media_hash_src.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0020_auto__add_field_segment_id_hash__chg_field_segment_iri_id__chg_field_s.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0021_recalculate_segment_id_hash_script.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0022_auto__add_unique_media_src_hash__chg_field_segment_cutting_id__chg_fie.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0023_auto__add_field_segment_audio_src__add_field_segment_audio_href.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/migrations/0024_auto__chg_field_tag_name.py=utf-8 -encoding//src/ldt/ldt/ldt_utils/views/json.py=utf-8 -encoding//src/ldt/ldt/management/utils.py=utf-8 -encoding//src/ldt/ldt/test/test_runner.py=utf-8 -encoding//src/ldt/ldt/text/migrations/0001_initial.py=utf-8 -encoding//src/ldt/ldt/user/migrations/0001_initial.py=utf-8 -encoding//src/ldt/ldt/user/migrations/0008_auto__chg_field_groupprofile_image__chg_field_groupprofile_group__chg_.py=utf-8 -encoding//virtualenv/web/env/guardianenv/Lib/site-packages/guardian/migrations/0001_initial.py=utf-8 -encoding/=UTF-8 +eclipse.preferences.version=1 +encoding//src/ldt/ldt/core/migrations/0001_initial.py=utf-8 +encoding//src/ldt/ldt/core/migrations/0002_auto__del_owner.py=utf-8 +encoding//src/ldt/ldt/indexation/backends/elasticsearch_backend.py=utf-8 +encoding//src/ldt/ldt/indexation/highlighter.py=utf-8 +encoding//src/ldt/ldt/indexation/models.py=utf-8 +encoding//src/ldt/ldt/indexation/query_parser.py=utf-8 +encoding//src/ldt/ldt/indexation/search_indexes.py=utf-8 +encoding//src/ldt/ldt/indexation/tests.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0001_initial.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0002_auto__add_field_media_mimetype_field__chg_field_media_external_src_url.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0003_auto__chg_field_project_owner.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0004_auto__add_field_project_description.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0005_add_permissions.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0006_auto__add_field_media_image.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0007_auto__add_field_content_image__del_field_media_image.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0008_auto__add_field_project_image.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0009_auto__chg_field_content_image__chg_field_project_image.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0010_auto__add_annotationstat.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0011_gen_stat_annotation.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0012_auto__add_field_content_last_annotated.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0013_auto__add_field_content_front_project__chg_field_content_last_annotate.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0014_auto__del_annotationstat__chg_field_content_last_annotated.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0015_auto__add_contentstat__del_field_content_last_annotated__del_field_con.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0016_one_to_one_stat_annotation.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0017_correct_image_path.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0018_auto__chg_field_content_iri_id__chg_field_project_ldt_id__chg_field_au.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0019_recalculate_media_hash_src.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0020_auto__add_field_segment_id_hash__chg_field_segment_iri_id__chg_field_s.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0021_recalculate_segment_id_hash_script.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0022_auto__add_unique_media_src_hash__chg_field_segment_cutting_id__chg_fie.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0023_auto__add_field_segment_audio_src__add_field_segment_audio_href.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0024_auto__chg_field_tag_name.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0025_chg_site_domain.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/views/json.py=utf-8 +encoding//src/ldt/ldt/management/utils.py=utf-8 +encoding//src/ldt/ldt/test/test_runner.py=utf-8 +encoding//src/ldt/ldt/text/migrations/0001_initial.py=utf-8 +encoding//src/ldt/ldt/user/migrations/0001_initial.py=utf-8 +encoding//src/ldt/ldt/user/migrations/0008_auto__chg_field_groupprofile_image__chg_field_groupprofile_group__chg_.py=utf-8 +encoding//virtualenv/web/env/guardianenv/Lib/site-packages/guardian/migrations/0001_initial.py=utf-8 +encoding/=UTF-8 diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/__init__.py --- a/src/ldt/ldt/__init__.py Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/__init__.py Fri Dec 14 15:12:39 2012 +0100 @@ -1,4 +1,4 @@ -VERSION = (1, 36, 0, "final", 0) +VERSION = (1, 41, 0, "final", 0) def get_version(): diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/api/ldt/resources/tag.py --- a/src/ldt/ldt/api/ldt/resources/tag.py Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/api/ldt/resources/tag.py Fri Dec 14 15:12:39 2012 +0100 @@ -26,15 +26,21 @@ # Search by content ids is priori content_ids = request.GET.get('contents', '') segment_ids = request.GET.get('segments', '') + # We define the number of steps in weight int + try: + weight_steps = int(request.GET.get('steps', 10)) + except: + weight_steps = 10 tags_cloud = None - if content_ids != "": + if content_ids=="all" or segment_ids=="all": + tags_cloud = Tag.objects.cloud_for_model(Segment, steps=weight_steps) + elif content_ids != "": # We get all the segments for these contents content_ids = content_ids.split(',') - tags_cloud = Tag.objects.cloud_for_model(Segment, filters={"iri_id__in":content_ids}) - if not all_segments and segment_ids != "": + tags_cloud = Tag.objects.cloud_for_model(Segment, filters={"iri_id__in":content_ids}, steps=weight_steps) + elif not all_segments and segment_ids != "": segment_ids = segment_ids.split(',') - tags_cloud = Tag.objects.cloud_for_model(Segment, filters={"element_id__in":segment_ids}) - + tags_cloud = Tag.objects.cloud_for_model(Segment, filters={"element_id__in":segment_ids}, steps=weight_steps) limit = request.GET.get('limit', getattr(settings, 'API_LIMIT_PER_PAGE', 20)) if limit == "0": @@ -52,10 +58,16 @@ bundle = self.build_bundle(obj=tag, request=request) bundle = self.full_dehydrate(bundle) objects.append(bundle) - + object_list = { 'objects': objects, } self.log_throttled_access(request) - return self.create_response(request, object_list) \ No newline at end of file + return self.create_response(request, object_list) + + def dehydrate(self, bundle): + # This function enable to add the weight of a tag in the bundle's datas, which is not in the tag model + if bundle.obj and hasattr(bundle.obj,'font_size'): + bundle.data['weight'] = bundle.obj.font_size + return bundle \ No newline at end of file diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/auth/views.py --- a/src/ldt/ldt/auth/views.py Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/auth/views.py Fri Dec 14 15:12:39 2012 +0100 @@ -8,7 +8,6 @@ redirect_field_name=REDIRECT_FIELD_NAME, authentication_form=AuthenticationForm, current_app=None): - extra_context = {'social_list': social_list} return django_login(request, template_name, redirect_field_name, authentication_form, current_app, extra_context) diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/admin.py --- a/src/ldt/ldt/ldt_utils/admin.py Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/admin.py Fri Dec 14 15:12:39 2012 +0100 @@ -8,6 +8,10 @@ from ldt.ldt_utils.models import Content, Project, Media, Author from ldt.ldt_utils.stat import update_stat_content from guardian.admin import GuardedModelAdmin +from django.http import HttpResponse +from StringIO import StringIO +from django.core.management import call_command +import logging class ProjectAdmin(GuardedModelAdmin): @@ -95,18 +99,38 @@ form = StatAnnotationForm() return render_to_response('admin/ldt_utils/content/stats_form.html', {'form': form, 'message':message, 'current_app': self.admin_site.name, 'current_action' : 'stats' }, context_instance=RequestContext(request)) - + + + def dumpdata(self, request): + # do we dump the datas ? + dump_str = request.REQUEST.get("dump") + app_str = request.REQUEST.get("app", "") + dump_bool = False + if dump_str: + dump_bool = {'true': True, 'false': False, "0": False, "1": True}.get(dump_str.lower()) + if dump_bool: + content = StringIO() + if app_str=="": + call_command("dumpdata", indent=1, stdout=content) + else: + call_command("dumpdata", app_str, indent=1, stdout=content) + content.seek(0) + out = content.getvalue() + content.close() + res = HttpResponse(out, mimetype='application/json') + res["Content-Disposition"] = "attachment; filename=dumpdata_ldt.json" + return res + return render_to_response('admin/ldt_utils/content/dumpdata.html', {}, context_instance=RequestContext(request)) + def get_urls(self): urls = super(ContentAdmin, self).get_urls() content_urls = patterns('', url(r'^reindex/$', self.admin_site.admin_view(self.reindex), name="ldt_content_reindex"), - # (r'^admin/ldt/content/import/upload/$', 'ldt.ldt_utils.views.uploadFile'), url(r'^import/$', self.admin_site.admin_view(self.import_file), name="ldt_content_import_file"), - url(r'^stats/$', self.admin_site.admin_view(self.stats_annotations), name="ldt_project_compute_stats") - + url(r'^stats/$', self.admin_site.admin_view(self.stats_annotations), name="ldt_project_compute_stats"), + url(r'^dumpdata/$', self.admin_site.admin_view(self.dumpdata), name="ldt_admin_dump_data"), ) - return content_urls + urls diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/migrations/0025_chg_site_domain.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/migrations/0025_chg_site_domain.py Fri Dec 14 15:12:39 2012 +0100 @@ -0,0 +1,168 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import DataMigration +from django.conf import settings +from django.db import models + +class Migration(DataMigration): + + def forwards(self, orm): + Sites = orm['sites.Site'] + site = Sites.objects.get(id=settings.SITE_ID) + web_url = settings.WEB_URL + if (web_url.startswith("http://")): + domain_area = web_url.split("//",1) + domain = domain_area[1] + else : + domain=web_url + if site.domain!=domain: + site.domain = domain + site.save() + if site.name!=domain: + site.name=domain + site.save() + + def backwards(self, orm): + #do nothing + 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'}) + }, + 'ldt_utils.author': { + 'Meta': {'object_name': 'Author'}, + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}), + 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'handle': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + 'ldt_utils.content': { + 'Meta': {'ordering': "['title']", 'object_name': 'Content'}, + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ldt_utils.Author']", 'symmetrical': 'False', 'blank': 'True'}), + 'content_creation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'duration': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'front_project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ldt_utils.Project']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('sorl.thumbnail.fields.ImageField', [], {'default': "'thumbnails/contents/content_default_icon.png'", 'max_length': '200'}), + 'iri_id': ('django.db.models.fields.CharField', [], {'default': "u'ccfe5711-3581-11e2-8abd-00161798aedb'", 'unique': 'True', 'max_length': '255'}), + 'iriurl': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'media_obj': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ldt_utils.Media']", 'null': 'True', 'blank': 'True'}), + 'tags': ('tagging.fields.TagField', [], {'max_length': '2048', 'null': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'update_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + }, + 'ldt_utils.contentstat': { + 'Meta': {'object_name': 'ContentStat'}, + 'annotation_volume_str': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'content': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'stat_annotation'", 'unique': 'True', 'to': "orm['ldt_utils.Content']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_annotated': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'blank': 'True'}), + 'nb_annotations': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'polemics_volume_str': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}) + }, + 'ldt_utils.media': { + 'Meta': {'object_name': 'Media'}, + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'duration': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'external_permalink': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'external_publication_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'external_src_url': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'media_creation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'mimetype_field': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'src': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'src_hash': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'blank': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'update_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'videopath': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}) + }, + 'ldt_utils.project': { + 'Meta': {'ordering': "['title']", 'object_name': 'Project'}, + 'changed_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}), + 'contents': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ldt_utils.Content']", 'symmetrical': 'False'}), + 'created_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('sorl.thumbnail.fields.ImageField', [], {'default': "'thumbnails/projects/project_default_icon.png'", 'max_length': '200'}), + 'ldt': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'ldt_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'modification_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'state': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024'}) + }, + 'ldt_utils.segment': { + 'Meta': {'object_name': 'Segment'}, + 'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'audio_href': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'audio_src': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'author': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'content': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ldt_utils.Content']"}), + 'cutting_id': ('django.db.models.fields.CharField', [], {'max_length': '512', 'db_index': 'True'}), + 'date': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'duration': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), + 'element_id': ('django.db.models.fields.CharField', [], {'max_length': '512', 'db_index': 'True'}), + 'ensemble_id': ('django.db.models.fields.CharField', [], {'max_length': '512', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'id_hash': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'blank': 'True'}), + 'iri_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'polemics': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True', 'blank': 'True'}), + 'project_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'project_obj': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ldt_utils.Project']", 'null': 'True'}), + 'start_ts': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), + 'tags': ('tagging.fields.TagField', [], {'max_length': '2048', 'null': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + 'sites.site': { + 'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"}, + 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + } + } + + complete_apps = ['sites', 'ldt_utils'] + symmetrical = True diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/models.py --- a/src/ldt/ldt/ldt_utils/models.py Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/models.py Fri Dec 14 15:12:39 2012 +0100 @@ -14,6 +14,7 @@ from utils import (create_ldt, copy_ldt, create_empty_iri, update_iri, generate_uuid) from ldt.utils import generate_hash +from ldt.utils.web_url_management import get_web_url import datetime import lxml.etree #@UnresolvedImport import mimetypes @@ -300,7 +301,9 @@ def __unicode__(self): return str(self.id) + ":" + self.iri_id + ":" + self.title.replace("\n", " ") - def iri_url(self, web_url=settings.WEB_URL): + def iri_url(self, web_url=None): + if not web_url: + web_url=get_web_url() if url_utils.is_absolute(self.iriurl): return self.iriurl else: diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/app_index.html --- a/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/app_index.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/app_index.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,7 +1,9 @@ {% extends "admin/app_index.html" %} +{% load absurl %} +{% load absstatic %} {% block extrastyle %} {{ block.super }} - + {% endblock %} {% load i18n %} {% block content %} @@ -11,27 +13,33 @@ - + + + + + - - - - - - - - - + + + + +
Import
Import - an ldtImport + an ldt +  
Reindex +  
Reindex -  
Compute stats -  
Compute stats +  
+
+ + + + + + +
Data
Dump data +  
+
{% endblock %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/dumpdata.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/dumpdata.html Fri Dec 14 15:12:39 2012 +0100 @@ -0,0 +1,16 @@ +{% extends "admin/ldt_utils/app_action.html" %} +{% load i18n %} +{% load absurl %} +{# DUMP DATA #} +{% block content %} +{% if message %} +
+

{{ message }}

+
+{% endif %} +
+

Click HERE if you want to download the dumpdata's json. It can be long to load. The dumpdata is full and raw, without natural keys.

+
+ +Back to administration page +{% endblock %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/reindex_form.html --- a/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/reindex_form.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/reindex_form.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,5 +1,6 @@ {% extends "admin/ldt_utils/app_action.html" %} {% load i18n %} +{% load absurl %} {# reindex contents #} {% block content %} {% if message %} @@ -11,13 +12,13 @@ {% endif %}
{% csrf_token %} + action="{% absurl admin:ldt_content_reindex %}">{% csrf_token %} {{ form.as_table }}
-Back to administration page +Back to administration page {% endblock %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/stats_form.html --- a/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/stats_form.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/admin/ldt_utils/content/stats_form.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,5 +1,6 @@ {% extends "admin/ldt_utils/app_action.html" %} {% load i18n %} +{% load absurl %} {# reindex contents #} {% block content %} {% if message %} @@ -11,13 +12,13 @@ {% endif %}
{% csrf_token %} + action="{% absurl admin:ldt_project_compute_stats %}">{% csrf_token %} {{ form.as_table }}
-Back to administration page +Back to administration page {% endblock %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html Fri Dec 14 15:12:39 2012 +0100 @@ -2,6 +2,7 @@ {% load i18n %} {% load thumbnail %} {% load front_tags %} +{% load absstatic %} {% block title %} {% if tag_label %} @@ -13,13 +14,13 @@ {% block js_import %} {{block.super}} - - + + {% endblock %} {% block css_import %} {{block.super}} - + {% endblock %} {% block js_declaration %} @@ -51,7 +52,7 @@ {% else %}{% trans 'All medias' %}{% endif %}
  • - {% trans 'Filter the medias' %}{% trans 'Filter the medias' %} {% trans 'Filter the medias' %} + {% trans 'Filter the medias' %}{% trans 'Filter the medias' %} {% trans 'Filter the medias' %}
  • diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/front/front_base.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_base.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_base.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,6 +1,7 @@ {% load i18n %} {% load logintag %} {% load navigation %} +{% load absstatic %} {% load analytics %} @@ -9,15 +10,15 @@ {% block head %} - + {% block title %}Lignes de temps{% endblock %} {% block js_import %} - - + + {% endblock %} {% block css_declaration %}{% endblock %} {% block css_import %} - + {% endblock %} {% block js_declaration %} - + + {% endblock %} {% block css_import %} {{block.super}} - + {% endblock %} {% block js_declaration %} @@ -42,7 +42,7 @@ diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/front/front_player.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_player.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_player.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,14 +1,15 @@ {% extends "front/front_base.html" %} {% load i18n %} {% load thumbnail %} +{% load absstatic %} {% block title %}Lignes de temps : {% trans 'Annotate' %} "{{content.title}}"{% endblock %} {% block css_import %} {{block.super}} - - - + + + {% endblock %} {% block js_declaration %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/front/front_search_results.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_search_results.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_search_results.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,18 +1,19 @@ {% extends "front/front_base.html" %} {% load i18n %} {% load thumbnail %} +{% load absstatic %} {% load front_tags %} {% block title %}Lignes de temps : {% trans 'search' %} "{{search}}" {% endblock %} {% block js_import %} {{block.super}} - + {% endblock %} {% block css_import %} {{block.super}} - + {% endblock %} {% block js_declaration %} @@ -40,7 +41,7 @@ var global_csrf_token = "{{ csrf_token }}"; - + {% endblock %} {% block body %} @@ -77,6 +78,7 @@
  • {{ nb_results }} {% trans "Result" %}{{ nb_results|pluralize }}

    +

    {{ nb_segment }} {% trans "Segment" %}{{ nb_segment|pluralize }}

  • @@ -106,7 +108,7 @@
  • - +

    diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/content_list.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/content_list.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/content_list.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,5 +1,6 @@ {% extends "ldt/user/user_base.html" %} {% load i18n %} +{% load absstatic %} {% block js_declaration %} {{block.super}} @@ -47,7 +48,7 @@ {% block css_import %} {{block.super}} - + {% endblock %} {% block breadcrumb %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/copy_ldt.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/copy_ldt.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/copy_ldt.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,11 +1,11 @@ {% extends "ldt/ldt_raw_base.html" %} - +{% load absstatic %} {% load i18n %} {# form of copy of project ldt #} {% block css_import %} {{ block.super }} - - - + + + {% endblock %} {% block body %}
    diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_content.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_content.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_content.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,5 +1,7 @@ {% extends "ldt/ldt_utils/workspace_base.html" %} {% load i18n %} +{% load absstatic %} +{% load absurl %} {# form of creation of content #} {% load adminmedia %} @@ -8,11 +10,17 @@ {{ block.super }} - + + + + + + + {{ content_form.media.js }} {% endblock %} @@ -26,7 +34,7 @@ "{{cookie_name}}" : "{{session_key}}"}; onCreateContentReady("{% url ldt.ldt_utils.views.content.upload %}", - "{{LDT_MEDIA_PREFIX}}", + '{% absstatic "ldt" %}', post_added_params, '{% trans "Browse" %}', '{% trans "File uploaded" %}', @@ -52,11 +60,11 @@ {% block css_import %} {{ block.super }} {{ content_form.media.css }} - - - - - + + + + + @@ -81,7 +89,11 @@ {{ content_form.errors }}
    -
    {% trans "Create content" %}
    + {% if iri_id %} +
    {% trans "Modify this content" %}
    + {% else %} +
    {% trans "Create content" %}
    + {% endif %}
    @@ -107,18 +119,14 @@
    {{ content_form.media_input_type.errors }}{{ content_form.media_input_type.label_tag }}{{content_form.media_input_type}}
    -
    - -
    - - - -
    - -
    + {{ media_form.media_file.errors }} + {% comment %}{{ media_form.media_file.label_tag }}{{media_form.media_file}}{% endcomment %} +
    + +
    +
    -
    {{ media_form.external_src_url.errors }}{{ media_form.external_src_url.label_tag }}{{ media_form.external_src_url }}
    {{ media_form.src.errors }}{{ media_form.src.label_tag }}{{ media_form.src }}
    @@ -135,10 +143,11 @@ {% endif %} {% include "ldt/ldt_utils/partial/picture.html"%} {% include "ldt/ldt_utils/partial/permissions.html" %} +
    -
    loader
    +
    loader
    {% trans "media file is being processed please wait." %}
     
    @@ -151,8 +160,4 @@
    - - - - {% endblock %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_group.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_group.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_group.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,23 +1,25 @@ {% extends "ldt/ldt_utils/workspace_base.html" %} {% load i18n %} +{% load absstatic %} +{% load absurl %} {% load adminmedia %} {% load thumbnail %} {% block js_import %} {{ block.super }} - - - + + + {{ content_form.media.js }} {% endblock %} {% block css_import %} {{ block.super }} {{ content_form.media.css }} - - - + + + {% endblock %} @@ -42,7 +44,7 @@ $( this ).find("button[type=submit]").removeClass("e-clicked"); }); - var search_url = "{% url ldt.ldt_utils.views.workspace.share_filter filter='__FILTER__' use_groups='false' %}"; + var search_url = "{% absurl ldt.ldt_utils.views.workspace.share_filter filter='__FILTER__' use_groups='false' %}"; }); @@ -53,7 +55,7 @@
    {% if group_id %}{% trans "Update a group" %}{% else %}{% trans "Create a group" %}{% endif %}
    -
    + {% csrf_token %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_ldt.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_ldt.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_ldt.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,23 +1,23 @@ {% extends "ldt/ldt_raw_base.html" %} - +{% load absstatic %} {% load i18n %} {# form of creation of content #} {% load adminmedia %} {% block js_import %} {{ block.super }} - + - - + + {{ content_form.media.js }} {% endblock %} {% block css_import %} {{ block.super }} {{ content_form.media.css }} - - - + + + {% endblock %} {% block js_declaration %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,5 +1,7 @@ {% load i18n %} {% load thumbnail %} +{% load absstatic %} +{% load absurl %} {% load analytics %}
    - + - - - + + + + {{ content_form.media.js }} {% endblock %} @@ -22,13 +25,21 @@ var player_id='{{player_id}}'; var translate_show="{% trans 'Show Player' %}"; var translate_hide="{% trans 'Hide Player' %}"; - var WEB_URL='{{WEB_URL}}'; - var LDT_MEDIA_PREFIX='{{LDT_MEDIA_PREFIX}}'; var LANGUAGE_CODE='{{LANGUAGE_CODE}}'; var json_url='{{json_url}}'; var player_id='{{player_id}}'; - var segment_api='{% url segment_api_empty resource_name="segments" api_name="1.0" %}'; + var defaultDir='{% absstatic "ldt/js/" %}'; + var jwPlayerSWF='{% absstatic "ldt/swf/player.swf" %}'; + var recordMicSwf='{% absstatic "ldt/swf/record_mic.swf" %}'; + var zeroClipboardSwf='{% absstatic "ldt/swf/ZeroClipboard10.swf" %}'; + var cssjQueryUI='{% absstatic "ldt/css/jq-css/themes/base/jquery-ui.css" %}'; + var widgetsDir='{% absstatic "ldt/metadataplayer" %}'; + var configCss='{% absstatic "ldt/metadataplayer/LdtPlayer-core.css" %}'; + var default_thumbnail='{% absstatic "ldt/css/imgs/video_sequence.png" %}'; + var segment_api="{% absurl segment_api_empty resource_name='segments' api_name='1.0' %}{% templatetag openvariable %}media{% templatetag closevariable %}/{% templatetag openvariable %}begin{% templatetag closevariable %}/{% templatetag openvariable %}end{% templatetag closevariable %}"; + var LdtPlayer_core='{% absstatic "ldt/metadataplayer/LdtPlayer-core.js" %}'; var creator_name='{{request.user.username}}'; + $j(document).ready(function(){ init_events(); }); @@ -38,10 +49,10 @@ {% block css_import %} {{ block.super }} {{ content_form.media.css }} - - - - + + + + {% endblock %} @@ -79,8 +90,8 @@
    {% trans 'Player Size : ' %} - x - + x +
    @@ -208,7 +219,7 @@ {% trans 'Show Player' %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/error_confirm.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/error_confirm.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/error_confirm.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,17 +1,17 @@ {% extends "ldt/ldt_utils/workspace_base.html" %} - +{% load absstatic %} {% load i18n %} {# form of creation of content #} {% block js_import %} {{ block.super }} - + {% endblock %} {% block css_import %} {{ block.super }} {{ content_form.media.css }} - + {% endblock %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/error_confirm_popup.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/error_confirm_popup.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/error_confirm_popup.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,18 +1,18 @@ {% extends "ldt/ldt_raw_base.html" %} - +{% load absstatic %} {% load i18n %} {# form of creation of content #} {% block js_import %} {{ block.super }} - + {% endblock %} {% block css_import %} {{ block.super }} {{ content_form.media.css }} - - + + {% endblock %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/groups.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/groups.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/groups.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,10 +1,10 @@ {% extends "ldt/ldt_base.html" %} {% load i18n %} - +{% load absstatic %} {% block js_import %} {{block.super}} - + {% endblock %} {% block js_declaration %} @@ -82,7 +82,7 @@ {% block css_import %} {{block.super}} - + {% endblock %} {% block content %} @@ -91,13 +91,13 @@
    {% trans "My groups" %} {% if can_add_group %} - {% trans 'Create group' %} + {% trans 'Create group' %} {% endif %}
    -
    loader
    +
    loader
    @@ -109,7 +109,7 @@
    {% trans "The group's projects" %}
    -
    loader
    +
    loader
    diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/init_ldt.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/init_ldt.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/init_ldt.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,3 +1,4 @@ +{% load absstatic %} @@ -6,10 +7,10 @@ Ligne de Temps - IRI - - + + - + - + {% endblock %} @@ -68,7 +68,7 @@ {% block css_import %} {{block.super}} - + {% endblock %} {% block content %} @@ -77,7 +77,7 @@
    {% trans "project list" %}
    -
    +
    diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/loading.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/loading.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/loading.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,3 +1,4 @@ +{% load absstatic %} @@ -20,7 +21,7 @@
    loading
    + src='{% absstatic "ldt/img/loadingAnimation.gif" %}' />
    diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/contentslist.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/contentslist.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/contentslist.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,6 +1,7 @@ {% load i18n %} {% load thumbnail %} {% load front_tags %} +{% load absstatic %}
    • {% if tag_cloud|length > 0 %}{% trans 'All categories' %}{% endif %}{% if current_content_tag %}{% if current_content_tag != "" %} > {{current_content_tag}} [x]{% endif %}{% endif %}
    • @@ -25,8 +26,8 @@ {% for content in contents %} -
      {% trans 'create project' %}
      -
      {% trans 'preview media'%}
      +
      {% trans 'create project' %}
      +
      {% trans 'preview media'%}
      {% thumbnail content.image "50x50" format="PNG" crop="top" as im %}{% endthumbnail %} {{ content.title|default:"_" }} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,10 +1,12 @@ {% spaceless %} {% load i18n %} +{% load absurl %} +{% load absstatic %} {% load thumbnail %}
      - +
      @@ -42,7 +57,7 @@ {{ group.name }} {% endif %} - + {% endfor %} @@ -54,7 +69,7 @@ {% trans "Projects shared with me only" %} - + {% endif %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/ldt_div.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/ldt_div.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/ldt_div.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,7 +1,9 @@ +{% load absurl %} +{% load absstatic %} {% comment %} Yes we include swfobject.js in the middle of the page... {% endcomment %} - +
       
      diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/permissions.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/permissions.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/permissions.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,6 +1,7 @@ {% load i18n %} +{% load absstatic %} - + diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,5 +1,6 @@ {% load i18n %} {% load thumbnail %} +{% load absstatic %} {% load front_tags %} {% if nb_pj_pages %} @@ -21,33 +22,33 @@ {% if is_gecko %} {% else %} {% endif %} -
      {% trans 'copy project' %}
      +
      {% trans 'copy project' %}
      + {% trans 'link json by id' %}
      {% ifequal project.state 2 %} - {% trans 'Project published, click to unpublish' %}
      + {% trans 'Project published, click to unpublish' %}
    {% else %} - {% trans 'Project not published, click to publish' %} + {% trans 'Project not published, click to publish' %} {% endifequal %} {% thumbnail project.image "50x50" crop="center" format="PNG" as im %}{% empty %} {% endthumbnail %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/publishedprojectslist.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/publishedprojectslist.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/publishedprojectslist.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,6 +1,7 @@ {% load i18n %} {% load thumbnail %} {% load front_tags %} +{% load absstatic %} {% if nb_pj_pages %}
      @@ -18,14 +19,14 @@ {% url ldt.ldt_utils.views.json.project_json_id project.ldt_id as json_url_id %} {% if is_gecko %} -
      {% trans 'open ldt' %}
      +
      {% trans 'open ldt' %}
      {% else %} -
      {% trans 'open ldt' %}
      +
      {% trans 'open ldt' %}
      {% endif %} -
      {% trans 'copy the project' %}
      -
      {% trans 'link json by id' %}
      +
      {% trans 'copy the project' %}
      +
      {% trans 'link json by id' %}
      - {% trans 'Project published' %} + {% trans 'Project published' %} {% thumbnail project.image "50x50" crop="center" format="PNG" as im %}{% empty %} {% endthumbnail %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/sharewith.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/sharewith.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/sharewith.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,12 +1,12 @@ {% load i18n %} - +{% load absstatic %} {% for res in elem_list %} {% if res.type == "user" %} - {% trans + {% trans {% else %} - {% + {% {% endif %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/published_projects.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/published_projects.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/published_projects.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,10 +1,10 @@ {% extends "ldt/ldt_base.html" %} {% load i18n %} - +{% load absstatic %} {% block js_import %} {{block.super}} - + {% endblock %} {% block js_declaration %} @@ -43,7 +43,7 @@ {% block css_import %} {{block.super}} - + {% endblock %} {% block content %} @@ -65,9 +65,9 @@
      {% trans "Published projects" %} - {% trans 'Create project' %}
      + {% trans 'Create project' %}
      -
      loader
      +
      loader
      diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/reset_confirm.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/reset_confirm.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/reset_confirm.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,18 +1,18 @@ {% extends "ldt/ldt_utils/workspace_base.html" %} - +{% load absstatic %} {% load i18n %} {# form of creation of content #} {% block js_import %} {{ block.super }} - + {% endblock %} {% block css_import %} {{ block.super }} {{ content_form.media.css }} - - + + {% endblock %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/reset_confirm_popup.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/reset_confirm_popup.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/reset_confirm_popup.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,18 +1,18 @@ {% extends "ldt/ldt_raw_base.html" %} - +{% load absstatic %} {% load i18n %} {# form of creation of content #} {% block js_import %} {{ block.super }} - + {% endblock %} {% block css_import %} {{ block.super }} {{ content_form.media.css }} - - + + {% endblock %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/search_form.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/search_form.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/search_form.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,5 +1,6 @@ {% extends "ldt/ldt_base.html" %} {% load i18n %} +{% load absurl %} {% block js_declaration %} - + {% endblock %} {% block css_import %} {{ block.super }} - + {% endblock %} {% block css_import %} - - + + - + {% endblock %} {% block js_declaration %} diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/templatetags/absstatic.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/templatetags/absstatic.py Fri Dec 14 15:12:39 2012 +0100 @@ -0,0 +1,24 @@ +from django import template +from django.contrib.staticfiles.storage import staticfiles_storage +from django.contrib.sites.models import Site +from django.template import Library +import logging +import urlparse + +register = template.Library() + +@register.simple_tag +def absstatic(context, path): + try: + request=context['request'] + if request.is_secure(): + domain = "https://%s" % Site.objects.get_current().domain + else: + domain = "http://%s" % Site.objects.get_current().domain + except: + domain = "http://%s" % Site.objects.get_current().domain + + new_path = staticfiles_storage.url(path) + return urlparse.urljoin(domain, new_path) + +absstatic=register.simple_tag(takes_context=True)(absstatic) \ No newline at end of file diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/templatetags/absurl.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/templatetags/absurl.py Fri Dec 14 15:12:39 2012 +0100 @@ -0,0 +1,31 @@ +import urlparse +from django.template import Library +from django.template.defaulttags import URLNode, url +from django.contrib.sites.models import Site +import logging + + +register = Library() + +class AbsoluteURLNode(URLNode): + def render(self, context): + path = super(AbsoluteURLNode, self).render(context) + try: + request=context['request'] + if request.is_secure(): + domain = "https://%s" % Site.objects.get_current().domain + else: + domain = "http://%s" % Site.objects.get_current().domain + except: + domain = "http://%s" % Site.objects.get_current().domain + return urlparse.urljoin(domain, path) + +@register.simple_tag +def absurl(parser, token, node_cls=AbsoluteURLNode): + """Just like {% url %} but ads the domain of the current site.""" + node_instance = url(parser, token) + return node_cls(view_name=node_instance.view_name, + args=node_instance.args, + kwargs=node_instance.kwargs, + asvar=node_instance.asvar) +absurl = register.tag(absurl) \ No newline at end of file diff -r b0ff67993356 -r 011f05e0e961 src/ldt/ldt/user/templates/ldt/user/login_form.html --- a/src/ldt/ldt/user/templates/ldt/user/login_form.html Thu Dec 06 14:39:14 2012 +0100 +++ b/src/ldt/ldt/user/templates/ldt/user/login_form.html Fri Dec 14 15:12:39 2012 +0100 @@ -1,10 +1,11 @@ {% load i18n %} +{% load absurl %} {# print user's state and form of login #} {% block js_import %} {{block.super}}