Removes username snippet

This commit is contained in:
Mouse Reeve 2021-03-07 10:24:46 -08:00
parent a63471c56f
commit 0bd27928e4
15 changed files with 58 additions and 37 deletions

View file

@ -252,7 +252,7 @@
<div class="media-left">{% include 'snippets/avatar.html' with user=rating.user %}</div> <div class="media-left">{% include 'snippets/avatar.html' with user=rating.user %}</div>
<div class="media-content"> <div class="media-content">
<div> <div>
{% include 'snippets/username.html' with user=rating.user %} <a href="{{ rating.user.local_path }}">{{ rating.user.display_name }}</a>
</div> </div>
<div class="is-flex"> <div class="is-flex">
<p class="mr-1">{% trans "rated it" %}</p> <p class="mr-1">{% trans "rated it" %}</p>

View file

@ -79,7 +79,7 @@
aria-controls="navbar-dropdown" aria-controls="navbar-dropdown"
> >
{% include 'snippets/avatar.html' with user=request.user %} {% include 'snippets/avatar.html' with user=request.user %}
<span class="ml-2">{% include 'snippets/username.html' with user=request.user anchor=false %}</span> <span class="ml-2">{{ user.display_name }}</span>
</a> </a>
<ul class="navbar-dropdown" id="navbar-dropdown"> <ul class="navbar-dropdown" id="navbar-dropdown">
<li> <li>

View file

@ -0,0 +1,10 @@
{% load i18n %}
{% spaceless %}
{% if list.curation != 'open' %}
{% blocktrans with username=list.user.display_name path=list.user.local_path %}Created and curated by <a href="{{ path }}">{{ username }}</a>{% endblocktrans %}
{% else %}
{% blocktrans with username=list.user.display_name path=list.user.local_path %}Created by <a href="{{ path }}">{{ username }}</a>{% endblocktrans %}
{% endif %}
{% endspaceless %}

View file

@ -24,7 +24,7 @@
{% include 'snippets/book_titleby.html' with book=item.book %} {% include 'snippets/book_titleby.html' with book=item.book %}
</td> </td>
<td> <td>
{% include 'snippets/username.html' with user=item.user %} <a href="{{ item.user.local_path }}">{{ item.user.display_name }}</a>
</td> </td>
<td> <td>
<div class="field has-addons"> <div class="field has-addons">

View file

@ -1,5 +1,4 @@
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% load i18n %}
<div class="columns is-multiline"> <div class="columns is-multiline">
{% for list in lists %} {% for list in lists %}
<div class="column is-one-quarter"> <div class="column is-one-quarter">
@ -16,7 +15,9 @@
</div> </div>
<div class="card-content is-flex-grow-0"> <div class="card-content is-flex-grow-0">
{% if list.description %}{{ list.description | to_markdown | safe | truncatewords_html:20 }}{% endif %} {% if list.description %}{{ list.description | to_markdown | safe | truncatewords_html:20 }}{% endif %}
<p class="subtitle help">{% if list.curation != 'open' %}{% trans "Created and curated by" %}{% else %}{% trans "Created by" %}{% endif %} {% include 'snippets/username.html' with user=list.user %}</p> <p class="subtitle help">
{% include 'lists/created_text.html' with list=list %}
</p>
</div> </div>
</div> </div>
</div> </div>

View file

@ -8,8 +8,9 @@
<header class="columns content is-mobile"> <header class="columns content is-mobile">
<div class="column"> <div class="column">
<h1 class="title">{{ list.name }} <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span></h1> <h1 class="title">{{ list.name }} <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span></h1>
<p class="subtitle help">{% if list.curation != 'open' %}{% trans "Created and curated by" %}{% else %}{% trans "Created by" %} {% include 'snippets/username.html' with user=list.user %}</p> <p class="subtitle help">
{% endif %} {% include 'lists/created_text.html' with list=list %}
</p>
{% include 'snippets/trimmed_text.html' with full=list.description %} {% include 'snippets/trimmed_text.html' with full=list.description %}
</div> </div>
{% if request.user == list.user %} {% if request.user == list.user %}

View file

