clean up ostatus templates

This commit is contained in:
Hugh Rundle 2021-11-29 19:37:56 +11:00
parent 3d73ea92e8
commit f5d9a204eb
No known key found for this signature in database
GPG key ID: CD23D6039184286B
4 changed files with 145 additions and 147 deletions

View file

@ -4,30 +4,28 @@
<div class="block"> <div class="block">
{% if not request.user.is_authenticated and not error == 'remote_subscribe' %} {% if not request.user.is_authenticated and not error == 'remote_subscribe' %}
<div class="navbar-item"> <div class="navbar-item">
<div class="columns">
<div class="columns"> <div class="column">
<div class="column"> <form name="login" method="post" action="{% url 'login' %}?next={{ request.path }}?acct={{ user.remote_id }}">
<form name="login" method="post" action="{% url 'login' %}?next={{ request.path }}?acct={{ user.remote_id }}"> {% csrf_token %}
{% csrf_token %} <div class="columns is-variable is-1">
<div class="columns is-variable is-1"> <div class="column">
<div class="column"> <label class="is-sr-only" for="id_localname">{% trans "Username:" %}</label>
<label class="is-sr-only" for="id_localname">{% trans "Username:" %}</label> <input type="text" name="localname" maxlength="150" class="input" required="" id="id_localname" placeholder="{% trans 'username' %}">
<input type="text" name="localname" maxlength="150" class="input" required="" id="id_localname" placeholder="{% trans 'username' %}"> </div>
</div> <div class="column">
<div class="column"> <label class="is-sr-only" for="id_password">{% trans "Password:" %}</label>
<label class="is-sr-only" for="id_password">{% trans "Password:" %}</label> <input type="password" name="password" maxlength="128" class="input" required="" id="id_password" placeholder="{% trans 'password' %}">
<input type="password" name="password" maxlength="128" class="input" required="" id="id_password" placeholder="{% trans 'password' %}"> <p class="help"><a href="{% url 'password-reset' %}">{% trans "Forgot your password?" %}</a></p>
<p class="help"><a href="{% url 'password-reset' %}">{% trans "Forgot your password?" %}</a></p> </div>
</div> <div class="column is-narrow">
<div class="column is-narrow"> <button class="button is-primary" type="submit">{% trans "Log in" %}</button>
<button class="button is-primary" type="submit">{% trans "Log in" %}</button> </div>
</div> </div>
</div> </form>
</form> </div>
</div> </div>
</div> </div>
</div>
{% elif error == 'ostatus_subscribe' %} {% elif error == 'ostatus_subscribe' %}
<div class="notification is-warning has-text-centered"> <div class="notification is-warning has-text-centered">
<p>{% blocktrans %}Something went wrong trying to follow <strong>{{ account }}</strong>{% endblocktrans %}</p> <p>{% blocktrans %}Something went wrong trying to follow <strong>{{ account }}</strong>{% endblocktrans %}</p>

View file

