forked from rDrama/rDrama
1
0
Fork 0

Merge branch 'frost' of https://github.com/Aevann1/Drama into frost

master
Aevann1 2021-12-28 08:28:22 +02:00
commit c3f65b0fe9
11 changed files with 471 additions and 189 deletions

View File

@ -1247,12 +1247,12 @@ video {
.w-5 {
width: 1.25rem;
}
.w-44 {
width: 11rem;
}
.w-7 {
width: 1.75rem;
}
.w-44 {
width: 11rem;
}
.min-w-full {
min-width: 100%;
}
@ -1608,6 +1608,14 @@ video {
--tw-border-opacity: 1;
border-color: rgba(var(--color-200), var(--tw-border-opacity));
}
.border-yellow-400 {
--tw-border-opacity: 1;
border-color: rgba(251, 191, 36, var(--tw-border-opacity));
}
.border-red-300 {
--tw-border-opacity: 1;
border-color: rgba(252, 165, 165, var(--tw-border-opacity));
}
.border-opacity-10 {
--tw-border-opacity: 0.1;
}
@ -1972,6 +1980,10 @@ video {
--tw-bg-opacity: 1;
background-color: rgba(54, 83, 20, var(--tw-bg-opacity));
}
.bg-yellow-100 {
--tw-bg-opacity: 1;
background-color: rgba(254, 243, 199, var(--tw-bg-opacity));
}
.bg-gray-300\/40 {
background-color: rgba(var(--color-300), 0.4);
}
@ -2464,6 +2476,10 @@ video {
--tw-text-opacity: 1;
color: rgba(54, 83, 20, var(--tw-text-opacity));
}
.text-yellow-400 {
--tw-text-opacity: 1;
color: rgba(251, 191, 36, var(--tw-text-opacity));
}
.antialiased {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@ -2978,6 +2994,45 @@ video {
.btn-blue:focus {
--tw-text-opacity: 1;
color: rgba(var(--color-200), var(--tw-text-opacity));
}
.btn-yellow {
--tw-border-opacity: 1;
border-color: rgba(120, 53, 15, var(--tw-border-opacity));
background-image: linear-gradient(to top, var(--tw-gradient-stops));
--tw-gradient-from: #b45309;
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(180, 83, 9, 0));
--tw-gradient-to: #d97706;
--tw-text-opacity: 1;
color: rgba(var(--color-100), var(--tw-text-opacity));
}
.btn-yellow:hover {
--tw-gradient-from: #d97706;
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(217, 119, 6, 0));
--tw-gradient-to: #b45309;
}
.btn-yellow:focus {
--tw-text-opacity: 1;
color: rgba(var(--color-200), var(--tw-text-opacity));
}
.btn-black {
border-color: rgba(0, 0, 0, 0.1);
--tw-bg-opacity: 1;
background-color: rgba(255, 255, 255, var(--tw-bg-opacity));
background-image: linear-gradient(to top, var(--tw-gradient-stops));
--tw-gradient-from: #000;
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(0, 0, 0, 0));
--tw-gradient-to: rgba(0, 0, 0, 0.8);
--tw-text-opacity: 1;
color: rgba(var(--color-100), var(--tw-text-opacity));
}
.btn-black:hover {
--tw-gradient-from: rgba(0, 0, 0, 0.9);
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(0, 0, 0, 0));
--tw-gradient-to: #000;
}
.btn-black:focus {
--tw-text-opacity: 1;
color: rgba(var(--color-200), var(--tw-text-opacity));
}
.btn-gray {
--tw-border-opacity: 1;
@ -3154,6 +3209,10 @@ video {
-o-object-fit: contain;
object-fit: contain}
.agendaposter {
text-transform: uppercase !important;
}
.odd\:bg-gray-200:nth-child(odd) {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-200), var(--tw-bg-opacity));
@ -3506,6 +3565,18 @@ video {
display: block;
}
@keyframes pulse {
50% {
opacity: .5;
}
}
.group:hover .group-hover\:animate-pulse {
-webkit-animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.peer:checked ~ .peer-checked\:border-blue-500 {
--tw-border-opacity: 1;
border-color: rgba(14, 165, 233, var(--tw-border-opacity));
@ -4076,6 +4147,3 @@ video {
width: 20%;
}
}
.agendaposter {
text-transform: uppercase !important;
}

View File

@ -404,6 +404,12 @@
.btn-blue {
@apply bg-gradient-to-t from-blue-700 to-blue-600 hover:from-blue-600 hover:to-blue-700 border-blue-900 text-gray-100 focus:text-gray-200;
}
.btn-yellow {
@apply bg-gradient-to-t from-yellow-700 to-yellow-600 hover:from-yellow-600 hover:to-yellow-700 border-yellow-900 text-gray-100 focus:text-gray-200;
}
.btn-black {
@apply bg-white bg-gradient-to-t from-black to-black/80 hover:from-black/90 hover:to-black border-black/10 text-gray-100 focus:text-gray-200;
}
.btn-gray {
@apply bg-gradient-to-t from-gray-200 to-gray-100 hover:from-gray-100 hover:to-gray-200 border-gray-300 text-gray-700 focus:text-gray-900;
}

View File

@ -118,7 +118,7 @@
{% endif %}
{% endif %}
{% if v and v.admin_level==6 and v.id==c.author_id %}
{% if v and v.admin_level > 0 and v.id==c.author_id %}
<li id="undistinguish-{{c.id}}" class="hidden {% if c.distinguish_level %}md:block{% endif %}">
<button class="dropdown-item dropdown-item-primary" onclick="post_toast3('/distinguish_comment/{{c.id}}','distinguish-{{c.id}}','undistinguish-{{c.id}}','no')">
<i class="fas fa-id-badge text-info fa-sm fa-fw mr-4"></i>Undistinguish

View File

@ -360,7 +360,7 @@
}
</script>
{% endif %}
<script src="/assets/CHRISTMAS/js/default.js?a=1"></script>
<script src="/assets/CHRISTMAS/js/default.js?a=2"></script>
</body>
</html>

