mirror of
https://github.com/Mistake35/Cedar-Django.git
synced 2026-07-18 00:21:14 +10:00
Fixing broken CSS, HTML changes, invite page is hidden if turned off, mods can revoke invite privileges.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{% extends "closedverse_main/layout.html" %}
|
||||
{% load closedverse_tags %}{% block main-body %}
|
||||
{% nocontent "If you're not careful and you noclip out of reality in the wrong areas, you'll end up in the Backrooms, where it's nothing but the stink of old moist carpet, the madness of mono-yellow, the endless background noise of fluorescent lights at maximum hum-buzz, and approximately six hundred million square miles of randomly segmented empty rooms to be trapped in. God save you if you hear something wandering around nearby, because it sure as hell has heard you." %}
|
||||
{% nocontent "There's nothing here." %}
|
||||
{% endblock %}
|
||||
@@ -84,12 +84,16 @@
|
||||
<div id="guide-menu">
|
||||
<a class="arrow-button" href="{% url "main:help-why" %}"><span>Why join?</span></a>
|
||||
<a class="arrow-button" href="{% url "main:help-rules" %}"><span>{{ brand_name }} Rules</span></a>
|
||||
{% if request.user.is_authenticated %}
|
||||
<a class="arrow-button" href="{% url "main:my-data" %}"><span>My Data</span></a>
|
||||
{% endif %}
|
||||
<a class="arrow-button" href="{% url "main:help-faq" %}"><span>Frequently Asked Questions (FAQ)</span></a>
|
||||
<a class="arrow-button" href="{% url "main:what-ads" %}"><span>What are user-generated ads?</span></a>
|
||||
{% if settings.CLOSEDVERSE_PROD %}
|
||||
<a class="arrow-button" href="{% url "main:help-contact" %}"><span>Contact information</span></a>
|
||||
{% endif %}
|
||||
<a class="arrow-button" href="https://pf2m.com/openverse/"><span>Info about Openverse</span></a>
|
||||
<a class="arrow-button" href="https://github.com/ariankordi/closedverse"><span>Closedverse Github</span></a>
|
||||
<a class="arrow-button" href="https://github.com/Mistake35/Cedar-Django"><span>Cedar-Django Github</span></a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
<menu id="global-menu">
|
||||
<li id="global-menu-logo"><h1><a href="/"><img src="{% static "img/menu-logo.svg" %}" alt="Cedar"></a></h1></li>
|
||||
{% if request.user.unique_id %}
|
||||
{% invite_only request as inv %}
|
||||
<li id="global-menu-list">
|
||||
<ul>
|
||||
<li id="global-menu-mymenu"><a href="{% url "main:user-view" request.user.username %}"><span class="icon-container {% user_class request.user %}"><img src="{% avatar request.user %}" alt="My Profile"></span><span>My Profile</span></a></li>
|
||||
@@ -115,7 +116,7 @@
|
||||
<menu id="global-my-menu" class="invisible none">
|
||||
<li><a href="{% url "main:profile-settings" %}" class="symbol my-menu-profile-setting"><span>Profile settings</span></a></li>
|
||||
<li><a href="#" class="symbol my-menu-account-setting"><span>Account preferences</span></a></li>
|
||||
<li><a href="{% url "main:invites" %}" class="symbol my-menu-guide"><span>Invites</span></a></li>
|
||||
{% if inv %}<li><a href="{% url "main:invites" %}" class="symbol my-menu-guide"><span>Invites</span></a></li>{% endif %}
|
||||
<li><a href="{% url "main:special-community-tag" "announcements" %}" class="symbol my-menu-openman"><span>Cedar Announcements</span></a></li>
|
||||
<li><a href="{% url "main:help-faq" %}" class="symbol my-menu-guide"><span>Frequently Asked Questions (FAQ)</span></a></li>
|
||||
<li><a href="{% url "main:help-rules" %}" class="symbol my-menu-guide"><span>Cedar Rules</span></a></li>
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
<p class="note">If you need to set a post limit for someone, you can do that here, Set this back to "0" to remove the restriction.</p>
|
||||
<input type="checkbox" name="let_freedom" {% if not profile.let_freedom %}checked{% endif %}>Restrict image posting:
|
||||
<p class="note">If you need to prevent someone from posting images and URLs, you can do that here. This will also prevent this user from making new accounts on the same IP address.</p>
|
||||
<input type="checkbox" name="can_invite" {% if not user.can_invite %}checked{% endif %}>Restrict invite creation:
|
||||
<p class="note">This site has an invitation function. If this invite function is active, users will need a code to sign up. Every user can make a code as long as they are allowed to do so. Check this box to prevent this user from making invites.</p>
|
||||
</li>
|
||||
<ul>
|
||||
<li class="setting">
|
||||
@@ -59,11 +61,27 @@
|
||||
<li class="setting">
|
||||
<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>
|
||||
{% if request.user.level >= min_lvl_metadata_perms %}
|
||||
<p class='red'>Each time you view someone's private info, a log is created.</p>
|
||||
<a href="{% url "main:user-tools-meta" user.username %}">View private info</a>
|
||||
<a class='button' href="{% url "main:user-tools-meta" user.username %}">View private info</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if accountmatch %}
|
||||
<h3>Account(s) found with the same IP address.</h3>
|
||||
<div class="user-data">
|
||||
<table style="width:100%">
|
||||
{% for accountmatch in accountmatch %}
|
||||
<tr>
|
||||
<td><a href={% url "main:user-view" accountmatch.username %}>{{ accountmatch.username }}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if seen_by %}
|
||||
<h3>Account viewed by:</h3>
|
||||
<div class="user-data">
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
<h2 class="label">View info for {{ user.username }}</h2>
|
||||
<div class="help-content">
|
||||
<p class="settings-label">Account metadata: Mods under level {{ min_lvl_metadata_perms }} can't see this.</p>
|
||||
<p class='red'>Each time you view someone's metadata, a log is created.</p>
|
||||
<div class="user-data">
|
||||
<p>Like any other site, we collect small bits of information from accounts for security reasons.
|
||||
<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>
|
||||
{% if accountmatch %}
|
||||
@@ -24,7 +24,7 @@
|
||||
</tr>
|
||||
{% for accountmatch in accountmatch %}
|
||||
<tr>
|
||||
<td>{{ accountmatch.username }}</td>
|
||||
<td><a href={% url "main:user-view" accountmatch.username %}>{{ accountmatch.username }}</a></td>
|
||||
<td>{{ accountmatch.created }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
<li class="setting-background">
|
||||
<p class="settings-label">Change your password:</p>
|
||||
<div class="center center-input">
|
||||
<p class="note">You can now <a href="{% url "main:change-password" %}">change your password</a>.</p>
|
||||
<a class="button" href={% url "main:change-password" %}>Change password</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="setting-nnid">
|
||||
|
||||
@@ -11,7 +11,7 @@ register = template.Library()
|
||||
def avatar(user, feeling=0):
|
||||
return user.do_avatar(feeling)
|
||||
@register.simple_tag
|
||||
def invite_only(settings):
|
||||
def invite_only(request):
|
||||
if settings.invite_only:
|
||||
return True
|
||||
else:
|
||||
|
||||
@@ -1680,11 +1680,9 @@ def user_tools(request, username):
|
||||
seen_by = MetaViews.objects.filter(target_user=user).distinct().order_by('-id')[:10]
|
||||
has_seen = MetaViews.objects.filter(from_user=user).distinct().order_by('-id')[:10]
|
||||
|
||||
'''
|
||||
findattempt = LoginAttempt.objects.filter(user=user).order_by('-id')[:1]
|
||||
for findattempt in findattempt:
|
||||
accountmatch = LoginAttempt.objects.filter(addr__in=[findattempt.addr])
|
||||
'''
|
||||
accountmatch = User.objects.filter(
|
||||
Q(addr=user.addr) | Q(addr=user.signup_addr)
|
||||
).exclude(username=user.username)
|
||||
|
||||
return render(request, 'closedverse_main/man/usertools.html', {
|
||||
'title': 'Admin tools',
|
||||
@@ -1692,6 +1690,7 @@ def user_tools(request, username):
|
||||
'seen_by': seen_by,
|
||||
'has_seen': has_seen,
|
||||
'profile': profile,
|
||||
'accountmatch': accountmatch,
|
||||
'min_lvl_metadata_perms': settings.min_lvl_metadata_perms,
|
||||
})
|
||||
|
||||
@@ -1772,6 +1771,7 @@ def user_tools_set(request, username):
|
||||
user.warned = False if request.POST.get('warned') is None else True
|
||||
profile.let_freedom = True if request.POST.get('let_freedom') is None else False
|
||||
profile.cannot_edit = False if request.POST.get('cannot_edit') is None else True
|
||||
user.can_invite = True if request.POST.get('can_invite') is None else False
|
||||
|
||||
purge_posts = False if request.POST.get('purge_posts') is None else True
|
||||
purge_comments = False if request.POST.get('purge_comments') is None else True
|
||||
@@ -1796,6 +1796,8 @@ def user_tools_set(request, username):
|
||||
raise Http404()
|
||||
|
||||
def invites(request):
|
||||
if not settings.invite_only:
|
||||
raise Http404()
|
||||
if not request.user.is_authenticated:
|
||||
raise Http404()
|
||||
invites_list = Invites.objects.filter(creator=request.user, used=False, void=False)
|
||||
|
||||
Reference in New Issue
Block a user