Adds separate privacy policy section

This commit is contained in:
Mouse Reeve 2021-02-27 11:53:36 -08:00
parent 0ecfff0f16
commit 7622bef35d
7 changed files with 120 additions and 57 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 3.0.7 on 2021-02-27 19:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bookwyrm', '0045_auto_20210210_2114'),
]
operations = [
migrations.AddField(
model_name='sitesettings',
name='privacy_policy',
field=models.TextField(default='Add a privacy policy here.'),
),
]

View file

@ -20,6 +20,8 @@ class SiteSettings(models.Model):
default='Contact an administrator to get an invite')
code_of_conduct = models.TextField(
default='Add a code of conduct here.')
privacy_policy = models.TextField(
default='Add a privacy policy here.')
allow_registration = models.BooleanField(default=True)
logo = models.ImageField(
upload_to='logos/', null=True, blank=True

View file

@ -1,21 +1,35 @@
{% extends 'layout.html' %}
{% block content %}
{% extends 'discover/landing_layout.html' %}
{% block panel %}
<header class="block has-text-centered">
<h1 class="title">{{ site.name }}</h1>
<h2 class="subtitle">{{ site.instance_tagline }}</h2>
</header>
<div class="block columns mt-4">
<nav class="menu column is-one-quarter">
<h2 class="menu-label">About {{ site.name }}</h2>
<ul class="menu-list">
<li>
<a href="#coc">Code of Conduct</a>
</li>
<li>
<a href="#privacy">Privacy Policy</a>
</li>
</ul>
</nav>
{% include 'discover/icons.html' %}
<div class="column content">
<div class="block" id="coc">
<h2 class="title">Code of Conduct</h2>
<div class="content">
{{ site.code_of_conduct | safe }}
</div>
</div>
<section class="block">
{% include 'snippets/about.html' %}
</section>
<hr aria-hidden="true">
<div class="block">
<h2 class="title">Code of Conduct</h2>
<div class="content">
{{ site.code_of_conduct | safe }}
<div class="block" id="privacy">
<h2 class="title">Privacy Policy</h2>
<div class="content">
{{ site.privacy_policy | safe }}
</div>
</div>
</div>
</div>

View file

@ -1,36 +1,5 @@
{% extends 'layout.html' %}
{% block content %}
<header class="block has-text-centered">
<h1 class="title">{{ site.name }}</h1>
<h2 class="subtitle">{{ site.instance_tagline }}</h2>
</header>
{% include 'discover/icons.html' %}
{% if not request.user.is_authenticated %}
<section class="tile is-ancestor">
<div class="tile is-7 is-parent">
<div class="tile is-child box">
{% include 'snippets/about.html' %}
</div>
</div>
<div class="tile is-5 is-parent">
<div class="tile is-child box has-background-primary-light content">
{% if site.allow_registration %}
<h2 class="title">Join {{ site.name }}</h2>
<form name="register" method="post" action="/register">
{% include 'snippets/register_form.html' %}
</form>
{% else %}
<h2 class="title">This instance is closed</h2>
<p>{{ site.registration_closed_text | safe}}</p>
{% endif %}
</div>
</div>
</section>
{% endif %}
{% extends 'discover/landing_layout.html' %}
{% block panel %}
<div class="block is-hidden-tablet">
<h2 class="title has-text-centered">Recent Books</h2>

View file

@ -0,0 +1,63 @@
{% extends 'layout.html' %}
{% load humanize %}
{% load bookwyrm_tags %}
{% block content %}
<header class="block has-text-centered">
<h1 class="title">{{ site.name }}</h1>
<h2 class="subtitle">{{ site.instance_tagline }}</h2>
</header>
{% include 'discover/icons.html' %}
<section class="tile is-ancestor">
<div class="tile is-7 is-parent">
<div class="tile is-child box">
{% include 'snippets/about.html' %}
</div>
</div>
<div class="tile is-5 is-parent">
{% if not request.user.is_authenticated %}
<div class="tile is-child box has-background-primary-light content">
{% if site.allow_registration %}
<h2 class="title">Join {{ site.name }}</h2>
<form name="register" method="post" action="/register">
{% include 'snippets/register_form.html' %}
</form>
{% else %}
<h2 class="title">This instance is closed</h2>
<p>{{ site.registration_closed_text | safe}}</p>
{% endif %}
</div>
{% else %}
<div class="tile is-child box has-background-white-bis">
<h2 class="title is-4">Your Account</h2>
<div class="media block">
<div class="media-left">
<a href="{{ user.local_path }}">
{% include 'snippets/avatar.html' with user=user large=True %}
</a>
</div>
<div class="media-content">
<p>{% if user.name %}{{ user.name }}{% else %}{{ user.localname }}{% endif %}</p>
<p><a href="{{ user.remote_id }}">{{ user.username }}</a></p>
<p>Joined {{ user.created_date | naturaltime }}</p>
<p>
<a href="{{ user.local_path }}/followers">{{ user.followers.count }} follower{{ user.followers.count | pluralize }}</a>,
<a href="{{ user.local_path }}/following">{{ user.following.count }} following</a>
</p>
</div>
</div>
<div class="box content">
{% if user.summary %}
{{ user.summary | to_markdown | safe }}
{% endif %}
</div>
</div>
{% endif %}
</div>
</section>
{% block panel %}{% endblock %}
{% endblock %}

View file

@ -23,6 +23,10 @@
<label class="label" for="id_code_of_conduct">Code of conduct:</label>
{{ site_form.code_of_conduct }}
</div>
<div class="control">
<label class="label" for="id_privacy_policy">Privacy Policy:</label>
{{ site_form.privacy_policy }}
</div>
</section>
<hr aria-hidden="true">

View file

@ -10,7 +10,7 @@
{# user bio #}
<div class="block">
<div class="columns">
<div class="column is-narrow">
<div class="column is-two-fifths">
<div class="media">
<div class="media-left">
<a href="{{ user.local_path }}">
@ -29,16 +29,9 @@
</div>
</div>
<div class="column">
<div class="column box has-background-white-bis content">
{% if user.summary %}
<div class="columns">
<div class="column is-narrow">
<span class="icon icon-quote-open"></span>
</div>
<div class="column">
<blockquote>{{ user.summary | to_markdown | safe }}</blockquote>
</div>
</div>
{{ user.summary | to_markdown | safe }}
{% endif %}
</div>
</div>