More tweaks

This commit is contained in:
Andrew Godwin 2023-05-03 14:04:58 -06:00
parent 592466579f
commit 6c5e7929b6
34 changed files with 53 additions and 34 deletions

View file

@ -247,6 +247,7 @@ class Config(models.Model):
policy_terms: str = "" policy_terms: str = ""
policy_privacy: str = "" policy_privacy: str = ""
policy_rules: str = "" policy_rules: str = ""
policy_issues: str = ""
signup_allowed: bool = True signup_allowed: bool = True
signup_text: str = "" signup_text: str = ""

View file

@ -1 +1 @@
__version__ = "0.8.0" __version__ = "0.9.0-dev"

View file

@ -266,17 +266,22 @@ urlpatterns = [
path( path(
"pages/privacy/", "pages/privacy/",
core.FlatPage.as_view(title="Privacy Policy", config_option="policy_privacy"), core.FlatPage.as_view(title="Privacy Policy", config_option="policy_privacy"),
name="privacy", name="policy_privacy",
), ),
path( path(
"pages/terms/", "pages/terms/",
core.FlatPage.as_view(title="Terms of Service", config_option="policy_terms"), core.FlatPage.as_view(title="Terms of Service", config_option="policy_terms"),
name="terms", name="policy_terms",
), ),
path( path(
"pages/rules/", "pages/rules/",
core.FlatPage.as_view(title="Server Rules", config_option="policy_rules"), core.FlatPage.as_view(title="Server Rules", config_option="policy_rules"),
name="rules", name="policy_rules",
),
path(
"pages/issues/",
core.FlatPage.as_view(title="Report a Problem", config_option="policy_issues"),
name="policy_issues",
), ),
# Annoucements # Annoucements
path("announcements/<id>/dismiss/", announcements.AnnouncementDismiss.as_view()), path("announcements/<id>/dismiss/", announcements.AnnouncementDismiss.as_view()),

View file

@ -1,7 +1,8 @@
<footer> <footer>
{% if config.site_about %}<a href="{% url "about" %}">About</a>{% endif %} {% if config.site_about %}<a href="{% url "about" %}">About</a>{% endif %}
{% if config.policy_rules %}<a href="{% url "rules" %}">Server&nbsp;Rules</a>{% endif %} {% if config.policy_rules %}<a href="{% url "policy_rules" %}">Server&nbsp;Rules</a>{% endif %}
{% if config.policy_terms %}<a href="{% url "terms" %}">Terms&nbsp;of&nbsp;Service</a>{% endif %} {% if config.policy_terms %}<a href="{% url "policy_terms" %}">Terms&nbsp;of&nbsp;Service</a>{% endif %}
{% if config.policy_privacy %}<a href="{% url "privacy" %}">Privacy&nbsp;Policy</a>{% endif %} {% if config.policy_privacy %}<a href="{% url "policy_privacy" %}">Privacy&nbsp;Policy</a>{% endif %}
{% if config.policy_issues %}<a href="{% url "policy_issues" %}">Report a Problem</a>{% endif %}
<a href="https://jointakahe.org">Takahē&nbsp;{{ config.version }}</a> <a href="https://jointakahe.org">Takahē&nbsp;{{ config.version }}</a>
</footer> </footer>

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}Create Announcement{% endblock %} {% block subtitle %}Create Announcement{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}Announcement #{{ announcement.pk }}{% endblock %} {% block subtitle %}Announcement #{{ announcement.pk }}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}Announcements{% endblock %} {% block subtitle %}Announcements{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block title %}Add Domain - Admin{% endblock %} {% block title %}Add Domain - Admin{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block title %}Delete {{ domain.domain }} - Admin{% endblock %} {% block title %}Delete {{ domain.domain }} - Admin{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}{{ domain.domain }}{% endblock %} {% block subtitle %}{{ domain.domain }}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}Domains{% endblock %} {% block subtitle %}Domains{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% load activity_tags %} {% load activity_tags %}
{% block subtitle %}Emoji{% endblock %} {% block subtitle %}Emoji{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}{{ emoji.shortcode }}{% endblock %} {% block subtitle %}{{ emoji.shortcode }}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% load activity_tags %} {% load activity_tags %}
{% block subtitle %}Federation{% endblock %} {% block subtitle %}Federation{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}{{ domain.domain }}{% endblock %} {% block subtitle %}{{ domain.domain }}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}{{ hashtag.hashtag }}{% endblock %} {% block subtitle %}{{ hashtag.hashtag }}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}Hashtags{% endblock %} {% block subtitle %}Hashtags{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% load activity_tags %} {% load activity_tags %}
{% block subtitle %}Identities{% endblock %} {% block subtitle %}Identities{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}{{ identity.name_or_handle }}{% endblock %} {% block subtitle %}{{ identity.name_or_handle }}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}Create Invite{% endblock %} {% block subtitle %}Create Invite{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}View Invite{% endblock %} {% block subtitle %}View Invite{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% load activity_tags %} {% load activity_tags %}
{% block subtitle %}Invites{% endblock %} {% block subtitle %}Invites{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}Report {{ report.pk }}{% endblock %} {% block subtitle %}Report {{ report.pk }}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% load activity_tags %} {% load activity_tags %}
{% block subtitle %}Reports{% endblock %} {% block subtitle %}Reports{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}{{ section.title }}{% endblock %} {% block subtitle %}{{ section.title }}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}Stator{% endblock %} {% block subtitle %}Stator{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% block subtitle %}{{ editing_user.email }}{% endblock %} {% block subtitle %}{{ editing_user.email }}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "admin/base.html" %} {% extends "admin/base_main.html" %}
{% load activity_tags %} {% load activity_tags %}
{% block subtitle %}Users{% endblock %} {% block subtitle %}Users{% endblock %}

View file

@ -624,12 +624,12 @@ class Identity(StatorModel):
from activities.models.post import Post, PostStates from activities.models.post import Post, PostStates
Post.transition_perform_queryset(self.posts, PostStates.deleted) Post.transition_perform_queryset(self.posts, PostStates.deleted)
# Move ourselves to deleted
self.transition_perform(IdentityStates.deleted)
# Remove all users from ourselves and mark deletion date # Remove all users from ourselves and mark deletion date
self.users.set([]) self.users.set([])
self.deleted = timezone.now() self.deleted = timezone.now()
self.save() self.save()
# Move ourselves to deleted
self.transition_perform(IdentityStates.deleted)
### Actor/Webfinger fetching ### ### Actor/Webfinger fetching ###

View file

@ -26,7 +26,8 @@ class IdentitiesRoot(ListView):
def get_queryset(self): def get_queryset(self):
identities = ( identities = (
Identity.objects.annotate(num_users=models.Count("users")) Identity.objects.not_deleted()
.annotate(num_users=models.Count("users"))
.annotate(followers_count=models.Count("inbound_follows")) .annotate(followers_count=models.Count("inbound_follows"))
.order_by("created") .order_by("created")
) )

View file

@ -215,6 +215,11 @@ class PoliciesSettings(AdminSettingsPage):
"help_text": "Will only be shown if it has content. Use Markdown for formatting.\nIf you would like to redirect elsewhere, enter just a URL.", "help_text": "Will only be shown if it has content. Use Markdown for formatting.\nIf you would like to redirect elsewhere, enter just a URL.",
"display": "textarea", "display": "textarea",
}, },
"policy_issues": {
"title": "Report a Problem Page",
"help_text": "Will only be shown if it has content. Use Markdown for formatting.\nIf you would like to redirect elsewhere, enter just a URL.",
"display": "textarea",
},
} }
layout = { layout = {
@ -222,5 +227,6 @@ class PoliciesSettings(AdminSettingsPage):
"policy_rules", "policy_rules",
"policy_terms", "policy_terms",
"policy_privacy", "policy_privacy",
"policy_issues",
], ],
} }

View file

@ -1,4 +1,5 @@
from django import forms from django import forms
from django.contrib import messages
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.core.files import File from django.core.files import File
from django.shortcuts import redirect from django.shortcuts import redirect
@ -124,4 +125,6 @@ class ProfilePage(FormView):
Config.set_identity( Config.set_identity(
self.identity, "search_enabled", form.cleaned_data["search_enabled"] self.identity, "search_enabled", form.cleaned_data["search_enabled"]
) )
messages.success(self.request, "Your profile has been updated.")
return redirect(".") return redirect(".")

View file

@ -2,6 +2,7 @@ from functools import partial
from typing import ClassVar from typing import ClassVar
from django import forms from django import forms
from django.contrib import messages
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.core.files import File from django.core.files import File
from django.shortcuts import redirect from django.shortcuts import redirect
@ -113,6 +114,7 @@ class SettingsPage(FormView):
field.name, field.name,
form.cleaned_data[field.name], form.cleaned_data[field.name],
) )
messages.success(self.request, "Your settings have been saved.")
return redirect(".") return redirect(".")