ide.html 2.07 KB
Newer Older
Hubert Denkmair's avatar
Hubert Denkmair committed
1
2
3
4
{% extends 'base.html' %}
{% load widget_tweaks %}
{% load static %}

Hubert Denkmair's avatar
Hubert Denkmair committed
5
6
7
8
{% block title %}
    <title>IDE - Schlangenprogrammiernacht 2018</title>
{% endblock %}

Hubert Denkmair's avatar
Hubert Denkmair committed
9
10
11
12
13
{% block css %}
  <link rel="stylesheet" type="text/css" href="{% static "ide/ide.css" %}" />
{% endblock %}

{% block content %}
Hubert Denkmair's avatar
Hubert Denkmair committed
14
<form id="snake_edit_form" method="post">
15
16
17
  {% csrf_token %}
  <textarea id="code" name="code">{{ snake.code }}</textarea>
</form>
Hubert Denkmair's avatar
Hubert Denkmair committed
18

Hubert Denkmair's avatar
Hubert Denkmair committed
19
20
21
22
23
24
<div id="ide" class="fullwindow">
  <div id="editor"></div>
  <div id="preview"></div>
  <div id="log"></div>
  <div id="tools">
    <div id="toolbar">
Hubert Denkmair's avatar
Hubert Denkmair committed
25
      <button id="bt_run" title="Ctrl+R">run</button>
Hubert Denkmair's avatar
Hubert Denkmair committed
26
      <button id="bt_restart">restart</button>
Hubert Denkmair's avatar
Hubert Denkmair committed
27
      <button id="bt_stop">stop</button>
Hubert Denkmair's avatar
Hubert Denkmair committed
28
29
30
      <button id="bt_save" title="Ctrl+S">save</button>
      <button id="bt_save_as" title="Ctrl+Shift+S">save as</button>
      <button id="bt_load" title="Ctrl+O">load</button>
Hubert Denkmair's avatar
Hubert Denkmair committed
31
32
33
34
35
      <button>preferences</button>
    </div>
  </div>
</div>

Hubert Denkmair's avatar
Hubert Denkmair committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<div class="modal">
  <div id="safe_as_dialog">
    <header>save current version as</header>
    <div class="main">
      <label for="save_as_title">Title:</label>
      <input id="save_as_title">
    </div>
    <footer>
      <button class="bt_ok">Save</button>
      <button class="bt_cancel">Cancel</button>
    </footer>
  </div>
</div>

Hubert Denkmair's avatar
Hubert Denkmair committed
50
51
52
53
54
55
56
57
58
59
60
61
62
<div class="modal">
  <div id="load_dialog">
    <header>load previous version</header>
    <div class="main">
      <div class="list"></div>
    </div>
    <footer>
      <button class="bt_ok">Load</button>
      <button class="bt_cancel">Cancel</button>
    </footer>
  </div>
</div>

Hubert Denkmair's avatar
Hubert Denkmair committed
63
64
65
{% endblock %}

{% block js %}
Hubert Denkmair's avatar
Hubert Denkmair committed
66
67
68
69
70
71
<script type="text/javascript">
  let snake_title = "{{ snake.comment | default:"" }}";
  let snake_id = {{ snake.id | default:"null" }};
  let viewer_key = "{{ profile.viewer_key }}";
  let csrftoken = $("[name=csrfmiddlewaretoken]").val();
</script>
Hubert Denkmair's avatar
Hubert Denkmair committed
72
<script src="{% static "ide/ace/src-noconflict/ace.js" %}" type="text/javascript" charset="utf-8"></script>
73
<script src="{% static "ide/ide.js" %}" type="text/javascript" charset="utf-8"></script>
Hubert Denkmair's avatar
Hubert Denkmair committed
74
75
{% include "visualization/js.html" %}
{% endblock %}