| author | rougeronj |
| Thu, 29 Jan 2015 17:23:04 +0100 | |
| changeset 435 | 0116feeb4fa3 |
| parent 433 | bffe8dfa3a7f |
| child 440 | 4c4cfe573486 |
| 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"> |
| 308 | 34 |
var io_options = {}, dialog=false; |
| 288 | 35 |
function startRenkan(){ |
36 |
var _renkan = new Rkns.Renkan({ |
|
| 308 | 37 |
manual_save: true, |
|
412
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
38 |
user_color_editable: false, |
|
424
33a1260273bc
Close #55 - on Login success set username, add the user to project if not done yet
rougeronj
parents:
423
diff
changeset
|
39 |
user_name_editable: false, |
|
417
fd847122d85d
Close #28 - add and show_user_color to false to hide the color picker
rougeronj
parents:
415
diff
changeset
|
40 |
show_user_color: false, |
|
412
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
41 |
{% if user.is_authenticated %} |
| 415 | 42 |
user_id:"{{ user.id }}", |
43 |
user_name:"{{ user }}", |
|
|
412
436f3ec9d840
prevent from editing color (todo: hide color field) + pass user name to Renkan
rougeronj
parents:
411
diff
changeset
|
44 |
{% endif %} |
|
299
8e00641076e7
remove renkan management to an other django app (see renkan hg repo)
cavaliet
parents:
298
diff
changeset
|
45 |
static_url : "{% static 'renkanmanager/lib/renkan/' %}", |
| 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", |
|
67 |
title: "Ressources", |
|
68 |
list: [ |
|
69 |
{ |
|
70 |
url: "http://www.histoiredesarts.culture.fr/", |
|
71 |
title: "Histoire des arts", |
|
72 |
description: "Portail Histoire des arts sur culture.fr", |
|
73 |
image: "http://www.culture.fr/extension/culture_fr/design/culture/images/favicon.ico" |
|
|
323
67cff4e39ad8
search in notice json, and renkan search bin for notices.
cavaliet
parents:
311
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 |
//_____________// |
| 310 | 86 |
io_options = { url: "{% url 'renkan_get_put' %}" + window.location.search, user_authenticated: {% if user.is_authenticated %}true{% else %}false{% endif %} }; |
| 308 | 87 |
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
|
88 |
|
| 308 | 89 |
}; |
90 |
|
|
91 |
$(function() { |
|
92 |
var form; |
|
| 365 | 93 |
|
| 308 | 94 |
dialog = $( "#dialog-form" ).dialog({ |
95 |
autoOpen: false, |
|
| 385 | 96 |
width: 520, |
97 |
modal: true, |
|
98 |
create: function (event, ui) { |
|
99 |
$("#login-popup-close").click(function(){ |
|
100 |
dialog.dialog("close"); |
|
101 |
}); |
|
102 |
} |
|
| 365 | 103 |
}); |
| 308 | 104 |
|
105 |
function manageLoginForm(e, form){ |
|
106 |
e.preventDefault(); |
|
107 |
f = $(form); |
|
108 |
$.ajax({ |
|
109 |
type: f.attr("method"), |
|
110 |
url: f.attr("action"), |
|
111 |
data: f.serialize(), |
|
112 |
success: function(data, textStatus, jqXHR) { |
|
| 310 | 113 |
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
|
114 |
if(d.hasClass("ok")){ |
| 310 | 115 |
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
|
116 |
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
|
117 |
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
|
118 |
io_options.user_name= $("#username",d).html(); |
|
33a1260273bc
Close #55 - on Login success set username, add the user to project if not done yet
rougeronj
parents:
423
diff
changeset
|
119 |
|
|
33a1260273bc
Close #55 - on Login success set username, add the user to project if not done yet
rougeronj
parents:
423
diff
changeset
|
120 |
$("#menu.profile").html(d.html()); |
|
33a1260273bc
Close #55 - on Login success set username, add the user to project if not done yet
rougeronj
parents:
423
diff
changeset
|
121 |
$(".Rk-CurrentUser-Name").html(io_options.user_name); |
| 310 | 122 |
dialog.dialog( "close" ); |
123 |
$(".Rk-Save-Button").click(); |
|
124 |
return true; |
|
125 |
} |
|
| 308 | 126 |
$("#dialog-form").html(data); |
127 |
// in case, login failed, we reassign the behaviour |
|
128 |
form = dialog.find( "form" ).on( "submit", function( event ) { |
|
129 |
manageLoginForm(event, this); |
|
130 |
}); |
|
131 |
} |
|
132 |
}); |
|
133 |
} |
|
134 |
|
|
| 365 | 135 |
form = dialog.find( "form" ).on( "submit", function( event ) { |
136 |
manageLoginForm(event, this); |
|
137 |
}); |
|
138 |
|
|
139 |
//help dialog init |
|
140 |
var help_dialog = $( "#help-container" ).dialog({ |
|
141 |
autoOpen: false, |
|
142 |
height: 330, |
|
143 |
width: 880, |
|
144 |
resizable: false, |
|
145 |
draggable: false, |
|
146 |
create: function (event, ui) { |
|
147 |
var help_slideshow = $('#help-slideshow').bjqs({ |
|
148 |
responsive:false, |
|
149 |
height: 320, |
|
150 |
width: 870, |
|
151 |
animtype: 'slide', |
|
152 |
showcontrols: true, |
|
153 |
centercontrols: false, |
|
154 |
nexttext: "", |
|
155 |
showmarkers : false, |
|
156 |
automatic: false |
|
157 |
}); |
|
158 |
|
|
159 |
$("#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
|
160 |
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
|
161 |
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
|
162 |
} |
|
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
163 |
else{ |
|
c70c34166758
Shrink help icon + Prevent the icon to disappear (with the text "circular view") when renkan is modified
rougeronj
parents:
366
diff
changeset
|
164 |
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
|
165 |
} |
| 365 | 166 |
}); |
167 |
$(".img-close").click(function(){ |
|
168 |
help_dialog.dialog("close"); |
|
169 |
}); |
|
170 |
} |
|
171 |
}); |
|
172 |
}); |
|
| 308 | 173 |
|
| 288 | 174 |
</script> |
175 |
{% endblock %} |
|
176 |
||
177 |
{% 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
|
178 |
<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
|
179 |
<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
|
180 |
<div class="renkan_help"> |
| 409 | 181 |
<ul> |
|
407
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
182 |
<li> |
| 433 | 183 |
{% trans 'Change organisation' %} |
| 409 | 184 |
<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
|
185 |
<ul> |
| 420 | 186 |
{% if 'shape=vert' in switch_shape_url.current %} |
| 433 | 187 |
<li id="graph-line"><a href="">✓ {% trans 'View graph in column' %}</a></li> |
188 |
<li id="graph-lineH"><a href="{{ switch_shape_url.horiz }}"> {% trans 'View graph in line' %}</a></li> |
|
189 |
<li id="graph-circle"><a href="{{ switch_shape_url.circle }}"> {% trans 'View graph in circle' %}</a></li> |
|
| 420 | 190 |
{% elif 'shape=horiz' in switch_shape_url.current %} |
| 433 | 191 |
<li id="graph-line"><a href="{{ switch_shape_url.vert }}"> {% trans 'View graph in column' %}</a></li> |
192 |
<li id="graph-lineH"><a href="">✓ {% trans 'View graph in line' %}</a></li> |
|
193 |
<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
|
194 |
{% else %} |
| 433 | 195 |
<li id="graph-line"><a href="{{ switch_shape_url.vert }}"> {% trans 'View graph in column' %}</a></li> |
196 |
<li id="graph-lineH"><a href="{{ switch_shape_url.horiz }}"> {% trans 'View graph in line' %}</a></li> |
|
197 |
<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
|
198 |
{% endif %} |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
199 |
</ul> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
200 |
</li> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
201 |
</ul> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
202 |
<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
|
203 |
</div> |
|
3f64001a8e1f
Split css of help Popup in new file + add dropdown to choose circle or line shape
rougeronj
parents:
385
diff
changeset
|
204 |
</div> |
| 308 | 205 |
<div id="dialog-form" title="Identification"> |
206 |
{% include 'ajax_identification/ajax_login.html' %} |
|
207 |
</div> |
|
| 365 | 208 |
|
209 |
<div id="help-container" class=""> |
|
| 423 | 210 |
{% include 'help_popup.html' %} |
| 336 | 211 |
</div> |
| 365 | 212 |
|
| 288 | 213 |
<div class="rnk-wrapper"> |
214 |
<div class="rnk-container"> |
|
215 |
<div id="renkan"></div> |
|
216 |
</div> |
|
| 308 | 217 |
</div> |
| 288 | 218 |
{% endblock %} |