diff --git a/bookwyrm/static/js/bookwyrm.js b/bookwyrm/static/js/bookwyrm.js index 049de497c..5bf845a4e 100644 --- a/bookwyrm/static/js/bookwyrm.js +++ b/bookwyrm/static/js/bookwyrm.js @@ -133,8 +133,10 @@ let BookWyrm = new class { revealForm(event) { let trigger = event.currentTarget; let hidden = trigger.closest('.hidden-form').querySelectorAll('.is-hidden')[0]; + // if the form has already been revealed, there is no '.is-hidden' element // so this doesn't really work as a toggle + if (hidden) { this.addRemoveClass(hidden, 'is-hidden', !hidden); } @@ -150,6 +152,7 @@ let BookWyrm = new class { let trigger = event.currentTarget; let targetId = trigger.dataset.hides let visible = document.getElementById(targetId) + this.addRemoveClass(visible, 'is-hidden', true); } diff --git a/bookwyrm/templates/groups/delete_group_modal.html b/bookwyrm/templates/groups/delete_group_modal.html index ff6593e50..fd6706157 100644 --- a/bookwyrm/templates/groups/delete_group_modal.html +++ b/bookwyrm/templates/groups/delete_group_modal.html @@ -8,14 +8,14 @@ {% endblock %} {% block modal-footer %} -
- {% csrf_token %} - - - {% trans "Cancel" as button_text %} - {% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="delete_list" controls_uid=list.id %} -
+
+ {% csrf_token %} + + + {% trans "Cancel" as button_text %} + {% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="delete_list" controls_uid=list.id %} +
{% endblock %} diff --git a/bookwyrm/templates/groups/find_users.html b/bookwyrm/templates/groups/find_users.html index 99ec67bc4..ec890a93d 100644 --- a/bookwyrm/templates/groups/find_users.html +++ b/bookwyrm/templates/groups/find_users.html @@ -1,8 +1,8 @@ {% extends 'groups/group.html' %} {% block searchresults %} -

- Add new members! -

- {% include 'groups/suggested_users.html' with suggested_users=suggested_users query=query %} +

+ Add new members! +

+ {% include 'groups/suggested_users.html' with suggested_users=suggested_users query=query %} {% endblock %} \ No newline at end of file diff --git a/bookwyrm/templates/groups/group.html b/bookwyrm/templates/groups/group.html index f19e8ee4f..408f1f945 100644 --- a/bookwyrm/templates/groups/group.html +++ b/bookwyrm/templates/groups/group.html @@ -11,7 +11,7 @@ {% block searchresults %} {% endblock %}
- {% include "groups/members.html" with group=group %} + {% include "groups/members.html" with group=group %}

Lists

@@ -20,42 +20,42 @@ {% else %}
- {% for list in lists %} -
-
-
-

- {{ list.name }} {% include 'snippets/privacy-icons.html' with item=list %} -

-
- - {% with list_books=list.listitem_set.all|slice:5 %} - {% if list_books %} - - {% endif %} - {% endwith %} - -
-
- {% if list.description %} - {{ list.description|to_markdown|safe|truncatechars_html:30 }} - {% else %} -   - {% endif %} -
-

- {% include 'lists/created_text.html' with list=list %} -

-
-
-
- {% endfor %} + {% for list in lists %} +
+
+
+

+ {{ list.name }} {% include 'snippets/privacy-icons.html' with item=list %} +

+
+ + {% with list_books=list.listitem_set.all|slice:5 %} + {% if list_books %} + + {% endif %} + {% endwith %} + +
+
+ {% if list.description %} + {{ list.description|to_markdown|safe|truncatechars_html:30 }} + {% else %} +   + {% endif %} +
+

+ {% include 'lists/created_text.html' with list=list %} +

+
+
+
+ {% endfor %}
{% endif %} diff --git a/bookwyrm/templates/groups/members.html b/bookwyrm/templates/groups/members.html index 8c3dac7b4..f8eefaff4 100644 --- a/bookwyrm/templates/groups/members.html +++ b/bookwyrm/templates/groups/members.html @@ -8,29 +8,29 @@

{% trans "Members can add and remove books on a group's book lists" %}

- {% for membership in group.memberships.all %} - {% with member=membership.user %} -
- - {% include 'snippets/avatar.html' with user=member large=True %} - {{ member.display_name|truncatechars:10 }} - @{{ member|username|truncatechars:8 }} - - {% if group.user == member %} - - Manager - - {% endif %} - {% include 'snippets/remove_from_group_button.html' with user=member group=group minimal=True %} - {% if request.user in member.following.all %} -

- {% trans "Follows you" %} -

- {% endif %} + {% for membership in group.memberships.all %} + {% with member=membership.user %} +
+ + {% include 'snippets/avatar.html' with user=member large=True %} + {{ member.display_name|truncatechars:10 }} + @{{ member|username|truncatechars:8 }} + + {% if group.user == member %} + + Manager + + {% endif %} + {% include 'snippets/remove_from_group_button.html' with user=member group=group minimal=True %} + {% if request.user in member.following.all %} +

+ {% trans "Follows you" %} +

+ {% endif %}
{% endwith %} {% endfor %} -
+
{% if group.user != request.user and group|is_member:request.user %}
@@ -38,11 +38,11 @@ + {% if show_username %} + {% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %} + {% else %} + {% trans "Remove self from group" %} + {% endif %} +
{% endif %} \ No newline at end of file diff --git a/bookwyrm/templates/groups/suggested_users.html b/bookwyrm/templates/groups/suggested_users.html index a719c5fad..212a1a76e 100644 --- a/bookwyrm/templates/groups/suggested_users.html +++ b/bookwyrm/templates/groups/suggested_users.html @@ -36,6 +36,7 @@ {% endfor %} {% else %} -

No potential members found for "{{ query }}"


+

No potential members found for "{{ query }}"

+
{% endif %} diff --git a/bookwyrm/templates/notifications/items/accept.html b/bookwyrm/templates/notifications/items/accept.html index 3ad671201..5aab79af0 100644 --- a/bookwyrm/templates/notifications/items/accept.html +++ b/bookwyrm/templates/notifications/items/accept.html @@ -4,17 +4,17 @@ {% load utilities %} {% block primary_link %}{% spaceless %} - {{ notification.related_group.local_path }} + {{ notification.related_group.local_path }} {% endspaceless %}{% endblock %} {% block icon %} - + {% endblock %} {% block description %} -{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %} -accepted your invitation to join group "{{ group_name }}" -{% endblocktrans %} + {% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %} + accepted your invitation to join group "{{ group_name }}" + {% endblocktrans %} {% endblock %} \ No newline at end of file diff --git a/bookwyrm/templates/notifications/items/leave.html b/bookwyrm/templates/notifications/items/leave.html index a30241c52..e6fe72be9 100644 --- a/bookwyrm/templates/notifications/items/leave.html +++ b/bookwyrm/templates/notifications/items/leave.html @@ -4,17 +4,17 @@ {% load utilities %} {% block primary_link %}{% spaceless %} - {{ notification.related_group.local_path }} + {{ notification.related_group.local_path }} {% endspaceless %}{% endblock %} {% block icon %} - + {% endblock %} {% block description %} -{% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %} -has left your group "{{ group_name }}" -{% endblocktrans %} + {% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %} + has left your group "{{ group_name }}" + {% endblocktrans %} {% endblock %} \ No newline at end of file diff --git a/bookwyrm/templates/notifications/items/remove.html b/bookwyrm/templates/notifications/items/remove.html index 784c0d00c..7ee38b4a7 100644 --- a/bookwyrm/templates/notifications/items/remove.html +++ b/bookwyrm/templates/notifications/items/remove.html @@ -4,11 +4,11 @@ {% load utilities %} {% block primary_link %}{% spaceless %} - {{ notification.related_group.local_path }} + {{ notification.related_group.local_path }} {% endspaceless %}{% endblock %} {% block icon %} - + {% endblock %} {% block description %} @@ -20,9 +20,9 @@ has been removed from your group "{{ group_name }}{{ group_name }} group" -{% endblocktrans %} + {% blocktrans with group_name=notification.related_group.name group_path=notification.related_group.local_path %} + You have been removed from the "{{ group_name }} group" + {% endblocktrans %} {% endif %} {% endblock %} diff --git a/bookwyrm/templates/snippets/add_to_group_button.html b/bookwyrm/templates/snippets/add_to_group_button.html index cf9ae15df..fd94f14d1 100644 --- a/bookwyrm/templates/snippets/add_to_group_button.html +++ b/bookwyrm/templates/snippets/add_to_group_button.html @@ -29,13 +29,13 @@ {% else %} - {% endif %} + {% if show_username %} + {% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %} + {% else %} + {% trans "Remove" %} + {% endif %} + + {% endif %} diff --git a/bookwyrm/templates/snippets/remove_from_group_button.html b/bookwyrm/templates/snippets/remove_from_group_button.html index 05b17b594..809d1d1fe 100644 --- a/bookwyrm/templates/snippets/remove_from_group_button.html +++ b/bookwyrm/templates/snippets/remove_from_group_button.html @@ -13,12 +13,12 @@ + {% if show_username %} + {% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %} + {% else %} + {% trans "Remove" %} + {% endif %} +