End of fake request for senseetive keywords : front/js/css ready.
authorcavaliet
Tue, 05 Mar 2013 10:29:27 +0100
changeset 86 5e1eb389036a
parent 85 4d320fbfc550
child 87 303eca26bcc0
End of fake request for senseetive keywords : front/js/css ready.
src/egonomy/locale/en/LC_MESSAGES/django.po
src/egonomy/locale/fr/LC_MESSAGES/django.po
src/egonomy/static/egonomy/css/egonomy.css
src/egonomy/static/egonomy/css/images/loader.gif
src/egonomy/templates/egonomy_create_fragment.html
src/egonomy/views.py
--- a/src/egonomy/locale/en/LC_MESSAGES/django.po	Mon Mar 04 17:40:57 2013 +0100
+++ b/src/egonomy/locale/en/LC_MESSAGES/django.po	Tue Mar 05 10:29:27 2013 +0100
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-03-04 08:25-0600\n"
+"POT-Creation-Date: 2013-03-05 03:24-0600\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -25,7 +25,7 @@
 msgid "English"
 msgstr ""
 
-#: views.py:71 views.py:95
+#: views.py:72 views.py:96
 msgid "You are not allowed to modify this fragment."
 msgstr ""
 
@@ -52,7 +52,7 @@
 
 #: templates/egonomy_all_fragments.html:40
 #: templates/egonomy_annotate_picture.html:102
-#: templates/egonomy_create_fragment.html:163 templates/egonomy_home.html:62
+#: templates/egonomy_create_fragment.html:220 templates/egonomy_home.html:62
 #: templates/egonomy_view_fragment.html:107
 msgid "Annotated by"
 msgstr ""
@@ -65,7 +65,7 @@
 
 #: templates/egonomy_all_pictures.html:48
 #: templates/egonomy_annotate_picture.html:12
-#: templates/egonomy_create_fragment.html:101 templates/egonomy_home.html:39
+#: templates/egonomy_create_fragment.html:154 templates/egonomy_home.html:39
 #: templates/egonomy_home.html.py:61 templates/egonomy_view_fragment.html:38
 msgid "No title"
 msgstr ""
@@ -100,22 +100,22 @@
 msgstr ""
 
 #: templates/egonomy_annotate_picture.html:55
-#: templates/egonomy_create_fragment.html:117
+#: templates/egonomy_create_fragment.html:170
 msgid "RMN keywords"
 msgstr ""
 
 #: templates/egonomy_annotate_picture.html:63
-#: templates/egonomy_create_fragment.html:124
+#: templates/egonomy_create_fragment.html:177
 msgid "Pertimm title"
 msgstr ""
 
 #: templates/egonomy_annotate_picture.html:67
-#: templates/egonomy_create_fragment.html:131
+#: templates/egonomy_create_fragment.html:184
 msgid "Pertimm description"
 msgstr ""
 
 #: templates/egonomy_annotate_picture.html:71
-#: templates/egonomy_create_fragment.html:138
+#: templates/egonomy_create_fragment.html:191
 msgid "Pertimm thesaurus"
 msgstr ""
 
@@ -138,7 +138,7 @@
 msgstr ""
 
 #: templates/egonomy_annotate_picture.html:91
-#: templates/egonomy_create_fragment.html:152
+#: templates/egonomy_create_fragment.html:209
 #: templates/egonomy_view_fragment.html:96
 msgid "Fragments from this picture"
 msgstr ""
@@ -159,55 +159,67 @@
 msgid "Create or edit a fragment"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:69
+#: templates/egonomy_create_fragment.html:89
+msgid "Add all Senseetive keywords to yours"
+msgstr ""
+
+#: templates/egonomy_create_fragment.html:122
 msgid "Erase the drawing"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:70
+#: templates/egonomy_create_fragment.html:123
 msgid "Back to the original drawing"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:71
+#: templates/egonomy_create_fragment.html:124
 msgid "New fragment"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:100
+#: templates/egonomy_create_fragment.html:153
 #: templates/egonomy_view_fragment.html:37
 msgid "Source picture"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:104
-#: templates/egonomy_create_fragment.html:105
+#: templates/egonomy_create_fragment.html:157
+#: templates/egonomy_create_fragment.html:158
 msgid "Fragment's title"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:108
+#: templates/egonomy_create_fragment.html:161
 #: templates/egonomy_view_fragment.html:41
 msgid "Fragment's description"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:112
+#: templates/egonomy_create_fragment.html:165
 #: templates/egonomy_view_fragment.html:45
 msgid "Users keywords"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:119
+#: templates/egonomy_create_fragment.html:172
 msgid "Add all RMN keywords to yours"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:126
+#: templates/egonomy_create_fragment.html:179
 msgid "Add all Pertimm title keywords to yours"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:133
