add web
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
{% extends 'groups/admin_template.html' %}
|
||||
{% block page_content%}
|
||||
<style>
|
||||
h5 {
|
||||
font-size: 15px;
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
</style>
|
||||
<h3>Create Role</h3>
|
||||
<form method="post">
|
||||
<div class="mt-3">
|
||||
<h5 class="mb-1">Role Name</h5>
|
||||
<input type="text" name="name" class="form-control" placeholder="Name" required>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<h5 class="mb-1">Role Description</h5>
|
||||
<textarea name="description" class="form-control" placeholder="Description" style="height: 100px" required></textarea>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<h5 class="mb-1">Rank ( 1 - 254 )</h5>
|
||||
<input type="number" name="rank" class="form-control" placeholder="Rank" max="254" min="1" required>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<div class="d-flex w-100 justify-content-end">
|
||||
<button type="submit" class="btn btn-light mt-3 ms-auto">Create R$25</button>
|
||||
</div>
|
||||
</form>
|
||||
{%endblock%}
|
||||
@@ -0,0 +1,42 @@
|
||||
{% extends 'groups/admin_template.html' %}
|
||||
{% block page_content%}
|
||||
<h3>
|
||||
Group Information
|
||||
</h3>
|
||||
<style>
|
||||
.upload-icon {
|
||||
font-size: 13px;
|
||||
}
|
||||
.upload-icon::file-selector-button {
|
||||
background-color: rgb(12, 12, 12);
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
color: rgb(200,200,200);
|
||||
border: 1px solid rgb(50,50,50);
|
||||
}
|
||||
.upload-icon::file-selector-button:hover {
|
||||
background-color: rgb(50,50,50);
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<img src="/Thumbs/GroupIcon.ashx?groupid={{group.id}}&x=420&y=420" width="100%" style="aspect-ratio: 1/1;" class="border rounded">
|
||||
<div class="mt-2">
|
||||
<input type="file" id="file" name="file" class="upload-icon">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="form-floating h-100 mt-2 mt-md-0">
|
||||
<textarea class="form-control" name="description" id="description" style="height: 100%;">{{group.description}}</textarea>
|
||||
<label for="description">Description</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<div class="w-100 mt-3">
|
||||
<button type="submit" class="btn btn-primary w-100 btn-sm" {% if group.owner_id != currentuser.id %}disabled{%endif%}>Save</button>
|
||||
</div>
|
||||
</form>
|
||||
{%endblock%}
|
||||
@@ -0,0 +1,52 @@
|
||||
{% extends 'groups/admin_template.html' %}
|
||||
{% block page_content%}
|
||||
<style>
|
||||
h5 {
|
||||
font-size: 15px;
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
</style>
|
||||
<div class="d-flex align-items-center">
|
||||
<h3 class="m-0">Join Requests</h3>
|
||||
<div class="ms-auto d-flex align-items-center">
|
||||
<form action="/groups/admin/{{group.id}}/members/requests/deny_all" method="post">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">Deny All</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
{% for request in JoinRequests.items %}
|
||||
<div class="col-4">
|
||||
<div class="p-2" style="background-color: rgb(31, 31, 31);box-shadow: 0px 0px 10px 0px rgb(0,0,0,0.5);">
|
||||
<div class="d-flex">
|
||||
<img src="/Thumbs/Head.ashx?x=100&y=100&userId={{request.user.id}}" width="60px" style="aspect-ratio: 1/1;" class="rounded border">
|
||||
<a class="text-decoration-none text-white ms-2" href="/users/{{request.user.id}}/profile">{{request.user.username}}</a>
|
||||
</div>
|
||||
<div class="d-flex align-items-center mt-1">
|
||||
<div class="w-50 p-1">
|
||||
<form action="/groups/admin/{{group.id}}/members/requests/deny/{{request.user.id}}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger w-100">Decline</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="w-50 p-1">
|
||||
<form action="/groups/admin/{{group.id}}/members/requests/accept/{{request.user.id}}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-light w-100">Accept</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if len(JoinRequests.items) == 0 %}
|
||||
<p class="mt-5 mb-5 w-100 text-center">No Results Found</p>
|
||||
{%endif%}
|
||||
<div class="d-flex w-100" style="font-size: 14px;">
|
||||
<a class="text-decoration-none ms-auto {% if not JoinRequests.has_prev: %}text-secondary{%endif%}" {% if JoinRequests.has_prev: %}href="/groups/admin/{{group.id}}/members/requests?page={{JoinRequests.prev_num}}"{%endif%}>Previous</a>
|
||||
<p class="m-0 ms-2 me-2 text-white">Page {{JoinRequests.page}} of {{JoinRequests.pages}}</p>
|
||||
<a class="text-decoration-none me-auto {% if not JoinRequests.has_next: %}text-secondary{%endif%}" {% if JoinRequests.has_next: %}href="/groups/admin/{{group.id}}/members/requests?page={{JoinRequests.next_num}}"{%endif%}>Next</a>
|
||||
</div>
|
||||
{%endblock%}
|
||||
@@ -0,0 +1,116 @@
|
||||
{% extends 'groups/admin_template.html' %}
|
||||
{% block page_content%}
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<h3 class="m-0">
|
||||
Members
|
||||
</h3>
|
||||
{% if group.settings.approval_required and permissions.invite_members %}
|
||||
<a href="/groups/admin/{{group.id}}/members/requests" class="m-0 ms-3 text-decoration-none">View Join Requests <span class="badge text-bg-primary">{{JoinRequestCount}}</span></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<form method="post" class="mb-3" style="font-size: 14px;">
|
||||
<div class="input-group">
|
||||
<div class="form-floating" style="width: 52%;">
|
||||
<input type="text" class="form-control" id="search-input" name="search-input" {%if searchByUsername != None: %}value="{{searchByUsername}}"{%endif%} placeholder="ROBLOX">
|
||||
<label for="search-input">Search</label>
|
||||
</div>
|
||||
<div class="form-floating" style="min-width: 160px;">
|
||||
<select class="form-select" id="search-by" name="search-by">
|
||||
<option value="0">All Roles</option>
|
||||
{% for roleObj in SortedRoles %}
|
||||
{% if roleObj.rank != 0 %}
|
||||
<option value="{{roleObj.id}}" {% if searchByRole.id == roleObj.id %}selected{%endif%}>{{roleObj.name}}</option>
|
||||
{%endif%}
|
||||
{%endfor%}
|
||||
</select>
|
||||
<label for="search-by">Search in</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-outline-primary fw-bold" style="min-width: 50px;"><i class="bi bi-search"></i></button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
{% for groupMember in Members %}
|
||||
<div class="col-4 col-sm-2 mb-3">
|
||||
<div class="position-relative">
|
||||
<img src="/Thumbs/Avatar.ashx?x=100&y=100&userId={{groupMember.user.id}}" width="100%" style="aspect-ratio: 1/1;" class="rounded border rounded-bottom-0 border-bottom-0">
|
||||
{% if permissions.remove_members and groupMember.group_role.rank < role.rank %}
|
||||
<button class="position-absolute btn-sm btn-outline-danger btn kick-btn" data-userid="{{groupMember.user.id}}" data-groupid="{{group.id}}" style="right: 5px;top: 5px;padding: 2px;">
|
||||
<i class="bi bi-hammer"></i>
|
||||
</button>
|
||||
{%endif%}
|
||||
</div>
|
||||
{% if permissions.change_rank and groupMember.group_role.rank < role.rank: %}
|
||||
<select style="font-size: 12px;padding: 4px;" class="form-select rounded-top-0 change-rank-select" data-userid="{{groupMember.user.id}}" data-groupid="{{group.id}}" data-currentrole="{{groupMember.group_role.id}}">
|
||||
{% for roleObj in SortedRoles %}
|
||||
{% if roleObj.rank != 0 and roleObj.rank < role.rank %}
|
||||
<option value="{{roleObj.id}}" {% if groupMember.group_role.id == roleObj.id %}selected{%endif%}>{{roleObj.name}}</option>
|
||||
{%endif%}
|
||||
{%endfor%}
|
||||
</select>
|
||||
{%else%}
|
||||
<p style="font-size: 12px;padding: 4px;" class="rounded-top-0 m-0 border rounded">{{groupMember.group_role.name}}</p>
|
||||
{%endif%}
|
||||
<a href="/users/{{groupMember.user.id}}/profile" class="text-decoration-none w-100 text-center d-block" style="font-size: 13px;">{{groupMember.user.username}}</a>
|
||||
</div>
|
||||
{%endfor%}
|
||||
</div>
|
||||
{% if len(Members.items) == 0 %}
|
||||
<p class="mt-5 mb-5 w-100 text-center">No Results Found</p>
|
||||
{%endif%}
|
||||
<div class="d-flex w-100" style="font-size: 14px;">
|
||||
<a class="text-decoration-none ms-auto {% if not Members.has_prev: %}text-secondary{%endif%}" {% if Members.has_prev: %}href="/groups/admin/{{group.id}}/members?page={{Members.prev_num}}{% if searchByUsername != None %}&search={{searchByUsername}}{%endif%}{%if searchByRole != None %}&role={{searchByRole.id}}{%endif%}"{%endif%}>Previous</a>
|
||||
<p class="m-0 ms-2 me-2 text-white">Page {{pageNumber}} of {{Members.pages}}</p>
|
||||
<a class="text-decoration-none me-auto {% if not Members.has_next: %}text-secondary{%endif%}" {% if Members.has_next: %}href="/groups/admin/{{group.id}}/members?page={{Members.next_num}}{% if searchByUsername != None %}&search={{searchByUsername}}{%endif%}{%if searchByRole != None %}&role={{searchByRole.id}}{%endif%}"{%endif%}>Next</a>
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
const XCSRFTOKEN = "{{ csrf_token() }}";
|
||||
const backgroundOverlay = document.getElementById('transparent-background-top');
|
||||
const changeRankSelects = document.querySelectorAll('.change-rank-select');
|
||||
changeRankSelects.forEach(select => {
|
||||
select.addEventListener('change', async () => {
|
||||
const userId = select.dataset.userid;
|
||||
const groupId = select.dataset.groupid;
|
||||
const currentRole = select.dataset.currentrole;
|
||||
const newRole = select.value;
|
||||
|
||||
if (newRole == currentRole) return;
|
||||
|
||||
backgroundOverlay.style.display = 'block';
|
||||
try {
|
||||
const response = await fetch(`/groups/admin/${groupId}/change_role/${userId}/${newRole}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': XCSRFTOKEN
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
})
|
||||
const kickBtns = document.querySelectorAll('.kick-btn');
|
||||
kickBtns.forEach(btn => {
|
||||
btn.addEventListener('click', async () => {
|
||||
const userId = btn.dataset.userid;
|
||||
const groupId = btn.dataset.groupid;
|
||||
backgroundOverlay.style.display = 'block';
|
||||
try {
|
||||
const response = await fetch(`/groups/admin/${groupId}/kick/${userId}`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': XCSRFTOKEN
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
} finally {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{%endblock%}
|
||||
@@ -0,0 +1,42 @@
|
||||
{% extends 'groups/admin_template.html' %}
|
||||
{% block page_content%}
|
||||
<style>
|
||||
h5 {
|
||||
font-size: 15px;
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
</style>
|
||||
<div class="d-flex align-items-center mb-1">
|
||||
<h3 class="m-0">One-time Payout</h3>
|
||||
</div>
|
||||
<form method="post" action="/groups/admin/{{group.id}}/payouts/one-time">
|
||||
<div class="d-flex align-items-center">
|
||||
<div style="width: 20%;" class="p-1">
|
||||
<div class="form-floating">
|
||||
<select class="form-control" id="payout-currency" name="payout-currency" required>
|
||||
<option value="robux">Robux</option>
|
||||
<option value="tickets">Tickets</option>
|
||||
</select>
|
||||
<label for="payout-currency">Currency Type</label>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 80%;" class="p-1">
|
||||
<div class="form-floating">
|
||||
<input type="text" class="form-control" id="payout-amount" name="payout-amount" placeholder="0" required>
|
||||
<label for="payout-amount">Amount</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%;" class="p-1 mt-1">
|
||||
<div class="form-floating">
|
||||
<input type="text" class="form-control" id="payout-recipient" name="payout-recipient" placeholder="ROBLOX" required>
|
||||
<label for="payout-recipient">Recipient Username</label>
|
||||
</div>
|
||||
<p class="mt-1 m-0 text-secondary" style="font-size:12px;">Enter the username of the recipient you want to pay! This is CaSe SeNsItIvE and please double check before clicking payout, all payments are final and cannot be reversed</p>
|
||||
</div>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<div class="mt-2 d-flex">
|
||||
<button type="submit" class="btn btn-light ms-auto" onclick="return confirm('Are you sure you want to pay this user?')">Payout</button>
|
||||
</div>
|
||||
</form>
|
||||
{%endblock%}
|
||||
@@ -0,0 +1,198 @@
|
||||
{% extends 'groups/admin_template.html' %}
|
||||
{% block page_content%}
|
||||
<style>
|
||||
.role-list {
|
||||
width: 140px;
|
||||
}
|
||||
.role-list a {
|
||||
display: block;
|
||||
color: rgb(220,220,220);
|
||||
text-decoration: none;
|
||||
margin-left: 10px;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 6px;
|
||||
transition: 0.1s;
|
||||
}
|
||||
.role-list a.selected {
|
||||
color: rgb(255,255,255);
|
||||
}
|
||||
.role-list a:hover {
|
||||
color: rgb(255,255,255);
|
||||
transition: 0.1s;
|
||||
}
|
||||
.role-container h5 {
|
||||
font-size: 15px;
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
.role-category {
|
||||
background-color: rgb(32, 32, 32);
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
box-shadow: 0px 0px 10px 0px rgb(0,0,0,0.5);
|
||||
}
|
||||
.role-permissions h5 {
|
||||
font-size: 25px;
|
||||
}
|
||||
.role-row p {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
color: rgb(255,255,255);
|
||||
}
|
||||
.role-row {
|
||||
padding: 3px;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid rgb(18, 18, 18);
|
||||
}
|
||||
</style>
|
||||
<div class="d-flex">
|
||||
<div class="me-2">
|
||||
<div class="border-end p-2" style="border-color: rgb(50,50,50) !important;">
|
||||
<h5 class="m-0 mb-1">Roles</h5>
|
||||
<div class="role-list">
|
||||
{% for role in roles %}
|
||||
<a href="/groups/admin/{{group.id}}/roles/{{role.id}}/view" class="text-truncate">{{role.name}}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<a class="btn btn-sm btn-light p-1 ps-3 pe-3 mt-2 w-100 {% if group.owner_id != currentuser.id %}disabled{%endif%}" {% if group.owner_id == currentuser.id %}href="/groups/admin/{{group.id}}/roles/create"{%endif%}>Create Role</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-fill mt-2">
|
||||
<form method="post" action="/groups/admin/{{group.id}}/roles/{{selectedrole.id}}/update" class="role-container">
|
||||
<div class="">
|
||||
<h5 class="m-0">Name</h5>
|
||||
<input type="text" class="form-control" name="role-name" placeholder="Name" value="{{selectedrole.name}}" required {% if selectedrole.rank == 0 %}disabled{%endif%}>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<h5 class="m-0">Description</h5>
|
||||
<textarea class="form-control" placeholder="Description" name="role-description" style="height: 100px" required {% if selectedrole.rank == 0 %}disabled{%endif%}>{{selectedrole.description}}</textarea>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<h5 class="m-0">Rank ( 0-255 )</h5>
|
||||
<input type="number" class="form-control" name="role-rank" placeholder="Rank" value="{{selectedrole.rank}}" max="254" min="1" required {% if selectedrole.rank == 0 or selectedrole.rank == 255 %}disabled{%endif%}>
|
||||
</div>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<div class="role-permissions mt-2">
|
||||
<h5>Posts</h5>
|
||||
<div class="role-category">
|
||||
<div class="role-row">
|
||||
<p>View group wall</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="view_wall" {% if selectedrole.permissions.view_wall %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="role-row">
|
||||
<p>Post on group wall</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="post_to_wall" {% if selectedrole.permissions.post_to_wall %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="role-row">
|
||||
<p>Delete group wall posts</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="delete_from_wall" {% if selectedrole.permissions.delete_from_wall %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="role-row">
|
||||
<p>View group shout</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="view_status" {% if selectedrole.permissions.view_status %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="role-row border-bottom-0">
|
||||
<p>Post group shout</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="post_to_status" {% if selectedrole.permissions.post_to_status %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h5 class="mt-3">Members</h5>
|
||||
<div class="role-category">
|
||||
<div class="role-row">
|
||||
<p>Manage lower-ranked member ranks</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="change_rank" {% if selectedrole.permissions.change_rank %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="role-row">
|
||||
<p>Accept join requests</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="invite_members" {% if selectedrole.permissions.invite_members %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="role-row border-bottom-0">
|
||||
<p>Kick lower-ranked members</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="remove_members" {% if selectedrole.permissions.remove_members %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h5 class="mt-3">Assets</h5>
|
||||
<div class="role-category">
|
||||
<div class="role-row">
|
||||
<p>Create Assets</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="create_items" {% if selectedrole.permissions.create_items %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="role-row">
|
||||
<p>Manage Assets</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="manage_items" {% if selectedrole.permissions.manage_items %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="role-row border-bottom-0">
|
||||
<p>Manage Group Games</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="manage_group_games" {% if selectedrole.permissions.manage_group_games %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h5 class="mt-3">Miscellaneous</h5>
|
||||
<div class="role-category">
|
||||
<div class="role-row">
|
||||
<p>Manage allies and enemies</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="manage_relationships" {% if selectedrole.permissions.manage_relationships %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="role-row border-bottom-0">
|
||||
<p>View audit log</p>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="view_audit_logs" {% if selectedrole.permissions.view_audit_logs %}checked{%endif%}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex w-100 justify-content-end">
|
||||
<button type="submit" class="btn btn-light mt-3 ms-auto" {% if group.owner_id != currentuser.id %}disabled{%endif%}>Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% if selectedrole.rank == 255 or group.owner_id != currentuser.id %}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const all_checkboxes = document.querySelectorAll('input[type="checkbox"]');
|
||||
all_checkboxes.forEach(checkbox => {
|
||||
checkbox.disabled = true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{%endif%}
|
||||
{% if group.owner_id != currentuser.id %}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const rank_input = document.querySelector('input[name="role-rank"]');
|
||||
const name_input = document.querySelector('input[name="role-name"]');
|
||||
const description_input = document.querySelector('textarea[name="role-description"]');
|
||||
rank_input.disabled = true;
|
||||
name_input.disabled = true;
|
||||
description_input.disabled = true;
|
||||
});
|
||||
</script>
|
||||
{%endif%}
|
||||
{%endblock%}
|
||||
@@ -0,0 +1,60 @@
|
||||
{% extends 'groups/admin_template.html' %}
|
||||
{% block page_content%}
|
||||
<h3>
|
||||
Settings
|
||||
</h3>
|
||||
<form enctype="multipart/form-data" method="post" class="ms-2">
|
||||
<div>
|
||||
<h5 class="mb-1">Requires Approval</h5>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="approval-required" id="approval-required1" value="off"{%if group.settings.approval_required == False %}checked{%endif%}>
|
||||
<label class="form-check-label" for="approval-required1">
|
||||
Anyone can join
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="approval-required" id="approval-required2" value="on"{%if group.settings.approval_required %}checked{%endif%}>
|
||||
<label class="form-check-label" for="approval-required2">
|
||||
Manual approval
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<h5 class="mb-1">Entry Qualifications</h5>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="membership-required" id="membership-required"{%if group.settings.membership_required %}checked{%endif%}>
|
||||
<label class="form-check-label" for="membership-required">
|
||||
User must have Builders Club
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<h5 class="mb-1">Miscellaneous</h5>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="declaration-allowed" id="declaration-allowed"{%if group.settings.enemies_allowed %}checked{%endif%}>
|
||||
<label class="form-check-label" for="declaration-allowed">
|
||||
Allow enemy declarations
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="funds-visible" id="funds-visible"{%if group.settings.funds_visible %}checked{%endif%}>
|
||||
<label class="form-check-label" for="funds-visible">
|
||||
Group funds are publicly visible
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="games-visible" id="games-visible"{%if group.settings.games_visible %}checked{%endif%}>
|
||||
<label class="form-check-label" for="games-visible">
|
||||
Group games are visible on the group home page
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<div class="mt-3">
|
||||
<button type="submit" class="btn btn-primary" {%if group.owner_id != user.id %}disabled{%endif%}>Save</button>
|
||||
{%if group.owner_id != user.id %}
|
||||
<p class="text-secondary m-0 mt-1">Only the owner of the group can modify the group settings</p>
|
||||
{%endif%}
|
||||
</div>
|
||||
</form>
|
||||
{%endblock%}
|
||||
Reference in New Issue
Block a user