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
/
dashboard.html
124 lines (122 loc) · 4.87 KB
/
dashboard.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 'base.html' %}
{% block subtitle %}
Dashboard
{% endblock %}
{% block wrapper %}
<div class="oddWrapper">
<!-- Loritta Teste -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9989170954243288"
data-ad-slot="6236021665"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- Loritta Teste 2 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9989170954243288"
data-ad-slot="8369584507"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="contentWrapper" style="text-align: center; width: 80%;">
<div class="sectionHeader">
{{ DASHBOARD_CHOOSE_A_SERVER }}
</div>
{% if userGuilds|length == 0 %}
<h1>¯\_(ツ)_/¯</h1>
<h2>{{ DASHBOARD_NoServerFound }}</h2>
{{ DASHBOARD_TryLoggingIn|raw }}
{% else %}
<div id="choose-your-server" class="pure-g vertically-centered-content" style="text-align: center;">
{% for guild in userGuilds %}
<div class="pure-u-1 pure-u-md-1-2">
<div class="server-sample server-normal">
<div class="server-sample-upper">
<img class="server-sample-icon" src="{% if guild.icon|length != 0 %}https://cdn.discordapp.com/icons/{{ guild.id }}/{{ guild.icon }}{% else %}{{ websiteUrl }}assets/img/unknown.png{% endif %}">
<div style="display: flex;
justify-content: space-between;
text-align: left;
align-items: center; height: 48px; padding-left: 22px;">
{% set userPermissionLevel = userPermissionLevels[guild] %}
<div class="server-info"><div class="server-name">{{ guild.name }}</div><div class="server-author">{% if userPermissionLevel.name == "OWNER" %}{{ DASHBOARD_OWNER }}{% elseif userPermissionLevel.name == "ADMINISTRATOR" %}{{ DASHBOARD_ADMINISTRATOR }}{% else %}{{ DASHBOARD_MANAGER }}{% endif %}</div></div>
{% if joinedServers[guild] == true %}
<a style="color: white;" href="{{ websiteUrl }}dashboard/configure/{{ guild.id }}"><div class="server-button"><div class="discord-logo"><i class="fab fa-discord"></i></div><div class="click-here">{{ DASHBOARD_MANAGE_SERVER }}</div></div></a>
{% else %}
<a style="color: white;" href="https://discordapp.com/oauth2/authorize?&client_id={{ clientId }}&scope=bot&permissions=2097176631&guild_id={{ guild.getId }}&response_type=code&redirect_uri={{ websiteUrl }}dashboard"><div class="server-button"><div class="discord-logo"><i class="fas fa-plus"></i></div><div class="click-here">{{ DASHBOARD_ADD_LORITTA }}</div></div></a>
{% endif %}
</div></div>
<div class="server-sample-bottom"></div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="evenWrapper">
<div class="contentWrapper" id="privacy-stuff" style="text-align: center;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Loritta Dashboard Privacy -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-9989170954243288"
data-ad-slot="2743900184"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="sectionHeader">
{{ DASHBOARD_Privacy }}
</div>
{% macro generateCheckbox(index, internalName, mainText, subText, isEnabled, needsToBeSaved) %}
<div class="pure-g" style="text-align: center;">
<div class="pure-u-1 pure-u-md-7-8">
<p class="toggleMainText">{{ mainText }}</p>
{% if subText|length > 0 %}<div class="toggleSubText">{{ subText | raw }}</div>{% endif %}
</div>
<div class="pure-u-1 pure-u-md-1-8">
<div class="switch">
<input type="checkbox" data-internal-name="{{ internalName }}" value="true" {% if needsToBeSaved == true %}data-send-on-save="true"{% endif %} {% if isEnabled == true %}checked{% endif %} id="cmn-toggle-{{ index }}" class="cmn-toggle cmn-toggle-round" type="checkbox">
<label for="cmn-toggle-{{ index }}"></label>
</div>
</div>
</div>
<br style="clear: both" /> <!-- So dirty! -->
{% endmacro %}
<hr>
{{ generateCheckbox(1,
"hideSharedServers",
DASHBOARD_HideSharedServers,
"",
lorittaProfile.hideSharedServers,
true) }}
<hr>
{{ generateCheckbox(2,
"hidePreviousUsernames",
DASHBOARD_HidePreviousUsernames,
"",
lorittaProfile.hidePreviousUsernames,
true) }}
<hr>
<a class="button-discord button-discord-success pure-button" onclick="saveDashboardStuff()">{{ DASHBOARD_SAVE }}</a></div>
<script>
function saveDashboardStuff() {
var hideSharedServers = $("#privacy-stuff #cmn-toggle-1").is(":checked")
var hidePreviousUsernames = $("#privacy-stuff #cmn-toggle-2").is(":checked")
$.post("{{ loriUrl }}dashboard", {
"hideSharedServers" : hideSharedServers,
"hidePreviousUsernames" : hidePreviousUsernames
}, function(data) {
var obj = JSON.parse(data);
console.log(obj);
// location.reload()
});
}
</script>
</div>
</div>
{% endblock %}