+#: templates/egonomy_create_fragment.html:186
 msgid "Add all Pertimm description keywords to yours"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:140
+#: templates/egonomy_create_fragment.html:193
 msgid "Add all Pertimm thesaurus keywords to yours"
 msgstr ""
 
-#: templates/egonomy_create_fragment.html:145
+#: templates/egonomy_create_fragment.html:197
+msgid "Senseetive keywords"
+msgstr ""
+
+#: templates/egonomy_create_fragment.html:198
+msgid "Request keywords from Senseetive API"
+msgstr ""
+
+#: templates/egonomy_create_fragment.html:202
 msgid "Save the fragment"
 msgstr ""
 
--- a/src/egonomy/locale/fr/LC_MESSAGES/django.po	Mon Mar 04 17:40:57 2013 +0100
+++ b/src/egonomy/locale/fr/LC_MESSAGES/django.po	Tue Mar 05 10:29:27 2013 +0100
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-03-04 08:25-0600\n"
+"POT-Creation-Date: 2013-03-05 03:24-0600\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -26,8 +26,8 @@
 msgid "English"
 msgstr "Anglais"
 
-#: views.py:71
-#: views.py:95
+#: views.py:72
+#: views.py:96
 msgid "You are not allowed to modify this fragment."
 msgstr "Vous n'être pas autorisé à modifier ce fragment."
 
@@ -55,7 +55,7 @@
 
 #: templates/egonomy_all_fragments.html:40
 #: templates/egonomy_annotate_picture.html:102
-#: templates/egonomy_create_fragment.html:163
+#: templates/egonomy_create_fragment.html:220
 #: templates/egonomy_home.html:62
 #: templates/egonomy_view_fragment.html:107
 msgid "Annotated by"
@@ -70,7 +70,7 @@
 
 #: templates/egonomy_all_pictures.html:48
 #: templates/egonomy_annotate_picture.html:12
-#: templates/egonomy_create_fragment.html:101
+#: templates/egonomy_create_fragment.html:154
 #: templates/egonomy_home.html:39
 #: templates/egonomy_home.html.py:61
 #: templates/egonomy_view_fragment.html:38
@@ -109,22 +109,22 @@
 msgstr "Localisation"
 
 #: templates/egonomy_annotate_picture.html:55
-#: templates/egonomy_create_fragment.html:117
+#: templates/egonomy_create_fragment.html:170
 msgid "RMN keywords"
 msgstr "Mots-clés RMN"
 
 #: templates/egonomy_annotate_picture.html:63
-#: templates/egonomy_create_fragment.html:124
+#: templates/egonomy_create_fragment.html:177
 msgid "Pertimm title"
 msgstr "Titre Pertimm"
 
 #: templates/egonomy_annotate_picture.html:67
-#: templates/egonomy_create_fragment.html:131
+#: templates/egonomy_create_fragment.html:184
 msgid "Pertimm description"
 msgstr "Description Pertimm"
 
 #: templates/egonomy_annotate_picture.html:71
-#: templates/egonomy_create_fragment.html:138
+#: templates/egonomy_create_fragment.html:191
 msgid "Pertimm thesaurus"
 msgstr "Thésaurus Pertimm"
 
@@ -148,7 +148,7 @@
 msgstr "Créer un fragment"
 
 #: templates/egonomy_annotate_picture.html:91
-#: templates/egonomy_create_fragment.html:152
+#: templates/egonomy_create_fragment.html:209
 #: templates/egonomy_view_fragment.html:96
 msgid "Fragments from this picture"
 msgstr "Fragments issus de cette image"
@@ -169,55 +169,67 @@
 msgid "Create or edit a fragment"
 msgstr "Créer ou modifier un fragment"
 
-#: templates/egonomy_create_fragment.html:69
+#: templates/egonomy_create_fragment.html:89
+msgid "Add all Senseetive keywords to yours"
+msgstr "Ajouter tous les mots-clés Senseetive aux votres"
+
+#: templates/egonomy_create_fragment.html:122
 msgid "Erase the drawing"
 msgstr "Effacer le tracé"
 
-#: templates/egonomy_create_fragment.html:70
+#: templates/egonomy_create_fragment.html:123
 msgid "Back to the original drawing"
 msgstr "Revenir au tracé d'origine"
 
-#: templates/egonomy_create_fragment.html:71
+#: templates/egonomy_create_fragment.html:124
 msgid "New fragment"
 msgstr "Nouveau fragment"
 
-#: templates/egonomy_create_fragment.html:100
+#: templates/egonomy_create_fragment.html:153
 #: templates/egonomy_view_fragment.html:37
 msgid "Source picture"
 msgstr "Image source"
 
