update indenting for linter

This commit is contained in:
Hugh Rundle 2021-10-04 22:20:02 +11:00
parent 05969c5311
commit 3a90311129
11 changed files with 109 additions and 105 deletions

View file

@ -133,8 +133,10 @@ let BookWyrm = new class {
revealForm(event) { revealForm(event) {
let trigger = event.currentTarget; let trigger = event.currentTarget;
let hidden = trigger.closest('.hidden-form').querySelectorAll('.is-hidden')[0]; let hidden = trigger.closest('.hidden-form').querySelectorAll('.is-hidden')[0];
// if the form has already been revealed, there is no '.is-hidden' element // if the form has already been revealed, there is no '.is-hidden' element
// so this doesn't really work as a toggle // so this doesn't really work as a toggle
if (hidden) { if (hidden) {
this.addRemoveClass(hidden, 'is-hidden', !hidden); this.addRemoveClass(hidden, 'is-hidden', !hidden);
} }
@ -150,6 +152,7 @@ let BookWyrm = new class {
let trigger = event.currentTarget; let trigger = event.currentTarget;
let targetId = trigger.dataset.hides let targetId = trigger.dataset.hides
let visible = document.getElementById(targetId) let visible = document.getElementById(targetId)
this.addRemoveClass(visible, 'is-hidden', true); this.addRemoveClass(visible, 'is-hidden', true);
} }

View file

@ -8,14 +8,14 @@
{% endblock %} {% endblock %}
{% block modal-footer %} {% block modal-footer %}
<div > <div>
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="id" value="{{ group.id }}"> <input type="hidden" name="id" value="{{ group.id }}">
<button class="button is-danger" type="submit"> <button class="button is-danger" type="submit">
{% trans "Delete" %} {% trans "Delete" %}
</button> </button>
{% trans "Cancel" as button_text %} {% trans "Cancel" as button_text %}
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="delete_list" controls_uid=list.id %} {% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="delete_list" controls_uid=list.id %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,8 +1,8 @@
{% extends 'groups/group.html' %} {% extends 'groups/group.html' %}
{% block searchresults %} {% block searchresults %}
<h2 class="title is-5"> <h2 class="title is-5">
Add new members! Add new members!
</h2> </h2>
{% include 'groups/suggested_users.html' with suggested_users=suggested_users query=query %} {% include 'groups/suggested_users.html' with suggested_users=suggested_users query=query %}
{% endblock %} {% endblock %}

View file

@ -11,7 +11,7 @@
{% block searchresults %} {% block searchresults %}
{% endblock %} {% endblock %}
<div class="mb-2"> <div class="mb-2">
{% include "groups/members.html" with group=group %} {% include "groups/members.html" with group=group %}
</div> </div>
<h2 class="title is-5">Lists</h2> <h2 class="title is-5">Lists</h2>
@ -20,42 +20,42 @@
{% else %} {% else %}
<div class="columns is-multiline"> <div class="columns is-multiline">
{% for list in lists %} {% for list in lists %}
<div class="column is-one-third"> <div class="column is-one-third">
<div class="card is-stretchable"> <div class="card is-stretchable">
<header class="card-header"> <header class="card-header">
<h4 class="card-header-title"> <h4 class="card-header-title">
<a href="{{ list.local_path }}">{{ list.name }}</a> <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span> <a href="{{ list.local_path }}">{{ list.name }}</a> <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span>
</h4> </h4>
</header> </header>
{% with list_books=list.listitem_set.all|slice:5 %} {% with list_books=list.listitem_set.all|slice:5 %}
{% if list_books %} {% if list_books %}
<div class="card-image columns is-mobile is-gapless is-clipped"> <div class="card-image columns is-mobile is-gapless is-clipped">
{% for book in list_books %} {% for book in list_books %}
<a class="column is-cover" href="{{ book.book.local_path }}"> <a class="column is-cover" href="{{ book.book.local_path }}">
{% include 'snippets/book_cover.html' with book=book.book cover_class='is-h-s' size='small' aria='show' %} {% include 'snippets/book_cover.html' with book=book.book cover_class='is-h-s' size='small' aria='show' %}
</a> </a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
<div class="card-content is-flex-grow-0"> <div class="card-content is-flex-grow-0">
<div class="is-clipped" {% if list.description %}title="{{ list.description }}"{% endif %}> <div class="is-clipped" {% if list.description %}title="{{ list.description }}"{% endif %}>
{% if list.description %} {% if list.description %}
{{ list.description|to_markdown|safe|truncatechars_html:30 }} {{ list.description|to_markdown|safe|truncatechars_html:30 }}
{% else %} {% else %}
&nbsp; &nbsp;
{% endif %} {% endif %}
</div> </div>
<p class="subtitle help"> <p class="subtitle help">
{% include 'lists/created_text.html' with list=list %} {% include 'lists/created_text.html' with list=list %}
</p> </p>
</div> </div>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}

View file

@ -8,29 +8,29 @@
<p class="subtitle is-6">{% trans "Members can add and remove books on a group's book lists" %}</p> <p class="subtitle is-6">{% trans "Members can add and remove books on a group's book lists" %}</p>
<div class="is-multiline is-flex is-flex-grow-0 is-flex-wrap-wrap"> <div class="is-multiline is-flex is-flex-grow-0 is-flex-wrap-wrap">
{% for membership in group.memberships.all %} {% for membership in group.memberships.all %}
{% with member=membership.user %} {% with member=membership.user %}
<div class="box has-text-centered is-shadowless has-background-white-bis my-2 mx-2"> <div class="box has-text-centered is-shadowless has-background-white-bis my-2 mx-2">
<a href="{{ member.local_path }}" class="has-text-black"> <a href="{{ member.local_path }}" class="has-text-black">
{% include 'snippets/avatar.html' with user=member large=True %} {% include 'snippets/avatar.html' with user=member large=True %}
<span title="{{ member.display_name }}" class="is-block is-6 has-text-weight-bold">{{ member.display_name|truncatechars:10 }}</span> <span title="{{ member.display_name }}" class="is-block is-6 has-text-weight-bold">{{ member.display_name|truncatechars:10 }}</span>
<span title="@{{ member|username }}" class="is-block pb-3">@{{ member|username|truncatechars:8 }}</span> <span title="@{{ member|username }}" class="is-block pb-3">@{{ member|username|truncatechars:8 }}</span>
</a> </a>
{% if group.user == member %} {% if group.user == member %}
<span class="icon icon-star-full" title="Manager"> <span class="icon icon-star-full" title="Manager">
<span class="is-sr-only">Manager</span> <span class="is-sr-only">Manager</span>
</span> </span>
{% endif %} {% endif %}
{% include 'snippets/remove_from_group_button.html' with user=member group=group minimal=True %} {% include 'snippets/remove_from_group_button.html' with user=member group=group minimal=True %}
{% if request.user in member.following.all %} {% if request.user in member.following.all %}
<p class="help"> <p class="help">
{% trans "Follows you" %} {% trans "Follows you" %}
</p> </p>
{% endif %} {% endif %}
</div> </div>
{% endwith %} {% endwith %}
{% endfor %} {% endfor %}
</div> </div>
{% if group.user != request.user and group|is_member:request.user %} {% if group.user != request.user and group|is_member:request.user %}
<form action="{% url 'remove-group-member' %}" method="POST" class="my-4"> <form action="{% url 'remove-group-member' %}" method="POST" class="my-4">
@ -38,11 +38,11 @@
<input type="hidden" name="group" value="{{ group.id }}"> <input type="hidden" name="group" value="{{ group.id }}">
<input type="hidden" name="user" value="{{ user.username }}"> <input type="hidden" name="user" value="{{ user.username }}">
<button class="button is-small is-danger is-light" type="submit"> <button class="button is-small is-danger is-light" type="submit">
{% if show_username %} {% if show_username %}
{% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %} {% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %}
{% else %} {% else %}
{% trans "Remove self from group" %} {% trans "Remove self from group" %}
{% endif %} {% endif %}
</button> </button>
</form> </form>
{% endif %} {% endif %}

View file

@ -36,6 +36,7 @@
{% endfor %} {% endfor %}
</div> </div>
{% else %} {% else %}
<p>No potential members found for "{{ query }}"</p><br/> <p>No potential members found for "{{ query }}"</p>
<br/>
{% endif %} {% endif %}

View file

@ -4,17 +4,17 @@
{% load utilities %} {% load utilities %}
{% block primary_link %}{% spaceless %} {% block primary_link %}{% spaceless %}
{{ notification.related_group.local_path }} {{ notification.related_group.local_path }}
{% endspaceless %}{% endblock %} {% endspaceless %}{% endblock %}
{% block icon %} {% block icon %}
<span class="icon icon-local"></span> <span class="icon icon-local"></span>
{% endblock %} {% endblock %}
{% block description %} {% block description %}
{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %} {% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
accepted your invitation to join group "<a href="{{ group_path }}">{{ group_name }}</a>" accepted your invitation to join group "<a href="{{ group_path }}">{{ group_name }}</a>"
{% endblocktrans %} {% endblocktrans %}
{% endblock %} {% endblock %}

View file

@ -4,17 +4,17 @@
{% load utilities %} {% load utilities %}
{% block primary_link %}{% spaceless %} {% block primary_link %}{% spaceless %}
{{ notification.related_group.local_path }} {{ notification.related_group.local_path }}
{% endspaceless %}{% endblock %} {% endspaceless %}{% endblock %}
{% block icon %} {% block icon %}
<span class="icon icon-local"></span> <span class="icon icon-local"></span>
{% endblock %} {% endblock %}
{% block description %} {% block description %}
{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %} {% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
has left your group "<a href="{{ group_path }}">{{ group_name }}</a>" has left your group "<a href="{{ group_path }}">{{ group_name }}</a>"
{% endblocktrans %} {% endblocktrans %}
{% endblock %} {% endblock %}

View file

@ -4,11 +4,11 @@
{% load utilities %} {% load utilities %}
{% block primary_link %}{% spaceless %} {% block primary_link %}{% spaceless %}
{{ notification.related_group.local_path }} {{ notification.related_group.local_path }}
{% endspaceless %}{% endblock %} {% endspaceless %}{% endblock %}
{% block icon %} {% block icon %}
<span class="icon icon-local"></span> <span class="icon icon-local"></span>
{% endblock %} {% endblock %}
{% block description %} {% block description %}
@ -20,9 +20,9 @@ has been removed from your group "<a href="{{ group_path }}">{{ group_name }}</a
{% else %} {% else %}
{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %} {% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %}
You have been removed from the "<a href="{{ group_path }}">{{ group_name }}</a> group" You have been removed from the "<a href="{{ group_path }}">{{ group_name }}</a> group"
{% endblocktrans %} {% endblocktrans %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View file

@ -29,13 +29,13 @@
</button> </button>
{% else %} {% else %}
<button class="button is-small is-danger is-light" type="submit"> <button class="button is-small is-danger is-light" type="submit">
{% if show_username %} {% if show_username %}
{% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %} {% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %}
{% else %} {% else %}
{% trans "Remove" %} {% trans "Remove" %}
{% endif %} {% endif %}
</button> </button>
{% endif %} {% endif %}
</form> </form>
</div> </div>
</div> </div>

View file

@ -13,12 +13,12 @@
<input type="hidden" name="group" value="{{ group.id }}"> <input type="hidden" name="group" value="{{ group.id }}">
<input type="hidden" name="user" value="{{ user.username }}"> <input type="hidden" name="user" value="{{ user.username }}">
<button class="button is-small" type="submit"> <button class="button is-small" type="submit">
{% if show_username %} {% if show_username %}
{% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %} {% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %}
{% else %} {% else %}
{% trans "Remove" %} {% trans "Remove" %}
{% endif %} {% endif %}
</button> </button>
</form> </form>
</div> </div>
</div> </div>