| author | ymh <ymh.work@gmail.com> |
| Fri, 20 Mar 2015 00:04:28 +0100 | |
| changeset 564 | 1df39ecb3da0 |
| parent 536 | 107a743740c1 |
| child 586 | 32d9c3ff86eb |
| permissions | -rw-r--r-- |
| 288 | 1 |
{% extends "base.html" %} |
2 |
{% load static %} |
|
| 336 | 3 |
{% load i18n %} |
| 288 | 4 |
|
5 |
{% block title %}{{block.super}} > {{datasheet.title}}{% endblock %} |
|
6 |
||
7 |
{% block css_import %} |
|
8 |
{{block.super}} |
|
| 308 | 9 |
<link rel="stylesheet" type="text/css" href="{% static 'hdalab/css/ui-lightness/jquery-ui-1.10.4.min.css' %}" /> |
| 311 | 10 |
<link rel="stylesheet" type="text/css" href="{% static 'renkanmanager/lib/renkan/css/renkan.css' %}" /> |
| 288 | 11 |
<link rel="stylesheet" type="text/css" href="{% static 'hdalab/css/additionnal_renkan.css' %}" /> |
| 337 | 12 |
<link rel="stylesheet" type="text/css" href="{% static 'hdalab/lib/bjqs.css' %}" /> |
| 288 | 13 |
{% endblock %} |
14 |
||
15 |
{% block js_import %} |
|
16 |
{{block.super}} |
|
| 337 | 17 |
<script src="{% static 'hdalab/lib/bjqs-1.3.min.js' %}"></script> |
| 413 | 18 |
<script src="{% static 'renkanmanager/lib/jquery-ui/jquery-ui.js' %}"></script> |
19 |
<script src="{% static 'renkanmanager/lib/jquery-mousewheel/jquery.mousewheel.js' %}"></script> |
|
20 |
<script src="{% static 'renkanmanager/lib/underscore/underscore.js' %}"></script> |
|
21 |
<script src="{% static 'renkanmanager/lib/backbone/backbone.js' %}"></script> |
|
22 |
<script src="{% static 'renkanmanager/lib/backbone-relational/backbone-relational.js' %}"></script> |
|
23 |
<script src="{% static 'renkanmanager/lib/paper/paper-full.js' %}"></script> |
|
| 288 | 24 |
<script type="text/javascript"> |
25 |
var require = { |
|
|
299
8e00641076e7
remove renkan management to an other django app (see renkan hg repo)
cavaliet
parents:
298
diff
changeset
|
26 |
baseUrl: "{% static 'renkanmanager/lib/' %}" |
| 288 | 27 |
}; |
28 |
</script> |
|
| 413 | 29 |
<script src="{% static 'renkanmanager/lib/requirejs/require.js' %}"></script> |
|
411
5e3f4a5f0900
Update ref to renkan.js + raise RENKANS_PER_PAGE from 3 to 8
rougeronj
parents:
409
diff
changeset
|
30 |
<script src="{% static 'renkanmanager/lib/renkan/js/renkan.js' %}"></script> |
|
323
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
31 |
<script src="{% static 'hdalab/js/renkan-manual-save.js' %}"></script> |
|
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
32 |
<script src="{% static 'hdalab/js/hdalab-renkan-bins.js' %}"></script> |
| 288 | 33 |
<script type="text/javascript"> |
|
440
4c4cfe573486
close 55 - On login, add user to project and set current user of renken to this new user
rougeronj
parents:
433
diff
changeset
|
34 |
var io_options = {}, dialog=false, _rkn; |
|
536
107a743740c1
extend Rkns.i18n.fr to change translation "search in bin"->"rechercher dans les resultats"
rougeronj
parents:
525
diff
changeset
|
35 |
_.extend(Rkns.i18n.fr, {"Search in Bins": "Rechercher dans les résultats"}); |
|
440
4c4cfe573486
close 55 - On login, add user to project and set current user of renken to this new user
rougeronj
parents:
433
diff
changeset
|
36 |
function startRenkan(){ |
| 288 | 37 |
var _renkan = new Rkns.Renkan({ |
| 308 | 38 |
manual_save: true, |
|
447
696958ea9ce7
Closes bug #62 : prevent image upload in renkan
ymh <ymh.work@gmail.com>
parents:
445
diff
changeset
|
39 |
user_color_editable: false, |
|
696958ea9ce7
Closes bug #62 : prevent image upload in renkan
ymh <ymh.work@gmail.com>
parents:
445
diff
changeset
|
40 |
user_name_editable: false, |
|
696958ea9ce7
Closes bug #62 : prevent image upload in renkan
ymh <ymh.work@gmail.com>
parents:
445
diff
changeset
|
41 |
show_user_color: false, |
| 482 | 42 |
show_export_button: false, |
|
525
f35e37814bff
remove "add egde" button and reduce title field to let place for "search in graph"
rougeronj
parents:
510
diff
changeset
|
43 |
show_addedge_button:false, |
|
299
8e00641076e7
remove renkan management to an other django app (see renkan hg repo)
cavaliet
parents:
298
diff
changeset
|
44 |
static_url : "{% static 'renkanmanager/lib/renkan/' %}", |
|
447
696958ea9ce7
Closes bug #62 : prevent image upload in renkan
ymh <ymh.work@gmail.com>
parents:
445
diff
changeset
|
45 |
allow_image_upload : false, |
| 288 | 46 |
search: [ |
47 |
{ |
|
| 324 | 48 |
type: "HdaTags", |
49 |
lang: "{{LANGUAGE_CODE}}", |
|
50 |
image: "http://dbpedia.org/statics/dbpedia_logo.png", |
|
51 |
url: "{% url 'tag_search' %}" |
|
52 |
}, |
|
53 |
{ |
|
|
323
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
54 |
type: "HdaNotices", |
|
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
55 |
lang: "{{LANGUAGE_CODE}}", |
|
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
56 |
image: "http://digital-impulse.com/wp-content/plugins/smilies-themer/digicons/IronMan.png", |
|
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
57 |
url: "{% url 'searchajax' %}" |
| 288 | 58 |
}, |
59 |
{ |
|
60 |
type: "Wikipedia", |
|
|
323
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
61 |
lang: "{{LANGUAGE_CODE}}" |
| 288 | 62 |
} |
63 |
], |
|
64 |
bins: [ |
|
65 |
{ |
|
66 |
type: "ResourceList", |
|
|
445
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
67 |
title: "{% trans 'Ressources' %}", |
| 288 | 68 |
list: [ |
|
445
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
69 |
{ |
|
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
70 |
url: "http://www.histoiredesarts.culture.fr/", |
|
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
71 |
title: "Histoire des arts", |
|
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
72 |
description: "Portail Histoire des arts sur culture.fr", |
|
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
73 |
image: "http://www.culture.fr/extension/culture_fr/design/culture/images/favicon.ico" |
|
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
74 |
} |
| 288 | 75 |
] |
76 |
} |
|
77 |
], |
|
78 |
/*property_files: [ "data/properties.json" ], |
|
79 |
node_fill_color: false*/ |
|
|
323
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
80 |
language: "{{LANGUAGE_CODE}}" |
| 288 | 81 |
}); |
| 308 | 82 |
|
|
412
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
83 |
//_create_user_// |
|
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
84 |
|
|
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
85 |
//_____________// |
|
457
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
86 |
io_options = { |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
87 |
url: "{% url 'renkan_get_put' %}" + window.location.search, |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
88 |
{% if user.is_authenticated %} |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
89 |
user_authenticated: true, |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
90 |
user_id:"{{ user.id }}", |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
91 |
user_name:"{{ user }}", |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
92 |
{% else %} |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
93 |
user_authenticated: false, |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
94 |
{% endif %} |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
95 |
}; |
| 308 | 96 |
Rkns.jsonIOSaveOnClick(_renkan, io_options); |
|
412
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
97 |
|
|
440
4c4cfe573486
close 55 - On login, add user to project and set current user of renken to this new user
rougeronj
parents:
433
diff
changeset
|
98 |
_rkn = _renkan; |
| 308 | 99 |
}; |
100 |
|
|
101 |
$(function() { |
|
102 |
var form; |
|
| 365 | 103 |
|
| 308 | 104 |
dialog = $( "#dialog-form" ).dialog({ |
105 |
autoOpen: false, |
|
| 385 | 106 |
width: 520, |
107 |
modal: true, |
|
108 |
create: function (event, ui) { |
|
109 |
$("#login-popup-close").click(function(){ |
|
110 |
dialog.dialog("close"); |
|
111 |
}); |
|
112 |
} |
|
| 365 | 113 |
}); |
| 308 | 114 |
|
115 |
function manageLoginForm(e, form){ |
|
116 |
e.preventDefault(); |
|
117 |
f = $(form); |
|
118 |
$.ajax({ |
|
119 |
type: f.attr("method"), |
|
120 |
url: f.attr("action"), |
|
121 |
data: f.serialize(), |
|
122 |
success: function(data, textStatus, jqXHR) { |
|
| 310 | 123 |
var d = $(data); |
|
424
33a1260273bc
Close #55 - on Login success set username, add the user to project if not done yet
rougeronj
parents:
423
diff
changeset
|
124 |
if(d.hasClass("ok")){ |
|
33a1260273bc
Close #55 - on Login success set username, add the user to project if not done yet
rougeronj
parents:
423
diff
changeset
|
125 |
io_options.login_user = true; |
|
33a1260273bc
Close #55 - on Login success set username, add the user to project if not done yet
rougeronj
parents:
423
diff
changeset
|
126 |
io_options.user_id= d.attr("id"); |
|
33a1260273bc
Close #55 - on Login success set username, add the user to project if not done yet
rougeronj
parents:
423
diff
changeset
|
127 |
io_options.user_name= $("#username",d).html(); |
|
440
4c4cfe573486
close 55 - On login, add user to project and set current user of renken to this new user
rougeronj
parents:
433
diff
changeset
|
128 |
io_options.user_authenticated = true; |
|
424
33a1260273bc
Close #55 - on Login success set username, add the user to project if not done yet
rougeronj
parents:
423
diff
changeset
|
129 |
|
|
440
4c4cfe573486
close 55 - On login, add user to project and set current user of renken to this new user
rougeronj
parents:
433
diff
changeset
|
130 |
_rkn.setCurrentUser(io_options.user_id, io_options.user_name); |
|
4c4cfe573486
close 55 - On login, add user to project and set current user of renken to this new user
rougeronj
parents:
433
diff
changeset
|
131 |
$("#menu.profile").html(d.html()); |
|
4c4cfe573486
close 55 - On login, add user to project and set current user of renken to this new user
rougeronj
parents:
433
diff
changeset
|
132 |
$(".Rk-Save-Button").click(); |
| 310 | 133 |
dialog.dialog( "close" ); |
134 |
return true; |
|
135 |
} |
|
| 308 | 136 |
$("#dialog-form").html(data); |
137 |
// in case, login failed, we reassign the behaviour |
|
138 |
form = dialog.find( "form" ).on( "submit", function( event ) { |
|
139 |
manageLoginForm(event, this); |
|
140 |
}); |
|
|
510
9f2c0fb8f7ad
Reassign "cancel" behaviour on cancel button of authentication popup
rougeronj
parents:
507
diff
changeset
|
141 |
$("#login-popup-close").click(function(){ |
|
9f2c0fb8f7ad
Reassign "cancel" behaviour on cancel button of authentication popup
rougeronj
parents:
507
diff
changeset
|
142 |
dialog.dialog("close"); |
|
9f2c0fb8f7ad
Reassign "cancel" behaviour on cancel button of authentication popup
rougeronj
parents:
507
diff
changeset
|
143 |
}); |
| 308 | 144 |
} |
145 |
}); |
|
146 |
} |
|
147 |
|
|
| 365 | 148 |
form = dialog.find( "form" ).on( "submit", function( event ) { |
149 |
manageLoginForm(event, this); |
|
150 |
}); |
|
151 |
|
|
152 |
//help dialog init |
|
153 |
var help_dialog = $( "#help-container" ).dialog({ |
|
154 |
autoOpen: false, |
|
155 |
height: 330, |
|
156 |
width: 880, |
|
157 |
resizable: false, |
|
158 |
draggable: false, |
|
159 |
create: function (event, ui) { |
|
160 |
var help_slideshow = $('#help-slideshow').bjqs({ |
|
161 |
responsive:false, |
|
162 |
height: 320, |
|
163 |
width: 870, |
|
164 |
animtype: 'slide', |
|
165 |
showcontrols: true, |
|
166 |
centercontrols: false, |
|
| 507 | 167 |
nexttext: "", |
168 |
prevtext: "", |
|
169 |
showmarkers : false, |
|
170 |
automatic: false |
|
| 365 | 171 |
}); |
172 |
|
|
173 |
$("#toggle-help").click(function(){ |
|
|
371
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
174 |
if (help_dialog.dialog("isOpen")){ |
|
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
175 |
help_dialog.dialog("close"); |
|
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
176 |
} |
|
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
177 |
else{ |
|
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
178 |
help_dialog.dialog("open"); |
|
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
179 |
} |
| 365 | 180 |
}); |
181 |
$(".img-close").click(function(){ |
|
182 |
help_dialog.dialog("close"); |
|
183 |
}); |
|
184 |
} |
|
185 |
}); |
|
186 |
}); |
|
| 308 | 187 |
|
| 288 | 188 |
</script> |
189 |
{% endblock %} |
|
190 |
||
191 |
{% block main_content %} |
|
|
407
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
192 |
<div class="all-title"> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
193 |
<h1><strong>RENKAN</strong></h1> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
194 |
<div class="renkan_help"> |
|
490
97afeb38e259
hide the switch-shape dropdown when its a saved renkan (id_rk is set)
rougeronj
parents:
482
diff
changeset
|
195 |
{% if switch_shape_url %} |
| 409 | 196 |
<ul> |
|
407
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
197 |
<li> |
| 433 | 198 |
{% trans 'Change organisation' %} |
| 409 | 199 |
<p> {% trans '(Indisponible si modification du RENKAN)' %}</p> |
|
407
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
200 |
<ul> |
| 420 | 201 |
{% if 'shape=vert' in switch_shape_url.current %} |
| 433 | 202 |
<li id="graph-line"><a href="">✓ {% trans 'View graph in column' %}</a></li> |
203 |
<li id="graph-lineH"><a href="{{ switch_shape_url.horiz }}"> {% trans 'View graph in line' %}</a></li> |
|
204 |
<li id="graph-circle"><a href="{{ switch_shape_url.circle }}"> {% trans 'View graph in circle' %}</a></li> |
|
| 420 | 205 |
{% elif 'shape=horiz' in switch_shape_url.current %} |
| 433 | 206 |
<li id="graph-line"><a href="{{ switch_shape_url.vert }}"> {% trans 'View graph in column' %}</a></li> |
207 |
<li id="graph-lineH"><a href="">✓ {% trans 'View graph in line' %}</a></li> |
|
208 |
<li id="graph-circle"><a href="{{ switch_shape_url.circle }}"> {% trans 'View graph in circle' %}</a></li> |
|
|
407
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
209 |
{% else %} |
| 433 | 210 |
<li id="graph-line"><a href="{{ switch_shape_url.vert }}"> {% trans 'View graph in column' %}</a></li> |
211 |
<li id="graph-lineH"><a href="{{ switch_shape_url.horiz }}"> {% trans 'View graph in line' %}</a></li> |
|
212 |
<li id="graph-circle"><a href="">✓ {% trans 'View graph in circle' %}</a></li> |
|
|
407
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
213 |
{% endif %} |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
214 |
</ul> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
215 |
</li> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
216 |
</ul> |
|
490
97afeb38e259
hide the switch-shape dropdown when its a saved renkan (id_rk is set)
rougeronj
parents:
482
diff
changeset
|
217 |
{% endif %} |
|
407
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
218 |
<a id="toggle-help" href="#"></a> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
219 |
</div> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
220 |
</div> |
| 308 | 221 |
<div id="dialog-form" title="Identification"> |
222 |
{% include 'ajax_identification/ajax_login.html' %} |
|
223 |
</div> |
|
| 365 | 224 |
|
225 |
<div id="help-container" class=""> |
|
| 423 | 226 |
{% include 'help_popup.html' %} |
| 336 | 227 |
</div> |
| 365 | 228 |
|
| 288 | 229 |
<div class="rnk-wrapper"> |
230 |
<div class="rnk-container"> |
|
231 |
<div id="renkan"></div> |
|
232 |
</div> |
|
| 308 | 233 |
</div> |
| 288 | 234 |
{% endblock %} |