@ -4,41 +4,40 @@
{% block content %} {% block content %}
<div class="block card"> <div class="block card">
<header class="card-header"> <header class="card-header">
<h2 class="card-header-title">{% blocktrans %}Follow {{ user.display_name }} on the fediverse{% endblocktrans %}</h2> <h2 class="card-header-title">{% blocktrans %}Follow {{ user.display_name }} on the fediverse{% endblocktrans %}</h2>
</header> </header>
<div class="card-content"> <div class="card-content">
<div class="media"> <div class="media">
<a href="{{ user.local_path }}" class="media-left"> <a href="{{ user.local_path }}" class="media-left">
{% include 'snippets/avatar.html' with user=user large=True %} {% include 'snippets/avatar.html' with user=user large=True %}
</a> </a>
<div class="media-content"> <div class="media-content">
<a href="{{ user.local_path }}" class="is-block mb-2"> <a href="{{ user.local_path }}" class="is-block mb-2">
<span class="title is-4 is-block"> <span class="title is-4 is-block">
{{ user.display_name }} {{ user.display_name }}
{% if user.manually_approves_followers %} {% if user.manually_approves_followers %}
<span class="icon icon-lock is-size-7" title="{% trans 'Locked account' %}"> <span class="icon icon-lock is-size-7" title="{% trans 'Locked account' %}">
<span class="is-sr-only">{% trans "Locked account" %}</span> <span class="is-sr-only">{% trans "Locked account" %}</span>
</span> </span>
{% endif %} {% endif %}
</span> </span>
<span class="subtitle is-7 is-block">@{{ user|username }}</span> <span class="subtitle is-7 is-block">@{{ user|username }}</span>
</a> </a>
<p>{% blocktrans %}Follow {{ user.display_name }} from another Fediverse account like Bookwyrm, Mastodon, or Pleroma.{% endblocktrans %}</p> <p>{% blocktrans %}Follow {{ user.display_name }} from another Fediverse account like Bookwyrm, Mastodon, or Pleroma.{% endblocktrans %}</p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="card"> <div class="card">
<section class="card-content content"> <section class="card-content content">
<form name="remote-follow" method="post" action="{% url 'remote-follow' %}"> <form name="remote-follow" method="post" action="{% url 'remote-follow' %}">
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="user" value="{{ user.id }}"> <input type="hidden" name="user" value="{{ user.id }}">
<label class="label" for="remote_user">{% trans 'User handle to follow from:' %}</label> <label class="label" for="remote_user">{% trans 'User handle to follow from:' %}</label>
<input class="input" type="text" name="remote_user" id="remote_user" placeholder="user@example.social"> <input class="input" type="text" name="remote_user" id="remote_user" placeholder="user@example.social">
<button class="button mt-1 is-primary" type="submit">{% trans 'Follow!' %}</button> <button class="button mt-1 is-primary" type="submit">{% trans 'Follow!' %}</button>
</form> </form>
</section> </section>
</div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -4,29 +4,29 @@
{% block content %} {% block content %}
<div class="block card"> <div class="block card">
<div class="card-content"> <div class="card-content">
<div class="media"> <div class="media">
<a href="{{ user.local_path }}" class="media-left"> <a href="{{ user.local_path }}" class="media-left">
{% include 'snippets/avatar.html' with user=user large=True %} {% include 'snippets/avatar.html' with user=user large=True %}
</a> </a>
<div class="media-content"> <div class="media-content">
<a href="{{ user.local_path }}" class="is-block mb-2"> <a href="{{ user.local_path }}" class="is-block mb-2">
<span class="title is-4 is-block"> <span class="title is-4 is-block">
{{ user.display_name }} {{ user.display_name }}
{% if user.manually_approves_followers %} {% if user.manually_approves_followers %}
<span class="icon icon-lock is-size-7" title="{% trans 'Locked account' %}"> <span class="icon icon-lock is-size-7" title="{% trans 'Locked account' %}">
<span class="is-sr-only">{% trans "Locked account" %}</span> <span class="is-sr-only">{% trans "Locked account" %}</span>
</span> </span>
{% endif %} {% endif %}
</span> </span>
<span class="subtitle is-7 is-block">@{{ user|username }}</span> <span class="subtitle is-7 is-block">@{{ user|username }}</span>
</a> </a>
</div> </div>
</div> </div>
<p class="notification is-success"> <p class="notification is-success">
<span class="icon icon-check m-0-mobile" aria-hidden="true"></span> <span class="icon icon-check m-0-mobile" aria-hidden="true"></span>
<span>{% trans 'You are now following ' %}{{ user.display_name }}! </span> <span>{% trans 'You are now following ' %}{{ user.display_name }}! </span>
</p> </p>
</div> </div>
</div> </div>
<div class="block is-pulled-right"> <div class="block is-pulled-right">

View file