View File

@ -63,14 +63,8 @@
<li>
<hr class="mt-2 mb-1.5 border-t border-black h-1 shadow-inset-t-white-05"/>
</li>
<li id="admin2" class="{% if u.admin_level > 1 %}hidden{% endif %}">
<button class="dropdown-item block w-full text-left px-4 py-2 text-sm text-gray-200 bg-gradient-to-t hover:from-red-800 hover:to-red-700 hover:shadow-inner focus:shadow-inner focus:bg-gradient-to-t focus:from-red-800 focus:to-red-700" onclick="post_toast2('/@{{u.username}}/make_admin','admin2','unadmin2')">
<i class="fas fa-user-shield fa-sm fa-fw mr-4"></i>
Make admin
</button>
</li>
<li id="unadmin2" class="{% if u.admin_level < 2 %}hidden{% endif %}">
<button class="dropdown-item block w-full text-left px-4 py-2 text-sm text-gray-200 bg-gradient-to-t hover:from-red-800 hover:to-red-700 hover:shadow-inner focus:shadow-inner focus:bg-gradient-to-t focus:from-red-800 focus:to-red-700" onclick="post_toast2('/@{{u.username}}/remove_admin','admin2','unadmin2')">
<button class="dropdown-item block w-full text-left px-4 py-2 text-sm text-gray-200 bg-gradient-to-t hover:from-red-800 hover:to-red-700 hover:shadow-inner focus:shadow-inner focus:bg-gradient-to-t focus:from-red-800 focus:to-red-700" onclick="postToast('/@{{u.username}}/remove_admin')">
<i class="fas fa-user-minus fa-sm fa-fw mr-4"></i>
Remove admin
</button>

View File

@ -40,7 +40,7 @@
</div>
<div class="px-3">
<input class="form-input" type="text" id="emoji_search" placeholder="Search emoji..">
<input class="form-input" type="text" id="emoji_search" autocomplete="false" placeholder="Search emoji..">
</div>
<div style="overflow-y: scroll;">

View File

@ -81,7 +81,7 @@
</li>
{% endif %}
{% if v %}
{% if v.admin_level>=1 and v.id==c.author_id %}
{% if v.admin_level > 0 and v.id==c.author_id %}
<li id="distinguish2-{{c.id}}" class="{% if c.distinguish_level %}hidden{% endif %}">
<button class="btn btn-gray w-full text-left" onclick="post_toast2('/distinguish_comment/{{c.id}}','distinguish2-{{c.id}}','undistinguish2-{{c.id}}')">
<i class="fas fa-id-badge fa-fw mr-4"></i>Distinguish

