mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-21 23:01:00 +00:00
More tweaks
This commit is contained in:
parent
592466579f
commit
6c5e7929b6
34 changed files with 53 additions and 34 deletions
|
@ -247,6 +247,7 @@ class Config(models.Model):
|
|||
policy_terms: str = ""
|
||||
policy_privacy: str = ""
|
||||
policy_rules: str = ""
|
||||
policy_issues: str = ""
|
||||
|
||||
signup_allowed: bool = True
|
||||
signup_text: str = ""
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "0.8.0"
|
||||
__version__ = "0.9.0-dev"
|
||||
|
|
|
@ -266,17 +266,22 @@ urlpatterns = [
|
|||
path(
|
||||
"pages/privacy/",
|
||||
core.FlatPage.as_view(title="Privacy Policy", config_option="policy_privacy"),
|
||||
name="privacy",
|
||||
name="policy_privacy",
|
||||
),
|
||||
path(
|
||||
"pages/terms/",
|
||||
core.FlatPage.as_view(title="Terms of Service", config_option="policy_terms"),
|
||||
name="terms",
|
||||
name="policy_terms",
|
||||
),
|
||||
path(
|
||||
"pages/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
|
||||
path("announcements/<id>/dismiss/", announcements.AnnouncementDismiss.as_view()),
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<footer>
|
||||
{% if config.site_about %}<a href="{% url "about" %}">About</a>{% endif %}
|
||||
{% if config.policy_rules %}<a href="{% url "rules" %}">Server Rules</a>{% endif %}
|
||||
{% if config.policy_terms %}<a href="{% url "terms" %}">Terms of Service</a>{% endif %}
|
||||
{% if config.policy_privacy %}<a href="{% url "privacy" %}">Privacy Policy</a>{% endif %}
|
||||
{% if config.policy_rules %}<a href="{% url "policy_rules" %}">Server Rules</a>{% endif %}
|
||||
{% if config.policy_terms %}<a href="{% url "policy_terms" %}">Terms of Service</a>{% endif %}
|
||||
{% if config.policy_privacy %}<a href="{% url "policy_privacy" %}">Privacy Policy</a>{% endif %}
|
||||
{% if config.policy_issues %}<a href="{% url "policy_issues" %}">Report a Problem</a>{% endif %}
|
||||
<a href="https://jointakahe.org">Takahē {{ config.version }}</a>
|
||||
</footer>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}Create Announcement{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}Announcement #{{ announcement.pk }}{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}Announcements{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block title %}Add Domain - Admin{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block title %}Delete {{ domain.domain }} - Admin{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}{{ domain.domain }}{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}Domains{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
{% load activity_tags %}
|
||||
|
||||
{% block subtitle %}Emoji{% endblock %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}{{ emoji.shortcode }}{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
{% load activity_tags %}
|
||||
|
||||
{% block subtitle %}Federation{% endblock %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}{{ domain.domain }}{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}{{ hashtag.hashtag }}{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}Hashtags{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
{% load activity_tags %}
|
||||
|
||||
{% block subtitle %}Identities{% endblock %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}{{ identity.name_or_handle }}{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}Create Invite{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}View Invite{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
{% load activity_tags %}
|
||||
|
||||
{% block subtitle %}Invites{% endblock %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}Report {{ report.pk }}{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
{% load activity_tags %}
|
||||
|
||||
{% block subtitle %}Reports{% endblock %}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}{{ section.title }}{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}Stator{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
|
||||
{% block subtitle %}{{ editing_user.email }}{% endblock %}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% extends "admin/base_main.html" %}
|
||||
{% load activity_tags %}
|
||||
|
||||
{% block subtitle %}Users{% endblock %}
|
||||
|
|
|
@ -624,12 +624,12 @@ class Identity(StatorModel):
|
|||
from activities.models.post import Post, PostStates
|
||||
|
||||
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
|
||||
self.users.set([])
|
||||
self.deleted = timezone.now()
|
||||
self.save()
|
||||
# Move ourselves to deleted
|
||||
self.transition_perform(IdentityStates.deleted)
|
||||
|
||||
### Actor/Webfinger fetching ###
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ class IdentitiesRoot(ListView):
|
|||
|
||||
def get_queryset(self):
|
||||
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"))
|
||||
.order_by("created")
|
||||
)
|
||||
|
|
|
@ -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.",
|
||||
"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 = {
|
||||
|
@ -222,5 +227,6 @@ class PoliciesSettings(AdminSettingsPage):
|
|||
"policy_rules",
|
||||
"policy_terms",
|
||||
"policy_privacy",
|
||||
"policy_issues",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django import forms
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.core.files import File
|
||||
from django.shortcuts import redirect
|
||||
|
@ -124,4 +125,6 @@ class ProfilePage(FormView):
|
|||
Config.set_identity(
|
||||
self.identity, "search_enabled", form.cleaned_data["search_enabled"]
|
||||
)
|
||||
|
||||
messages.success(self.request, "Your profile has been updated.")
|
||||
return redirect(".")
|
||||
|
|
|
@ -2,6 +2,7 @@ from functools import partial
|
|||
from typing import ClassVar
|
||||
|
||||
from django import forms
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.core.files import File
|
||||
from django.shortcuts import redirect
|
||||
|
@ -113,6 +114,7 @@ class SettingsPage(FormView):
|
|||
field.name,
|
||||
form.cleaned_data[field.name],
|
||||
)
|
||||
messages.success(self.request, "Your settings have been saved.")
|
||||
return redirect(".")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue