3 {% load i18n %} |
3 {% load i18n %} |
4 {% load thumbnail %} |
4 {% load thumbnail %} |
5 {% load egonomy_thumbnail %} |
5 {% load egonomy_thumbnail %} |
6 |
6 |
7 {% block title %}{% trans "Create or edit a fragment" %}{% endblock %} |
7 {% block title %}{% trans "Create or edit a fragment" %}{% endblock %} |
8 |
8 {% block css_page %} |
|
9 <link rel="stylesheet" href="{% static 'egonomy/css/jquery-ui.css' %}" /> |
|
10 <link rel="stylesheet" href="{% static 'egonomy/css/jquery.tagit.css' %}" /> |
|
11 <link rel="stylesheet" href="{% static 'egonomy/css/tagit.ui-zendesk.css' %}" /> |
|
12 {% endblock %} |
9 {% block js_import %} |
13 {% block js_import %} |
10 {{block.super}} |
14 {{block.super}} |
11 <script type="text/javascript" src="{% static 'egonomy/lib/raphael-min.js' %}"></script> |
15 <script type="text/javascript" src="{% static 'egonomy/lib/raphael-min.js' %}"></script> |
12 <script type="text/javascript" src="{% static 'egonomy/js/cutout.js' %}"></script> |
16 <script type="text/javascript" src="{% static 'egonomy/js/cutout.js' %}"></script> |
|
17 <script type="text/javascript" src="{% static 'egonomy/lib/jquery-ui.min.js' %}"></script> |
|
18 <script type="text/javascript" src="{% static 'egonomy/js/tag-it.js' %}"></script> |
13 {% endblock %} |
19 {% endblock %} |
14 {% block js_inline %} |
20 {% block js_inline %} |
15 {{block.super}} |
21 {{block.super}} |
16 <script type="text/javascript"> |
22 <script type="text/javascript"> |
17 window.onload = function() { |
23 window.onload = function() { |
18 if($("#add_rmn_tags")){ |
24 if($("#add_rmn_tags")){ |
19 $("#add_rmn_tags").click(function() { |
25 $("#add_rmn_tags").click(function() { |
20 var s = $("#users_keywords").val(); |
26 addTags($("#rmn_tags").html().split(',')) |
21 if(s!="" && s.substring(s.length - 1)!=",") { |
|
22 s = s + ","; |
|
23 } |
|
24 $("#users_keywords").val(s + $("#rmn_tags").html()); |
|
25 }); |
27 }); |
26 } |
28 } |
27 if($("#add_pertimm_title")){ |
29 if($("#add_pertimm_title")){ |
28 $("#add_pertimm_title").click(function() { |
30 $("#add_pertimm_title").click(function() { |
29 var s = $("#users_keywords").val(); |
31 addTags($("#pertimm_title_tags").html().split(',')) |
30 if(s!="" && s.substring(s.length - 1)!=",") { |
|
31 s = s + ","; |
|
32 } |
|
33 $("#users_keywords").val(s + $("#pertimm_title_tags").html()); |
|
34 }); |
32 }); |
35 } |
33 } |
36 if($("#add_pertimm_description")){ |
34 if($("#add_pertimm_description")){ |
37 $("#add_pertimm_description").click(function() { |
35 $("#add_pertimm_description").click(function() { |
38 var s = $("#users_keywords").val(); |
36 addTags($("#pertimm_description_tags").html().split(',')) |
39 if(s!="" && s.substring(s.length - 1)!=",") { |
|
40 s = s + ","; |
|
41 } |
|
42 $("#users_keywords").val(s + $("#pertimm_description_tags").html()); |
|
43 }); |
37 }); |
44 } |
38 } |
45 if($("#add_pertimm_thesaurus")){ |
39 if($("#add_pertimm_thesaurus")){ |
46 $("#add_pertimm_thesaurus").click(function() { |
40 $("#add_pertimm_thesaurus").click(function() { |
47 var s = $("#users_keywords").val(); |
41 addTags($("#pertimm_thesaurus_tags").html().split(',')) |
48 if(s!="" && s.substring(s.length - 1)!=",") { |
|
49 s = s + ","; |
|
50 } |
|
51 $("#users_keywords").val(s + $("#pertimm_thesaurus_tags").html()); |
|
52 }); |
42 }); |
53 } |
43 } |
54 }; |
44 }; |
|
45 function addTags(tags){ |
|
46 nt = tags.length; |
|
47 for(var i=0; i<nt; i++){ |
|
48 $('#user_keywords').tagit('createTag', tags[i]); |
|
49 } |
|
50 } |
|
51 $(function() { |
|
52 $('#user_keywords').tagit({allowSpaces: true}); |
|
53 }); |
55 </script> |
54 </script> |
56 {% endblock %} |
55 {% endblock %} |
57 |
56 |
58 {% block content %} |
57 {% block content %} |
59 <div class="fullwidth"> |
58 <div class="fullwidth"> |
100 <th>{% trans "Fragment's description" %} :</th> |
99 <th>{% trans "Fragment's description" %} :</th> |
101 <td><textarea class="fragment-description" name="fragment_description" id="fragment_description"></textarea></td> |
100 <td><textarea class="fragment-description" name="fragment_description" id="fragment_description"></textarea></td> |
102 </tr> |
101 </tr> |
103 <tr> |
102 <tr> |
104 <th>{% trans 'Users keywords' %} :</th> |
103 <th>{% trans 'Users keywords' %} :</th> |
105 <td><textarea class="user-keywords" name="users_keywords" id="users_keywords"></textarea></td> |
104 <td><input id="user_keywords" name="user_keywords" class="user-keywords"></ul><!--textarea class="user-keywords" name="user_keywords" id="user_keywords"></textarea--></td> |
106 </tr> |
105 </tr> |
107 {% if img.metadata.mots_cles %} |
106 {% if img.metadata.mots_cles %} |
108 <tr> |
107 <tr> |
109 <th>{% trans 'RMN keywords' %} :</th> |
108 <th>{% trans 'RMN keywords' %} :</th> |
110 <td><span id="rmn_tags">{{ img.metadata.mots_cles }}</span><br/><span id="add_rmn_tags" class="right add_tag_btn">+ {% trans 'Add RMN keywords to yours' %}</span></td> |
109 <td><span id="rmn_tags">{{ img.metadata.mots_cles }}</span><br/><span id="add_rmn_tags" class="right add_tag_btn">+ {% trans 'Add RMN keywords to yours' %}</span></td> |