forked from nextcloud/circles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnavigate.php
More file actions
424 lines (377 loc) · 13.4 KB
/
Copy pathnavigate.php
File metadata and controls
424 lines (377 loc) · 13.4 KB
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
<?php
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@pontapreta.net>
* @copyright 2017
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
use OCA\Circles\Api\v1\Circles;
use OCA\Circles\AppInfo\Application;
script(Application::APP_NAME, 'vendor/notyf');
style(Application::APP_NAME, 'notyf');
Circles::addJavascriptAPI();
script(
Application::APP_NAME, [
'circles.app.elements', 'circles.app.actions',
'circles.app.navigation', 'circles.app.settings',
'circles.app', 'circles.app.results.circles', 'circles.app.results.members',
'circles.app.results.groups', 'circles.app.results.links'
]
);
style(Application::APP_NAME, 'navigation');
?>
<div id="circle-navigation" class="noborder" style="position: relative">
<div class="navigation-element" style="height: 100%; padding-top: 15px">
<input id="circles_new_name" type="text"
placeholder="<?php p($l->t('Create a new circle')); ?>"/>
<select id="circles_new_type" style="display: none;" class="select_none">
<option value="" style="font-style: italic"> <?php p(
$l->t("Select a circle type")
); ?></option>
<?php
// Personal Circle
if ($_['allowed_circles'][\OCA\Circles\Model\Circle::CIRCLES_PERSONAL]) {
print_unescaped(
sprintf(
'<option value="%s">%s</option>',
\OCA\Circles\Model\Circle::CIRCLES_PERSONAL,
$l->t("Create a personal circle")
)
);
}
// Public Circle
if ($_['allowed_circles'][\OCA\Circles\Model\Circle::CIRCLES_PUBLIC]) {
print_unescaped(
sprintf(
'<option value="%s">%s</option>',
\OCA\Circles\Model\Circle::CIRCLES_PUBLIC,
$l->t("Create a public circle")
)
);
}
// Closed Circle
if ($_['allowed_circles'][\OCA\Circles\Model\Circle::CIRCLES_CLOSED]) {
print_unescaped(
sprintf(
'<option value="%s">%s</option>',
\OCA\Circles\Model\Circle::CIRCLES_CLOSED,
$l->t("Create a closed circle")
)
);
}
// Secret Circle
if ($_['allowed_circles'][\OCA\Circles\Model\Circle::CIRCLES_SECRET]) {
print_unescaped(
sprintf(
'<option value="%s">%s</option>',
\OCA\Circles\Model\Circle::CIRCLES_SECRET,
$l->t("Create a secret circle")
)
);
}
?>
</select>
<input id="circles_new_submit" type="submit" value="<?php p($l->t('Creation')); ?>" style="display: none;"/>
<div id="circles_new_type_definition" style="display: none;">
<div id="circles_new_type_1"><b>
<?php p(
$l->t(
"A personal circle is a list of users known only to the owner."
)
); ?>
</b><br/>
<?php p(
$l->t(
"This is the right option if you want to do recurrent sharing with the same list of local users."
)
); ?>
</div>
<div id="circles_new_type_2"><b>
<?php p(
$l->t(
"A secret circle is an hidden group that can only be seen by its members or by people knowing the exact name of the circle."
)
); ?></b><br/><?php p(
$l->t(
"Non-members won't be able to find your secret circle using the search bar."
)
); ?>
</div>
<div id="circles_new_type_4"><b><?php p(
$l->t(
"Joining a closed circle requires an invitation or confirmation by a moderator."
)
); ?>
</b><br/><?php p(
$l->t(
"Anyone can find and request an invitation to the circle; but only members can see its membership and get access to its shared items."
)
); ?>
</div>
<div id="circles_new_type_8"><b><?php p(
$l->t(
"A public circle is an open group visible to anyone willing to join."
)
); ?></b><br/><?php p(
$l->t(
"Anyone can see, join, and access the items shared within the circle."
)
); ?>
</div>
</div>
</div>
<div id="circles_list">
<?php
if ($_['allowed_circles'][\OCA\Circles\Model\Circle::CIRCLES_PERSONAL]) {
print_unescaped(
'<div circle-type="' . \OCA\Circles\Model\Circle::CIRCLES_PERSONAL . '">' . $l->t(
'Personal circles'
) . '</div>'
);
}
if ($_['allowed_circles'][\OCA\Circles\Model\Circle::CIRCLES_PUBLIC]) {
print_unescaped(
'<div circle-type="' . \OCA\Circles\Model\Circle::CIRCLES_PUBLIC . '">' . $l->t(
'Public circles'
) . '</div>'
);
}
if ($_['allowed_circles'][\OCA\Circles\Model\Circle::CIRCLES_CLOSED]) {
print_unescaped(
'<div circle-type="' . \OCA\Circles\Model\Circle::CIRCLES_CLOSED . '">' . $l->t(
'Closed circles'
) . '</div>'
);
}
if ($_['allowed_circles'][\OCA\Circles\Model\Circle::CIRCLES_SECRET]) {
print_unescaped(
'<div circle-type="' . \OCA\Circles\Model\Circle::CIRCLES_SECRET . '">' . $l->t(
'Secret circles'
) . '</div>'
);
}
?>
<div circle-type="all"><?php p($l->t('All circles')); ?></div>
</div>
</div>
<div id="circle-navigation" class="circles" style="display: none;">
<input id="circles_search" type="text"
placeholder="<?php p($l->t('Search circles')); ?>"/>
<select id="circles_filters">
<option value="0"><?php p($l->t('No filter')); ?></option>
<option value="1"><?php p($l->t('Circles you belong to')); ?></option>
<option value="9"><?php p($l->t('Circles you own')); ?></option>
</select>
</div>
<script id="tmpl_circle" type="text/template">
<div class="title">%title%</div>
<div class="type"><b>%type%</b> (%status%, %level_string%)</div>
<div class="owner"><b><?php p($l->t('Owner')); ?>:</b> %owner%</div>
</script>
<div id="app-content" style="position: relative">
<div id="emptycontent">
<div class="icon-circles"></div>
<h2><?php p($l->t('No circle selected')); ?></h2>
</div>
<div id="mainui">
<div id="circle_details">
<div class="lightenbg">
<input id="adminsettingscircle" type="submit"
value="<?php p($l->t('Settings')); ?>"/>
</div>
<div id="name"></div>
<div id="type"></div>
<div id="circle-actions">
<div id="circle-actions-buttons">
<div id="joincircle_invit"><?php p(
$l->t("Pending invitation to join this circle")
); ?></div>
<div id="joincircle_request"><?php p(
$l->t('You have a pending request to join this circle')
); ?></div>
<button id="circle-actions-add" class="icon-add-user"
title="<?php p($l->t('Add a member')); ?>"></button>
<button id="circle-actions-group" class="icon-link-group"
title="<?php p($l->t('Link a group')); ?>"></button>
<button id="circle-actions-link" class="icon-public"
title="<?php p($l->t('Link a circle')); ?>"></button>
<button id="circle-actions-join" class="icon-join"
title="<?php p($l->t('Join this circle')); ?>"></button>
<button id="circle-actions-delete" class="icon-delete"
title="<?php p($l->t('Delete circle')); ?>"></button>
<button id="circle-actions-settings" class="icon-settings-dark"
title="<?php p($l->t('Edit circle')); ?>"></button>
</div>
<div id="circle-actions-more">
<input id="joincircle_acceptinvit" type="submit"
value="<?php p($l->t('Accept the invitation')); ?>"/>
<input id="joincircle_rejectinvit" type="submit"
value="<?php p($l->t('Decline the invitation')); ?>"/>
<input id="joincircle" type="submit"
value="<?php p($l->t('Join this circle')); ?>"/>
<input id="leavecircle" type="submit"
value="<?php p($l->t('Leave this circle')); ?>"/>
<input id="addmember" type="text"
placeholder="<?php p($l->t('Add a member')); ?>"/>
<input id="linkgroup" type="text"
placeholder="<?php p($l->t('Link a group')); ?>"/>
<input id="linkcircle" type="text"
placeholder="<?php p($l->t('Link to a circle')); ?>"/>
<button id="circle-actions-return" class="icon-close"
title="<?php p($l->t('Return to menu')); ?>"></button>
</div>
<div id="members_search_result"></div>
<div id="groups_search_result"></div>
</div>
<div id="circledata">
<div id="circle_desc"></div>
<div id="memberslist">
<table id="memberslist_table">
<tr class="header">
<td class="username"><?php p($l->t('Username')); ?></td>
<td class="level"><?php p($l->t('Level')); ?></td>
<td class="status"><?php p($l->t('Status')); ?></td>
<td class="joined"><?php p($l->t('Joined')); ?></td>
</tr>
</table>
<br/><br/><br/><br/>
<table id="groupslist_table">
<tr class="header">
<td class="groupid"><?php p($l->t('Group Name')); ?></td>
<td class="level"><?php p($l->t('Level')); ?></td>
<!-- <td class="joined">--><?php //p($l->t('Joined')); ?><!--</td>-->
</tr>
</table>
<br/><br/><br/><br/>
<table id="linkslist_table">
<tr class="header">
<td class="address"><?php p($l->t('Link')); ?></td>
<td class="status"><?php p($l->t('Status')); ?></td>
<td class="linked"><?php p($l->t('Linked')); ?></td>
</tr>
</table>
<script id="tmpl_member" type="text/template">
<tr class="entry" member-id="%username%" member-type="%type%" member-level="%level%"
member-levelString="%levelString%"
member-status="%status%">
<td class="username" style="padding-left: 15px;">%displayname%</td>
<td class="level">
<select class="level-select">
<option value="1"><?php p($l->t('Member')); ?></option>
<option value="4"><?php p($l->t('Moderator')); ?></option>
<option value="8"><?php p($l->t('Admin')); ?></option>
<option value="9"><?php p($l->t('Owner')); ?></option>
</select>
</td>
<td class="status">
<select class="status-select">
</select>
</td>
<td class="joined">%joined%</td>
<td>
<div class="icon-checkmark" style="display: none;"></div>
</td>
</tr>
</script>
<script id="tmpl_group" type="text/template">
<tr class="entry" group-id="%groupid%" group-level="%level%">
<td class="groupid" style="padding-left: 15px;">%groupid%</td>
<td class="level">
<select class="level-select">
<option value="1"><?php p($l->t('Member')); ?></option>
<option value="4"><?php p($l->t('Moderator')); ?></option>
<option value="8"><?php p($l->t('Admin')); ?></option>
</select>
</td>
<!-- <td class="joined">%joined%</td>-->
</tr>
</script>
<script id="tmpl_link" type="text/template">
<tr class="entry" link-id="%id%" link-address="%address%"
link-status="%status%">
<td class="address" style="padding-left: 15px;">%token%@%address%</td>
<td class="status">
<select class="link-status-select">
</select>
</td>
<td class="joined">%joined%</td>
</tr>
</script>
</div>
</div>
<div id="settings-panel">
<table id="settings-table">
<tr>
<td class="left">Name of the Circle</td>
<td><input type="text" id="settings-name"/></td>
</tr>
<tr>
<td class="left" style="vertical-align: top">Description</td>
<td><textarea type="text" id="settings-desc"></textarea></td>
</tr>
<tr id="settings-entry-limit">
<td class="left"><?php p($l->t('Members limit')); ?><br/>
<span class="hint"><?php p(
$l->t(
'Change the limit to the number of members. (0: default, -1: unlimited)'
)
); ?></span>
</td>
<td><input type="text" value="" id="settings-limit"></td>
</tr>
<tr id="settings-entry-link">
<td class="left"><?php p($l->t('Allow Federated Links')); ?><br/>
<span class="hint"><?php p(
$l->t(
'Makes the circle federated, and enables sharing between federated circles'
)
); ?></span>
</td>
<td><input type="checkbox" value="1" id="settings-link"></td>
</tr>
<!--<tr id="settings-entry-link-files">
<td class="left">Share Files With Linked Circles<br/>
<span class="hint">Files that are locally shared with this circle will be shared with all Linked circles</span>
</td>
<td><input type="checkbox" value="1" id="settings-link-files"></td>
</tr>-->
<tr id="settings-entry-link-auto">
<td class="left"><?php p($l->t('Accept Link Request Automatically')); ?>
<br/>
<span class="hint"><?php p(
$l->t(
'Warning: Enabling this will automatically accept new link requests from other circles.'
)
); ?></span>
</td>
<td><input type="checkbox" value="1" id="settings-link-auto"></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<input type="submit" id="settings-submit"
value="<?php p($l->t('Save settings')); ?>"/>
</td>
</tr>
</table>
<div>
</div>
</div>
</div>