@ -42,8 +42,10 @@
<p> <p>
{# DESCRIPTION #} {# DESCRIPTION #}
{% if notification.related_user %} {% if notification.related_user %}
<a href="{{ notification.related_user.local_path }}">
{% include 'snippets/avatar.html' with user=notification.related_user %} {% include 'snippets/avatar.html' with user=notification.related_user %}
{% include 'snippets/username.html' with user=notification.related_user %} {{ notification.related_user.display_name }}
</a>
{% if notification.notification_type == 'FAVORITE' %} {% if notification.notification_type == 'FAVORITE' %}
{% if related_status.status_type == 'Review' %} {% if related_status.status_type == 'Review' %}
{% blocktrans with book_title=related_status.book.title related_path=related_status.local_path %}favorited your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>{% endblocktrans %} {% blocktrans with book_title=related_status.book.title related_path=related_status.local_path %}favorited your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>{% endblocktrans %}

View file

@ -15,7 +15,7 @@
{% for user in request.user.blocks.all %} {% for user in request.user.blocks.all %}
<li class="is-flex"> <li class="is-flex">
<p> <p>
{% include 'snippets/avatar.html' with user=user %} {% include 'snippets/username.html' with user=user %} <a href="{{ user.local_path }}">{% include 'snippets/avatar.html' with user=user %} {{ user.display_name }}</a>
</p> </p>
<p class="mr-2"> <p class="mr-2">
{% include 'snippets/block_button.html' with user=user %} {% include 'snippets/block_button.html' with user=user %}

View file

@ -79,8 +79,10 @@
<ul> <ul>
{% for result in user_results %} {% for result in user_results %}
<li class="block"> <li class="block">
{% include 'snippets/avatar.html' with user=result %}</h2> <a href="{{ result.local_path }}">
{% include 'snippets/username.html' with user=result show_full=True %}</h2> {% include 'snippets/avatar.html' with user=result %}
{{ result.display_name }}
</a> ({{ result.username }})
{% include 'snippets/follow_button.html' with user=result %} {% include 'snippets/follow_button.html' with user=result %}
</li> </li>
{% endfor %} {% endfor %}

View file

@ -2,8 +2,10 @@
{% load i18n %} {% load i18n %}
{% if not status.deleted %} {% if not status.deleted %}
{% if status.status_type == 'Announce' %} {% if status.status_type == 'Announce' %}
<a href="{{ status.user.local_path }}">
{% include 'snippets/avatar.html' with user=status.user %} {% include 'snippets/avatar.html' with user=status.user %}
{% include 'snippets/username.html' with user=status.user %} {{ user.display_name }}
</a>
{% trans "boosted" %} {% trans "boosted" %}
{% include 'snippets/status/status_body.html' with status=status|boosted_status %} {% include 'snippets/status/status_body.html' with status=status|boosted_status %}
{% else %} {% else %}

View file

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
<a href="{{ status.user.local_path }}"> <a href="{{ status.user.local_path }}">
{% include 'snippets/avatar.html' with user=status.user ariaHide="true" %} {% include 'snippets/avatar.html' with user=status.user ariaHide="true" %}
{% include 'snippets/username.html' with user=status.user %} {{ status.user.display_name }}
</a> </a>
{% if status.status_type == 'GeneratedNote' %} {% if status.status_type == 'GeneratedNote' %}
@ -17,7 +17,17 @@
{% trans "quoted" %} {% trans "quoted" %}
{% elif status.reply_parent %} {% elif status.reply_parent %}
{% with parent_status=status|parent %} {% with parent_status=status|parent %}
replied to {% include 'snippets/username.html' with user=parent_status.user possessive=True %} <a href="{{parent_status.remote_id }}">{% if parent_status.status_type == 'GeneratedNote' %}update{% else %}{{ parent_status.status_type | lower }}{% endif %}</a>
{% if parent_status.status_type == 'Review' %}
{% blocktrans with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">review</a>{% endblocktrans %}
{% elif parent_status.status_type == 'Comment' %}
{% blocktrans with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">comment</a>{% endblocktrans %}
{% elif parent_status.status_type == 'Quotation' %}
{% blocktrans with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">quote</a>{% endblocktrans %}
{% else %}
{% blocktrans with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">status</a>{% endblocktrans %}
{% endif %}
{% endwith %} {% endwith %}
{% endif %} {% endif %}
{% if status.book %} {% if status.book %}

View file

@ -1,13 +0,0 @@
{% spaceless %}
{% load bookwyrm_tags %}
<{% if anchor %}a href="{{ user.local_path }}"{% else %}span{% endif %}>
{{ user.display_name }}
</a>
{% if possessive %}'s{% endif %}
{% if show_full and user.name or show_full and user.localname %}
({{ user.username }})
{% endif %}
{% endspaceless %}

View file

@ -11,19 +11,22 @@
{% block panel %} {% block panel %}
<div class="block"> <div class="block">
<h2 class="title">{% trans "Followers" %}</h2> <h2 class="title">{% trans "Followers" %}</h2>
{% for followers in followers %} {% for follower in followers %}
<div class="block columns"> <div class="block columns">
<div class="column"> <div class="column">
{% include 'snippets/avatar.html' with user=followers %} <a href="{{ follower.local_path }}">
{% include 'snippets/username.html' with user=followers show_full=True %} {% include 'snippets/avatar.html' with user=follower %}
{{ follower.display_name }}
</a>
({{ follower.username }})
</div> </div>
<div class="column is-narrow"> <div class="column is-narrow">
{% include 'snippets/follow_button.html' with user=followers %} {% include 'snippets/follow_button.html' with user=follower %}
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
{% if not followers.count %} {% if not followers.count %}
<div>{% blocktrans with username=user|username %}{{ username }} has no followers{% endblocktrans %}</div> <div>{% blocktrans with username=user.display_name %}{{ username }} has no followers{% endblocktrans %}</div>
{% endif %} {% endif %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -14,8 +14,11 @@
{% for follower in user.following.all %} {% for follower in user.following.all %}
<div class="block columns"> <div class="block columns">
<div class="column"> <div class="column">
<a href="{{ follower.local_path }}">
{% include 'snippets/avatar.html' with user=follower %} {% include 'snippets/avatar.html' with user=follower %}
{% include 'snippets/username.html' with user=follower show_full=True %} {{ follower.display_name }}
</a>
({{ follower.username }})
</div> </div>
<div class="column"> <div class="column">
{% include 'snippets/follow_button.html' with user=follower %} {% include 'snippets/follow_button.html' with user=follower %}

View file

@ -33,7 +33,7 @@
{% for requester in user.follower_requests.all %} {% for requester in user.follower_requests.all %}
<div class="row shrink"> <div class="row shrink">
<p> <p>
{% include 'snippets/username.html' with user=requester show_full=True %} <a href="{{ requester.local_path }}">{{ requester.display_name }}</a> ({{ requester.username }})
</p> </p>
{% include 'snippets/follow_request_buttons.html' with user=requester %} {% include 'snippets/follow_request_buttons.html' with user=requester %}
</div> </div>