View File

@ -220,9 +220,9 @@
<script src="/assets/CHRISTMAS/js/mobile_navigation_bar.js?a=1"></script>
{% if v %}
<script>function formkey() {return '{{v.formkey}}';}</script>
<script>
function formkey() {return '{{v.formkey}}';}
var previousTheme = '{{ v.theme2 }}'.split(' ');
function changeTheme(theme) {
const root = document.documentElement
@ -235,9 +235,12 @@
// Set global previous selection to current selection
previousTheme = theme;
}
const twoStepModal = new bootstrap.Modal(document.getElementById('2faModal'));
</script>
{% endif %}
<script src="/assets/CHRISTMAS/js/default.js?a=1"></script>
<script src="/assets/CHRISTMAS/js/default.js?a=2"></script>
</body>
</html>

View File

@ -267,6 +267,5 @@
document.getElementById("emailpasswordRequired").classList.remove("hidden");
});
});
const twoStepModal = new bootstrap.Modal(document.getElementById('2faModal'))
</script>
{% endblock %}

View File

@ -1,4 +1,205 @@
<div class="hidden xl:block xl:col-start-10 xl:col-end-13 flex-shrink-0 my-4 px-4 py-3 rounded-md bg-gray-300/40 dark:bg-gray-700/40 shadow-inner">
<div class="hidden xl:block xl:col-start-10 xl:col-end-13 flex-shrink-0">
{% if v and v.admin_level > 1 and v.id != u.id %}
<div class="relative my-4 px-4 py-3 rounded-md border border-yellow-400 dark:border-gray-700 bg-yellow-100 dark:bg-gray-700/40">
<span class="absolute top-2 right-3 text-base">
<i class="fas fa-crown fa-sm text-yellow-400 dark:text-gray-300" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Visible only to moderators"></i>
</span>
<h2 class="ml-2 font-bold text-lg font-heading leading-normal mb-2">
Manage User
</h2>
<ul class="flex flex-col mt-3 mb-0 space-y-6">
<li>
<div class="label text-black dark:text-gray-200">Attributes</div>
<ul class="flex flex-col mb-0 space-y-3">
<li class="flex space-x-2">
<input type="checkbox" value="verify" class="w-5 h-5" onchange="verifyBadge(this,'{{u.id}}')" {% if u.verified %}checked{% endif %}>
<div>
<label class="label mb-0" for="verify">Verify</label>
<small class="block text-gray-600 dark:text-gray-400">
Gives <i class="fas fa-badge-check fa-sm fa-fw"></i> {{ u.username }} a badge
</small>
</div>
</li>
<li class="flex space-x-2">
<input type="checkbox" value="club" class="w-5 h-5" onchange="clubAccess(this,'{{u.username}}')" {% if u.paid_dues %}checked{% endif %}>
<div>
<label class="label mb-0" for="club">Country Club Access</label>
<small class="block text-gray-600 dark:text-gray-400">
Grant @{{ u.username }} access to the Country Club
</small>
</div>
</li>
</ul>
</li>
<li>
<div class="label text-black dark:text-gray-200">Custom flair</div>
<form id="sidebar-flair-change" action="/admin/title_change/{{u.id}}" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<div class="flex items-center space-x-2 mb-2">
<input id="sidebar-custom-flair" type="text" name="title" class="form-input" placeholder='Enter a flair...' value="{% if u.customtitle %}{{u.customtitle}}{% endif %}">
<button type="button" class="btn btn-gray">
<i class="fas fa-smile-beam fa-fw" onclick="loadEmojis('sidebar-custom-flair')" aria-hidden="true" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Add Emoji"></i>
</button>
</div>
<div class="flex space-x-2 mb-3">
<input type="checkbox" id="sidebar-locked" class="w-5 h-5" name="locked" {% if u.flairchanged %}checked{% endif %}>
<div>
<label class="label mb-0" for="sidebar-locked">Locked</label>
<small class="block text-gray-600 dark:text-gray-400">
Restrict @{{ u.username }} from updating their flair
</small>
</div>
</div>
<button form="sidebar-flair-change" type="submit" class="btn btn-yellow w-full">
<i class="fas fa-pen fa-sm fa-fw mr-2"></i>
Change flair
</button>
</form>
</li>
</ul>
</div>
<div class="relative my-4 px-4 py-3 rounded-md border border-red-300 dark:border-gray-700 bg-red-100 dark:bg-gray-700/40 group">
<span class="absolute top-2 right-3 text-base">
<i class="fas fa-exclamation-triangle fa-sm text-red-400 dark:text-gray-300 group-hover:animate-pulse" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Visible only to moderators. Recommend internal mod discussion before making changes here."></i>
</span>
<h2 class="ml-2 font-bold text-lg font-heading leading-normal mb-2">
Danger Zone
</h2>
<ul class="flex flex-col mt-3 mb-0 space-y-6">
{% if v.admin_level > 2 %}
<li>
<div class="label text-black dark:text-gray-200">Meme Moderator Status</div>
<div id="sidebar-memeadmin" class="{% if u.admin_level == 1%}hidden{% endif %}">
<button class="btn btn-yellow w-full" onclick="post_toast2('/@{{u.username}}/make_meme_admin','sidebar-memeadmin','sidebar-unmemeadmin')">
<i class="fas fa-grin-squint-tears fa-sm fa-fw mr-2"></i>
Make meme admin
</button>
</div>
<div id="sidebar-unmemeadmin" class="{% if u.admin_level != 1 %}hidden{% endif %}">
<button class="btn btn-gray w-full" onclick="post_toast2('/@{{u.username}}/remove_meme_admin','sidebar-memeadmin','sidebar-unmemeadmin')">
<i class="fas fa-sad-cry fa-sm fa-fw mr-2"></i>
Remove meme admin
</button>
</div>
</li>
{% endif %}
<li>
<div class="label text-black dark:text-gray-200">Agendaposter Mode</div>
<form id="sidebar-agendaposter" class="{% if u.agendaposter %}hidden{% endif %}" action="/agendaposter/{{u.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input type="number" step="any" name="days" class="form-input mb-3" placeholder="Days (0 or blank = permanent)" >
<button class="btn btn-red w-full">
<i class="fas fa-paint-brush fa-sm fa-fw mr-2"></i>
Lock agendaposter theme
</button>
</form>
<div id="sidebar-unagendaposter" class="{% if not u.agendaposter %}hidden{% endif %}">
<button class="btn btn-green w-full" onclick="post_toast2('/agendaposter/{{u.id}}','sidebar-agendaposter','sidebar-unagendaposter')">
<i class="fas fa-check fa-sm fa-fw mr-2"></i>
Disable Agendaposter Theme
</button>
</div>
</li>
<li>
{% if u.is_suspended %}
<div class="label text-black dark:text-gray-200">Unban {{ u.username }}</div>
<form id="sidebar-unban" action="/unban_user/{{u.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input type="hidden" name="redir" value="true">
<div class="flex space-x-2 mb-3">
<input type="checkbox" id="sidebar-alts" class="w-5 h-5" name="alts" value="1">
<div>
<label class="label mb-0" for="sidebar-alts">Include alts</label>
<small class="block text-gray-600 dark:text-gray-400">
Unban rogue accounts connected to @{{ u.username }}
</small>
</div>
</div>
<button form="sidebar-unban" type="submit" class="btn btn-green w-full">
<i class="fas fa-user-check fa-sm fa-fw mr-2"></i>
Unban user
</button>
</form>
{% else %}
<div class="label text-black dark:text-gray-200">Ban {{ u.username }}</div>
<form id="sidebar-ban" action="/ban_user/{{u.id}}/" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input type="hidden" name="redir" value="true">
<input type="text" class="form-input mb-2" name="reason" placeholder="Ban Reason" onchange="document.getElementById('sidebar-ban-btn').disabled=false">
<input type="number" step="any" class="form-input mb-2" name="days" placeholder="Days (blank = permanent)">
<div class="flex space-x-2 mb-3">
<input type="checkbox" id="sidebar-alts" class="w-5 h-5" name="alts" value="1">
<div>
<label class="label mb-0" for="sidebar-alts">Include alts</label>
<small class="block text-gray-600 dark:text-gray-400">
Ban rogue accounts connected to @{{ u.username }}
</small>
</div>
</div>
<button form="sidebar-ban" id="sidebar-ban-btn" type="submit" class="btn btn-red w-full" disabled>
<i class="fas fa-user-slash fa-sm fa-fw mr-2"></i>
Ban user
</button>
</form>
{% endif %}
</li>
<li>
<div class="label text-black dark:text-gray-200">Shadow Ban</div>
<div id="sidebar-shadowban" class="{% if u.shadowbanned %}hidden{% endif %}">
<button class="btn btn-black w-full" onclick="post_toast2('/shadowban/{{u.id}}','sidebar-shadowban','sidebar-unshadowban')">
<i class="fas fa-eye-slash fa-sm fa-fw mr-2"></i>
Shadow ban
</button>
</div>
<div id="sidebar-unshadowban" class="{% if not u.shadowbanned %}hidden{% endif %}">
<button class="btn btn-green w-full" onclick="post_toast2('/unshadowban/{{u.id}}','sidebar-shadowban','sidebar-unshadowban')">
<i class="fas fa-eye fa-sm fa-fw mr-2"></i>
Lift shadow ban
</button>
</div>
</li>
<li>
<div class="label text-black dark:text-gray-200">Content</div>
<form id="sidebar-unnuke" action="/admin/unnuke_user" method="post" class="mb-2">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input type="hidden" name="user" value="{{u.username}}">
<button class="btn btn-green w-full">
<i class="fas fa-check fa-sm fa-fw mr-2"></i>
Approve all content
</button>
</form>
<form id="sidebar-nuke" action="/admin/nuke_user" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input type="hidden" name="user" value="{{u.username}}">
<button class="btn btn-red w-full">
<i class="fas fa-trash fa-sm fa-fw mr-2"></i>
Remove all content
</button>
</form>
</li>
{% if u.admin_level > 1 %}
<li>
<div class="label text-black dark:text-gray-200">Damage Control</div>
<button class="btn btn-blue w-full" onclick="postToast('/@{{u.username}}/revert_actions')">
<i class="fas fa-history fa-sm fa-fw mr-2"></i>
Revert admin actions
</button>
</li>
{% endif %}
{% if v.admin_level > 2 and u.admin_level > 2 %}
<li>
<div class="label text-black dark:text-gray-200">Admin Persmissions</div>
<button class="btn btn-red w-full" onclick="postToast('/@{{u.username}}/remove_admin'); this.disabled = true">
<i class="fas fa-user-slash fa-sm fa-fw mr-2"></i>
Revoke admin permissions
</button>
</li>
{% endif %}
</ul>
</div>
{% endif %}
<div class="my-4 px-4 py-3 rounded-md bg-gray-300/40 dark:bg-gray-700/40 shadow-inner">
<div>
<h2 class="ml-2 font-bold text-lg font-heading leading-normal mb-2">About</h2>
<div class="flex flex-col space-y-4">
@ -58,13 +259,20 @@
<hr class="mt-6 mb-5 h-0.5 border-b border-gray-300 dark:border-gray-900 shadow-inset-t-white-05"/>
<div>
<h2 class="ml-2 font-bold text-lg font-heading leading-normal mb-2">Alts</h2>
<ul class="flex flex-row flex-wrap gap-2 mb-0">
<ul class="flex flex-col space-y-2 mb-0">
{% for account in u.alts_unique %}
<li>
<a href="{{account.url}}">@{{account.username}}</a>{% if account._is_manual %} [m]{% endif %}
<li class="flex items-center space-x-2">
<img src="@{{account.profile_url}}" class="flex-shrink-0 object-cover h-7 w-7 p-[3px] bg-white border border-gray-300 dark:border-gray-900" alt="@{{account.username}} avatar"/>
<a href="{{account.url}}" class="text-sm font-bold text-black dark:text-gray-200 hover:text-primary">
@{{account.username}}
</a>
{% if account._is_manual %}
<span class="badge badge-yellow" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="This alt was manually connected by a moderator">Manual</span>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>

View File

@ -136,6 +136,10 @@
<span data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Original username: @{{u.original_username}}">@{{u.original_username}}
</span>
</div>
<div>&#183;</div>
<div>
#{{u.id}}
</div>
{% endif %}
</div>
</div>
@ -457,5 +461,5 @@
</script>
{% endif %}
<script defer src="/assets/CHRISTMAS/js/userpage.js?a=1"></script>
<script defer src="/assets/CHRISTMAS/js/userpage.js?a=6"></script>
{% endblock %}