-#: templates/egonomy_create_fragment.html:104
-#: templates/egonomy_create_fragment.html:105
+#: templates/egonomy_create_fragment.html:157
+#: templates/egonomy_create_fragment.html:158
 msgid "Fragment's title"
 msgstr "Titre du fragment"
 
-#: templates/egonomy_create_fragment.html:108
+#: templates/egonomy_create_fragment.html:161
 #: templates/egonomy_view_fragment.html:41
 msgid "Fragment's description"
 msgstr "Description du fragment"
 
-#: templates/egonomy_create_fragment.html:112
+#: templates/egonomy_create_fragment.html:165
 #: templates/egonomy_view_fragment.html:45
 msgid "Users keywords"
 msgstr "Mots-clés Utilisateurs"
 
-#: templates/egonomy_create_fragment.html:119
+#: templates/egonomy_create_fragment.html:172
 msgid "Add all RMN keywords to yours"
 msgstr "Ajouter tous les mots-clés RMN aux votres"
 
-#: templates/egonomy_create_fragment.html:126
+#: templates/egonomy_create_fragment.html:179
 msgid "Add all Pertimm title keywords to yours"
 msgstr "Ajouter tous les mots-clés du titre Pertimm aux votres"
 
-#: templates/egonomy_create_fragment.html:133
+#: templates/egonomy_create_fragment.html:186
 msgid "Add all Pertimm description keywords to yours"
 msgstr "Ajouter tous les mots-clés de la description Pertimm aux votres"
 
-#: templates/egonomy_create_fragment.html:140
+#: templates/egonomy_create_fragment.html:193
 msgid "Add all Pertimm thesaurus keywords to yours"
 msgstr "Ajouter les mots-clés du thésaurus Pertimm aux votres"
 
-#: templates/egonomy_create_fragment.html:145
+#: templates/egonomy_create_fragment.html:197
+msgid "Senseetive keywords"
+msgstr "Mots-clés Senseetive"
+
+#: templates/egonomy_create_fragment.html:198
+msgid "Request keywords from Senseetive API"
+msgstr "Demander les mots-clés à l'API Senseetive"
+
+#: templates/egonomy_create_fragment.html:202
 msgid "Save the fragment"
 msgstr "Enregistrer le fragment"
 
--- a/src/egonomy/static/egonomy/css/egonomy.css	Mon Mar 04 17:40:57 2013 +0100
+++ b/src/egonomy/static/egonomy/css/egonomy.css	Tue Mar 05 10:29:27 2013 +0100
@@ -332,6 +332,11 @@
     background: #AAAAAA; margin: 5px 0; padding: 6px; border-radius: 4px; color: #555555;
     font-weight: bold; font-size: 13px; float: left;
 }
+.loader {
+	background: #D0E0FF url(images/loader.gif) right no-repeat;
+	background-size: 25px 25px;
+	padding-right: 30px;
+}
 
 .big-button {
     background: #D0E0FF; margin: 10px 0 10px 16px; padding: 8px; border-radius: 4px; color: #003366;
Binary file src/egonomy/static/egonomy/css/images/loader.gif has changed
--- a/src/egonomy/templates/egonomy_create_fragment.html	Mon Mar 04 17:40:57 2013 +0100
+++ b/src/egonomy/templates/egonomy_create_fragment.html	Tue Mar 05 10:29:27 2013 +0100
@@ -70,7 +70,8 @@
                 if($("#senseetive_click")){
                     $("#senseetive_click").click(function() {
                     	var v = $(".fragment-path").val();
-                    	if(v!="" && v!="MZ"){
+                    	if(v!="" && v!="MZ" && !$("#senseetive_click").hasClass("loader")){
+                    		$("#senseetive_click").addClass("loader");
 	                    	var data_obj = { "image":"{{ img.id }}", "path":$("#fragment_path").val() };
 	                    	$.ajax({
 	                    		url: '{% url "senseetive_api" %}',
--- a/src/egonomy/views.py	Mon Mar 04 17:40:57 2013 +0100
+++ b/src/egonomy/views.py	Tue Mar 05 10:29:27 2013 +0100
@@ -222,7 +222,7 @@
     if not image_id or frg_path=="MZ":
         return HttpResponseForbidden("The request needs an image and a not null path parameters.")
     # This is a TEMPORARY algorithm. In the future, this function build a picture from the fragment and will request the senseetive api 
-    img = get_object_or_404(Image.objects.select_related('info', 'metadata'), id=image_id)
+    img = get_object_or_404(Image, id=image_id)
     frg_list = Fragment.objects.filter(image=img)
     tag_list = []
     for frg in frg_list:
@@ -232,6 +232,8 @@
             if t != "":
                 logger.debug(t)
                 tag_list.append(t)
+    from time import sleep
+    sleep(2)
     
     return HttpResponse(json.dumps(sorted(set(tag_list))))