mirror of
https://github.com/jointakahe/takahe.git
synced 2024-12-23 05:56:29 +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
|
||||
default_post_visibility: int = 0 # Post.Visibilities.public
|
||||
visible_follows: bool = True
|
||||
|
||||
# wellness Options
|
||||
visible_reaction_counts: bool = True
|
||||
|
|
|
@ -46,6 +46,11 @@ urlpatterns = [
|
|||
settings.InterfacePage.as_view(),
|
||||
name="settings_interface",
|
||||
),
|
||||
path(
|
||||
"settings/user/",
|
||||
settings.WellnessPage.as_view(),
|
||||
name="settings_wellness",
|
||||
),
|
||||
path(
|
||||
"admin/",
|
||||
admin.AdminRoot.as_view(),
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{% if post.pk in interactions.boost %}
|
||||
<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>
|
||||
{% else %}
|
||||
<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>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{% if post.pk in interactions.like %}
|
||||
<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>
|
||||
{% else %}
|
||||
<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>
|
||||
{% endif %}
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
body {
|
||||
--color-highlight: {{ config.highlight_color }};
|
||||
}
|
||||
{% if not config_system.visible_reaction_counts %}
|
||||
.like-count {
|
||||
display: none;
|
||||
}
|
||||
{% endif %}
|
||||
</style>
|
||||
{% block extra_head %}{% endblock %}
|
||||
</head>
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
<a href="{% url "settings_interface" %}" {% if section == "interface" %}class="selected"{% endif %} title="Interface">
|
||||
<i class="fa-solid fa-display"></i> Interface
|
||||
</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>
|
||||
<a href="{% url "settings_security" %}" {% if section == "security" %}class="selected"{% endif %} title="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.security import SecurityPage # noqa
|
||||
from users.views.settings.settings_page import SettingsPage # noqa
|
||||
from users.views.settings.wellness import WellnessPage # noqa
|
||||
|
||||
|
||||
@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