moviewyrm/bookwyrm/templates/layout.html

219 lines
9.9 KiB
HTML
Raw Normal View History

2020-12-13 02:25:04 +00:00
{% load bookwyrm_tags %}
2021-02-27 23:00:19 +00:00
{% load i18n %}
2020-01-25 23:25:19 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<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">
2020-09-29 01:30:12 +00:00
<link type="text/css" rel="stylesheet" href="/static/css/bulma.min.css">
2020-09-28 21:47:53 +00:00
<link type="text/css" rel="stylesheet" href="/static/css/format.css">
<link type="text/css" rel="stylesheet" href="/static/css/icons.css">
2020-01-25 23:25:19 +00:00
2021-01-04 20:47:10 +00:00
<link rel="shortcut icon" type="image/x-icon" href="{% if site.favicon %}/images/{{ site.favicon }}{% else %}/static/images/favicon.ico{% endif %}">
2020-01-25 23:25:19 +00:00
<meta name="twitter:card" content="summary">
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 }}">
<meta name="twitter:description" content="{{ site.instance_tagline }}">
<meta name="og:description" content="{{ site.instance_tagline }}">
2021-01-04 20:47:10 +00:00
<meta name="twitter:image" content="{% if site.logo %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}">
<meta name="og:image" content="{% if site.logo %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}">
<meta name="twitter:image:alt" content="BookWyrm Logo">
2020-01-25 23:25:19 +00:00
</head>
<body>
<nav class="navbar container" aria-label="main navigation">
2020-09-28 21:47:53 +00:00
<div class="navbar-brand">
<a class="navbar-item" href="/">
2021-01-04 20:47:10 +00:00
<img class="image logo" src="{% if site.logo_small %}/images/{{ site.logo_small }}{% else %}/static/images/logo-small.png{% endif %}" alt="Home page">
2020-09-28 21:47:53 +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">
2021-02-28 02:48:10 +00:00
<span class="icon icon-search" title="{% trans 'Search' %}">
2021-02-28 16:42:25 +00:00
<span class="is-sr-only">{% trans "Search" %}</span>
</span>
</button>
</div>
</div>
</form>
2020-09-28 21:47:53 +00:00
2021-01-18 04:40:33 +00:00
<div role="button" tabindex="0" class="navbar-burger pulldown-menu" data-controls="main-nav" aria-expanded="false">
2020-11-10 00:53:52 +00:00
<div class="navbar-item mt-3">
2021-02-28 02:48:10 +00:00
<div class="icon icon-dots-three-vertical" title="{% trans 'Main navigation menu' %}">
<span class="is-sr-only">{% trans "Main navigation menu" %}</span>
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
</div>
2021-01-18 04:31:37 +00:00
<div class="navbar-menu" id="main-nav">
2020-09-28 21:47:53 +00:00
<div class="navbar-start">
2020-09-29 17:21:10 +00:00
{% if request.user.is_authenticated %}
2021-01-31 05:33:41 +00:00
<a href="{% url 'user-shelves' request.user.localname %}" class="navbar-item">
2021-02-28 00:18:24 +00:00
{% trans "Your shelves" %}
2020-09-28 21:47:53 +00:00
</a>
2020-10-28 20:17:02 +00:00
<a href="/#feed" class="navbar-item">
2021-02-28 00:18:24 +00:00
{% trans "Feed" %}
2020-04-02 02:38:07 +00:00
</a>
2021-01-31 05:33:41 +00:00
<a href="{% url 'lists' %}" class="navbar-item">
2021-02-28 00:18:24 +00:00
{% trans "Lists" %}
2021-01-31 05:33:41 +00:00
</a>
2021-01-31 19:11:26 +00:00
{% endif %}
2020-04-02 02:38:07 +00:00
</div>
2020-03-15 21:15:36 +00:00
2020-09-28 21:47:53 +00:00
<div class="navbar-end">
{% if request.user.is_authenticated %}
2020-09-28 21:47:53 +00:00
<div class="navbar-item has-dropdown is-hoverable">
<a
href="{{ user.local_path }}"
class="navbar-link pulldown-menu"
role="button"
aria-expanded="false"
tabindex="0"
aria-haspopup="true"
aria-controls="navbar-dropdown"
>
2020-10-13 23:20:04 +00:00
{% 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>
<a href="/direct-messages" class="navbar-item">
{% trans "Direct Messages" %}
</a>
</li>
<li>
<a href="/user/{{request.user.localname}}" class="navbar-item">
{% trans 'Profile' %}
</a>
</li>
<li>
2021-01-29 17:28:00 +00:00
<a href="/preferences/profile" class="navbar-item">
{% trans 'Settings' %}
</a>
</li>
<li>
<a href="/import" class="navbar-item">
{% trans 'Import Books' %}
</a>
</li>
2021-01-29 23:50:46 +00:00
{% if perms.bookwyrm.create_invites or perms.bookwyrm.edit_instance_settings%}
<li class="navbar-divider" role="presentation"></li>
2021-01-29 23:50:46 +00:00
{% endif %}
2020-10-01 20:09:37 +00:00
{% if perms.bookwyrm.create_invites %}
<li>
2021-01-29 23:38:42 +00:00
<a href="{% url 'settings-invites' %}" class="navbar-item">
{% trans 'Invites' %}
</a>
</li>
2021-01-29 23:50:46 +00:00
{% endif %}
{% if perms.bookwyrm.edit_instance_settings %}
<li>
2021-03-08 23:49:44 +00:00
<a href="{% url 'settings-reports' %}" class="navbar-item">
{% trans 'Admin' %}
2021-01-29 23:50:46 +00:00
</a>
</li>
2020-10-01 20:09:37 +00:00
{% endif %}
<li class="navbar-divider" role="presentation"></li>
<li>
<a href="/logout" class="navbar-item">
{% trans 'Log out' %}
</a>
</li>
</ul>
2020-09-28 21:47:53 +00:00
</div>
<div class="navbar-item">
2021-01-19 00:52:51 +00:00
<a href="/notifications" class="tags has-addons">
<span class="tag is-medium">
2021-02-28 02:48:10 +00:00
<span class="icon icon-bell" title="{% trans 'Notifications' %}">
<span class="is-sr-only">{% trans "Notifications" %}</span>
2020-09-30 18:56:02 +00:00
</span>
2021-01-19 00:52:51 +00:00
</span>
<span class="{% if not request.user|notification_count %}hidden {% endif %}tag is-danger is-medium" data-poll="notifications">
{{ request.user | notification_count }}
</span>
2020-09-30 18:56:02 +00:00
</a>
2020-03-15 21:15:36 +00:00
</div>
{% else %}
2020-09-28 21:47:53 +00:00
<div class="navbar-item">
2021-01-12 16:19:08 +00:00
{% if request.path != '/login' and request.path != '/login/' %}
2021-01-03 19:10:04 +00:00
<div class="columns">
<div class="column">
2021-01-12 16:19:08 +00:00
<form name="login" method="post" action="/login">
2021-01-03 22:35:28 +00: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' %}">
2021-01-03 19:10:04 +00:00
</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' %}">
<p class="help"><a href="/password-reset">{% trans "Forgot your password?" %}</a></p>
2021-01-03 19:10:04 +00:00
</div>
<div class="column is-narrow">
<button class="button is-primary" type="submit">{% trans "Log in" %}</button>
</div>
2021-01-03 19:10:04 +00:00
</div>
</form>
</div>
{% if site.allow_registration and request.path != '' and request.path != '/' %}
2021-01-03 19:10:04 +00:00
<div class="column is-narrow">
<a href="/" class="button is-link">
{% trans "Join" %}
2021-01-03 19:10:04 +00:00
</a>
</div>
{% endif %}
2020-09-28 21:47:53 +00:00
</div>
{% endif %}
2020-01-25 23:25:19 +00:00
</div>
{% endif %}
2020-01-25 23:25:19 +00:00
</div>
2020-09-28 21:47:53 +00:00
</div>
</nav>
2020-01-25 23:25:19 +00:00
2021-01-03 20:53:51 +00:00
<div class="section container">
2020-01-29 01:23:38 +00:00
{% block content %}
{% endblock %}
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">
<div class="column">
<p>
<a href="/about">{% trans "About this server" %}</a>
2021-01-03 20:53:51 +00:00
</p>
{% if site.admin_email %}
<p>
<a href="mailto:{{ site.admin_email }}">{% trans "Contact site admin" %}</a>
2021-01-03 20:53:51 +00:00
</p>
{% endif %}
</div>
{% if site.support_link %}
<div class="column">
<span class="icon icon-heart"></span>
2021-03-07 23:42:49 +00:00
{% 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 %}
2021-01-03 20:53:51 +00:00
</div>
2020-12-11 20:31:02 +00:00
{% endif %}
2021-01-03 20:53:51 +00:00
<div class="column">
{% trans 'BookWyrm is open source software. You can contribute or report issues on <a href="https://github.com/mouse-reeve/bookwyrm">GitHub</a>.' %}
2021-01-03 20:53:51 +00:00
</div>
</div>
</div>
2021-01-03 20:53:51 +00:00
</footer>
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>
<script src="/static/js/shared.js"></script>
{% block scripts %}{% endblock %}
2020-01-25 23:25:19 +00:00
</body>
</html>