1
0
Fork 0

Create goal with privacy

This commit is contained in:
Mouse Reeve 2021-01-16 11:34:19 -08:00
parent 739b6e19e2
commit 112b9f9332
11 changed files with 161 additions and 16 deletions

View file

@ -1,7 +1,9 @@
{% load bookwyrm_tags %}
{% if book %}
{% include 'snippets/book_cover.html' with book=book %}
{% if ratings %}
{% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %}
{% endif %}
<h3 class="title is-6"><a href="/book/{{ book.id }}">{{ book.title }}</a></h3>
{% if book.authors %}

View file

@ -1,4 +1,4 @@
<form method="post" name="goal" action="/goal/{{ year }}">
<form method="post" name="goal" action="{{ request.user.local_path }}/goal/{{ year }}">
{% csrf_token %}
<input type="hidden" name="year" value="{{ year }}">
<input type="hidden" name="user" value="{{ request.user.id }}">
@ -15,16 +15,15 @@
</div>
<div class="column">
<label for="post_status" class="label">
<input type="checkbox" name="post-status" id="post_status" class="checkbox" checked>
Post to feed
<label class="label"><p class="mb-2">Goal privacy:</p>
{% include 'snippets/privacy_select.html' with no_label=True %}
</label>
<div class="field">
{% include 'snippets/privacy_select.html' %}
</div>
</div>
</div>
<label for="post_status" class="label">
<input type="checkbox" name="post-status" id="post_status" class="checkbox" checked>
Post to feed
</label>
<p>
<button type="submit" class="button is-link">Set goal</button>

View file

@ -0,0 +1,10 @@
<p>
{% if goal.progress_percent >= 100 %}
Success!
{% elif goal.progress_percent %}
{{ goal.progress_percent }}% complete!
{% endif %}
{% if goal.user == request.user %}You've{% else %}{{ goal.user.display_name }} has{% endif %} read {% if request.path != goal.local_path %}<a href="{{ goal.local_path }}">{% endif %}{{ goal.book_count }} of {{ goal.goal }} books{% if request.path != goal.local_path %}</a>{% endif %}.
</p>
<progress class="progress is-large" value="{{ goal.book_count }}" max="{{ goal.goal }}">{{ goal.progress_percent }}%</progress>