forked from rapidpro/rapidpro
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathframe.html
292 lines (279 loc) · 11.5 KB
/
frame.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!DOCTYPE HTML>
{% load humanize i18n smartmin sms compress static %}
{% block html-tag %}
<html lang="{{ LANGUAGE_CODE }}">
{% endblock html-tag %}
<head>
<title>
{% block head-title %}
{% if title %}
{{ title }}
{% else %}
{{ branding.name }}
{% endif %}
{% endblock head-title %}
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta name="description"
content="{% block page-description %}{{ branding.name }} lets you visually build interactive SMS applications and launch them anywhere in the world.{% endblock page-description %}">
<meta name="author" content="TextIt">
<meta http-equiv="X-UA-Compatible" content="IE=10">
{% block extra-meta %}
{% endblock extra-meta %}
<script src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
{% compress js %}
<script src="{{ STATIC_URL }}rest_framework/js/prettify-min.js"></script>
<script src="{{ STATIC_URL }}highcharts/highstock.js?v=9.3.0"></script>
<script src="{{ STATIC_URL }}highcharts/modules/drilldown.js"></script>
<script src="{{ STATIC_URL }}qrious/dist/qrious.min.js"></script>
<script src="{{ STATIC_URL }}rest_framework/js/prettify-min.js"></script>
<script src="{{ STATIC_URL }}croppie/croppie.js"></script>
{% endcompress %}
{% compress js %}
<script src="{{ STATIC_URL }}js/utils.js"></script>
{% endcompress %}
<script type="text/javascript">
function isMobile() {
return window.innerWidth < 600;
}
function updateFrameForMobile() {
var body = document.querySelector("body");
if (body) {
if (isMobile()) {
body.classList.add("mobile");
} else {
body.classList.remove("mobile");
}
}
}
var static_url = "{{ STATIC_URL }}";
var org_id = {% if active_org %}{{ active_org.id }}{% else %}null{% endif %};
var tembaVersion = "{{ temba_version }}";
var params = "{{ url_params|safe }}";
var anon_org = asBool("{{ user_org.is_anon }}");
var menuSelection = "{{ temba_menu_selection }}";
function handleMenuReady() {
var selection = window.location.pathname.split("/").filter(function(path) {
return !!path
});
var menu = document.querySelector("temba-menu");
if (menu && menuSelection) {
menu.setFocusedItem(menuSelection);
}
}
function handleMenuListSelection(evt) {
const selected = evt.detail.selected;
document.activeElement.blur();
if (selected.target_url) {
spaGet(evt.detail.selected.target_url);
} else if (selected.type == "workspace") {
handleWorkspaceChanged(selected.id);
}
}
// set our initial title
document.addEventListener("DOMContentLoaded", function(event) {
const titleText = document.querySelector("#title-text");
if (titleText) {
document.title = titleText.innerText;
}
updateFrameForMobile();
if (isMobile()) {
var menu = document.querySelector("temba-menu");
if (menu) {
menu.collapsed = true;
}
}
window.addEventListener('resize', function(event) {
updateFrameForMobile();
});
});
document.addEventListener("temba-workspace-settings", function(event) {
spaGet('/org/workspace');
var menu = document.querySelector('temba-menu');
if (menu) {
menu.click();
}
});
document.addEventListener('temba-open-tab', function(event) {
const item = event.detail;
if (item.href) {
window.open(item.href, '_blank');
}
});
</script>
{% block scripts %}
{% compress js %}
<script src="{{ STATIC_URL }}js/temba.js"></script>
<script src="{{ STATIC_URL }}js/frame.js"></script>
<script src="{{ STATIC_URL }}js/labels.js"></script>
{% endcompress %}
{% endblock scripts %}
{% for script in flow_editor_scripts %}<script type="text/javascript" src="{{script}}"></script>{% endfor %}
{% for style in flow_editor_styles %}<link rel="stylesheet" href="{{ style }}" type="text/css">{% endfor %}
{% block favico %}
<link type="image/ico" rel="shortcut icon" href="{{ STATIC_URL }}images/favicon.ico">
{% endblock favico %}
{% block styles %}
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:200,300,400,500">
{% compress css %}
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}css/tailwind.css">
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}css/temba-components.css">
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}css/frame.css">
<link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}css/mobile.css">
<style>
#error-dialog {
--header-bg: var(--color-alert);
}
* {
font-synthesis: none !important;
}
</style>
{% endcompress %}
{% endblock styles %}
{% include "includes/frame_top.html" %}
</head>
{% block body %}
<body class="bg-gradient" id="pageBody">
{% if COMPONENTS_DEV_MODE %}
<script type="module">
import '/out-tsc/temba-modules.js';
</script>
{% else %}
{% compress js %}
<script src="{% static '@nyaruka/temba-components/dist/temba-components.js' %}"></script>
{% endcompress %}
{% endif %}
{% if user_org %}
<temba-store {% if org_perms.globals.global_list %}globals="/api/v2/globals.json"{% endif %}
completion="/mr/docs/{{ LANGUAGE_CODE }}/editor.json"
languages="/org/languages/"
fields="/api/v2/fields.json"
groups="/api/v2/groups.json"
workspace="/api/v2/workspace.json"
shortcuts="/api/internal/shortcuts.json"
users="/api/v2/users.json">
</temba-store>
{% else %}
<temba-store>
</temba-store>
{% endif %}
<div class="flex flex-col h-full">
{% block post-header %}
{% endblock post-header %}
<!-- Content -->
{% block page-container %}
<!-- {{temba_version}} -->
<temba-mask>
</temba-mask>
<temba-modax id="shared-modax" -temba-error="showErrorDialog();">
</temba-modax>
<temba-dialog id="shared-dialog">
</temba-dialog>
{% block error-dialog %}
<temba-dialog id="error-dialog" header="Uh oh!">
<div class="p-6">
{% blocktrans trimmed %}
We tried our best, but there was an error processing your request. If this keeps happening, please refresh your browser.
{% endblocktrans %}
</div>
</temba-dialog>
{% endblock error-dialog %}
<temba-toast duration="5000" error-sticky>
</temba-toast>
<div class="ajax-scripts"></div>
<div class="flex-col">
<div style="height:100vh;width:100%" class="flex flex-col">
{% include "includes/servicing.html" %}
<div style="height:100vh;width:100%;overflow:hidden" class="flex widget-container">
<div class="folders">
<temba-menu style="height:100%"
endpoint="{% url 'orgs.org_menu' %}"
onchange="handleMenuChanged(event)"
-temba-button-clicked="handleMenuClicked(event)"
-temba-ready="handleMenuReady"
-temba-selection="handleMenuListSelection"
class="{% if servicing %}{% endif %}"
id="nav">
{% block menu-header %}
{% endblock menu-header %}
</temba-menu>
</div>
<div class="flex-grow spa-container flex flex-col initial-load">
<div class="spa-loader hide absolute">
<div style="display:flex;z-index:100000;margin-top:0.1em;margin-left:1em" class="wrapper">
<temba-loading size="16" units="6">
</temba-loading>
</div>
</div>
<div class="spa-content p-5 pb-5">
{% block extra-style %}
{% endblock extra-style %}
{% block extra-script %}
{% endblock extra-script %}
{% block page-header %}
{% csrf_token %}
<div class="mb-4">
<div class="no-menu flex items-center">
<div class="text-container text-2xl text-gray-700">
<div class="flex flex-row">
{% block title %}
<div id="title-text">
{% block title-text %}
{{ title }}
{% endblock title-text %}
</div>
{% endblock title %}
</div>
</div>
<div class="line flex-grow mr-2 ml-6">
<div class="h-0 border border-gray-200"></div>
</div>
{% if has_context_menu %}
{% include "spa_page_menu.html" %}
{% endif %}
</div>
<div class="text-lg text-gray-600">
{% block subtitle %}
{% endblock subtitle %}
</div>
</div>
{% endblock page-header %}
{% block alert-messages %}
{% if user_org.is_suspended %}
{% include "org_suspended_include.html" %}
{% endif %}
{% endblock alert-messages %}
{% block content %}
{% endblock content %}
</div>
{% block footer %}
<div class="spa-footer text-center text-gray-500 py-6 bg-gray-200">
<!--
License requires that the copyright attribution remain, please do not modify.
-->
Copyright © 2012-2025 TextIt. All rights reserved.
</div>
{% endblock footer %}
</div>
</div>
</div>
</div>
<temba-lightbox>
</temba-lightbox>
{% endblock page-container %}
</div>
{% trans "Delete" as title %}
<temba-dialog header="{{ title|escapejs }}"
primaryButtonName="{{ title|escapejs }}"
destructive="true"
class="hidden"
id="general-delete-confirmation">
<div class="p-6 confirmation-body">{% trans "Are you sure you want to continue? This cannot be undone." %}</div>
</temba-dialog>
<!-- media associated with any form we are displaying -->
{% if form %}{{ form.media }}{% endif %}
</body>
{% endblock body %}
</html>