| author | ymh <ymh.work@gmail.com> |
| Sun, 03 Jul 2016 14:16:07 +0200 | |
| changeset 74 | fa4fd5e8b54e |
| parent 73 | f64fb2da5a54 |
| child 75 | ada126bb171a |
| permissions | -rw-r--r-- |
| 1 | 1 |
{% extends "base.html" %} |
2 |
{% load staticfiles %} |
|
|
70
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
3 |
{% load i18n %} |
| 1 | 4 |
{% block js_import %} |
5 |
{{block.super}} |
|
6 |
<script src="{% static 'renkanmanager/lib/jquery-mousewheel/jquery.mousewheel.js' %}"></script> |
|
| 73 | 7 |
<script src="{% static 'metaeducation/lib/js.cookie.min.js' %}"></script> |
| 1 | 8 |
<script src="{% static 'renkanmanager/lib/lodash/lodash.js' %}"></script> |
9 |
<script src="{% static 'renkanmanager/lib/backbone/backbone.js' %}"></script> |
|
10 |
<script src="{% static 'renkanmanager/lib/backbone-relational/backbone-relational.js' %}"></script> |
|
11 |
<script src="{% static 'renkanmanager/lib/paper/paper-full.js' %}"></script> |
|
12 |
<script type="text/javascript"> |
|
13 |
var require = { |
|
14 |
baseUrl: "{% static 'renkanmanager/lib/' %}" |
|
15 |
}; |
|
16 |
</script> |
|
17 |
<script src="{% static 'renkanmanager/lib/requirejs/require.js' %}"></script> |
|
18 |
<script src="{% static 'renkanmanager/lib/renkan/js/renkan.js' %}"></script> |
|
|
69
0abec1f6a66f
Implemented client-side error notice for renkan in metaeducation
durandn
parents:
64
diff
changeset
|
19 |
<script src="{% static 'metaeducation/js/mtdc-save.js' %}"></script> |
| 73 | 20 |
<script src="{% static 'metaeducation/js/mtdc-tracking.js' %}"></script> |
21 |
<script src="{% static 'metaeducation/js/mtdc-tracking-worker.js' %}"></script> |
|
| 1 | 22 |
<script type="text/javascript"> |
| 73 | 23 |
|
| 1 | 24 |
function startRenkan(){ |
25 |
var _renkan = new Rkns.Renkan({ |
|
26 |
static_url : "{% static 'renkanmanager/lib/renkan/' %}", |
|
27 |
show_bins: false, |
|
28 |
language: "{{ LANGUAGE_CODE }}", |
|
29 |
url_parameters: false, |
|
30 |
update_url: false, |
|
31 |
user_authenticated: true, |
|
|
64
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
32 |
url_parameters: false, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
33 |
update_url: false, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
34 |
user_color_editable: false, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
35 |
show_user_color: false, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
36 |
show_search_field: true, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
37 |
show_user_list: false, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
38 |
user_name_editable: false, |
| 1 | 39 |
user_color_editable: false, |
40 |
show_user_color: false, |
|
|
64
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
41 |
show_save_button: true, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
42 |
show_export_button: false, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
43 |
show_open_button: false, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
44 |
show_addnode_button: true, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
45 |
show_addedge_button: true, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
46 |
show_bookmarklet: false, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
47 |
show_fullscreen_button: false, |
|
8745c7bcf096
removed some unecessary buttons at the top of the renkan editor (via config options)
durandn
parents:
1
diff
changeset
|
48 |
home_button_url: false, |
|
69
0abec1f6a66f
Implemented client-side error notice for renkan in metaeducation
durandn
parents:
64
diff
changeset
|
49 |
popup_editor: true, |
| 1 | 50 |
}); |
| 73 | 51 |
_renkan.setCurrentUser('{{ user.external_id }}', '{{ user.username }}'); |
52 |
||
|
74
fa4fd5e8b54e
add tracking of close + first version of tracking server side
ymh <ymh.work@gmail.com>
parents:
73
diff
changeset
|
53 |
var trackingWorker = Mtdc.TrackingWorker(_renkan, "{% url 'tracking_view' %}", "{% url 'tracking_view_close' %}"); |
| 73 | 54 |
|
55 |
Rkns.mtdcTracking(_renkan, trackingWorker); |
|
|
69
0abec1f6a66f
Implemented client-side error notice for renkan in metaeducation
durandn
parents:
64
diff
changeset
|
56 |
Rkns.mtdcJsonIO(_renkan, { |
| 73 | 57 |
url: "{% url 'v1.0:renkan_detail' renkan_guid=renkan_guid %}?content_only=true", |
58 |
user_id: '{{ user.external_id }}', |
|
59 |
user_name: '{{ user.username }}' |
|
| 1 | 60 |
}); |
|
74
fa4fd5e8b54e
add tracking of close + first version of tracking server side
ymh <ymh.work@gmail.com>
parents:
73
diff
changeset
|
61 |
$(window).on('beforeunload', function(e) { |
|
fa4fd5e8b54e
add tracking of close + first version of tracking server side
ymh <ymh.work@gmail.com>
parents:
73
diff
changeset
|
62 |
trackingWorker.closeProject(); |
|
fa4fd5e8b54e
add tracking of close + first version of tracking server side
ymh <ymh.work@gmail.com>
parents:
73
diff
changeset
|
63 |
}); |
| 1 | 64 |
}; |
65 |
</script> |
|
66 |
{% endblock js_import %} |
|
67 |
{% block css_import %} |
|
68 |
<link rel="stylesheet" href="{% static 'renkanmanager/lib/renkan/css/renkan.css' %}" /> |
|
|
69
0abec1f6a66f
Implemented client-side error notice for renkan in metaeducation
durandn
parents:
64
diff
changeset
|
69 |
<link rel="stylesheet" href="{% static 'metaeducation/css/style.css' %}" /> |
| 1 | 70 |
{% endblock css_import %} |
71 |
{% block navbar %} |
|
72 |
{% endblock navbar %} |
|
73 |
{% block main_content %} |
|
74 |
<div id="renkan"></div> |
|
|
69
0abec1f6a66f
Implemented client-side error notice for renkan in metaeducation
durandn
parents:
64
diff
changeset
|
75 |
<div id="renkanErrorModal" class="errorModal"> |
|
0abec1f6a66f
Implemented client-side error notice for renkan in metaeducation
durandn
parents:
64
diff
changeset
|
76 |
<div class="errorModal-cnt"> |
|
70
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
77 |
<div class="errorModal-header"> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
78 |
<h2>{% trans "The Renkan server has reported an error" %}</h2> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
79 |
</div> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
80 |
<div class="errorModal-body"> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
81 |
<p id="400Error_timestamp" class="errorMsg">{% trans "The Renkan graph you are trying to edit is currently being edited by another user. We advise you to reload the page." %}</p> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
82 |
<p id="400Error_other" class="errorMsg">{% trans "There was an error with the graph data sent to the Renkan server. If the problem persists after a page reload, please contact an administrator. Error message was : " %} </p> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
83 |
<p id="403Error" class="errorMsg">{% trans "You don't have the permission to edit this Renkan graph." %}</p> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
84 |
<p id="404Error" class="errorMsg">{% trans "The Renkan graph you are trying to edit or view doesn't exist" %}</p> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
85 |
<p id="500Error" class="errorMsg">{% trans "There was an error with the Renkan server. If the problem persists after a page reload, please contact an administrator. The error message was : " %}</p> |
| 73 | 86 |
<p id="503Error" class="errorMsg">{% trans "There was no response from the server. If the problem persists after a page reload, please contact an administrator." %}</p> |
|
70
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
87 |
</div> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
88 |
<div class="errorModal-footer"> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
89 |
<h4 id="renkanErrorReload">{% trans "Reload the page" %}</h4> |
|
97e57904f11d
implemented client-side error handling + translation
durandn
parents:
69
diff
changeset
|
90 |
</div> |
|
69
0abec1f6a66f
Implemented client-side error notice for renkan in metaeducation
durandn
parents:
64
diff
changeset
|
91 |
</div> |
|
0abec1f6a66f
Implemented client-side error notice for renkan in metaeducation
durandn
parents:
64
diff
changeset
|
92 |
</div> |
| 73 | 93 |
{% endblock main_content %} |