Hide goal using database field instead of localstorage
This commit is contained in:
@ -19,9 +19,9 @@
|
||||
</div>
|
||||
|
||||
{# announcements and system messages #}
|
||||
{% if not goal and tab == 'home' %}
|
||||
{% if request.user.show_goal and not goal and tab == 'home' %}
|
||||
{% now 'Y' as year %}
|
||||
<section class="block hidden" aria-title="{% trans 'Announcements' %}" data-hide="hide-{{ year }}-reading-goal">
|
||||
<section class="block" aria-title="{% trans 'Announcements' %}">
|
||||
{% include 'snippets/goal_card.html' with year=year %}
|
||||
<hr>
|
||||
</section>
|
||||
|
@ -17,8 +17,9 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block card-footer %}
|
||||
<div class="card-footer-item is-flex-direction-column">
|
||||
<button class="button is-danger is-light is-block set-display" data-id="hide-{{ year }}-reading-goal" data-value="true">{% trans "Dismiss message" %}</button>
|
||||
<form class="card-footer-item is-flex-direction-column" method="post" action="{% url 'hide-goal' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="button is-danger is-light is-block set-display" >{% trans "Dismiss message" %}</button>
|
||||
<p class="help">{% blocktrans with path=request.user.local_path %}You can set or change your reading goal any time from your <a href="{{ path }}">profile page</a>{% endblocktrans %}</p>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user