mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Merge pull request #739 from mouse-reeve/site-images
Fixes upload and display of logos in admin panel
This commit is contained in:
commit
8396785a49
3 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
{% block panel %}
|
||||
|
||||
<form action="{% url 'settings-site' %}" method="POST" class="content">
|
||||
<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>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="columns">
|
||||
<div class="column is-narrow is-hidden-mobile">
|
||||
<figure class="block">
|
||||
<img src="{% if site.logo_small %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}" alt="BookWyrm logo">
|
||||
<img src="{% if site.logo %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}" alt="BookWyrm logo">
|
||||
</figure>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
|
|
@ -26,7 +26,7 @@ class Site(View):
|
|||
def post(self, request):
|
||||
""" edit the site settings """
|
||||
site = models.SiteSettings.objects.get()
|
||||
form = forms.SiteForm(request.POST, instance=site)
|
||||
form = forms.SiteForm(request.POST, request.FILES, instance=site)
|
||||
if not form.is_valid():
|
||||
data = {"site_form": form}
|
||||
return TemplateResponse(request, "settings/site.html", data)
|
||||
|
|
Loading…
Reference in a new issue