2021-06-07 16:13:24 +00:00
{% load layout %}
{% load i18n %}
{% load static %}
2020-01-25 23:25:19 +00:00
<!DOCTYPE html>
2021-04-22 18:41:58 +00:00
< html lang = "{% get_lang %}" >
2020-01-25 23:25:19 +00:00
< head >
2021-02-27 19:07:16 +00:00
< title > {% block title %}BookWyrm{% endblock %} | {{ site.name }}< / title >
2020-01-25 23:25:19 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" >
2021-06-07 16:13:24 +00:00
< 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 / bookwyrm . css " % } " >
2020-01-25 23:25:19 +00:00
2021-06-07 16:13:24 +00:00
< link rel = "shortcut icon" type = "image/x-icon" href = "{% if site.favicon %}{% get_media_prefix %}{{ site.favicon }}{% else %}{% static " images / favicon . ico " % } { % endif % } " >
2020-01-25 23:25:19 +00:00
2021-06-18 17:15:36 +00:00
{% if preview_images_enabled is True %}
< meta name = "twitter:card" content = "summary_large_image" >
{% else %}
2020-01-25 23:25:19 +00:00
< meta name = "twitter:card" content = "summary" >
2021-06-18 17:15:36 +00:00
{% endif %}
2021-01-04 20:47:10 +00:00
< meta name = "twitter:title" content = "{% if title %}{{ title }} | {% endif %}{{ site.name }}" >
< meta name = "og:title" content = "{% if title %}{{ title }} | {% endif %}{{ site.name }}" >
2021-01-04 20:58:31 +00:00
< meta name = "twitter:description" content = "{{ site.instance_tagline }}" >
< meta name = "og:description" content = "{{ site.instance_tagline }}" >
2021-01-04 20:47:10 +00:00
2021-05-26 12:44:15 +00:00
{% block opengraph_images %}
2021-05-28 15:00:07 +00:00
{% include 'snippets/opengraph_images.html' %}
2021-05-26 12:44:15 +00:00
{% endblock %}
2021-01-04 20:47:10 +00:00
< meta name = "twitter:image:alt" content = "BookWyrm Logo" >
2020-01-25 23:25:19 +00:00
< / head >
< body >
2021-04-15 19:51:14 +00:00
< nav class = "navbar" aria-label = "main navigation" >
< div class = "container" >
< div class = "navbar-brand" >
< a class = "navbar-item" href = "/" >
2021-06-07 16:13:24 +00:00
< 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" >
2021-04-15 19:51:14 +00:00
< / a >
< form class = "navbar-item column" action = "/search/" >
< div class = "field has-addons" >
< div class = "control" >
< input aria-label = "{% trans 'Search for a book or user' %}" id = "search-input" class = "input" type = "text" name = "q" placeholder = "{% trans 'Search for a book or user' %}" value = "{{ query }}" >
< / 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 >
2020-11-21 05:19:26 +00:00
< / div >
2021-04-15 19:51:14 +00:00
< / form >
2020-09-28 21:47:53 +00:00
2021-04-15 19:51:14 +00:00
< div role = "button" tabindex = "0" class = "navbar-burger pulldown-menu" data-controls = "main-nav" aria-expanded = "false" >
< div class = "navbar-item mt-3" >
< div class = "icon icon-dots-three-vertical" title = "{% trans 'Main navigation menu' %}" >
< span class = "is-sr-only" > {% trans "Main navigation menu" %}< / span >
< / div >
2020-11-10 00:53:52 +00:00
< / div >
< / div >
2021-01-18 04:31:37 +00:00
< / div >
2020-09-28 21:47:53 +00:00
2021-04-15 19:51:14 +00:00
< div class = "navbar-menu" id = "main-nav" >
< div class = "navbar-start" >
{% if request.user.is_authenticated %}
< a href = "/#feed" class = "navbar-item" >
{% trans "Feed" %}
< / a >
< a href = "{% url 'lists' %}" class = "navbar-item" >
{% trans "Lists" %}
2020-09-30 18:56:02 +00:00
< / a >
2021-05-10 22:55:42 +00:00
< a href = "{% url 'directory' %}" class = "navbar-item" >
{% trans "Directory" %}
< / a >
2021-04-15 19:51:14 +00:00
{% endif %}
2020-03-15 21:15:36 +00:00
< / div >
2021-04-15 19:51:14 +00:00
< div class = "navbar-end" >
{% if request.user.is_authenticated %}
< div class = "navbar-item has-dropdown is-hoverable" >
< a
href="{{ request.user.local_path }}"
class="navbar-link pulldown-menu"
role="button"
aria-expanded="false"
tabindex="0"
aria-haspopup="true"
aria-controls="navbar-dropdown"
>
{% include 'snippets/avatar.html' with user=request.user %}
< span class = "ml-2" > {{ request.user.display_name }}< / span >
< / a >
< ul class = "navbar-dropdown" id = "navbar-dropdown" >
< li >
2021-05-10 22:55:42 +00:00
< a href = "{% url 'user-shelves' request.user.localname %}" class = "navbar-item" >
{% trans 'Your Books' %}
2021-04-15 19:51:14 +00:00
< / a >
< / li >
< li >
2021-05-10 22:55:42 +00:00
< a href = "{% url 'direct-messages' %}" class = "navbar-item" >
{% trans "Direct Messages" %}
2021-04-15 19:51:14 +00:00
< / a >
< / li >
< li >
2021-05-04 16:34:16 +00:00
< a href = "{% url 'prefs-profile' %}" class = "navbar-item" >
2021-04-15 19:51:14 +00:00
{% trans 'Settings' %}
< / a >
< / li >
{% if perms.bookwyrm.create_invites or perms.moderate_users %}
< li class = "navbar-divider" role = "presentation" > < / li >
{% endif %}
{% if perms.bookwyrm.create_invites %}
< li >
< a href = "{% url 'settings-invite-requests' %}" class = "navbar-item" >
{% trans 'Invites' %}
< / a >
< / li >
{% endif %}
{% if perms.bookwyrm.moderate_users %}
< li >
< a href = "{% url 'settings-users' %}" class = "navbar-item" >
{% trans 'Admin' %}
< / a >
< / li >
{% endif %}
< li class = "navbar-divider" role = "presentation" > < / li >
< li >
2021-05-04 16:34:16 +00:00
< a href = "{% url 'logout' %}" class = "navbar-item" >
2021-04-15 19:51:14 +00:00
{% trans 'Log out' %}
< / a >
< / li >
< / ul >
< / div >
< div class = "navbar-item" >
2021-05-04 16:34:16 +00:00
< a href = "{% url 'notifications' %}" class = "tags has-addons" >
2021-04-15 19:51:14 +00: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-23 01:34:34 +00:00
{% with request.user.unread_notification_count as notification_count %}
2021-04-30 14:49:34 +00:00
< span
2021-05-23 01:34:34 +00: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 14:49:34 +00:00
data-poll-wrapper
>
2021-05-23 01:34:34 +00:00
< span data-poll = "notifications" > {{ notification_count }}< / span >
2021-04-15 19:51:14 +00:00
< / span >
2021-05-23 01:34:34 +00:00
{% endwith %}
2021-04-15 19:51:14 +00:00
< / a >
< / div >
{% else %}
< div class = "navbar-item" >
{% if request.path != '/login' and request.path != '/login/' %}
< div class = "columns" >
< div class = "column" >
< form name = "login" method = "post" action = "/login" >
{% 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" >
< label class = "is-sr-only" for = "id_password" > {% trans "Username:" %}< / label >
< input type = "password" name = "password" maxlength = "128" class = "input" required = "" id = "id_password" placeholder = "{% trans 'password' %}" >
2021-05-04 16:34:16 +00:00
< p class = "help" > < a href = "{% url 'password-reset' %}" > {% trans "Forgot your password?" %}< / a > < / p >
2021-04-15 19:51:14 +00:00
< / div >
< div class = "column is-narrow" >
< button class = "button is-primary" type = "submit" > {% trans "Log in" %}< / button >
< / div >
2021-01-14 03:14:01 +00:00
< / div >
2021-04-15 19:51:14 +00: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 19:10:04 +00:00
< / div >
2021-01-03 23:41:20 +00:00
{% endif %}
2020-09-28 21:47:53 +00:00
< / div >
2021-01-03 23:41:20 +00:00
{% endif %}
2020-01-25 23:25:19 +00:00
< / div >
< / div >
2020-09-28 21:47:53 +00:00
< / div >
< / nav >
2021-05-20 22:11:47 +00:00
{% if request.user.is_authenticated and active_announcements.exists %}
2021-05-19 22:35:14 +00:00
< div class = "block is-flex-grow-1" >
< div class = "container" >
{% for announcement in active_announcements %}
2021-05-20 15:09:35 +00:00
{% include 'snippets/announcement.html' with announcement=announcement %}
2021-05-19 22:35:14 +00:00
{% endfor %}
< / div >
< / div >
{% endif %}
2020-01-25 23:25:19 +00:00
2021-04-15 19:51:14 +00:00
< div class = "section is-flex-grow-1" >
< div class = "container" >
2021-05-23 00:58:08 +00:00
{# almost every view needs to know the user shelves #}
{% with request.user.shelf_set.all as user_shelves %}
2021-04-15 19:51:14 +00:00
{% block content %}
{% endblock %}
2021-05-23 00:58:08 +00:00
{% endwith %}
2021-04-15 19:51:14 +00:00
< / div >
2020-01-25 23:25:19 +00:00
< / div >
2021-01-03 20:53:51 +00:00
< footer class = "footer" >
< div class = "container" >
< div class = "columns" >
2021-04-30 18:03:36 +00:00
< div class = "column is-one-fifth" >
2021-01-03 20:53:51 +00:00
< p >
2021-06-01 21:28:53 +00:00
< a href = "{% url 'about' %}" > {% trans "About this instance" %}< / a >
2021-01-03 20:53:51 +00:00
< / p >
{% if site.admin_email %}
< p >
2021-02-27 22:22:39 +00:00
< a href = "mailto:{{ site.admin_email }}" > {% trans "Contact site admin" %}< / a >
2021-01-03 20:53:51 +00:00
< / p >
{% endif %}
2021-04-30 18:03:36 +00:00
< p >
< a href = "https://docs.joinbookwyrm.com/" > {% trans "Documentation" %}< / a >
< / p >
< / div >
< div class = "column content is-two-fifth" >
{% if site.support_link %}
< p >
< 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 %}
< / p >
{% endif %}
< p >
2021-05-14 22:21:26 +00:00
{% 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 %}
2021-04-30 18:03:36 +00:00
< / p >
2021-01-03 20:53:51 +00:00
< / div >
2021-04-30 17:42:27 +00:00
{% if site.footer_item %}
< div class = "column" >
< p > {{ site.footer_item|safe }}< / p >
< / div >
{% endif %}
2020-12-11 20:07:37 +00:00
< / div >
< / div >
2021-01-03 20:53:51 +00:00
< / footer >
2020-12-11 20:07:37 +00:00
2020-03-15 21:15:36 +00:00
< script >
2020-03-16 01:12:45 +00:00
var csrf_token = '{{ csrf_token }}';
2020-03-15 21:15:36 +00:00
< / script >
2021-06-07 16:13:24 +00:00
< script src = "{% static " js / bookwyrm . js " % } " > < / script >
< script src = "{% static " js / localstorage . js " % } " > < / script >
2021-03-19 17:47:32 +00:00
{% block scripts %}{% endblock %}
2020-01-25 23:25:19 +00:00
< / body >
< / html >