mirror of
https://github.com/Mistake35/Cedar-Django.git
synced 2026-07-18 00:21:14 +10:00
Login page moved to forms.py, New warning and ban system, a bunch of other shit.
- Change password page from profile settings has been moved over to forms.py - Login page has been moved over to forms.py. There is no JavaScript right now, however it is still functional. -Profile_tools_Form has been altered to remove a few unneeded fields that administrators don't need to mess with. - warned_reason and warned fields are gone from User_tools_Form and will be removed from models.py at a later point. - a new ban system has been implemented. While bans are still incomplete and lack capabilities to ban IP addresses as of right now, the groundwork is now here and those features can be added later. - manage_bans page was added. - A new warning system has been implemented. If a Warning is created, a notification is created automatically with it. A warning notification replaces the "new announcement" notification type. - Warning notifications are larger and stand out compared to normal notifications - When posting, commenting or messaging someone, a check is performed to make sure you've seen the warning notification. - manage_warnings page was added. This page will also show you the warning history. - help_text was added to a bunch of fields.
This commit is contained in:
@@ -4,21 +4,12 @@
|
||||
<div id="help" class="main-column">
|
||||
<div class="post-list-outline">
|
||||
<h2 class="label">Change password</h2>
|
||||
<form class="setting-form" method="post" action={% url "main:change-password-set" %}>
|
||||
<form class="setting-form" method="post" action={% url "main:change-password" %}>
|
||||
<p>You can change your password here</p>
|
||||
<li class="setting">
|
||||
<p class="settings-label">Old Password:</p>
|
||||
<div class="center center-input">
|
||||
<input type="password" name="old-password" maxlength="100" placeholder="Old Password">
|
||||
</div>
|
||||
<p class="settings-label">New Password:</p>
|
||||
<div class="center center-input">
|
||||
<input type="password" name="new-password" maxlength="100" placeholder="New Password">
|
||||
</div>
|
||||
<p class="settings-label">Confirm Password:</p>
|
||||
<div class="center center-input">
|
||||
<input type="password" name="confirm-password" maxlength="100" placeholder="Confirm Password">
|
||||
</div>
|
||||
<li class="center-input">
|
||||
{% for field in form %}
|
||||
<h3 class='label'>{{ field }}</h3>
|
||||
{% endfor %}
|
||||
</li>
|
||||
{% csrf_token %}
|
||||
<div class="form-buttons">
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
</div>
|
||||
<div class="community-top-sidebar">
|
||||
<div class="post-list-outline index-memo">
|
||||
<h2 class="label">Community creation Q&A</h2>
|
||||
<h2 class="label">Community creation</h2>
|
||||
<h2>Why?</h2>
|
||||
<p>I have no idea, I guess it's cool to have. You can have your own little corner of this site now...</p>
|
||||
<h2>What can I do with my own community?</h2>
|
||||
<p>You can edit it, and that's basically it.</p>
|
||||
<p>Maybe there's a community that's missing which should be here, or you just want a corner of the site to call your own.</p>
|
||||
<h2>How can I make my own community?</h2>
|
||||
<p>Assuming you haven't already made one, A button should be visible below that will allow you to create a community. Don't worry, you'll be able to set the icon and banner when editing a community after it has been made. Just keep in mind that creating inappropriate, or shitty communities can result in them getting taken down, if this does happen you will not be refunded your C-Token, and you're shit out of luck.</p>
|
||||
<h2>What are C-Tokens, and how do I get them?</h2>
|
||||
<p>Community tokens are a stupid and overcomplicated method of preventing 200,000 communities from being made by one person. You get one when signing up, and you can use it to make your own community. Please do not ask staff for more C-Tokens unless you believe the communities you are going to make are really that good.</p>
|
||||
<h2>Any future plans?</h2>
|
||||
<p>no</p>
|
||||
<p>Community tokens are a stupid and overcomplicated method of preventing a bunch of communities from being made by one person. You get one when signing up, and you can use it to make your own community. Please do not ask staff for more C-Tokens, you probably won't be given any, and let's be honest here, one community is enough for one person.</p>
|
||||
<h2>Okay great... Now what can I do with my community?</h2>
|
||||
<p>Whatever you want, really... So long as your community isn't so shitty that we take it down. You are able to edit your community, set your banner, icon and whatnot. And you can ban people from posting and replying in your community if you block someone. Just keep in mind that blocks work both ways, they cannot fuck with you, nor can you fuck with them.</p>
|
||||
</div>
|
||||
{% if request.user.c_tokens > 0 %}<a class="big-button" href={% url "main:community-create" %}><span class="symbol-label">Create a community</span></a>{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -7,22 +7,7 @@
|
||||
<form action="{% url "main:community-search" %}" class="search">
|
||||
<input maxlength="32" name="query" placeholder="Search all communities" type="text"><input title="Search" type="submit" value="q">
|
||||
</form>
|
||||
<!--<div class="close-announce-container">
|
||||
<div class="close-announce-link">
|
||||
<a class="title" id="close-text-ann" href="/posts/1186"><b>Closedverse is still in indefinite maintenance.</b></a>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
{% if user.is_warned and user.is_active %}
|
||||
<div class="notice" style="background-color: #ffc783;border: 1px solid #ffb358;">
|
||||
<p><b>WARNING</b>: You have been issued a warning by an administrator.
|
||||
<div>
|
||||
{% if user.get_warned_reason %}
|
||||
<p>Reason: "{{ user.get_warned_reason }}"</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not user.is_active and user.is_authenticated %}
|
||||
<div class="notice" style="background-color: #ff9797;border: 1px solid #ff5252;">
|
||||
<p><b>Oops</b>: You've been smacked by an admin. Better luck next time.
|
||||
@@ -44,6 +29,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if announcements and request.user.is_authenticated %}
|
||||
<a href="#communities">Skip to communities</a>
|
||||
<div class="tleft">
|
||||
<div class="post-list-outline">
|
||||
<h2 class="label">Latest Announcements</h2>
|
||||
|
||||
@@ -20,23 +20,19 @@
|
||||
{% if request.user.has_freedom %}
|
||||
<li class="setting-community-icon">
|
||||
<label class="file-button-container">
|
||||
<p class="input-label">Community icon: {{ max_icon_size }}MB</p>
|
||||
<p class="input-label">Community icon:</p>
|
||||
<span class="button file-upload-button">Upload a new icon</span>
|
||||
<input accept="image/gif, image/png, image/webp, image/jpeg, image/jpg, image/svg+xml, image/bmp" type="file" style="display: none;" name="community_icon" onchange="loadFile(event)" id="upload-file">
|
||||
<input accept="image/gif, image/png, image/webp, image/jpeg, image/jpg, image/svg+xml, image/bmp" type="file" style="display: none;" name="community_icon" id="upload-file">
|
||||
</label>
|
||||
</li>
|
||||
<li class="setting-community-banner">
|
||||
<label class="file-button-container">
|
||||
<p class="input-label">Community banner: {{ max_banner_size }}MB</p>
|
||||
<p class="input-label">Community banner:</p>
|
||||
<span class="button file-upload-button">Upload a new banner</span>
|
||||
<input accept="image/gif, image/png, image/webp, image/jpeg, image/jpg, image/svg+xml, image/bmp" type="file" style="display: none;" name="community_banner" onchange="loadFile(event)" id="upload-file">
|
||||
</label>
|
||||
</li>
|
||||
<<<<<<< Updated upstream
|
||||
{% endif %}
|
||||
=======
|
||||
{% endif %}
|
||||
>>>>>>> Stashed changes
|
||||
<li>
|
||||
<p> </p>
|
||||
<input type="checkbox" name="force_login" {% if community.require_auth %}checked{% endif %}>Require login:
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
{% extends "closedverse_main/layout.html" %}{% block main-body %}{% load closedverse_community %}
|
||||
{% community_sidebar community request %}
|
||||
<div class="main-column">
|
||||
{% if user.is_warned %}
|
||||
<div class="notice" style="background-color: #ffc783;border: 1px solid #ffb358;">
|
||||
<p><b>WARNING</b>: You have been issued a warning by an administrator.
|
||||
<div>
|
||||
{% if user.get_warned_reason %}
|
||||
<p>Reason: "{{ user.get_warned_reason }}"</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="post-list-outline">
|
||||
<h2 class="label">{{ community.name }}</h2>
|
||||
{% if request.user.is_authenticated and community.post_perm %}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<p>I'm loading it !</p>
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</label>
|
||||
<div class="file-button-container">
|
||||
<span class="input-label">Video <span>MP4s and WEBMs are allowed. (50MB size limit)</span></span>
|
||||
<span class="input-label">Video <span>MP4s and WEBMs are allowed.</span></span>
|
||||
<input type="file" class="file-button" name="video" accept="video/mp4, video/webm">
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{% if message.drawing %}
|
||||
<p class="post-content-memo"><img src="{{ message.drawing }}"></p>
|
||||
{% else %}
|
||||
<div class="post-content-text">{{ message.body|markdown }}</div>
|
||||
<div class="post-content-text">{{ message.body }}</div>
|
||||
{% endif %}
|
||||
{% if message.screenshot %}
|
||||
<div class="screenshot-container still-image"><img src="{{ message.screenshot }}"></div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% load closedverse_tags %}<div class="news-list-content trigger{% if not notification.read %} notify{% endif %}" tabindex="0" id="{{ notification.unique_id }}" data-href="{{ notification.url }}">
|
||||
{% user_icon_container notification.source %}
|
||||
{% load closedverse_tags %}<div class="news-list-content trigger{% if not notification.read %} notify{% endif %}{% if notification.type == 5 %} bigger{% endif %}" tabindex="0" id="{{ notification.unique_id }}" {% if notification.url %}data-href="{{ notification.url }}"{% endif %}>
|
||||
{% if not notification.type == 5 %}{% user_icon_container notification.source %}{% endif %}
|
||||
<div class="body">
|
||||
{% if notification.type == 0 %}
|
||||
{% print_names notification.all_users %} gave <a href="{{ notification.url }}" class="link">your post ({{ notification.context_post.trun|truncatechars:30 }})</a> a Yeah.
|
||||
@@ -11,6 +11,10 @@
|
||||
{% print_names notification.all_users %} commented on <a href="{{ notification.url }}" class="link">{{ notification.source.nickname }}'s post ({{ notification.context_post.trun|truncatechars:30 }})</a>.
|
||||
{% elif notification.type == 4 %}
|
||||
Followed by {% print_names notification.all_users %}.
|
||||
{% elif notification.type == 5 %}
|
||||
<p class='warning-notif'>You've received a warning from an administrator!</p>
|
||||
{% if notification.context_warning.reason %}<p class='warning-reason'><b>Reason: </b>{{ notification.context_warning.reason }}</p>{% endif %}
|
||||
<p class='warning-note'>To avoid seeing this in the future, it's a good idea to catch up on the rules. Continuous violations of our rules may result in your account getting restricted.</p>
|
||||
{% endif %}
|
||||
<span class="timestamp"> {% time notification.latest %}</span>
|
||||
{% if notification.type == 4 and not notification.source.is_following and not notification.all_users|length > 1 %}
|
||||
|
||||
@@ -11,17 +11,6 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if user.is_warned and user.is_active %}
|
||||
<div class="notice" style="background-color: #ffc783;border: 1px solid #ffb358;">
|
||||
<p><b>Notice</b>: This user has received a warning by an administrator.</p>
|
||||
<div>
|
||||
{% if user.get_warned_reason %}
|
||||
<p>Reason: "{{ user.get_warned_reason }}"</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="sidebar-container">
|
||||
{% if profile.favorite.screenshot %}
|
||||
@@ -50,13 +39,10 @@
|
||||
<button type="button" data-action="{% url "main:user-fr-delete" user.username %}" data-screen-name="{{ user.nickname }}" class="friend-button unf delete button symbol">Friends</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not has_authority and request.user.can_manage %}
|
||||
<button class="button" data-href="{% url "main:user-tools" user.username %}">User Settings</button>
|
||||
{% endif %}
|
||||
{% if not general and not user.is_me and profile.can_block %}
|
||||
{% if not user.is_me %}
|
||||
<div class="report-buttons-content">
|
||||
<!-- for later use <button type="button" class="report-button report-user" data-track-label="user" data-track-action="openReportModal" data-track-category="reportViolator" data-modal-open="#report-violator-page">Report Violation</button> -->
|
||||
<button type="button" class="report-button block-button">{% if profile.is_blocked %}Unblock{% else %}Block{% endif %}</button>
|
||||
{% if profile.can_block %}<button type="button" class="report-button block-button">{% if profile.is_blocked %}Unblock{% else %}Block{% endif %}</button>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -124,6 +110,21 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if not has_authority and request.user.can_manage %}
|
||||
<div class="sidebar-setting sidebar-container">
|
||||
<div class="sidebar-post-menu">
|
||||
<a href={% url "main:user-tools" user.username %} class="sidebar-admin-settings symbol{% if selection == 7 %} selected{% endif %}">
|
||||
<span>User Settings</span>
|
||||
</a>
|
||||
<a href={% url "main:user-tools-warnings" user.username %} class="sidebar-admin-warnings symbol{% if selection == 8 %} selected{% endif %}">
|
||||
<span>Warn User</span>
|
||||
</a>
|
||||
<a href={% url "main:user-tools-bans" user.username %} class="sidebar-admin-bans symbol{% if selection == 9 %} selected{% endif %}">
|
||||
<span>Ban User</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="sidebar-container sidebar-profile">
|
||||
{% if profile.comment %}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<h3>General account information:</h3>
|
||||
<p>IP address: <span>{% if user.addr %}{{ user.addr }}{% else %}Data missing{% endif %}
|
||||
<p>Signup IP address: <span>{% if user.signup_addr %}{{ user.signup_addr }}{% else %}Data missing{% endif %}</p>
|
||||
<p>User agent: <span>{% if user.user_agent %}{{ user.user_agent }}{% else %}Data missing{% endif %}
|
||||
<p>Rank: <span>{% if user.staff %}You are a staff member.{% elif not user.level <= 0 %}You are a moderator. (Level {{ user.level }}){% else %}You are a regular user.{% endif %}
|
||||
<h3>My content:</h3>
|
||||
<p>Your account has existed for {{ age }} days! During that time, we've collected:</p>
|
||||
|
||||
@@ -7,12 +7,18 @@
|
||||
<p class="lh">Log In</p>
|
||||
<p>Sign in to access this instance of {{ brand_name }}</p>
|
||||
<div class="login-box">
|
||||
<h3 class="label"><input type="text" class="auth-input" name="username" maxlength="32" placeholder="Username"></h3>
|
||||
<h3 class="label"><input type="password" class="auth-input" name="password" maxlength="32" placeholder="Password"></h3>
|
||||
<h3 class='label'>{{ form.username }}</h3>
|
||||
<h3 class='label'>{{ form.password }}</h3>
|
||||
</div>
|
||||
{% csrf_token %}
|
||||
|
||||
<p class="red" style="margin-bottom:6px"></p>
|
||||
<p class="red" style="margin-bottom:6px">
|
||||
{% for field, errors in form.errors.items %}
|
||||
{% for error in errors %}
|
||||
{{ error }}<br>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
|
||||
<button type="submit" class="black-button">Sign In</button>
|
||||
<div class="ll">
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends "closedverse_main/layout.html" %}
|
||||
{% block main-body %}{% load closedverse_user %}{% load closedverse_tags %}
|
||||
{% user_sidebar request user profile 9 False %}
|
||||
<div class="main-column"><div class="post-list-outline">
|
||||
<h2 class="label">Ban {{ user.username }}</h2>
|
||||
<form class="setting-form" method="post" action={% url "main:user-tools-bans" user.username %}>
|
||||
{% if not banned %}
|
||||
<li class="setting">
|
||||
<p class="settings-label">Reasoning:</p>
|
||||
{{ form.reason }}
|
||||
<p class="settings-label">Expiry:</p>
|
||||
{{ form.expiry_date }}
|
||||
<p class='note'>{{ user.username }} will be banned from {{ brand_name }} until the time is right.</p>
|
||||
</li>
|
||||
{% csrf_token %}
|
||||
<div class="form-buttons">
|
||||
<input type="submit" class="button apply-button" value="Ban {{ user.username }}">
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="label">This user is banned already.</p>
|
||||
<p>The ban will expire on: {{ active_ban.expiry_date }}</p>
|
||||
<p>Time remaining: {{ active_ban.expiry_date|timeuntil }}</p>
|
||||
{% endif %}
|
||||
</form></div></div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,49 @@
|
||||
{% extends "closedverse_main/layout.html" %}
|
||||
{% block main-body %}{% load closedverse_user %}{% load closedverse_tags %}
|
||||
{% user_sidebar request user profile 8 False %}
|
||||
<div class="main-column"><div class="post-list-outline">
|
||||
<h2 class="label">Send a warning to {{ user.username }}</h2>
|
||||
<form class="setting-form" method="post" action={% url "main:user-tools-warnings" user.username %}>
|
||||
<li class="setting">
|
||||
<p class="settings-label">Reasoning:</p>
|
||||
{{ form.reason }}
|
||||
<p class='note'>Warnings will show as notifications. {{ user.username }} will not be able to post, comment, or message another user until this notification is seen. {{ user.username }} will not see who sent this warning.</p>
|
||||
</li>
|
||||
<div class="user-data">
|
||||
{% if unread_warnings %}<li>
|
||||
<p class='setting'>Warnings that have not been read yet:<p>
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Incident</th>
|
||||
</tr>
|
||||
{% for Notifications in unread_warnings %}
|
||||
<tr>
|
||||
<td>{{ Notifications.created }}</td>
|
||||
<td>{{ Notifications.context_warning.reason }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>{% endif %}
|
||||
</li>{% if all_warnings %}
|
||||
<p class='setting'>Incident history:<p>
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<th>Time</th>
|
||||
<th>Issued by</th>
|
||||
<th>Incident</th>
|
||||
</tr>
|
||||
{% for Warning in all_warnings %}
|
||||
<tr>
|
||||
<td>{{ Warning.created }}</td>
|
||||
<td>{{ Warning.by }}</td>
|
||||
<td>{{ Warning.reason }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>{% endif %}
|
||||
</div>
|
||||
{% csrf_token %}
|
||||
<div class="form-buttons">
|
||||
<input type="submit" class="button apply-button" value="Send warning to {{ user.username }}">
|
||||
</div>
|
||||
</form></div></div>
|
||||
{% endblock %}
|
||||
@@ -1,12 +1,9 @@
|
||||
{% extends "closedverse_main/layout.html" %}
|
||||
{% block main-body %}{% load closedverse_user %}{% load closedverse_tags %}
|
||||
{% user_sidebar request user profile 7 False %}
|
||||
<div class="main-column"><div class="post-list-outline">
|
||||
<h2 class="label">Change settings for {{ user.username }}</h2>
|
||||
<form class="setting-form" method="post" action={% url "main:user-tools-set" user.username %}>
|
||||
<p>Yes, this form is now ugly, but it's way more powerful.</p>
|
||||
<li class="setting">
|
||||
{% user_sidebar_info user %}
|
||||
|
||||
{% for field in user_form %}
|
||||
<li class='setting'>
|
||||
{% if field.field.widget.input_type == 'checkbox' %}
|
||||
@@ -38,8 +35,6 @@
|
||||
<p class='note'>{{ field.help_text }}</p>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
</li>
|
||||
<li class="setting">
|
||||
<p class="settings-label">Purge content:</p>
|
||||
{% for field in purge_form %}
|
||||
@@ -51,7 +46,6 @@
|
||||
<div class="center center-input">
|
||||
<p class="settings-label">Metadata:</p>
|
||||
<div class="user-data">
|
||||
<p>User agent: <span>{% if user.user_agent %}{{ user.user_agent }}{% else %}Data missing{% endif %}
|
||||
<p>Rank: <span>{% if user.staff %}Staff member.{% elif not user.level <= 0 %}Moderator. (Level {{ user.level }}){% else %}Regular user.{% endif %}
|
||||
<p> </p>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<h3>General account information:</h3>
|
||||
<p>IP address: <span>{% if user.addr %}{{ user.addr }}{% else %}Data missing{% endif %}
|
||||
<p>Signup IP address: <span>{% if user.signup_addr %}{{ user.signup_addr }}{% else %}Data missing{% endif %}</p>
|
||||
<p>User agent: <span>{% if user.user_agent %}{{ user.user_agent }}{% else %}Data missing{% endif %}
|
||||
<p>Email: <span>{% if user.email %}{{ user.email }}{% else %}Data missing{% endif %}
|
||||
<p>Rank: <span>{% if user.staff %}Staff member.{% elif not user.level <= 0 %}Moderator. (Level {{ user.level }}){% else %}Regular user.{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<li class="setting-website">
|
||||
<p class="settings-label">Discord Username</p>
|
||||
<div class="center center-input">
|
||||
<input type="text" name="external" maxlength="255" placeholder="Discord Tag" value="{{ profile.external }}">
|
||||
<input type="text" name="external" maxlength="255" placeholder="@" value="{{ profile.external }}">
|
||||
</div>
|
||||
<p class="note">Actually, you don't have to put a Discord username here, you can put anything here, such as your Threads username or X username. Discord sure is popular though.</p>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user