@ -8,7 +8,7 @@
|
||||
<head>
|
||||
<title>{% block title %}BookWyrm{% endblock %} - {{ site.name }}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="{% sass_src 'css/bookwyrm.scss' %}" rel="stylesheet" type="text/css" />
|
||||
<link href="{% sass_src site_theme %}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="{% url 'opensearch' %}" title="{% blocktrans with site_name=site.name %}{{ site_name }} search{% endblocktrans %}" />
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
{% block profile-tabs %}
|
||||
<ul class="menu-list">
|
||||
<li><a href="#profile">{% trans "Profile" %}</a></li>
|
||||
<li><a href="#display-preferences">{% trans "Display preferences" %}</a></li>
|
||||
<li><a href="#display-preferences">{% trans "Display" %}</a></li>
|
||||
<li><a href="#privacy">{% trans "Privacy" %}</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
@ -61,7 +61,7 @@
|
||||
<hr aria-hidden="true">
|
||||
|
||||
<section class="block" id="display-preferences">
|
||||
<h2 class="title is-4">{% trans "Display preferences" %}</h2>
|
||||
<h2 class="title is-4">{% trans "Display" %}</h2>
|
||||
<div class="box">
|
||||
<div class="field">
|
||||
<label class="checkbox label" for="id_show_goal">
|
||||
@ -97,6 +97,12 @@
|
||||
{{ form.preferred_language }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="id_them">{% trans "Theme:" %}</label>
|
||||
<div class="select">
|
||||
{{ form.theme }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
@ -86,6 +86,10 @@
|
||||
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Site Settings" %}</a>
|
||||
{% block site-subtabs %}{% endblock %}
|
||||
</li>
|
||||
<li>
|
||||
{% url 'settings-themes' as url %}
|
||||
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Themes" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
@ -8,7 +8,7 @@
|
||||
{% block site-subtabs %}
|
||||
<ul class="menu-list">
|
||||
<li><a href="#instance-info">{% trans "Instance Info" %}</a></li>
|
||||
<li><a href="#images">{% trans "Images" %}</a></li>
|
||||
<li><a href="#display">{% trans "Display" %}</a></li>
|
||||
<li><a href="#footer">{% trans "Footer Content" %}</a></li>
|
||||
<li><a href="#registration">{% trans "Registration" %}</a></li>
|
||||
</ul>
|
||||
@ -33,7 +33,12 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form action="{% url 'settings-site' %}" method="POST" class="content" enctype="multipart/form-data">
|
||||
<form
|
||||
action="{% url 'settings-site' %}"
|
||||
method="POST"
|
||||
class="content"
|
||||
enctype="multipart/form-data"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<section class="block" id="instance_info">
|
||||
<h2 class="title is-4">{% trans "Instance Info" %}</h2>
|
||||
@ -68,20 +73,33 @@
|
||||
|
||||
<hr aria-hidden="true">
|
||||
|
||||
<section class="block" id="images">
|
||||
<h2 class="title is-4">{% trans "Images" %}</h2>
|
||||
<div class="box is-flex">
|
||||
<div>
|
||||
<label class="label" for="id_logo">{% trans "Logo:" %}</label>
|
||||
{{ site_form.logo }}
|
||||
<section class="block" id="display">
|
||||
<h2 class="title is-4">{% trans "Display" %}</h2>
|
||||
<div class="box">
|
||||
<h3 class="title is-5">{% trans "Images" %}</h3>
|
||||
<div class="block is-flex">
|
||||
<div>
|
||||
<label class="label" for="id_logo">{% trans "Logo:" %}</label>
|
||||
{{ site_form.logo }}
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="id_logo_small">{% trans "Logo small:" %}</label>
|
||||
{{ site_form.logo_small }}
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="id_favicon">{% trans "Favicon:" %}</label>
|
||||
{{ site_form.favicon }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="id_logo_small">{% trans "Logo small:" %}</label>
|
||||
{{ site_form.logo_small }}
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="id_favicon">{% trans "Favicon:" %}</label>
|
||||
{{ site_form.favicon }}
|
||||
|
||||
<h3 class="title is-5">{% trans "Themes" %}</h3>
|
||||
<div class="block">
|
||||
<label class="label" for="id_default_theme">
|
||||
{% trans "Default theme:" %}
|
||||
</label>
|
||||
<div class="select">
|
||||
{{ site_form.default_theme }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
140
bookwyrm/templates/settings/themes.html
Normal file
140
bookwyrm/templates/settings/themes.html
Normal file
@ -0,0 +1,140 @@
|
||||
{% extends 'settings/layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Themes" %}{% endblock %}
|
||||
|
||||
{% block header %}{% trans "Themes" %}{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<a class="subtitle help is-link" href="{% url 'settings-site' %}/#display">
|
||||
{% trans "Set instance default theme" %}
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
{% if success %}
|
||||
<div class="notification is-success is-light">
|
||||
<span class="icon icon-check" aria-hidden="true"></span>
|
||||
<span>
|
||||
{% trans "Successfully added theme" %}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<section class="block">
|
||||
<div class="notification content">
|
||||
<h2 class="title is-5">{% trans "How to add a theme" %}</h2>
|
||||
<ol>
|
||||
<li>
|
||||
{% trans "Copy the theme file into the <code>bookwyrm/static/css/themes</code> directory on your server from the command line." %}
|
||||
</li>
|
||||
<li>
|
||||
{% trans "Run <code>./bw-dev compilescss</code>." %}
|
||||
</li>
|
||||
<li>
|
||||
{% trans "Add the file name using the form below to make it available in the application interface." %}
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="block content">
|
||||
<h2 class="title is-4">{% trans "Add theme" %}</h2>
|
||||
|
||||
{% if theme_form.errors %}
|
||||
<div class="notification is-danger is-light">
|
||||
<span class="icon icon-x" aria-hidden="true"></span>
|
||||
<span>
|
||||
{% trans "Unable to save theme" %}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form
|
||||
method="POST"
|
||||
action="{% url 'settings-themes' %}"
|
||||
class="box"
|
||||
enctype="multipart/form-data"
|
||||
>
|
||||
{% if not choices %}
|
||||
<div class="notification is-warning">
|
||||
{% trans "No available theme files detected" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<fieldset {% if not choices %}disabled{% endif %}>
|
||||
{% csrf_token %}
|
||||
<div class="columns">
|
||||
<div class="column is-half">
|
||||
<label class="label" for="id_name">
|
||||
{% trans "Theme name" %}
|
||||
</label>
|
||||
<div class="control">
|
||||
{{ theme_form.name }}
|
||||
{% include 'snippets/form_errors.html' with errors_list=theme_form.name.errors id="desc_name" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="column">
|
||||
<label class="label" for="id_path">
|
||||
{% trans "Theme filename" %}
|
||||
</label>
|
||||
<div class="control">
|
||||
<div class="select">
|
||||
<select
|
||||
name="path"
|
||||
aria-describedby="desc_path"
|
||||
class=""
|
||||
id="id_path"
|
||||
>
|
||||
{% for choice in choices %}
|
||||
<option value="{{ choice }}">
|
||||
{{ choice }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% include 'snippets/form_errors.html' with errors_list=theme_form.path.errors id="desc_path" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="button">{% trans "Add theme" %}</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="block content">
|
||||
<h2 class="title is-4">{% trans "Available Themes" %}</h2>
|
||||
<div class="table-container">
|
||||
<table class="table is-striped">
|
||||
<tr>
|
||||
<th>
|
||||
{% trans "Theme name" %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans "File" %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans "Actions" %}
|
||||
</th>
|
||||
</tr>
|
||||
{% for theme in themes %}
|
||||
<tr>
|
||||
<td>{{ theme.name }}</td>
|
||||
<td><code>{{ theme.path }}</code></td>
|
||||
<td>
|
||||
<form method="POST" action="{% url 'settings-themes-delete' theme.id %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="button is-danger is-light is-small">
|
||||
<span class="icon icon-x" aria-hideen="true"></span>
|
||||
<span>{% trans "Remove theme" %}</span>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
@ -1,7 +1,7 @@
|
||||
{% load humanize %}{% load i18n %}{% load utilities %}
|
||||
{% with announcement.id|uuid as uuid %}
|
||||
<aside
|
||||
class="notification mb-1 p-3{% if not admin_mode %} is-hidden{% endif %} transition-y has-background-{{ announcement.display_type }}"
|
||||
class="notification mb-1 p-3{% if not admin_mode %} is-hidden{% endif %} transition-y {% if announcement.display_type %}has-background-{{ announcement.display_type }}{% endif %}"
|
||||
{% if not admin_mode %}data-hide="hide_announcement_{{ announcement.id }}"{% endif %}
|
||||
>
|
||||
<details>
|
||||
|
Reference in New Issue
Block a user