2021-06-07 18:13:24 +02:00
|
|
|
{% load layout %}
|
2022-03-04 12:40:06 -08:00
|
|
|
{% load sass_tags %}
|
2021-06-07 18:13:24 +02:00
|
|
|
{% load i18n %}
|
|
|
|
{% load static %}
|
2022-02-19 15:29:47 -08:00
|
|
|
|
2020-01-25 15:25:19 -08:00
|
|
|
<!DOCTYPE html>
|
2021-04-22 20:41:58 +02:00
|
|
|
<html lang="{% get_lang %}">
|
2020-01-25 15:25:19 -08:00
|
|
|
<head>
|
2021-09-18 17:09:18 -07:00
|
|
|
<title>{% block title %}BookWyrm{% endblock %} - {{ site.name }}</title>
|
2020-01-25 15:25:19 -08:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2022-03-04 12:40:06 -08:00
|
|
|
<link href="{% sass_src site_theme %}" rel="stylesheet" type="text/css" />
|
2020-01-25 15:25:19 -08:00
|
|
|
|
2021-09-10 16:47:59 -07:00
|
|
|
<link rel="search" type="application/opensearchdescription+xml" href="{% url 'opensearch' %}" title="{% blocktrans with site_name=site.name %}{{ site_name }} search{% endblocktrans %}" />
|
|
|
|
|
2021-06-07 18:13:24 +02:00
|
|
|
<link rel="shortcut icon" type="image/x-icon" href="{% if site.favicon %}{% get_media_prefix %}{{ site.favicon }}{% else %}{% static "images/favicon.ico" %}{% endif %}">
|
2022-12-10 17:57:05 +01:00
|
|
|
<link rel="apple-touch-icon" href="{% if site.logo %}{{ media_full_url }}{{ site.logo }}{% else %}{% static "images/logo.png" %}{% endif %}">
|
2020-01-25 15:25:19 -08:00
|
|
|
|
2023-01-11 16:17:41 -05:00
|
|
|
{% block opengraph %}
|
|
|
|
{% include 'snippets/opengraph.html' %}
|
2021-05-26 14:44:15 +02:00
|
|
|
{% endblock %}
|
2021-12-20 23:38:18 +01:00
|
|
|
|
|
|
|
{% block head_links %}{% endblock %}
|
2020-01-25 15:25:19 -08:00
|
|
|
</head>
|
|
|
|
<body>
|
2022-02-17 10:02:27 -08:00
|
|
|
{% block body %}
|
2021-04-15 21:51:14 +02:00
|
|
|
<nav class="navbar" aria-label="main navigation">
|
|
|
|
<div class="container">
|
|
|
|
<div class="navbar-brand">
|
|
|
|
<a class="navbar-item" href="/">
|
2021-12-04 16:17:51 +01:00
|
|
|
<img class="image logo" src="{% if site.logo_small %}{% get_media_prefix %}{{ site.logo_small }}{% else %}{% static "images/logo-small.png" %}{% endif %}" alt="{% blocktrans with site_name=site.name %}{{ site_name }} home page{% endblocktrans %}">
|
2021-04-15 21:51:14 +02:00
|
|
|
</a>
|
2021-12-17 17:30:14 +01:00
|
|
|
<form class="navbar-item column is-align-items-start pt-5" action="{% url 'search' %}">
|
2021-04-15 21:51:14 +02:00
|
|
|
<div class="field has-addons">
|
|
|
|
<div class="control">
|
2021-09-20 12:28:08 -07:00
|
|
|
{% if user.is_authenticated %}
|
|
|
|
{% trans "Search for a book, user, or list" as search_placeholder %}
|
|
|
|
{% else %}
|
|
|
|
{% trans "Search for a book" as search_placeholder %}
|
|
|
|
{% endif %}
|
2022-07-03 15:57:10 +10:00
|
|
|
<input aria-label="{{ search_placeholder }}" id="tour-search" class="input" type="text" name="q" placeholder="{{ search_placeholder }}" value="{{ query }}">
|
2021-04-15 21:51:14 +02:00
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<button class="button" type="submit">
|
|
|
|
<span class="icon icon-search" title="{% trans 'Search' %}">
|
|
|
|
<span class="is-sr-only">{% trans "Search" %}</span>
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2022-02-26 23:28:13 -08:00
|
|
|
<div class="control">
|
2022-02-15 02:38:57 -08:00
|
|
|
<button class="button" type="button" data-modal-open="barcode-scanner-modal">
|
2022-07-03 15:57:10 +10:00
|
|
|
<span class="icon icon-barcode" title="{% trans 'Scan Barcode' %}" id="tour-barcode">
|
2022-02-14 02:56:05 -08:00
|
|
|
<span class="is-sr-only">{% trans "Scan Barcode" %}</span>
|
|
|
|
</span>
|
|
|
|
</button>
|
2021-04-15 21:51:14 +02:00
|
|
|
</div>
|
2020-11-20 21:19:26 -08:00
|
|
|
</div>
|
2021-04-15 21:51:14 +02:00
|
|
|
</form>
|
2022-02-15 02:38:57 -08:00
|
|
|
{% include "search/barcode_modal.html" with id="barcode-scanner-modal" %}
|
2020-09-28 14:47:53 -07:00
|
|
|
|
2022-08-05 11:15:11 +02:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
tabindex="0"
|
|
|
|
class="navbar-burger pulldown-menu my-4 is-flex-touch is-align-items-center is-justify-content-center"
|
|
|
|
data-controls="main_nav"
|
|
|
|
aria-expanded="false"
|
|
|
|
aria-label="{% trans 'Main navigation menu' %}"
|
|
|
|
>
|
|
|
|
<i class="icon-dots-three-vertical" aria-hidden="true"></i>
|
|
|
|
|
|
|
|
{% with request.user.unread_notification_count as notification_count %}
|
|
|
|
<strong
|
|
|
|
class="{% if not notification_count %}is-hidden {% elif request.user.has_unread_mentions %}is-danger {% else %}is-primary {% endif %} tag is-small px-1"
|
|
|
|
data-poll-wrapper
|
|
|
|
>
|
|
|
|
<span class="is-sr-only">{% trans "Notifications" %}</span>
|
|
|
|
<strong data-poll="notifications" class="has-text-white">
|
|
|
|
{{ notification_count }}
|
|
|
|
</strong>
|
|
|
|
</strong>
|
|
|
|
{% endwith %}
|
2021-12-17 17:30:14 +01:00
|
|
|
</button>
|
2021-01-17 20:31:37 -08:00
|
|
|
</div>
|
2020-09-28 14:47:53 -07:00
|
|
|
|
2021-08-08 18:40:47 -07:00
|
|
|
<div class="navbar-menu" id="main_nav">
|
2022-07-03 15:57:10 +10:00
|
|
|
<div class="navbar-start" id="tour-navbar-start">
|
2021-04-15 21:51:14 +02:00
|
|
|
{% if request.user.is_authenticated %}
|
2021-12-17 17:30:14 +01:00
|
|
|
<a href="/#feed" class="navbar-item mt-3 py-0">
|
2021-04-15 21:51:14 +02:00
|
|
|
{% trans "Feed" %}
|
|
|
|
</a>
|
2021-12-17 17:30:14 +01:00
|
|
|
<a href="{% url 'lists' %}" class="navbar-item mt-3 py-0">
|
2021-04-15 21:51:14 +02:00
|
|
|
{% trans "Lists" %}
|
2020-09-30 11:56:02 -07:00
|
|
|
</a>
|
2021-12-17 17:30:14 +01:00
|
|
|
<a href="{% url 'discover' %}" class="navbar-item mt-3 py-0">
|
2021-08-08 08:07:20 -07:00
|
|
|
{% trans "Discover" %}
|
2021-05-10 15:55:42 -07:00
|
|
|
</a>
|
2021-04-15 21:51:14 +02:00
|
|
|
{% endif %}
|
2020-03-15 14:15:36 -07:00
|
|
|
</div>
|
2021-04-15 21:51:14 +02:00
|
|
|
|
|
|
|
<div class="navbar-end">
|
|
|
|
{% if request.user.is_authenticated %}
|
2022-04-08 13:11:41 -07:00
|
|
|
<div class="navbar-item mt-3 py-0">
|
|
|
|
{% include 'user_menu.html' %}
|
2021-04-15 21:51:14 +02:00
|
|
|
</div>
|
2021-12-17 17:30:14 +01:00
|
|
|
<div class="navbar-item mt-3 py-0">
|
2022-07-03 15:57:10 +10:00
|
|
|
<a href="{% url 'notifications' %}" class="tags has-addons" id="tour-notifications">
|
2021-04-15 21:51:14 +02:00
|
|
|
<span class="tag is-medium">
|
|
|
|
<span class="icon icon-bell" title="{% trans 'Notifications' %}">
|
|
|
|
<span class="is-sr-only">{% trans "Notifications" %}</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
2021-05-22 18:34:34 -07:00
|
|
|
{% with request.user.unread_notification_count as notification_count %}
|
2021-04-30 07:49:34 -07:00
|
|
|
<span
|
2021-05-22 18:34:34 -07:00
|
|
|
class="{% if not notification_count %}is-hidden {% elif request.user.has_unread_mentions %}is-danger {% endif %}tag is-medium transition-x"
|
2021-04-30 07:49:34 -07:00
|
|
|
data-poll-wrapper
|
|
|
|
>
|
2021-05-22 18:34:34 -07:00
|
|
|
<span data-poll="notifications">{{ notification_count }}</span>
|
2021-04-15 21:51:14 +02:00
|
|
|
</span>
|
2021-05-22 18:34:34 -07:00
|
|
|
{% endwith %}
|
2021-04-15 21:51:14 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
2021-12-17 17:30:14 +01:00
|
|
|
<div class="navbar-item pt-5 pb-0">
|
2021-04-15 21:51:14 +02:00
|
|
|
{% if request.path != '/login' and request.path != '/login/' %}
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column">
|
2021-08-02 16:24:36 -07:00
|
|
|
<form name="login" method="post" action="{% url 'login' %}?next={{ request.path }}">
|
2021-04-15 21:51:14 +02:00
|
|
|
{% csrf_token %}
|
|
|
|
<div class="columns is-variable is-1">
|
|
|
|
<div class="column">
|
|
|
|
<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' %}">
|
|
|
|
</div>
|
|
|
|
<div class="column">
|
2021-10-16 10:20:06 -07:00
|
|
|
<label class="is-sr-only" for="id_password">{% trans "Password:" %}</label>
|
2021-04-15 21:51:14 +02:00
|
|
|
<input type="password" name="password" maxlength="128" class="input" required="" id="id_password" placeholder="{% trans 'password' %}">
|
2021-05-04 09:34:16 -07:00
|
|
|
<p class="help"><a href="{% url 'password-reset' %}">{% trans "Forgot your password?" %}</a></p>
|
2021-04-15 21:51:14 +02:00
|
|
|
</div>
|
|
|
|
<div class="column is-narrow">
|
|
|
|
<button class="button is-primary" type="submit">{% trans "Log in" %}</button>
|
|
|
|
</div>
|
2021-01-13 19:14:01 -08:00
|
|
|
</div>
|
2021-04-15 21:51:14 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% if site.allow_registration and request.path != '' and request.path != '/' %}
|
|
|
|
<div class="column is-narrow">
|
|
|
|
<a href="/" class="button is-link">
|
|
|
|
{% trans "Join" %}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-01-03 11:10:04 -08:00
|
|
|
</div>
|
2021-01-03 15:41:20 -08:00
|
|
|
{% endif %}
|
2020-09-28 14:47:53 -07:00
|
|
|
</div>
|
2021-01-03 15:41:20 -08:00
|
|
|
{% endif %}
|
2020-01-25 15:25:19 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-09-28 14:47:53 -07:00
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
|
2021-05-20 15:11:47 -07:00
|
|
|
{% if request.user.is_authenticated and active_announcements.exists %}
|
2022-10-20 07:45:53 -07:00
|
|
|
<div class="is-flex-grow-1">
|
2021-05-19 15:35:14 -07:00
|
|
|
<div class="container">
|
|
|
|
{% for announcement in active_announcements %}
|
2021-05-20 08:09:35 -07:00
|
|
|
{% include 'snippets/announcement.html' with announcement=announcement %}
|
2021-05-19 15:35:14 -07:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2020-01-25 15:25:19 -08:00
|
|
|
|
2022-02-12 16:10:40 +01:00
|
|
|
<main class="section is-flex-grow-1">
|
2021-04-15 21:51:14 +02:00
|
|
|
<div class="container">
|
2022-02-17 17:10:12 -08:00
|
|
|
{# almost every view needs to know the user shelves #}
|
|
|
|
{% with request.user.shelf_set.all as user_shelves %}
|
2021-04-15 21:51:14 +02:00
|
|
|
{% block content %}
|
|
|
|
{% endblock %}
|
2022-02-17 17:10:12 -08:00
|
|
|
{% endwith %}
|
2021-04-15 21:51:14 +02:00
|
|
|
</div>
|
2022-02-12 16:10:40 +01:00
|
|
|
</main>
|
2020-01-25 15:25:19 -08:00
|
|
|
|
2021-09-10 10:12:37 -07:00
|
|
|
<div role="region" aria-live="polite" id="live-messages">
|
|
|
|
<p id="status-success-message" class="live-message is-sr-only is-hidden">{% trans "Successfully posted status" %}</p>
|
|
|
|
<p id="status-error-message" class="live-message notification is-danger p-3 pr-5 pl-5 is-hidden">{% trans "Error posting status" %}</p>
|
|
|
|
</div>
|
|
|
|
|
2022-11-14 18:18:27 -08:00
|
|
|
{% include 'snippets/footer.html' %}
|
2022-02-17 13:01:36 -08:00
|
|
|
{% endblock %}
|
2020-12-11 12:07:37 -08:00
|
|
|
|
2020-03-15 14:15:36 -07:00
|
|
|
<script>
|
2020-03-15 18:12:45 -07:00
|
|
|
var csrf_token = '{{ csrf_token }}';
|
2020-03-15 14:15:36 -07:00
|
|
|
</script>
|
2021-09-09 07:39:38 -07:00
|
|
|
|
2021-09-10 10:57:16 -07:00
|
|
|
<script src="{% static "js/bookwyrm.js" %}?v={{ js_cache }}"></script>
|
|
|
|
<script src="{% static "js/localstorage.js" %}?v={{ js_cache }}"></script>
|
|
|
|
<script src="{% static "js/status_cache.js" %}?v={{ js_cache }}"></script>
|
2022-02-28 21:22:49 -08:00
|
|
|
<script src="{% static "js/vendor/quagga.min.js" %}?v={{ js_cache }}"></script>
|
2022-06-12 19:41:50 +10:00
|
|
|
<script src="{% static "js/vendor/shepherd.min.js" %}?v={{ js_cache }}"></script>
|
2022-06-18 13:27:00 +10:00
|
|
|
<script src="{% static "js/guided_tour.js" %}?v={{ js_cache }}"></script>
|
2021-09-09 07:39:38 -07:00
|
|
|
|
2021-03-19 10:47:32 -07:00
|
|
|
{% block scripts %}{% endblock %}
|
2021-09-09 07:39:38 -07:00
|
|
|
|
2020-01-25 15:25:19 -08:00
|
|
|
</body>
|
|
|
|
</html>
|