server/src/metaeducation/templates/renkan_edit.html
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--
add tracking of close + first version of tracking server side
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
     1
{% extends "base.html" %}
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
     2
{% load staticfiles %}
70
97e57904f11d implemented client-side error handling + translation
durandn
parents: 69
diff changeset
     3
{% load i18n %}
1
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
     4
{% block js_import %}
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
     5
  {{block.super}}
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
     6
  <script src="{% static 'renkanmanager/lib/jquery-mousewheel/jquery.mousewheel.js' %}"></script>
73
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
     7
  <script src="{% static 'metaeducation/lib/js.cookie.min.js' %}"></script>
1
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
     8
  <script src="{% static 'renkanmanager/lib/lodash/lodash.js' %}"></script>
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
     9
  <script src="{% static 'renkanmanager/lib/backbone/backbone.js' %}"></script>
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    10
  <script src="{% static 'renkanmanager/lib/backbone-relational/backbone-relational.js' %}"></script>
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    11
  <script src="{% static 'renkanmanager/lib/paper/paper-full.js' %}"></script>
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    12
  <script type="text/javascript">
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    13
      var require = {
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    14
          baseUrl: "{% static 'renkanmanager/lib/' %}"
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    15
      };
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    16
  </script>
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    17
  <script src="{% static 'renkanmanager/lib/requirejs/require.js' %}"></script>
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    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
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    20
  <script src="{% static 'metaeducation/js/mtdc-tracking.js' %}"></script>
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    21
  <script src="{% static 'metaeducation/js/mtdc-tracking-worker.js' %}"></script>
1
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    22
  <script type="text/javascript">
73
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    23
1
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    24
      function startRenkan(){
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    25
          var _renkan = new Rkns.Renkan({
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    26
              static_url : "{% static 'renkanmanager/lib/renkan/' %}",
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    27
              show_bins: false,
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    28
              language: "{{ LANGUAGE_CODE }}",
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    29
              url_parameters: false,
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    30
              update_url: false,
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    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
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    39
              user_color_editable: false,
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    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
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    50
          });
73
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    51
          _renkan.setCurrentUser('{{ user.external_id }}', '{{ user.username }}');
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    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
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    54
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    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
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    57
              url: "{% url 'v1.0:renkan_detail' renkan_guid=renkan_guid %}?content_only=true",
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    58
              user_id: '{{ user.external_id }}',
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    59
              user_name: '{{ user.username }}'
1
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    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
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    64
      };
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    65
  </script>
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    66
{% endblock js_import %}
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    67
{% block css_import %}
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    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
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    70
{% endblock css_import %}
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    71
{% block navbar %}
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    72
{% endblock navbar %}
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    73
{% block main_content %}
5f50937893ac Commit work on metaeducation
durandn
parents:
diff changeset
    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
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    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
f64fb2da5a54 add editin tracking
ymh <ymh.work@gmail.com>
parents: 70
diff changeset
    93
{% endblock main_content %}