| author | ymh <ymh.work@gmail.com> |
| Sat, 28 Feb 2015 06:44:11 +0100 | |
| changeset 463 | 2a3ef4dcbb6b |
| parent 457 | 1121fd3d8b0e |
| child 482 | 99f650e5b772 |
| 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; |
|
4c4cfe573486
close 55 - On login, add user to project and set current user of renken to this new user
rougeronj
parents:
433
diff
changeset
|
35 |
function startRenkan(){ |
| 288 | 36 |
var _renkan = new Rkns.Renkan({ |
| 308 | 37 |
manual_save: true, |
|
447
696958ea9ce7
Closes bug #62 : prevent image upload in renkan
ymh <ymh.work@gmail.com>
parents:
445
diff
changeset
|
38 |
user_color_editable: false, |
|
696958ea9ce7
Closes bug #62 : prevent image upload in renkan
ymh <ymh.work@gmail.com>
parents:
445
diff
changeset
|
39 |
user_name_editable: false, |
|
696958ea9ce7
Closes bug #62 : prevent image upload in renkan
ymh <ymh.work@gmail.com>
parents:
445
diff
changeset
|
40 |
show_user_color: false, |
|
299
8e00641076e7
remove renkan management to an other django app (see renkan hg repo)
cavaliet
parents:
298
diff
changeset
|
41 |
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
|
42 |
allow_image_upload : false, |
| 288 | 43 |
search: [ |
44 |
{ |
|
| 324 | 45 |
type: "HdaTags", |
46 |
lang: "{{LANGUAGE_CODE}}", |
|
47 |
image: "http://dbpedia.org/statics/dbpedia_logo.png", |
|
48 |
url: "{% url 'tag_search' %}" |
|
49 |
}, |
|
50 |
{ |
|
|
323
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
51 |
type: "HdaNotices", |
|
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
52 |
lang: "{{LANGUAGE_CODE}}", |
|
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
53 |
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
|
54 |
url: "{% url 'searchajax' %}" |
| 288 | 55 |
}, |
56 |
{ |
|
57 |
type: "Wikipedia", |
|
|
323
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
58 |
lang: "{{LANGUAGE_CODE}}" |
| 288 | 59 |
} |
60 |
], |
|
61 |
bins: [ |
|
62 |
{ |
|
63 |
type: "ResourceList", |
|
|
445
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
64 |
title: "{% trans 'Ressources' %}", |
| 288 | 65 |
list: [ |
|
445
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
66 |
{ |
|
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
67 |
url: "http://www.histoiredesarts.culture.fr/", |
|
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
68 |
title: "Histoire des arts", |
|
a74ec9e02042
correct #35 + add tag abstract + improve translations
ymh <ymh.work@gmail.com>
parents:
440
diff
changeset
|
69 |
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
|
70 |
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
|
71 |
} |
| 288 | 72 |
] |
73 |
} |
|
74 |
], |
|
75 |
/*property_files: [ "data/properties.json" ], |
|
76 |
node_fill_color: false*/ |
|
|
323
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
diff
changeset
|
77 |
language: "{{LANGUAGE_CODE}}" |
| 288 | 78 |
}); |
| 308 | 79 |
|
|
412
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
80 |
//_create_user_// |
|
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
81 |
|
|
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
82 |
//_____________// |
|
457
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
83 |
io_options = { |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
84 |
url: "{% url 'renkan_get_put' %}" + window.location.search, |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
85 |
{% if user.is_authenticated %} |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
86 |
user_authenticated: true, |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
87 |
user_id:"{{ user.id }}", |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
88 |
user_name:"{{ user }}", |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
89 |
{% else %} |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
90 |
user_authenticated: false, |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
91 |
{% endif %} |
|
1121fd3d8b0e
user_id and user_name correctly passed through io_options
rougeronj
parents:
447
diff
changeset
|
92 |
}; |
| 308 | 93 |
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
|
94 |
|
|
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
|
95 |
_rkn = _renkan; |
| 308 | 96 |
}; |
97 |
|
|
98 |
$(function() { |
|
99 |
var form; |
|
| 365 | 100 |
|
| 308 | 101 |
dialog = $( "#dialog-form" ).dialog({ |
102 |
autoOpen: false, |
|
| 385 | 103 |
width: 520, |
104 |
modal: true, |
|
105 |
create: function (event, ui) { |
|
106 |
$("#login-popup-close").click(function(){ |
|
107 |
dialog.dialog("close"); |
|
108 |
}); |
|
109 |
} |
|
| 365 | 110 |
}); |
| 308 | 111 |
|
112 |
function manageLoginForm(e, form){ |
|
113 |
e.preventDefault(); |
|
114 |
f = $(form); |
|
115 |
$.ajax({ |
|
116 |
type: f.attr("method"), |
|
117 |
url: f.attr("action"), |
|
118 |
data: f.serialize(), |
|
119 |
success: function(data, textStatus, jqXHR) { |
|
| 310 | 120 |
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
|
121 |
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
|
122 |
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
|
123 |
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
|
124 |
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
|
125 |
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
|
126 |
|
|
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
|
127 |
_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
|
128 |
$("#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
|
129 |
$(".Rk-Save-Button").click(); |
| 310 | 130 |
dialog.dialog( "close" ); |
131 |
return true; |
|
132 |
} |
|
| 308 | 133 |
$("#dialog-form").html(data); |
134 |
// in case, login failed, we reassign the behaviour |
|
135 |
form = dialog.find( "form" ).on( "submit", function( event ) { |
|
136 |
manageLoginForm(event, this); |
|
137 |
}); |
|
138 |
} |
|
139 |
}); |
|
140 |
} |
|
141 |
|
|
| 365 | 142 |
form = dialog.find( "form" ).on( "submit", function( event ) { |
143 |
manageLoginForm(event, this); |
|
144 |
}); |
|
145 |
|
|
146 |
//help dialog init |
|
147 |
var help_dialog = $( "#help-container" ).dialog({ |
|
148 |
autoOpen: false, |
|
149 |
height: 330, |
|
150 |
width: 880, |
|
151 |
resizable: false, |
|
152 |
draggable: false, |
|
153 |
create: function (event, ui) { |
|
154 |
var help_slideshow = $('#help-slideshow').bjqs({ |
|
155 |
responsive:false, |
|
156 |
height: 320, |
|
157 |
width: 870, |
|
158 |
animtype: 'slide', |
|
159 |
showcontrols: true, |
|
160 |
centercontrols: false, |
|
161 |
nexttext: "", |
|
162 |
showmarkers : false, |
|
163 |
automatic: false |
|
164 |
}); |
|
165 |
|
|
166 |
$("#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
|
167 |
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
|
168 |
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
|
169 |
} |
|
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
170 |
else{ |
|
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
171 |
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
|
172 |
} |
| 365 | 173 |
}); |
174 |
$(".img-close").click(function(){ |
|
175 |
help_dialog.dialog("close"); |
|
176 |
}); |
|
177 |
} |
|
178 |
}); |
|
179 |
}); |
|
| 308 | 180 |
|
| 288 | 181 |
</script> |
182 |
{% endblock %} |
|
183 |
||
184 |
{% 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
|
185 |
<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
|
186 |
<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
|
187 |
<div class="renkan_help"> |
| 409 | 188 |
<ul> |
|
407
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
189 |
<li> |
| 433 | 190 |
{% trans 'Change organisation' %} |
| 409 | 191 |
<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
|
192 |
<ul> |
| 420 | 193 |
{% if 'shape=vert' in switch_shape_url.current %} |
| 433 | 194 |
<li id="graph-line"><a href="">✓ {% trans 'View graph in column' %}</a></li> |
195 |
<li id="graph-lineH"><a href="{{ switch_shape_url.horiz }}"> {% trans 'View graph in line' %}</a></li> |
|
196 |
<li id="graph-circle"><a href="{{ switch_shape_url.circle }}"> {% trans 'View graph in circle' %}</a></li> |
|
| 420 | 197 |
{% elif 'shape=horiz' in switch_shape_url.current %} |
| 433 | 198 |
<li id="graph-line"><a href="{{ switch_shape_url.vert }}"> {% trans 'View graph in column' %}</a></li> |
199 |
<li id="graph-lineH"><a href="">✓ {% trans 'View graph in line' %}</a></li> |
|
200 |
<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
|
201 |
{% else %} |
| 433 | 202 |
<li id="graph-line"><a href="{{ switch_shape_url.vert }}"> {% 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="">✓ {% 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
|
205 |
{% endif %} |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
206 |
</ul> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
207 |
</li> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
208 |
</ul> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
209 |
<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
|
210 |
</div> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
211 |
</div> |
| 308 | 212 |
<div id="dialog-form" title="Identification"> |
213 |
{% include 'ajax_identification/ajax_login.html' %} |
|
214 |
</div> |
|
| 365 | 215 |
|
216 |
<div id="help-container" class=""> |
|
| 423 | 217 |
{% include 'help_popup.html' %} |
| 336 | 218 |
</div> |
| 365 | 219 |
|
| 288 | 220 |
<div class="rnk-wrapper"> |
221 |
<div class="rnk-container"> |
|
222 |
<div id="renkan"></div> |
|
223 |
</div> |
|
| 308 | 224 |
</div> |
| 288 | 225 |
{% endblock %} |