This repository has been archived by the owner on May 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpermissions.html
124 lines (110 loc) · 3.67 KB
/
permissions.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
{% extends 'configure_server.html' %}
{% block rightSidebarContents %}
<div class="discord-scroller" style="width: 25.5%; float: left;">
<div class="server-name">
{{ USERINFO_ROLES }}
</div>
{% for role in guild.getRoles %}
<div data-clickable-role="true" onclick="displayRoleStuff(this, '{{ role.getId }}');" class="item" style="font-weight: 600; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;{% if role.getColor != null %}color: rgb({{ role.getColor.getRed }}, {{ role.getColor.getGreen }}, {{ role.getColor.getBlue }});{% endif %}">
{{ role.getName }}
</div>
{% endfor %}
</div>
<div style="padding: 0px 0px 80px 20px;">
{% for role in guild.getRoles %}
<div id="role-{{ role.getId }}" data-internal-id="{{ role.getId }}" style="width: 74.5%; float: right;" class="totallyHidden">
{{ generateCheckbox(role.getId + 1,
"allowInvites",
DASHBOARD_AllowSendingInvites,
"",
roleConfigs[role].allowInvites,
true) }}
<hr>
{{ generateCheckbox(role.getId + 2,
"ignoreCommands",
DASHBOARD_IgnoreCommands,
DASHBOARD_IgnoreCommands_Description,
roleConfigs[role].ignoreCommands,
true) }}
<hr>
{{ generateCheckbox(role.getId + 3,
"bypassCommandBlacklist",
"Permitir usar comandos em qualquer canal",
"Caso esteja ativado, eu irei permitir usar comandos em canais que foram adicionados para eu ignorar.",
roleConfigs[role].bypassCommandBlacklist,
true) }}
<hr>
{{ generateCheckbox(role.getId + 4,
"bypassSlowMode",
"Permitir burlar o limite do Slow Mode",
"Caso esteja ativado, eu irei ignorar o limite do Slow Mode para pessoas que possuem este cargo.",
roleConfigs[role].bypassSlowMode,
true) }}
<hr>
{{ generateCheckbox(role.getId + 7,
"allowUsingMusicCommands",
"dj",
"dj",
roleConfigs[role].allowUsingMusicCommands,
true) }}
<hr>
{{ generateCheckbox(role.getId + 8,
"allowAccessToDashboard",
"Permitir acessar a configuração deste servidor",
"Caso esteja ativado, usuários com esta permissão poderão acessar e manipular a configuração deste servidor no meu painel. Essa é uma permissão perigosa para conceder.",
roleConfigs[role].allowAccessToDashboard,
true) }}
<hr>
{% if userIdentification.id == "123170274651668480" %}
{{ generateCheckbox(role.getId + 5,
"bypassAutoMod",
"bypassAutoMod",
"bypassAutoMod",
roleConfigs[role].bypassAutoMod,
true) }}
<hr>
{{ generateCheckbox(role.getId + 6,
"bypassAutoCaps",
"bypassAutoCaps",
"bypassAutoCaps",
roleConfigs[role].bypassAutoCaps,
true) }}
<hr>
{% endif %}
<br style="clear: both" /> <!-- So dirty! -->
</div>
{% endfor %}
</div>
<hr>
<script>
function displayRoleStuff(element, roleId) {
$('div[data-internal-id]').each(function(index) {
$(this).addClass("totallyHidden");
});
$('div[data-clickable-role]').each(function(index) {
$(this).removeClass("selected-item");
});
$(element).addClass("selected-item");
$("#role-" + roleId).removeClass("totallyHidden");
}
function transformRolesToJson() {
var configAttr = {"type":"{{ saveType }}"}
$('[data-internal-id]').each(function( index ) {
var roleAttr = {}
$(this).find("[data-internal-name]").each(function( index ) {
var value = $(this).val();
if ($(this).attr("type") == "checkbox") {
value = $(this).is(':checked')
}
roleAttr[$(this).data("internal-name")] = value
});
configAttr[$(this).data("internal-id")] = roleAttr;
});
console.log(configAttr);
var json = JSON.stringify(configAttr);
sendJsonToServer(json);
}
</script>
<button onclick="transformRolesToJson()" style="float: right;" class="button-discord button-discord-success pure-button">{{ DASHBOARD_SAVE }}</button>
<br style="clear: both" /> <!-- So dirty! -->
{% endblock %}