Skip to content

Commit

Permalink
#91 Prepare more views for translations
Browse files Browse the repository at this point in the history
  • Loading branch information
anze3db committed Dec 18, 2024
1 parent cbcdfc9 commit 982a9a3
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 70 deletions.
8 changes: 4 additions & 4 deletions accounts/templates/cotton/follow_button.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
data-modal-toggle="authentication-modal"
data-umami-event="follow-signup-modal"
class="plausible-event-name=follow-signup-modal text-white absolute end-2 -bottom-12 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
Follow
{% trans "Follow" %}
</button>
{% elif account.is_following %}
<button disable
class="absolute -bottom-12 end-2 cursor-not-allowed rounded-lg bg-gray-300 px-4 py-2 text-sm font-medium text-gray-900 opacity-50 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200">
Following
{% trans "Following" %}
</button>
{% elif user.accountaccess.account.account_id == account.account_id %}
<button disable
class="absolute -bottom-12 end-2 cursor-not-allowed rounded-lg bg-gray-300 px-4 py-2 text-sm font-medium text-gray-900 opacity-50 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200">
You!
{% trans "You!" %}
</button>
{% else %}
<button hx-post="{% url 'follow' account.pk %}"
hx-swap="outerHTML"
data-umami-event="follow"
class="plausible-event-name=follow absolute -bottom-12 end-2 rounded-lg bg-blue-700 px-4 py-2 text-sm font-medium text-white hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
Follow
{% trans "Follow" %}
</button>
<style nonce={{request.csp_nonce}}>
.htmx-request {
Expand Down
14 changes: 8 additions & 6 deletions accounts/templates/login_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<!-- Modal header -->
<div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
<h3 class="text-xl font-semibold">Sign in to your Mastodon instance</h3>
<h3 class="text-xl font-semibold">{% trans "Sign in to your Mastodon instance" %}</h3>
{% if not hide_close %}
<button type="button"
class="end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
Expand All @@ -16,7 +16,7 @@ <h3 class="text-xl font-semibold">Sign in to your Mastodon instance</h3>
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" />
</svg>
<span class="sr-only">Close modal</span>
<span class="sr-only">{% trans "Close modal" %}</span>
</button>
{% endif %}
</div>
Expand All @@ -28,22 +28,24 @@ <h3 class="text-xl font-semibold">Sign in to your Mastodon instance</h3>
action="#">
{% csrf_token %}
<div>
<label for="email" class="block mb-2 text-sm font-medium">Your instance</label>
<label for="email" class="block mb-2 text-sm font-medium">{% trans "Your instance" %}</label>
<input type="text"
name="instance"
id="instance"
class="bg-gray-50 mb-4 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
placeholder="fosstodon.org"
placeholder="mastodon.social"
list="instances"
required />
{% instances_datalist %}
<p class="mb-4 text-sm font-medium text-gray-500 dark:text-gray-300">
<strong>Write</strong> permissions will be requested to be able to follow accounts on your behalf.
{% blocktrans trimmed %}
<strong>Write</strong> permissions will be requested to be able to follow accounts on your behalf.
{% endblocktrans %}
</p>
<button type="submit"
data-umami-event="authorize"
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
Authorize
{% trans "Authorize" %}
</button>
</div>
</form>
Expand Down
10 changes: 5 additions & 5 deletions accounts/templates/v2/accounts.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ <h5 class="mb-1 text-2xl font-semibold flex gap-2 [&>img]:max-w-8">{% render_emo
{% endif %}
<div class="grid grid-cols-4 gap-2 pt-4 mt-4 text-sm text-gray-500 border-t divide-x dark:text-gray-500 border-color-gray-700 dark:border-gray-700 divide-color-gray-700 dark:divide-gray-700">
<div class="flex flex-col gap-0 text-center" title="Last status">
<span class="text-xs">Last posted</span>
<span class="text-xs">{% trans "Last posted" %}</span>
<span class="font-semibold text-gray-700 truncate dark:text-gray-400 text-md">
{% if sort_order == '-accountlookup__last_status_at' %}▼{% endif %}
{{ account.last_status_at_cached }}</span>
</div>
<div class="flex flex-col gap-0 text-center" title="Statuses">
<span class="text-xs">Posts</span>
<span class="text-xs">{% trans "Posts" %}</span>
<span class="font-semibold text-gray-700 truncate dark:text-gray-400 text-md">
{% if sort_order == '-accountlookup__daily_statuses_count' %}
<span class="{% if account.accountlookup.daily_statuses_count > 0 %}text-green-600{% endif %}">▼ {{ account.accountlookup.daily_statuses_count | intcomma }}</span>
Expand All @@ -93,7 +93,7 @@ <h5 class="mb-1 text-2xl font-semibold flex gap-2 [&>img]:max-w-8">{% render_emo
</span>
</div>
<div class="flex flex-col gap-0 text-center" title="Followers">
<span class="text-xs">Followers</span>
<span class="text-xs">{% trans "Followers" %}</span>
<span class="font-semibold text-gray-700 truncate dark:text-gray-400 text-md">
{% if sort_order == '-accountlookup__daily_followers_count' %}
<span class="{% if account.accountlookup.daily_followers_count > 0 %}text-green-600{% endif %}">▼ {{ account.accountlookup.daily_followers_count | intcomma }}</span>
Expand All @@ -109,7 +109,7 @@ <h5 class="mb-1 text-2xl font-semibold flex gap-2 [&>img]:max-w-8">{% render_emo
</span>
</div>
<div class="flex flex-col gap-0 text-center" title="Following">
<span class="text-xs">Following</span>
<span class="text-xs">{% trans "Following" %}</span>
<span class="font-semibold text-gray-700 truncate dark:text-gray-400 text-md">
{% if sort_order == '-accountlookup__daily_following_count' %}
<span class="{% if account.accountlookup.daily_following_count > 0 %}text-green-600{% endif %}">▼ {{ account.accountlookup.daily_following_count | intcomma }}</span>
Expand All @@ -129,7 +129,7 @@ <h5 class="mb-1 text-2xl font-semibold flex gap-2 [&>img]:max-w-8">{% render_emo
</div>
{% empty %}
<div class="prose dark:prose-invert">
No accounts found. <a href="{% url 'index' %}">Reset the filters</a>.
{% trans "No accounts found." %} <a href="{% url 'index' %}">{% trans "Reset the filters" %}</a>.
</div>
{% endfor %}
</div>
Expand Down
Loading

0 comments on commit 982a9a3

Please sign in to comment.