Merge branch 'main' into progress_update
This commit is contained in:
21
bookwyrm/templates/snippets/components/card.html
Normal file
21
bookwyrm/templates/snippets/components/card.html
Normal file
@ -0,0 +1,21 @@
|
||||
<article class="card">
|
||||
<header class="card-header">
|
||||
{% block card-header %}
|
||||
{% endblock %}
|
||||
</header>
|
||||
|
||||
{% if not status or status.status_type != 'GeneratedNote' or status.book or status.mention_books.exists or status.mention_users.exists %}
|
||||
<section class="card-content">
|
||||
{% block card-content %}
|
||||
{% endblock %}
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<footer class="card-footer has-background-white-bis">
|
||||
{% block card-footer %}
|
||||
{% endblock %}
|
||||
</footer>
|
||||
|
||||
{% block card-bonus %}
|
||||
{% endblock %}
|
||||
</article>
|
13
bookwyrm/templates/snippets/components/dropdown.html
Normal file
13
bookwyrm/templates/snippets/components/dropdown.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% with 0|uuid as uuid %}
|
||||
<div class="dropdown control{% if right %} is-right{% endif %}" id="menu-{{ uuid }}">
|
||||
<button type="button" class="button dropdown-trigger pulldown-menu {{ class }}" aria-expanded="false" class="pulldown-menu" aria-haspopup="true" aria-controls="menu-options-{{ uuid }}" data-controls="menu-{{ uuid }}">
|
||||
{% block dropdown-trigger %}{% endblock %}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<ul class="dropdown-content" role="menu" id="menu-options-{{ book.id }}">
|
||||
{% block dropdown-list %}{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
23
bookwyrm/templates/snippets/components/modal.html
Normal file
23
bookwyrm/templates/snippets/components/modal.html
Normal file
@ -0,0 +1,23 @@
|
||||
<div class="modal hidden" id="{{ controls_text }}-{{ controls_uid }}">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head" tabindex="0" id="modal-title-{{ controls_text }}-{{ controls_uid }}">
|
||||
<h2 class="modal-card-title">
|
||||
{% block modal-title %}{% endblock %}
|
||||
</h2>
|
||||
{% include 'snippets/toggle/toggle_button.html' with label="close" class="delete" nonbutton=True %}
|
||||
</header>
|
||||
|
||||
{% block modal-form-open %}{% endblock %}
|
||||
|
||||
{% block modal-body %}{% endblock %}
|
||||
|
||||
<footer class="modal-card-foot">
|
||||
{% block modal-footer %}{% endblock %}
|
||||
</footer>
|
||||
{% block modal-form-close %}{% endblock %}
|
||||
</div>
|
||||
<label class="modal-close is-large" for="{{ controls_text }}-{{ readthrough.id }}" aria-label="close"></label>
|
||||
{% include 'snippets/toggle/toggle_button.html' with label="close" class="modal-close is-large" nonbutton=True %}
|
||||
</div>
|
||||
|
@ -1,20 +1,4 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% with 0|uuid as uuid %}
|
||||
<div class="control">
|
||||
<div>
|
||||
<input type="radio" class="toggle-control" id="include-spoilers-{{ uuid }}" name="sensitive" value="true" {% if parent_status.content_warning %}checked{% endif %} data-hover-target="id_content_warning_{{ uuid }}">
|
||||
<div class="toggle-content hidden">
|
||||
<label class="is-sr-only" for="id_content_warning_{{ uuid }}">Spoilers/content warning:</label>
|
||||
<input type="text" name="content_warning" maxlength="255" class="input" id="id_content_warning_{{ uuid }}" placeholder="Spoilers ahead!"{% if parent_status.content_warning %} value="{{ parent_status.content_warning }}"{% endif %}>
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="hide-spoilers" controls_uid=uuid text="Remove spoilers/content warning" small=True %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="radio" class="toggle-control" name="sensitive" value="false" id="hide-spoilers-{{ uuid }}" {% if not parent_status.content_warning %}checked{% endif %}>
|
||||
<div class="toggle-content hidden">
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="include-spoilers" controls_uid=uuid text="Add spoilers/content warning" small=True %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control{% if not parent_status.content_warning %} hidden{% endif %}" id="spoilers-{{ uuid }}">
|
||||
<label class="is-sr-only" for="id_content_warning-{{ uuid }}">Spoiler alert:</label>
|
||||
<input type="text" name="content_warning" maxlength="255" class="input" id="id_content_warning-{{ uuid }}" placeholder="Spoilers ahead!"{% if parent_status.content_warning %} value="{{ parent_status.content_warning }}"{% endif %}>
|
||||
</div>
|
||||
{% endwith %}
|
||||
|
@ -3,41 +3,32 @@
|
||||
|
||||
<div class="tabs is-boxed">
|
||||
<ul role="tablist">
|
||||
<li class="is-active" data-id="tab-review-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<label for="review-{{ book.id }}">
|
||||
<div class="tab-change" role="tab" aria-selected="true" tabindex="0">
|
||||
<a>Review</a>
|
||||
</div>
|
||||
</label>
|
||||
<li class="tab-change is-active" data-category="tab-option-{{ book.id }}" role="tab" aria-selected="true" tabindex="0" data-tab="review-{{ book.id }}">
|
||||
<a>Review</a>
|
||||
</li>
|
||||
<li data-id="tab-comment-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<label for="comment-{{ book.id}}">
|
||||
<div class="tab-change" role="tab" tabindex="0">
|
||||
<a>Comment</a>
|
||||
</div>
|
||||
</label>
|
||||
<li class="tab-change" data-category="tab-option-{{ book.id }}" role="tab" tabindex="0" data-tab="comment-{{ book.id}}">
|
||||
<a>Comment</a>
|
||||
</li>
|
||||
<li data-id="tab-quotation-{{ book.id }}" data-category="tab-option-{{ book.id }}">
|
||||
<label for="quote-{{ book.id }}">
|
||||
<div class="tab-change" role="tab" tabindex="0">
|
||||
<a>Quote</a>
|
||||
</div>
|
||||
</label>
|
||||
<li class="tab-change" data-category="tab-option-{{ book.id }}" role="tab" tabindex="0" data-tab="quote-{{ book.id }}">
|
||||
<a>Quote</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input class="toggle-control" type="radio" name="status-tabs-{{ book.id }}" id="review-{{ book.id }}" checked>
|
||||
<div class="tab-option-{{ book.id }}" id="review-{{ book.id }}">
|
||||
{% with 0|uuid as uuid %}
|
||||
{% include 'snippets/create_status_form.html' with type='review' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input class="toggle-control" type="radio" name="status-tabs-{{ book.id }}" id="comment-{{ book.id }}">
|
||||
<div class="hidden tab-option-{{ book.id }}" id="comment-{{ book.id }}">
|
||||
{% with 0|uuid as uuid %}
|
||||
{% include 'snippets/create_status_form.html' with type="comment" placeholder="Some thoughts on '"|add:book.title|add:"'" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input class="toggle-control" type="radio" name="status-tabs-{{ book.id }}" id="quote-{{ book.id }}">
|
||||
<div class="hidden tab-option-{{ book.id }}" id="quote-{{ book.id }}">
|
||||
{% with 0|uuid as uuid %}
|
||||
{% include 'snippets/create_status_form.html' with type="quotation" placeholder="An excerpt from '"|add:book.title|add:"'" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
@ -1,7 +1,8 @@
|
||||
<form class="toggle-content hidden tab-option-{{ book.id }}" name="{{ type }}" action="/post/{{ type }}" method="post" id="tab-{{ type }}-{{ book.id }}">
|
||||
<form class="is-flex-grow-1" name="{{ type }}" action="/post/{{ type }}" method="post" id="tab-{{ type }}-{{ book.id }}{{ reply_parent.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="user" value="{{ request.user.id }}">
|
||||
<input type="hidden" name="reply_parent" value="{{ reply_parent.id }}">
|
||||
{% if type == 'review' %}
|
||||
<div class="control">
|
||||
<label class="label" for="id_name_{{ book.id }}_{{ type }}">Title:</label>
|
||||
@ -9,8 +10,9 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="control">
|
||||
{% if not type == 'reply' %}
|
||||
<label class="label" for="id_{% if type == 'quotation' %}quote{% else %}content{% endif %}_{{ book.id }}_{{ type }}">{{ type|title }}:</label>
|
||||
{% include 'snippets/content_warning_field.html' %}
|
||||
{% endif %}
|
||||
|
||||
{% if type == 'review' %}
|
||||
<fieldset>
|
||||
@ -31,18 +33,30 @@
|
||||
{% if type == 'quotation' %}
|
||||
<textarea name="quote" class="textarea" id="id_quote_{{ book.id }}_{{ type }}" placeholder="{{ placeholder }}" required></textarea>
|
||||
{% else %}
|
||||
<textarea name="content" class="textarea" id="id_content_{{ book.id }}_{{ type }}" placeholder="{{ placeholder }}" required></textarea>
|
||||
{% include 'snippets/content_warning_field.html' with parent_status=status %}
|
||||
<textarea name="content" class="textarea" id="id_content_{{ type }}-{{ book.id }}{{reply_parent.id}}" placeholder="{{ placeholder }}" {% if type == 'reply' %} aria-label="Reply"{% endif %} required></textarea>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if type == 'quotation' %}
|
||||
<div class="control">
|
||||
<label class="label" for="id_content_{{ book.id }}_quote">Comment:</label>
|
||||
<textarea name="content" class="textarea is-small" id="id_content_{{ book.id }}_quote"></textarea>
|
||||
<label class="label" for="id_content_quote-{{ book.id }}">Comment:</label>
|
||||
{% include 'snippets/content_warning_field.html' with parent_status=status %}
|
||||
<textarea name="content" class="textarea is-small" id="id_content_quote-{{ book.id }}"></textarea>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="control is-grouped">
|
||||
{% include 'snippets/privacy_select.html' %}
|
||||
<button class="button is-primary" type="submit">post {{ type }}</button>
|
||||
<input type="checkbox" class="hidden" name="sensitive" id="id_show_spoilers-{{ uuid }}" {% if status.content_warning %}checked{% endif %} aria-hidden="true">
|
||||
{# bottom bar #}
|
||||
<div class="columns pt-1">
|
||||
<div class="field has-addons column">
|
||||
<div class="control">
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Include spoiler alert" icon="warning is-size-4" controls_text="spoilers" controls_uid=uuid focus="id_content_warning" checkbox="id_show_spoilers" class="toggle-button" pressed=status.content_warning %}
|
||||
</div>
|
||||
<div class="control">
|
||||
{% include 'snippets/privacy_select.html' with current=reply_parent.privacy%}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<button class="button is-link" type="submit">Post</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
13
bookwyrm/templates/snippets/delete_readthrough_modal.html
Normal file
13
bookwyrm/templates/snippets/delete_readthrough_modal.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends 'snippets/components/modal.html' %}
|
||||
{% block modal-title %}Delete these read dates?{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<form name="delete-readthrough-{{ readthrough.id }}" action="/delete-readthrough" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{ readthrough.id }}">
|
||||
<button class="button is-danger" type="submit">
|
||||
Delete
|
||||
</button>
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="delete-readthrough" controls_uid=readthrough.id %}
|
||||
</form>
|
||||
{% endblock %}
|
@ -1,49 +1,46 @@
|
||||
{% load bookwyrm_tags %}
|
||||
<div>
|
||||
<input class="toggle-control" type="checkbox" name="finish-reading-{{ uuid }}" id="finish-reading-{{ uuid }}">
|
||||
<div class="modal toggle-content hidden">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Finish "{{ book.title }}"</p>
|
||||
{% include 'snippets/toggle/toggle_button.html' with label="close" controls_text="finish-reading" controls_uid=uuid class="delete" %}
|
||||
</header>
|
||||
{% active_read_through book user as readthrough %}
|
||||
<form name="finish-reading" action="/finish-reading/{{ book.id }}" method="post">
|
||||
<section class="modal-card-body">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{ readthrough.id }}">
|
||||
<div class="field">
|
||||
<label class="label">
|
||||
Started reading
|
||||
<input type="date" name="start_date" class="input" id="finish_id_start_date-{{ uuid }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
|
||||
</label>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">
|
||||
Finished reading
|
||||
<input type="date" name="finish_date" class="input" id="id_finish_date-{{ uuid }}" value="{% now "Y-m-d" %}">
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<div class="columns">
|
||||
<div class="column field">
|
||||
<label for="post_status-{{ uuid }}">
|
||||
<input type="checkbox" name="post-status" class="checkbox" id="post_status-{{ uuid }}" checked>
|
||||
Post to feed
|
||||
</label>
|
||||
{% include 'snippets/privacy_select.html' %}
|
||||
</div>
|
||||
<div class="column">
|
||||
<button type="submit" class="button is-success">Save</button>
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="finish-reading" controls_uid=uuid %}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</form>
|
||||
</div>
|
||||
<label class="modal-close is-large" for="finish-reading-{{ uuid }}" aria-label="close" role="button"></label>
|
||||
{% extends 'snippets/components/modal.html' %}
|
||||
|
||||
{% block modal-title %}
|
||||
Finish "<em>{{ book.title }}</em>"
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="finish-reading" action="/finish-reading/{{ book.id }}" method="post">
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
<section class="modal-card-body">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{ readthrough.id }}">
|
||||
<div class="field">
|
||||
<label class="label">
|
||||
Started reading
|
||||
<input type="date" name="start_date" class="input" id="finish_id_start_date-{{ uuid }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
|
||||
</label>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">
|
||||
Finished reading
|
||||
<input type="date" name="finish_date" class="input" id="id_finish_date-{{ uuid }}" value="{% now "Y-m-d" %}">
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<div class="columns">
|
||||
<div class="column field">
|
||||
<label for="post_status-{{ uuid }}">
|
||||
<input type="checkbox" name="post-status" class="checkbox" id="post_status-{{ uuid }}" checked>
|
||||
Post to feed
|
||||
</label>
|
||||
{% include 'snippets/privacy_select.html' %}
|
||||
</div>
|
||||
<div class="column">
|
||||
<button type="submit" class="button is-success">Save</button>
|
||||
{% include 'snippets/toggle/close_button.html' with text="Cancel" controls_text="finish-reading" controls_uid=uuid %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
||||
|
23
bookwyrm/templates/snippets/goal_card.html
Normal file
23
bookwyrm/templates/snippets/goal_card.html
Normal file
@ -0,0 +1,23 @@
|
||||
{% extends 'snippets/components/card.html' %}
|
||||
|
||||
{% block card-header %}
|
||||
<h3 class="card-header-title has-background-primary has-text-white">
|
||||
<span class="icon icon-book is-size-3 mr-2" aria-hidden="true"></span> {{ year }} reading goal
|
||||
</h3>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block card-content %}
|
||||
<div class="content">
|
||||
<p>Set a goal for how many books you'll finish reading in {{ year }}, and track your progress throughout the year.</p>
|
||||
|
||||
{% include 'snippets/goal_form.html' %}
|
||||
</div>
|
||||
{% 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">Dismiss message</button>
|
||||
<p class="help">You can set or change your reading goal any time from your <a href="{{ request.user.local_path }}">profile page</a></p>
|
||||
</div>
|
||||
{% endblock %}
|
@ -28,7 +28,7 @@
|
||||
<p>
|
||||
<button type="submit" class="button is-link">Set goal</button>
|
||||
{% if goal %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="hide-edit-goal" %}
|
||||
{% include 'snippets/toggle/close_button.html' with text="Cancel" controls_text="show-edit-goal" %}
|
||||
{% endif %}
|
||||
</p>
|
||||
</form>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% load bookwyrm_tags %}
|
||||
<div class="select">
|
||||
<div class="select {{ class }}">
|
||||
{% with 0|uuid as uuid %}
|
||||
{% if not no_label %}
|
||||
<label class="is-sr-only" for="privacy-{{ uuid }}">Post privacy</label>
|
||||
@ -12,7 +12,7 @@
|
||||
Unlisted
|
||||
</option>
|
||||
<option value="followers" {% if current == 'followers' %}selected{% endif %}>
|
||||
Followers only
|
||||
Followers
|
||||
</option>
|
||||
<option value="direct" {% if current == 'direct' %}selected{% endif %}>
|
||||
Private
|
||||
|
@ -1,18 +1,33 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% if request.user.is_authenticated %}
|
||||
<span class="is-sr-only">Leave a rating</span>
|
||||
<div class="field is-grouped stars rate-stars">
|
||||
{% for i in '12345'|make_list %}
|
||||
<form name="rate" action="/rate/" method="POST">
|
||||
<div class="block">
|
||||
<form class="hidden-form" name="rate" action="/post/rating" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="user" value="{{ request.user.id }}">
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="privacy" value="public">
|
||||
<input type="hidden" name="rating" value="{{ forloop.counter }}">
|
||||
<button type="submit" class="icon icon-star-{% if book|rating:user < forloop.counter %}empty{% else %}full{% endif %}">
|
||||
<span class="is-sr-only">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
|
||||
</button>
|
||||
|
||||
<div class="field is-grouped stars form-rate-stars mb-1">
|
||||
<label class="is-sr-only" for="no-rating-{{ book.id }}">No rating</label>
|
||||
<input class="is-sr-only" type="radio" name="rating" value="" id="no-rating-{{ book.id }}" checked>
|
||||
{% for i in '12345'|make_list %}
|
||||
<input class="is-sr-only" id="book{{book.id}}-star-{{ forloop.counter }}" type="radio" name="rating" value="{{ forloop.counter }}" {% if book|rating:user == forloop.counter %}checked{% endif %}>
|
||||
<label class="icon icon-star-empty" for="book{{book.id}}-star-{{ forloop.counter }}">
|
||||
<span class="is-sr-only">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="field has-addons hidden">
|
||||
<div class="control">
|
||||
{% include 'snippets/privacy_select.html' with class="is-small" %}
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-small is-primary" type="submit">Rate</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -1,7 +1,6 @@
|
||||
{% load humanize %}
|
||||
<div class="content block">
|
||||
<input class="toggle-control" type="radio" name="show-edit-readthrough-{{ readthrough.id }}" id="show-readthrough-{{ readthrough.id }}" checked>
|
||||
<div class="toggle-content hidden">
|
||||
<div id="hide-edit-readthrough-{{ readthrough.id }}">
|
||||
<dl class="mb-1">
|
||||
{% if readthrough.start_date %}
|
||||
<div class="is-flex">
|
||||
@ -25,9 +24,13 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
<div class="field is-grouped">
|
||||
{% include 'snippets/toggle/toggle_button.html' with small=True text="Edit read dates" icon="pencil" controls_text="edit-readthrough" controls_uid=readthrough.id %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with small=True text="Delete these read dates" icon="x" controls_text="delete-readthrough" controls_uid=readthrough.id %}
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text="Edit read dates" icon="pencil" controls_text="edit-readthrough" controls_uid=readthrough.id focus="edit-readthrough" %}
|
||||
</div>
|
||||
<div class="control">
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text="Delete these read dates" icon="x" controls_text="delete-readthrough" controls_uid=readthrough.id focus="modal-title-delete-readthrough" %}
|
||||
</div>
|
||||
</div>
|
||||
{% if show_progress %}
|
||||
Progress Updates:
|
||||
@ -62,41 +65,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<input class="toggle-control" type="radio" name="show-edit-readthrough-{{ readthrough.id }}" id="edit-readthrough-{{ readthrough.id }}">
|
||||
<div class="toggle-content hidden">
|
||||
<div class="box">
|
||||
<form name="edit-readthrough" action="/edit-readthrough" method="post">
|
||||
{% include 'snippets/readthrough_form.html' with readthrough=readthrough %}
|
||||
<div class="field is-grouped">
|
||||
<button class="button is-primary" type="submit">Save</button>
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="show-readthrough" controls_uid=readthrough.id %}
|
||||
</div>
|
||||
</form>
|
||||
<div class="box hidden" id="edit-readthrough-{{ readthrough.id }}" tabindex="0">
|
||||
<h3 class="title is-5">Edit read dates</h3>
|
||||
<form name="edit-readthrough" action="/edit-readthrough" method="post">
|
||||
{% include 'snippets/readthrough_form.html' with readthrough=readthrough %}
|
||||
<div class="field is-grouped">
|
||||
<button class="button is-primary" type="submit">Save</button>
|
||||
{% include 'snippets/toggle/close_button.html' with text="Cancel" controls_text="edit-readthrough" controls_uid=readthrough.id %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input class="toggle-control" type="checkbox" name="delete-readthrough-{{ readthrough.id }}" id="delete-readthrough-{{ readthrough.id }}">
|
||||
<div class="modal toggle-content hidden">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Delete this read-though?</p>
|
||||
<label class="delete" for="delete-readthrough-{{ readthrough.id }}" aria-label="close"></label>
|
||||
</header>
|
||||
<footer class="modal-card-foot">
|
||||
<form name="delete-readthrough-{{ readthrough.id }}" action="/delete-readthrough" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{ readthrough.id }}">
|
||||
<button class="button is-danger is-light" type="submit">
|
||||
Delete
|
||||
</button>
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="delete-readthrough" controls_uid=readthrough.id %}
|
||||
</form>
|
||||
</footer>
|
||||
</div>
|
||||
<label class="modal-close is-large" for="delete-readthrough-{{ readthrough.id }}" aria-label="close"></label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% include 'snippets/delete_readthrough_modal.html' with controls_text="delete-readthrough" controls_uid=readthrough.id %}
|
||||
|
@ -1,25 +0,0 @@
|
||||
{% load bookwyrm_tags %}
|
||||
<form class="is-flex-grow-1" name="reply" action="/post/reply" method="post">
|
||||
<div class="columns is-align-items-flex-end">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="reply_parent" value="{{ status.id }}">
|
||||
<input type="hidden" name="user" value="{{ request.user.id }}">
|
||||
<div class="column">
|
||||
{% include 'snippets/content_warning_field.html' with parent_status=status %}
|
||||
<label for="id_content_{{ status.id }}-{{ uuid }}" class="is-sr-only">Reply</label>
|
||||
<div class="field">
|
||||
<textarea class="textarea" name="content" placeholder="Leave a comment..." id="id_content_{{ status.id }}-{{ uuid }}" required="true"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<div class="field">
|
||||
{% include 'snippets/privacy_select.html' with current=status.privacy %}
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="button is-primary" type="submit">
|
||||
post reply
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
@ -1,36 +1,29 @@
|
||||
<div class="dropdown">
|
||||
<div class="dropdown-trigger">
|
||||
<label for="shelf-select-dropdown-{{ book.id }}-toggle" role="button" aria-expanded="false" class="pulldown-menu" tabindex="0" aria-haspopup="true" aria-controls="shelf-select-{{ book.id }}">
|
||||
<div class="button">
|
||||
<span>Change shelf</span>
|
||||
<span class="icon icon-arrow-down" aria-hidden="true"></span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<input type="checkbox" class="toggle-control" id="shelf-select-dropdown-{{ book.id }}-toggle">
|
||||
<div class="dropdown-menu toggle-content hidden" id="shelf-select-{{ book.id }}" role="menu">
|
||||
<ul class="dropdown-content">
|
||||
{% for shelf in request.user.shelf_set.all %}
|
||||
{% if shelf.identifier != current.identifier %}
|
||||
<li role="menuitem">
|
||||
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="shelf" value="{{ shelf.identifier }}">
|
||||
<button class="button is-small" type="submit">{{ shelf.name }}</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<hr class="navbar-divider">
|
||||
<li>
|
||||
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/unshelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="shelf" value="{{ current.id }}">
|
||||
<button class="button is-small is-danger is-light" type="submit">Unshelve</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% extends 'snippets/components/dropdown.html' %}
|
||||
{% block dropdown-trigger %}
|
||||
<span>Change shelf</span>
|
||||
<span class="icon icon-arrow-down" aria-hidden="true"></span>
|
||||
{% endblock %}
|
||||
|
||||
{% block dropdown-list %}
|
||||
{% for shelf in request.user.shelf_set.all %}
|
||||
{% if shelf.identifier != current.identifier %}
|
||||
<li role="menuitem">
|
||||
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="shelf" value="{{ shelf.identifier }}">
|
||||
<button class="button is-fullwidth is-small" type="submit">{{ shelf.name }}</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<hr class="navbar-divider">
|
||||
<li>
|
||||
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/unshelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="shelf" value="{{ current.id }}">
|
||||
<button class="button is-fullwidth is-small is-danger is-light" type="submit">Unshelve</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endblock %}
|
||||
|
@ -3,63 +3,38 @@
|
||||
|
||||
{% with book.id|uuid as uuid %}
|
||||
{% active_shelf book as active_shelf %}
|
||||
<div class="field is-grouped">
|
||||
<div class="field has-addons">
|
||||
{% if switch_mode and active_shelf.book != book %}
|
||||
{% include 'snippets/switch_edition_button.html' with edition=book size='is-small' %}
|
||||
{% else %}
|
||||
|
||||
{% if active_shelf.shelf.identifier == 'read' %}
|
||||
<button class="button is-small" disabled>
|
||||
<span>Read</span> <span class="icon icon-check"></span>
|
||||
</button>
|
||||
{% elif active_shelf.shelf.identifier == 'reading' %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with small=True text="I'm done!" controls_text="finish-reading" controls_uid=uuid %}
|
||||
{% elif active_shelf.shelf.identifier == 'to-read' %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with small=True text="Start reading" controls_text="start-reading" controls_uid=uuid %}
|
||||
{% else %}
|
||||
<form name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
||||
<input type="hidden" name="shelf" value="to-read">
|
||||
<button class="button is-small" type="submit">Want to read</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<div class="dropdown">
|
||||
<div class="dropdown-trigger">
|
||||
<label for="shelf-select-dropdown-{{ uuid }}-toggle" role="button" aria-expanded="false" class="pulldown-menu" tabindex="0" aria-haspopup="true" aria-controls="shelf-select-{{ uuid }}">
|
||||
<div class="button is-small">
|
||||
<span class="icon icon-arrow-down"><span class="is-sr-only">More shelves</span></span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<input type="checkbox" class="toggle-control" id="shelf-select-dropdown-{{ uuid }}-toggle">
|
||||
<div class="dropdown-menu toggle-content hidden" id="shelf-select-{{ uuid }}" role="menu">
|
||||
<ul class="dropdown-content">
|
||||
{% for shelf in request.user.shelf_set.all %}
|
||||
<li role="menuitem">
|
||||
{% if active_shelf.shelf.identifier != 'reading' and shelf.identifier == 'reading' %}
|
||||
<div class="dropdown-item pt-0 pb-0">
|
||||
{% include 'snippets/toggle/toggle_button.html' with small=True text="Start reading" controls_text="start-reading" controls_uid=uuid %}
|
||||
</div>
|
||||
{% else %}
|
||||
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
||||
<button class="button is-small" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>
|
||||
<span>{{ shelf.name }}</span>
|
||||
{% if shelf in book.shelf_set.all %}<span class="icon icon-check"></span>{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="control">
|
||||
{% include 'snippets/switch_edition_button.html' with edition=book size='is-small' %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="control">
|
||||
{% if active_shelf.shelf.identifier == 'read' %}
|
||||
<button class="button is-small" disabled>
|
||||
<span>Read</span> <span class="icon icon-check"></span>
|
||||
</button>
|
||||
{% elif active_shelf.shelf.identifier == 'reading' %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text="I'm done!" controls_text="finish-reading" controls_uid=uuid focus="modal-title-finish-reading" %}
|
||||
{% elif active_shelf.shelf.identifier == 'to-read' %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text="Start reading" controls_text="start-reading" controls_uid=uuid focus="modal-title-start-reading" %}
|
||||
{% else %}
|
||||
<form name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
||||
<input type="hidden" name="shelf" value="to-read">
|
||||
<button class="button is-small" type="submit">Want to read</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% include 'snippets/shelve_button_dropdown.html' with class="is-small" button_uuid=uuid%}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% include 'snippets/start_reading_modal.html' with book=active_shelf.book %}
|
||||
{% include 'snippets/finish_reading_modal.html' with book=active_shelf.book %}
|
||||
|
||||
{% include 'snippets/start_reading_modal.html' with book=active_shelf.book controls_text="start-reading" controls_uid=uuid %}
|
||||
|
||||
{% latest_read_through book request.user as readthrough %}
|
||||
{% include 'snippets/finish_reading_modal.html' with book=active_shelf.book controls_text="finish-reading" controls_uid=uuid readthrough=readthrough %}
|
||||
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
28
bookwyrm/templates/snippets/shelve_button_dropdown.html
Normal file
28
bookwyrm/templates/snippets/shelve_button_dropdown.html
Normal file
@ -0,0 +1,28 @@
|
||||
{% extends 'snippets/components/dropdown.html' %}
|
||||
{% block dropdown-trigger %}
|
||||
<span class="icon icon-arrow-down">
|
||||
<span class="is-sr-only">More shelves</span>
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block dropdown-list %}
|
||||
{% for shelf in request.user.shelf_set.all %}
|
||||
<li role="menuitem">
|
||||
{% if active_shelf.shelf.identifier != 'reading' and shelf.identifier == 'reading' %}
|
||||
<div class="dropdown-item pt-0 pb-0">
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-fullwidth is-small" text="Start reading" controls_text="start-reading" controls_uid=button_uuid focus="modal-title-start-reading" %}
|
||||
</div>
|
||||
{% else %}
|
||||
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
||||
<button class="button is-fullwidth is-small" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>
|
||||
<span>{{ shelf.name }}</span>
|
||||
{% if shelf in book.shelf_set.all %}<span class="icon icon-check"></span>{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
@ -1,39 +1,38 @@
|
||||
<div>
|
||||
<input class="toggle-control" type="checkbox" name="start-reading-{{ uuid }}" id="start-reading-{{ uuid }}">
|
||||
<div class="modal toggle-content hidden">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Start "{{ book.title }}"</p>
|
||||
{% include 'snippets/toggle/toggle_button.html' with label="close" controls_text="start-reading" controls_uid=uuid class="delete" %}
|
||||
</header>
|
||||
<form name="start-reading" action="/start-reading/{{ book.id }}" method="post">
|
||||
<section class="modal-card-body">
|
||||
{% csrf_token %}
|
||||
<div class="field">
|
||||
<label class="label">
|
||||
Started reading
|
||||
<input type="date" name="start_date" class="input" id="start_id_start_date-{{ uuid }}" value="{% now "Y-m-d" %}">
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<div class="columns">
|
||||
<div class="column field">
|
||||
<label for="post_status_start-{{ uuid }}">
|
||||
<input type="checkbox" name="post-status" class="checkbox" id="post_status_start-{{ uuid }}" checked>
|
||||
Post to feed
|
||||
</label>
|
||||
{% include 'snippets/privacy_select.html' %}
|
||||
</div>
|
||||
<div class="column">
|
||||
<button class="button is-success" type="submit">Save</button>
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="start-reading" controls_uid=uuid %}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</form>
|
||||
</div>
|
||||
<label class="modal-close is-large" for="start-reading-{{ uuid }}" aria-label="close"></label>
|
||||
{% extends 'snippets/components/modal.html' %}
|
||||
|
||||
{% block modal-title %}
|
||||
Start "<em>{{ book.title }}</em>"
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="start-reading" action="/start-reading/{{ book.id }}" method="post">
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
<section class="modal-card-body">
|
||||
{% csrf_token %}
|
||||
<div class="field">
|
||||
<label class="label">
|
||||
Started reading
|
||||
<input type="date" name="start_date" class="input" id="start_id_start_date-{{ uuid }}" value="{% now "Y-m-d" %}">
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<div class="columns">
|
||||
<div class="column field">
|
||||
<label for="post_status_start-{{ uuid }}">
|
||||
<input type="checkbox" name="post-status" class="checkbox" id="post_status_start-{{ uuid }}" checked>
|
||||
Post to feed
|
||||
</label>
|
||||
{% include 'snippets/privacy_select.html' %}
|
||||
</div>
|
||||
<div class="column">
|
||||
<button class="button is-success" type="submit">Save</button>
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="start-reading" controls_uid=uuid %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
||||
|
@ -1,101 +1,77 @@
|
||||
{% extends 'snippets/components/card.html' %}
|
||||
|
||||
{% load bookwyrm_tags %}
|
||||
{% load humanize %}
|
||||
|
||||
{% if not status.deleted %}
|
||||
<article class="card">
|
||||
<header class="card-header">
|
||||
<div class="card-header-title has-background-white-ter">
|
||||
<div class="columns">
|
||||
<div class="column is-narrow">
|
||||
{% include 'snippets/status_header.html' with status=status %}
|
||||
</div>
|
||||
</div>
|
||||
{% block card-header %}
|
||||
<h3 class="card-header-title has-background-white-ter is-block">
|
||||
{% include 'snippets/status_header.html' with status=status %}
|
||||
</h3>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block card-content %}
|
||||
{% include 'snippets/status_content.html' with status=status %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block card-footer %}
|
||||
<div class="card-footer-item">
|
||||
{% if request.user.is_authenticated %}
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="show-comment" controls_uid=status.id text="Reply" icon="comment" class="is-small" focus="id_content_reply" %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="card-content">
|
||||
{% include 'snippets/status_content.html' with status=status %}
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<div class="card-footer has-background-white-bis">
|
||||
<div class="card-footer-item">
|
||||
{% if request.user.is_authenticated %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="show-comment" controls_uid=status.id text="Reply" icon='comment' small=True %}
|
||||
{% include 'snippets/boost_button.html' with status=status %}
|
||||
{% include 'snippets/fav_button.html' with status=status %}
|
||||
|
||||
{% else %}
|
||||
<a href="/login">
|
||||
<span class="icon icon-comment" title="Reply">
|
||||
<span class="is-sr-only">Reply</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-boost" title="Boost status">
|
||||
<span class="is-sr-only">Boost status</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-heart" title="Like status">
|
||||
<span class="is-sr-only">Like status</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/privacy-icons.html' with item=status %}
|
||||
</div>
|
||||
|
||||
<div class="card-footer-item">
|
||||
<a href="{{ status.remote_id }}">{{ status.published_date | post_date }}</a>
|
||||
</div>
|
||||
{% if status.user == request.user %}
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="more-info" controls_uid=status.id text="More options" icon="dots-three" small=True %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="control">
|
||||
{% include 'snippets/boost_button.html' with status=status %}
|
||||
</div>
|
||||
|
||||
{% if request.user.is_authenticated %}
|
||||
{% with status.id|uuid as uuid %}
|
||||
<input class="toggle-control" type="checkbox" name="show-comment-{{ status.id }}" id="show-comment-{{ status.id }}" data-hover-target="id_content_{{ status.id }}-{{ uuid }}">
|
||||
<div class="toggle-content hidden">
|
||||
<div class="card-footer">
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/reply_form.html' with status=status %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control">
|
||||
{% include 'snippets/fav_button.html' with status=status %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if status.user == request.user %}
|
||||
<div>
|
||||
<input class="toggle-control" type="checkbox" name="more-info-{{ status.id }}" id="more-info-{{ status.id }}">
|
||||
<div class="toggle-content hidden card-footer">
|
||||
{% if status.user == request.user %}
|
||||
<div class="card-footer-item">
|
||||
<form name="delete-{{status.id}}" action="/delete-status/{{ status.id }}" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="button is-danger is-light" type="submit">
|
||||
Delete post
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</footer>
|
||||
</article>
|
||||
{% else %}
|
||||
<article class="card">
|
||||
<header class="card-header">
|
||||
<p>
|
||||
{% include 'snippets/avatar.html' with user=status.user %}
|
||||
{% include 'snippets/username.html' with user=status.user %}
|
||||
deleted this status
|
||||
</p>
|
||||
</header>
|
||||
</article>
|
||||
{% else %}
|
||||
<a href="/login">
|
||||
<span class="icon icon-comment" title="Reply">
|
||||
<span class="is-sr-only">Reply</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-boost" title="Boost status">
|
||||
<span class="is-sr-only">Boost status</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-heart" title="Like status">
|
||||
<span class="is-sr-only">Like status</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/privacy-icons.html' with item=status %}
|
||||
</div>
|
||||
|
||||
<div class="card-footer-item">
|
||||
<a href="{{ status.remote_id }}">{{ status.published_date | post_date }}</a>
|
||||
</div>
|
||||
{% if status.user == request.user %}
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/status_options.html' with class="is-small" right=True %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block card-bonus %}
|
||||
{% if request.user.is_authenticated %}
|
||||
{% with status.id|uuid as uuid %}
|
||||
<section class="hidden" id="show-comment-{{ status.id }}">
|
||||
<div class="card-footer">
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/create_status_form.html' with reply_parent=status type="reply" %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -10,19 +10,15 @@
|
||||
{% endif %}
|
||||
|
||||
{% if status.content_warning %}
|
||||
<div class="toggle-content">
|
||||
<div>
|
||||
<p>{{ status.content_warning }}</p>
|
||||
<input class="toggle-control" type="radio" name="toggle-status-cw-{{ status.id }}" id="hide-status-cw-{{ status.id }}" checked>
|
||||
<div class="toggle-content hidden">
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Show More" small=True controls_text="show-status-cw" controls_uid=status.id %}
|
||||
</div>
|
||||
{% include 'snippets/toggle/open_button.html' with text="show more" class="is-small" controls_text="show-status-cw" controls_uid=status.id %}
|
||||
</div>
|
||||
|
||||
<input class="toggle-control" type="radio" name="toggle-status-cw-{{ status.id }}" id="show-status-cw-{{ status.id }}">
|
||||
{% endif %}
|
||||
<div{% if status.content_warning %} class="toggle-content hidden"{% endif %}>
|
||||
|
||||
<div{% if status.content_warning %} class="hidden" id="show-status-cw-{{ status.id }}"{% endif %}>
|
||||
{% if status.content_warning %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="Show Less" small=True controls_text="hide-status-cw" controls_uid=status.id %}
|
||||
{% include 'snippets/toggle/close_button.html' with text="show less" class="is-small" controls_text="show-status-cw" controls_uid=status.id %}
|
||||
{% endif %}
|
||||
|
||||
{% if status.quote %}
|
||||
|
18
bookwyrm/templates/snippets/status_options.html
Normal file
18
bookwyrm/templates/snippets/status_options.html
Normal file
@ -0,0 +1,18 @@
|
||||
{% extends 'snippets/components/dropdown.html' %}
|
||||
|
||||
{% block dropdown-trigger %}
|
||||
<span class="icon icon-dots-three">
|
||||
<span class="is-sr-only">More options</span>
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
||||
{% block dropdown-list %}
|
||||
<li role="menuitem">
|
||||
<form class="dropdown-item pt-0 pb-0" name="delete-{{status.id}}" action="/delete-status/{{ status.id }}" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="button is-danger is-light is-fullwidth is-small" type="submit">
|
||||
Delete post
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endblock %}
|
@ -1,5 +1,5 @@
|
||||
<form name="switch-edition" action="/switch-edition" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="edition" value="{{ edition.id }}">
|
||||
<button class="button {{ size }}">Switch to this edition</button>
|
||||
<button type="submit" class="button {{ size }}">Switch to this edition</button>
|
||||
</form>
|
||||
|
1
bookwyrm/templates/snippets/toggle/close_button.html
Normal file
1
bookwyrm/templates/snippets/toggle/close_button.html
Normal file
@ -0,0 +1 @@
|
||||
{% include 'snippets/toggle/toggle_button.html' with button_type='hide-inactive' %}
|
1
bookwyrm/templates/snippets/toggle/open_button.html
Normal file
1
bookwyrm/templates/snippets/toggle/open_button.html
Normal file
@ -0,0 +1 @@
|
||||
{% include 'snippets/toggle/toggle_button.html' with button_type='hide-active' %}
|
@ -1,4 +1,13 @@
|
||||
<label class="{% if class %}{{ class }}{% else %}button{% endif %}{% if small %} is-small{% endif %}" for="{{ controls_text }}{% if controls_uid %}-{{ controls_uid }}{% endif %}" tabindex="0" role="button"{% if label %} aria-label="{{ label }}"{% endif %}>
|
||||
<button
|
||||
type="button"
|
||||
class="{% if not nonbutton %}button {% endif %}{{ class }}{% if button_type %} {{ button_type }}{% endif %}"
|
||||
data-controls="{{ controls_text }}{% if controls_uid %}-{{ controls_uid }}{% endif %}"
|
||||
{% if focus %}data-focus-target="{{ focus }}{% if controls_uid %}-{{ controls_uid }}{% endif %}"{% endif %}
|
||||
{% if checkbox %}data-controls-checkbox="{{ checkbox }}{% if controls_uid %}-{{ controls_uid }}{% endif %}"{% endif %}
|
||||
{% if label %}aria-label="{{ label }}"{% endif %}
|
||||
aria-pressed="{% if pressed %}true{% else %}false{% endif %}"
|
||||
>
|
||||
|
||||
{% if icon %}
|
||||
<span class="icon icon-{{ icon }}" title="{{ text }}">
|
||||
<span class="is-sr-only">{{ text }}</span>
|
||||
@ -6,4 +15,4 @@
|
||||
{% else %}
|
||||
{{ text }}
|
||||
{% endif %}
|
||||
</label>
|
||||
</button>
|
||||
|
@ -2,18 +2,16 @@
|
||||
{% with 0|uuid as uuid %}
|
||||
{% if full %}
|
||||
|
||||
{% with full|truncatewords_html:60 as trimmed %}
|
||||
{% with full|to_markdown|safe|truncatewords_html:60 as trimmed %}
|
||||
{% if trimmed != full %}
|
||||
<div>
|
||||
<input type="radio" name="show-hide-{{ uuid }}" id="show-{{ uuid }}" class="toggle-control" checked>
|
||||
<blockquote class="content toggle-content hidden"><span dir="auto">{{ trimmed | to_markdown | safe }}</span>
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="show more" controls_text="hide" controls_uid=uuid class="has-text-link is-clickable" %}
|
||||
<div id="hide-full-{{ uuid }}">
|
||||
<blockquote class="content" id="trimmed-{{ uuid }}"><span dir="auto">{{ trimmed }}</span>
|
||||
{% include 'snippets/toggle/open_button.html' with text="show more" controls_text="full" controls_uid=uuid class="is-small" %}
|
||||
</blockquote>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" name="show-hide-{{ uuid }}" id="hide-{{ uuid }}" class="toggle-control">
|
||||
<blockquote class="content toggle-content hidden"><span dir="auto">{{ full | to_markdown | safe }}</span>
|
||||
{% include 'snippets/toggle/toggle_button.html' with text="show less" controls_text="show" controls_uid=uuid class="has-text-link is-clickable" %}
|
||||
<div id="full-{{ uuid }}" class="hidden">
|
||||
<blockquote class="content"><span dir="auto">{{ full | to_markdown | safe }}</span>
|
||||
{% include 'snippets/toggle/close_button.html' with text="show less" controls_text="full" controls_uid=uuid class="is-small" %}
|
||||
</blockquote>
|
||||
</div>
|
||||
{% else %}
|
||||
|
Reference in New Issue
Block a user