fix missing license headers
[osm/LW-UI.git] / descriptorhandler / template / descriptor_view_base.html
1 <!--
2 Copyright 2019 EveryUP srl
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 -->
16
17 {% extends "base.html" %}
18
19 {% load staticfiles %}
20
21 {% block head_block %}
22 {{ block.super }}
23
24
25 <!-- Codemirror core CSS -->
26 <link rel="stylesheet" href="/static/node_modules/codemirror/lib/codemirror.css" >
27 <link rel="stylesheet" href="/static/node_modules/codemirror/addon/fold/foldgutter.css" />
28 <link rel="stylesheet" href="/static/node_modules/codemirror/theme/neat.css" >
29 <link rel="stylesheet" href="/static/node_modules/codemirror/addon/dialog/dialog.css" >
30 <link rel="stylesheet" href="/static/node_modules/codemirror/addon/display/fullscreen.css" >
31
32 {% endblock %}
33
34
35
36
37 {% block content_body %}
38 {{ block.super }}
39 <div class="row">
40 <div class="col-md-12">
41 <div class="nav-tabs-custom" style="position: relative;">
42 <ul class="nav nav-tabs" >
43 {% block tab_pane_button_list %}
44
45 {% endblock %}
46
47 {% block nav_buttons_list %}
48
49 {% endblock %}
50
51 </ul>
52 <div class="alert alert-success" id="success-alert" style="position: absolute; z-index: 100; top: 44px; left: 0;
53 width: 100%;
54 border-radius: 1px;
55 background-color: rgba(0, 166, 90, 0.8) !important;
56 text-align: center;
57 border-color: rgba(0, 141, 76, 0.4);" hidden>
58 <button type="button" class="close" onclick="$('#success-alert').toggle()">x</button>
59 <strong>Success! </strong>
60 Descriptor updated!
61 </div>
62 <div class="tab-content">
63 {% block tab_pane_list %}
64
65 {% endblock %}
66 </div>
67 <!-- /.tab-content -->
68
69
70
71
72 </div>
73
74 </div>
75 </div>
76 {% endblock %}
77
78 {% block resource_block %}
79 {{ block.super }}
80
81
82 <script src="/static/node_modules/codemirror/lib/codemirror.js" ></script>
83 <script src="/static/node_modules/codemirror/addon/fold/foldcode.js" ></script>
84 <script src="/static/node_modules/codemirror/addon/fold/foldgutter.js" ></script>
85 <script src="/static/node_modules/codemirror/addon/fold/brace-fold.js" ></script>
86 <script src="/static/node_modules/codemirror/mode/javascript/javascript.js" ></script>
87 <script src="/static/node_modules/codemirror/mode/yaml/yaml.js" ></script>
88 <script src="/static/node_modules/codemirror/mode/markdown/markdown.js" ></script>
89 <script src="/static/node_modules/codemirror/addon/search/searchcursor.js" ></script>
90 <script src="/static/node_modules/codemirror/addon/search/search.js" ></script>
91 <script src="/static/node_modules/codemirror/addon/dialog/dialog.js" ></script>
92 <script src="/static/node_modules/codemirror/addon/display/autorefresh.js" ></script>
93 <script src="/static/node_modules/codemirror/addon/edit/matchbrackets.js" ></script>
94 <script src="/static/node_modules/codemirror/addon/edit/closebrackets.js" ></script>
95 <script src="/static/node_modules/codemirror/addon/display/fullscreen.js" ></script>
96 <script src="/static/node_modules/codemirror/keymap/sublime.js" ></script>
97
98
99 <script>
100
101 var json_editor_settings = {
102 mode: "javascript",
103 showCursorWhenSelecting: true,
104 autofocus: true,
105 lineNumbers: true,
106 lineWrapping: true,
107 foldGutter: true,
108 gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
109 autoCloseBrackets: true,
110 matchBrackets: true,
111 extraKeys: {
112 "F11": function (cm) {
113 cm.setOption("fullScreen", !cm.getOption("fullScreen"));
114 },
115 "Esc": function (cm) {
116 if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
117 },
118 "Ctrl-Q": function (cm) {
119 cm.foldCode(cm.getCursor());
120 }
121 },
122 theme: "neat",
123 keyMap: "sublime"
124 };
125
126 var yaml_editor_settings = {
127 mode: "yaml",
128 showCursorWhenSelecting: true,
129 autofocus: true,
130 autoRefresh: true,
131 lineNumbers: true,
132 lineWrapping: true,
133 foldGutter: true,
134 gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
135 autoCloseBrackets: true,
136 matchBrackets: true,
137 extraKeys: {
138 "F11": function (cm) {
139 cm.setOption("fullScreen", !cm.getOption("fullScreen"));
140 },
141 "Esc": function (cm) {
142 if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
143 },
144 "Ctrl-Q": function (cm) {
145 cm.foldCode(cm.getCursor());
146 }
147 },
148 theme: "neat",
149 keyMap: "sublime"
150 };
151
152
153 function goToGraph() {
154 window.location.href = '/projects/descriptors/composer?type={{descriptor_type}}&id={{descriptor_id}}'
155 }
156 </script>
157 {% endblock %}