@ -7,45 +7,46 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{% get_lang %}"> <html lang="{% get_lang %}">
<head> <head>
<title>{% block title %}{% endblock %}{{ site.name }}</title> <title>{% block title %}{% endblock %}{{ site.name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{% static "css/vendor/bulma.min.css" %}"> <link rel="stylesheet" href="{% static "css/vendor/bulma.min.css" %}">
<link rel="stylesheet" href="{% static "css/vendor/icons.css" %}"> <link rel="stylesheet" href="{% static "css/vendor/icons.css" %}">
<link rel="stylesheet" href="{% static "css/bookwyrm.css" %}"> <link rel="stylesheet" href="{% static "css/bookwyrm.css" %}">
<link rel="search" type="application/opensearchdescription+xml" href="{% url 'opensearch' %}" title="{% blocktrans with site_name=site.name %}{{ site_name }} search{% endblocktrans %}" /> <link rel="search" type="application/opensearchdescription+xml" href="{% url 'opensearch' %}" title="{% blocktrans with site_name=site.name %}{{ site_name }} search{% endblocktrans %}" />
<link rel="shortcut icon" type="image/x-icon" href="{% if site.favicon %}{% get_media_prefix %}{{ site.favicon }}{% else %}{% static "images/favicon.ico" %}{% endif %}"> <link rel="shortcut icon" type="image/x-icon" href="{% if site.favicon %}{% get_media_prefix %}{{ site.favicon }}{% else %}{% static "images/favicon.ico" %}{% endif %}">
{% if preview_images_enabled is True %} {% if preview_images_enabled is True %}
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:card" content="summary_large_image">
{% else %} {% else %}
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
{% endif %} {% endif %}
<meta name="twitter:title" content="{% if title %}{{ title }} - {% endif %}{{ site.name }}"> <meta name="twitter:title" content="{% if title %}{{ title }} - {% endif %}{{ site.name }}">
<meta name="og:title" content="{% if title %}{{ title }} - {% endif %}{{ site.name }}"> <meta name="og:title" content="{% if title %}{{ title }} - {% endif %}{{ site.name }}">
<meta name="twitter:description" content="{{ site.instance_tagline }}"> <meta name="twitter:description" content="{{ site.instance_tagline }}">
<meta name="og:description" content="{{ site.instance_tagline }}"> <meta name="og:description" content="{{ site.instance_tagline }}">
{% block opengraph_images %} {% block opengraph_images %}
{% include 'snippets/opengraph_images.html' %} {% include 'snippets/opengraph_images.html' %}
{% endblock %} {% endblock %}
<meta name="twitter:image:alt" content="BookWyrm Logo"> <meta name="twitter:image:alt" content="BookWyrm Logo">
<script> <script>
function closeWindow() { function closeWindow() {
window.close(); window.close();
} }
</script> </script>
</head> </head>
<body> <body>
<nav class="navbar" aria-label="main navigation"> <nav class="navbar" aria-label="main navigation">
<div class="container"> <div class="container">
<div class="navbar-brand"> <div class="navbar-brand">
<a class="navbar-item" href="/"> <a class="navbar-item" href="/">
<img class="image logo" src="{% if site.logo_small %}{% get_media_prefix %}{{ site.logo_small }}{% else %}{% static "images/logo-small.png" %}{% endif %}" alt="Home page"> <img class="image logo" src="{% if site.logo_small %}{% get_media_prefix %}{{ site.logo_small }}{% else %}{% static "images/logo-small.png" %}{% endif %}" alt="Home page">
</a> </a>
<h2 class="navbar-item subtitle">{% block heading %}{% endblock %}</h2> <h2 class="navbar-item subtitle">{% block heading %}{% endblock %}</h2>
</div> </div>
</div>
</nav> </nav>
@ -57,43 +58,43 @@
<!-- TODO: pull footer into its own template: this is the same as generic template footer --> <!-- TODO: pull footer into its own template: this is the same as generic template footer -->
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<div class="columns"> <div class="columns">
<div class="column is-one-fifth"> <div class="column is-one-fifth">
<p> <p>
<a href="{% url 'about' %}">{% blocktrans with site_name=site.name %}About {{ site_name }}{% endblocktrans %}</a> <a href="{% url 'about' %}">{% blocktrans with site_name=site.name %}About {{ site_name }}{% endblocktrans %}</a>
</p> </p>
{% if site.admin_email %} {% if site.admin_email %}
<p> <p>
<a href="mailto:{{ site.admin_email }}">{% trans "Contact site admin" %}</a> <a href="mailto:{{ site.admin_email }}">{% trans "Contact site admin" %}</a>
</p> </p>
{% endif %} {% endif %}
<p> <p>
<a href="https://docs.joinbookwyrm.com/">{% trans "Documentation" %}</a> <a href="https://docs.joinbookwyrm.com/">{% trans "Documentation" %}</a>
</p> </p>
</div> </div>
<div class="column content is-two-fifth"> <div class="column content is-two-fifth">
{% if site.support_link %} {% if site.support_link %}
<p> <p>
<span class="icon icon-heart"></span> <span class="icon icon-heart"></span>
{% blocktrans with site_name=site.name support_link=site.support_link support_title=site.support_title %}Support {{ site_name }} on <a href="{{ support_link }}" target="_blank">{{ support_title }}</a>{% endblocktrans %} {% blocktrans with site_name=site.name support_link=site.support_link support_title=site.support_title %}Support {{ site_name }} on <a href="{{ support_link }}" target="_blank">{{ support_title }}</a>{% endblocktrans %}
</p> </p>
{% endif %} {% endif %}
<p> <p>
{% blocktrans %}BookWyrm's source code is freely available. You can contribute or report issues on <a href="https://github.com/mouse-reeve/bookwyrm">GitHub</a>.{% endblocktrans %} {% blocktrans %}BookWyrm's source code is freely available. You can contribute or report issues on <a href="https://github.com/mouse-reeve/bookwyrm">GitHub</a>.{% endblocktrans %}
</p> </p>
</div> </div>
{% if site.footer_item %} {% if site.footer_item %}
<div class="column"> <div class="column">
<p>{{ site.footer_item|safe }}</p> <p>{{ site.footer_item|safe }}</p>
</div> </div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</footer> </footer>
<script> <script>
var csrf_token = '{{ csrf_token }}'; var csrf_token = '{{ csrf_token }}';
</script> </script>
<script src="{% static "js/bookwyrm.js" %}?v={{ js_cache }}"></script> <script src="{% static "js/bookwyrm.js" %}?v={{ js_cache }}"></script>