forked from mirrors/bookwyrm
Merge pull request #477 from mouse-reeve/logo-default
Lets instances customize logos
This commit is contained in:
commit
e7553ee0c5
4 changed files with 46 additions and 6 deletions
28
bookwyrm/migrations/0031_auto_20210104_2040.py
Normal file
28
bookwyrm/migrations/0031_auto_20210104_2040.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# Generated by Django 3.0.7 on 2021-01-04 20:40
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('bookwyrm', '0030_auto_20201224_1939'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='sitesettings',
|
||||||
|
name='favicon',
|
||||||
|
field=models.ImageField(blank=True, null=True, upload_to='logos/'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='sitesettings',
|
||||||
|
name='logo',
|
||||||
|
field=models.ImageField(blank=True, null=True, upload_to='logos/'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='sitesettings',
|
||||||
|
name='logo_small',
|
||||||
|
field=models.ImageField(blank=True, null=True, upload_to='logos/'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -17,6 +17,15 @@ class SiteSettings(models.Model):
|
||||||
code_of_conduct = models.TextField(
|
code_of_conduct = models.TextField(
|
||||||
default="Add a code of conduct here.")
|
default="Add a code of conduct here.")
|
||||||
allow_registration = models.BooleanField(default=True)
|
allow_registration = models.BooleanField(default=True)
|
||||||
|
logo = models.ImageField(
|
||||||
|
upload_to='logos/', null=True, blank=True
|
||||||
|
)
|
||||||
|
logo_small = models.ImageField(
|
||||||
|
upload_to='logos/', null=True, blank=True
|
||||||
|
)
|
||||||
|
favicon = models.ImageField(
|
||||||
|
upload_to='logos/', null=True, blank=True
|
||||||
|
)
|
||||||
support_link = models.CharField(max_length=255, null=True, blank=True)
|
support_link = models.CharField(max_length=255, null=True, blank=True)
|
||||||
support_title = models.CharField(max_length=100, null=True, blank=True)
|
support_title = models.CharField(max_length=100, null=True, blank=True)
|
||||||
admin_email = models.EmailField(max_length=255, null=True, blank=True)
|
admin_email = models.EmailField(max_length=255, null=True, blank=True)
|
||||||
|
|
|
@ -8,20 +8,23 @@
|
||||||
<link type="text/css" rel="stylesheet" href="/static/css/format.css">
|
<link type="text/css" rel="stylesheet" href="/static/css/format.css">
|
||||||
<link type="text/css" rel="stylesheet" href="/static/css/icons.css">
|
<link type="text/css" rel="stylesheet" href="/static/css/icons.css">
|
||||||
|
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="/static/images/favicon.ico">
|
<link rel="shortcut icon" type="image/x-icon" href="{% if site.favicon %}/images/{{ site.favicon }}{% else %}/static/images/favicon.ico{% endif %}">
|
||||||
|
|
||||||
<meta name="twitter:card" content="summary">
|
<meta name="twitter:card" content="summary">
|
||||||
<meta name="twitter:title" content="{{ site.name }}">
|
<meta name="twitter:title" content="{% if title %}{{ title }} | {% endif %}{{ site.name }}">
|
||||||
<meta name="og:title" content="{{ site.name }}">
|
<meta name="og:title" content="{% if title %}{{ title }} | {% endif %}{{ site.name }}">
|
||||||
<meta name="twitter:description" content="Federated Social Reading">
|
<meta name="twitter:description" content="Federated Social Reading">
|
||||||
<meta name="og:description" content="Federated Social Reading">
|
<meta name="og:description" content="Federated Social Reading">
|
||||||
|
|
||||||
|
<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">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<nav class="navbar container" role="navigation" aria-label="main navigation">
|
<nav class="navbar container" role="navigation" aria-label="main navigation">
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand">
|
||||||
<a class="navbar-item" href="/">
|
<a class="navbar-item" href="/">
|
||||||
<img class="image logo" src="/static/images/logo-small.png" alt="Home page">
|
<img class="image logo" src="{% if site.logo_small %}/images/{{ site.logo_small }}{% else %}/static/images/logo-small.png{% endif %}" alt="Home page">
|
||||||
</a>
|
</a>
|
||||||
<form class="navbar-item column" action="/search/">
|
<form class="navbar-item column" action="/search/">
|
||||||
<div class="field has-addons">
|
<div class="field has-addons">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column is-narrow is-hidden-mobile">
|
<div class="column is-narrow is-hidden-mobile">
|
||||||
<figure class="block">
|
<figure class="block">
|
||||||
<img src="/static/images/logo.png" alt="BookWyrm">
|
<img src="{% if site.logo_small %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}" alt="BookWyrm logo">
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
Loading…
Reference in a new issue