self.set_names()
super(Artist, self).save(*args, **kwargs)
+ @property
+ def featured_image(self):
+ if self.photo_featured:
+ return self.photo_featured
+ else:
+ return self.photo
+
class Media(Displayable, RichText):
"""Media"""
+{% load i18n pages_tags mezzanine_tags %}
+
<div class="artist__item msry__item">
<div class="artist__item__inner">
<a href="{% url 'festival-artist-detail' artist.slug %}" class="artist__item__inner">
<figure class="artist__item__img">
- <img src="{% if artist.photo_featured %}{{ artist.photo_featured.url }}{% elif artist.photo %}/{{ artist.photo.url }}{% else %}{% endif %}" alt="Portrait {{ artist.name }}">
+ <img src="{{ MEDIA_URL }}{% thumbnail artist.featured_image 500 0 %}" alt="Portrait {{ artist.name }}">
</figure>
<h3 class="artist__item__name">
<span>
<div class="push__calendar">
<a href='{{ event|google_calendar_url }}' target="_blank" class="push__calendar__item">
<i class="icon icon__calendar"></i>
- Add to Google Calendar
+ {% trans "Add to" %} Google Calendar
</a>
<a href='{% icalendar_url %}' class="push__calendar__item">
<i class="icon icon__windows"></i>
- Add to Outlook/iCal
+ {% trans "Add to" %} Outlook/iCal
</a>
</div>
{% endblock %}
<ul id="lightSlider">
{% featured_events as events %}
{% for event in events %}
- <li class="hero__slider__item" style="background-image: url({{ event.featured_image_header.url }});">
+ <li class="hero__slider__item" style="background-image: url({{ MEDIA_URL }}{% thumbnail event.featured_image_header 1920 0 %});">
<div class="hero__slider__infos">
<div class="container">
<p class="hero__slider__name">
</script>
</html>
-