Unverified Commit b16f99c4 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Add committee fallback image

parent 7f1671fd
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-13 20:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('committees', '0004_auto_20160727_2253'),
]
operations = [
migrations.AlterField(
model_name='committee',
name='photo',
field=models.ImageField(blank=True, null=True, upload_to='public/committeephotos/', verbose_name='Image'),
),
]
......@@ -48,6 +48,8 @@ class Committee(models.Model):
photo = models.ImageField(
verbose_name=_('Image'),
upload_to='public/committeephotos/',
null=True,
blank=True,
)
members = models.ManyToManyField(
......
......@@ -15,7 +15,9 @@
<div class="clearfix portfolio">
<div id="committee-div">
<div class="row">
<img alt="{{ committee.name }}" class="span12" src="{{ MEDIA_URL }}{{ committee.photo }}">
{% if committee.photo %}
<img alt="{{ committee.name }}" class="span12" src="{{ committee.photo.url }}">
{% endif %}
</div>
<div>
<h1 class="midhead">{% blocktrans with name=committee.name %}About the {{ name }}{% endblocktrans %}</h1>
......@@ -32,7 +34,7 @@
{% if not member.photo %}
<img alt="{% trans "Default avatar" %}" src="{% static 'members/images/default-avatar.jpg' %}" height="620" width="620" />
{% else %}
<img alt="{{ member.display_name }}" src="{{ MEDIA_URL }}{{ member.photo }}" width="620" height="620" />
<img alt="{{ member.display_name }}" src="{{ member.photo.url }}" width="620" height="620" />
{% endif %}
</div>
{% if member.chair %}
......
{% extends "base.html" %}
{% load i18n thumbnail %}
{% load i18n thumbnail static %}
{% block title %}{% trans 'Committees' %} — {{ block.super }}{% endblock %}
{% block page_title %}{% trans 'Committees' %}{% endblock %}
......@@ -15,7 +15,11 @@
<div class="post-inner">
<div class="inner-img">
<img src="{% thumbnail committee.photo '1024x600' fit=False %}" alt="{{ committee.name }}">
{% if committee.photo %}
<img src="{% thumbnail committee.photo '220x220' fit=False %}" alt="Photo of {{ committee.name }}">
{% else %}
<img height="220" width="220" src="{% static 'committees/images/logo-black-bg.png' %}">
{% endif %}
</div>
<div class="post-overlay">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment