#47 Settinge of Place Hero Image
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
<article class="LP-PlaceTeaser {% if extended %} LP-PlaceTeaser--extended{% endif %}">
|
||||
<div class="LP-PlaceTeaser__Image">
|
||||
{% if place.placeimages.all|length > 0 %}
|
||||
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url link_url=place.get_absolute_url%}
|
||||
{% if place.get_hero_image %}
|
||||
{% include 'partials/image.html' with source_url=place.get_hero_image.filename.thumbnail.url link_url=place.get_absolute_url%}
|
||||
{% else %}
|
||||
<a href="{{place.get_absolute_url}}">
|
||||
<img class="LP-Image" src="{% static 'images/missing_image.png' %}" />
|
||||
|
@@ -0,0 +1,3 @@
|
||||
{%load lostplaces %}
|
||||
|
||||
{% include 'partials/image.html' with source_url=object.filename.thumbnail.url %}
|
@@ -22,13 +22,15 @@
|
||||
|
||||
{% block maincontent %}
|
||||
<article class="LP-PlaceDetail">
|
||||
|
||||
<header class="LP-PlaceDetail__Header">
|
||||
<h1 class="LP-Headline">{{ place.name }} {% include 'partials/icons/place_favorite.html' %} {% include 'partials/icons/place_visited.html' %}</h1>
|
||||
{% if place.placeimages.first.filename.hero.url %}
|
||||
{% if place.get_hero_image %}
|
||||
<div class="LP-PlaceDetail__Image">
|
||||
{% partial image %}
|
||||
{% set source_url place.placeimages.first.filename.hero.url %}
|
||||
{% set source_url place.get_hero_image.filename.hero.url %}
|
||||
{% set link_url %}
|
||||
{{"#image"|addstr:place.get_hero_index_in_queryset}}
|
||||
{% endset %}
|
||||
{% endpartial %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
{% extends 'global.html'%}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
# {% block title %}{% translate 'Edit place' %}{% endblock %}
|
||||
|
||||
@@ -38,6 +39,15 @@
|
||||
{% include 'partials/form/inputField.html' with field=form.filename %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if object.placeimages.all|length > 0 %}
|
||||
<legend class="LP-Form__Legend">{% translate 'Set Hero Image' %}</legend>
|
||||
<div class="LP-Form__Composition">
|
||||
<div class="LP-Form__Field">
|
||||
{% render_field form.hero container_class='LP-ImageGrid__Container' item_class='LP-ImageGrid__Item LP-Select' current_selected_value=object.hero.id%}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% translate 'Update' as action %}
|
||||
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
||||
|
Reference in New Issue
Block a user