mirror of
https://github.com/jointakahe/takahe.git
synced 2024-12-23 14:00:28 +00:00
parent
9fb18ac841
commit
aca77314d1
8 changed files with 40 additions and 4 deletions
|
@ -243,3 +243,6 @@ class Config(models.Model):
|
||||||
toot_mode: bool = False
|
toot_mode: bool = False
|
||||||
default_post_visibility: int = 0 # Post.Visibilities.public
|
default_post_visibility: int = 0 # Post.Visibilities.public
|
||||||
visible_follows: bool = True
|
visible_follows: bool = True
|
||||||
|
|
||||||
|
# wellness Options
|
||||||
|
visible_reaction_counts: bool = True
|
||||||
|
|
|
@ -46,6 +46,11 @@ urlpatterns = [
|
||||||
settings.InterfacePage.as_view(),
|
settings.InterfacePage.as_view(),
|
||||||
name="settings_interface",
|
name="settings_interface",
|
||||||
),
|
),
|
||||||
|
path(
|
||||||
|
"settings/user/",
|
||||||
|
settings.WellnessPage.as_view(),
|
||||||
|
name="settings_wellness",
|
||||||
|
),
|
||||||
path(
|
path(
|
||||||
"admin/",
|
"admin/",
|
||||||
admin.AdminRoot.as_view(),
|
admin.AdminRoot.as_view(),
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{% if post.pk in interactions.boost %}
|
{% if post.pk in interactions.boost %}
|
||||||
<a title="Unboost" class="active" hx-post="{{ post.urls.action_unboost }}" hx-swap="outerHTML">
|
<a title="Unboost" class="active" hx-post="{{ post.urls.action_unboost }}" hx-swap="outerHTML">
|
||||||
<i class="fa-solid fa-retweet"></i> {% if event.boost_count is not None %}{{ event.boost_count }}{% else %}{{ post.boost_count }}{% endif %}
|
<i class="fa-solid fa-retweet"></i>
|
||||||
|
<span class="like-count">{% if event.boost_count is not None %}{{ event.boost_count }}{% else %}{{ post.boost_count }}{% endif %}</span>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a title="Boost" hx-post="{{ post.urls.action_boost }}" hx-swap="outerHTML">
|
<a title="Boost" hx-post="{{ post.urls.action_boost }}" hx-swap="outerHTML">
|
||||||
<i class="fa-solid fa-retweet"></i> {% if event.boost_count is not None %}{{ event.boost_count }}{% else %}{{ post.boost_count }}{% endif %}
|
<i class="fa-solid fa-retweet"></i>
|
||||||
|
<span class="like-count">{% if event.boost_count is not None %}{{ event.boost_count }}{% else %}{{ post.boost_count }}{% endif %}</span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{% if post.pk in interactions.like %}
|
{% if post.pk in interactions.like %}
|
||||||
<a title="Unlike" class="active" hx-post="{{ post.urls.action_unlike }}" hx-swap="outerHTML" role="menuitem">
|
<a title="Unlike" class="active" hx-post="{{ post.urls.action_unlike }}" hx-swap="outerHTML" role="menuitem">
|
||||||
<i class="fa-solid fa-star"></i> {% if event.like_count is not None %}{{ event.like_count }}{% else %}{{ post.like_count }}{% endif %}
|
<i class="fa-solid fa-star"></i>
|
||||||
|
<span class="like-count">{% if event.like_count is not None %}{{ event.like_count }}{% else %}{{ post.like_count }}{% endif %}</span>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a title="Like" hx-post="{{ post.urls.action_like }}" hx-swap="outerHTML" role="menuitem">
|
<a title="Like" hx-post="{{ post.urls.action_like }}" hx-swap="outerHTML" role="menuitem">
|
||||||
<i class="fa-solid fa-star"></i> {% if event.like_count is not None %}{{ event.like_count }}{% else %}{{ post.like_count }}{% endif %}
|
<i class="fa-solid fa-star"></i>
|
||||||
|
<span class="like-count">{% if event.like_count is not None %}{{ event.like_count }}{% else %}{{ post.like_count }}{% endif %}</span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
body {
|
body {
|
||||||
--color-highlight: {{ config.highlight_color }};
|
--color-highlight: {{ config.highlight_color }};
|
||||||
}
|
}
|
||||||
|
{% if not config_system.visible_reaction_counts %}
|
||||||
|
.like-count {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
{% endif %}
|
||||||
</style>
|
</style>
|
||||||
{% block extra_head %}{% endblock %}
|
{% block extra_head %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
<a href="{% url "settings_interface" %}" {% if section == "interface" %}class="selected"{% endif %} title="Interface">
|
<a href="{% url "settings_interface" %}" {% if section == "interface" %}class="selected"{% endif %} title="Interface">
|
||||||
<i class="fa-solid fa-display"></i> Interface
|
<i class="fa-solid fa-display"></i> Interface
|
||||||
</a>
|
</a>
|
||||||
|
<a href="{% url "settings_wellness" %}" {% if section == "wellness" %}class="selected"{% endif %} title="Wellness">
|
||||||
|
<i class="fa-solid fa-staff-snake"></i> Wellness
|
||||||
|
</a>
|
||||||
<h3>Account</h3>
|
<h3>Account</h3>
|
||||||
<a href="{% url "settings_security" %}" {% if section == "security" %}class="selected"{% endif %} title="Login & Security">
|
<a href="{% url "settings_security" %}" {% if section == "security" %}class="selected"{% endif %} title="Login & Security">
|
||||||
<i class="fa-solid fa-key"></i> Login & Security
|
<i class="fa-solid fa-key"></i> Login & Security
|
||||||
|
|
|
@ -6,6 +6,7 @@ from users.views.settings.interface import InterfacePage # noqa
|
||||||
from users.views.settings.profile import ProfilePage # noqa
|
from users.views.settings.profile import ProfilePage # noqa
|
||||||
from users.views.settings.security import SecurityPage # noqa
|
from users.views.settings.security import SecurityPage # noqa
|
||||||
from users.views.settings.settings_page import SettingsPage # noqa
|
from users.views.settings.settings_page import SettingsPage # noqa
|
||||||
|
from users.views.settings.wellness import WellnessPage # noqa
|
||||||
|
|
||||||
|
|
||||||
@method_decorator(identity_required, name="dispatch")
|
@method_decorator(identity_required, name="dispatch")
|
||||||
|
|
15
users/views/settings/wellness.py
Normal file
15
users/views/settings/wellness.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
from users.views.settings.settings_page import SettingsPage
|
||||||
|
|
||||||
|
|
||||||
|
class WellnessPage(SettingsPage):
|
||||||
|
|
||||||
|
section = "wellness"
|
||||||
|
|
||||||
|
options = {
|
||||||
|
"visible_reaction_counts": {
|
||||||
|
"title": "Show Boost and Like Counts",
|
||||||
|
"help_text": "Disable to hide the number of Likes and Boosts on a 'Post'",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
layout = {"Wellness": ["visible_reaction_counts"]}
|
Loading…
Reference in a new issue