Compare commits
4 Commits
feature/33
...
bae4e13137
Author | SHA1 | Date | |
---|---|---|---|
bae4e13137 | |||
b752454233 | |||
196fb02436 | |||
9be993d9ba |
102
django_lostplaces/lostplaces/migrations/0004_release_0_1_3.py
Normal file
102
django_lostplaces/lostplaces/migrations/0004_release_0_1_3.py
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# Generated by Django 3.1.1 on 2020-12-19 13:53
|
||||||
|
|
||||||
|
import django.core.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
import easy_thumbnails.fields
|
||||||
|
import lostplaces.models.place
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('lostplaces', '0003_voucher'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='photoalbum',
|
||||||
|
name='label',
|
||||||
|
field=models.CharField(max_length=100, verbose_name='link text'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='photoalbum',
|
||||||
|
name='submitted_by',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='photoalbums', to='lostplaces.explorer', verbose_name='Submitter'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='photoalbum',
|
||||||
|
name='submitted_when',
|
||||||
|
field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='Submission date'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='photoalbum',
|
||||||
|
name='url',
|
||||||
|
field=models.URLField(verbose_name='URL'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='place',
|
||||||
|
name='description',
|
||||||
|
field=models.TextField(help_text="Description of the place: e.g. how to get there, where to be careful, the place's history...", verbose_name='Description'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='place',
|
||||||
|
name='latitude',
|
||||||
|
field=models.FloatField(help_text='Latitude in decimal format: e. g. 41.40338', validators=[django.core.validators.MinValueValidator(-90), django.core.validators.MaxValueValidator(90)], verbose_name='Latitude'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='place',
|
||||||
|
name='location',
|
||||||
|
field=models.CharField(max_length=50, verbose_name='Location'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='place',
|
||||||
|
name='longitude',
|
||||||
|
field=models.FloatField(help_text='Longitude in decimal format: e. g. 2.17403', validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)], verbose_name='Longitude'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='place',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(max_length=50, verbose_name='Name'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='place',
|
||||||
|
name='submitted_by',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='places', to='lostplaces.explorer', verbose_name='Submitter'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='place',
|
||||||
|
name='submitted_when',
|
||||||
|
field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='Submission date'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='placeimage',
|
||||||
|
name='description',
|
||||||
|
field=models.TextField(blank=True, verbose_name='Description'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='placeimage',
|
||||||
|
name='filename',
|
||||||
|
field=easy_thumbnails.fields.ThumbnailerImageField(help_text='Optional: One or more images to upload', upload_to=lostplaces.models.place.generate_image_upload_path, verbose_name='Filename(s)'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='placeimage',
|
||||||
|
name='submitted_by',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='placeimages', to='lostplaces.explorer', verbose_name='Submitter'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='placeimage',
|
||||||
|
name='submitted_when',
|
||||||
|
field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='Submission date'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='voucher',
|
||||||
|
name='created_when',
|
||||||
|
field=models.DateTimeField(auto_now_add=True, verbose_name='Creation date'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='voucher',
|
||||||
|
name='expires_when',
|
||||||
|
field=models.DateTimeField(verbose_name='Expiration date'),
|
||||||
|
),
|
||||||
|
]
|
@@ -63,25 +63,8 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
<h1 class="LP-Headline">{% trans 'Images submitted by' %} {{explorer.user.username}}</h1>
|
{% translate 'Images submitted by' as submitted_by %}
|
||||||
<div class="LP-ImageGrid">
|
{% include 'partials/placeImageGrid.html' with headline=submitted_by|add:' '|add:explorer.user.username image_list=assets.placeimages.all%}
|
||||||
<ul class="LP-ImageGrid__Container">
|
|
||||||
{% for place_image in assets.placeimages.all %}
|
|
||||||
<li class="LP-ImageGrid__Item">
|
|
||||||
<a href="{{ place_image.filename.large.url }}" class="LP-Link">
|
|
||||||
<img class="LP-Image" src="{{ place_image.filename.thumbnail.url }}">
|
|
||||||
</a>
|
|
||||||
{% if user.explorer == place_image.submitted_by%}
|
|
||||||
<span class="LP-ImageGrid__DeleteItem" title="Bild löschen">
|
|
||||||
<a href="{% url 'place_image_delete' pk=place_image.id %}" class="LP-Link">
|
|
||||||
<img class="LP-Icon" src="{% static 'icons/cancel.svg' %}" />
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class=" LP-Section">
|
<section class=" LP-Section">
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
|
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
|
||||||
<article class="LP-PlaceTeaser">
|
<article class="LP-PlaceTeaser">
|
||||||
<div class="LP-PlaceTeaser__Image">
|
<div class="LP-PlaceTeaser__Image">
|
||||||
<img class="LP-Image" src="{{ place.placeimages.first.filename.thumbnail.url}}" />
|
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %}
|
||||||
</div>
|
</div>
|
||||||
<div class="LP-PlaceTeaser__Meta">
|
<div class="LP-PlaceTeaser__Meta">
|
||||||
<div class="LP-PlaceTeaser__Info">
|
<div class="LP-PlaceTeaser__Info">
|
||||||
|
14
django_lostplaces/lostplaces/templates/partials/image.html
Normal file
14
django_lostplaces/lostplaces/templates/partials/image.html
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{% if link_url %}
|
||||||
|
<a
|
||||||
|
class="LP-Link"
|
||||||
|
href="{{link_url}}"
|
||||||
|
>
|
||||||
|
{% endif %}
|
||||||
|
<figure class="LP-Figure">
|
||||||
|
<img
|
||||||
|
src="{{ source_url }}"
|
||||||
|
{% if alt_text %} alt="{{alt_text}}" {% endif %}
|
||||||
|
class="LP-Image"
|
||||||
|
/>
|
||||||
|
</figure>
|
||||||
|
{% if link_url %}</a>{% endif %}
|
@@ -0,0 +1,21 @@
|
|||||||
|
{% load static %}
|
||||||
|
|
||||||
|
{% if headline %}
|
||||||
|
<h1 class="LP-Headline">{{headline}}</h1>
|
||||||
|
{% endif %}
|
||||||
|
<div class="LP-ImageGrid">
|
||||||
|
<ul class="LP-ImageGrid__Container">
|
||||||
|
{% for image in image_list %}
|
||||||
|
<li class="LP-ImageGrid__Item">
|
||||||
|
{% include 'partials/image.html' with source_url=image.filename.thumbnail.url link_url=image.filename.large.url %}
|
||||||
|
{% if user.explorer == image.submitted_by%}
|
||||||
|
<span class="LP-ImageGrid__DeleteItem" title="Bild löschen">
|
||||||
|
<a href="{% url 'place_image_delete' pk=image.id %}" class="LP-Link">
|
||||||
|
<img class="LP-Icon" src="{% static 'icons/cancel.svg' %}" />
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
@@ -3,7 +3,7 @@
|
|||||||
<article class="LP-PlaceTeaser {% if extended %} LP-PlaceTeaser--extended{% endif %}">
|
<article class="LP-PlaceTeaser {% if extended %} LP-PlaceTeaser--extended{% endif %}">
|
||||||
<div class="LP-PlaceTeaser__Image">
|
<div class="LP-PlaceTeaser__Image">
|
||||||
{% if place.placeimages.all|length > 0 %}
|
{% if place.placeimages.all|length > 0 %}
|
||||||
<img class="LP-Image" src="{{ place.placeimages.first.filename.thumbnail.url}}" />
|
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<img class="LP-Image" src="{% static 'images/missing_image.png' %}" />
|
<img class="LP-Image" src="{% static 'images/missing_image.png' %}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -25,9 +25,9 @@
|
|||||||
<header class="LP-PlaceDetail__Header">
|
<header class="LP-PlaceDetail__Header">
|
||||||
<h1 class="LP-Headline">{{ place.name }}</h1>
|
<h1 class="LP-Headline">{{ place.name }}</h1>
|
||||||
{% if place.placeimages.first.filename.hero.url %}
|
{% if place.placeimages.first.filename.hero.url %}
|
||||||
<figure class="LP-PlaceDetail__Image">
|
<div class="LP-PlaceDetail__Image">
|
||||||
<img src="{{ place.placeimages.first.filename.hero.url }}" class="LP-Image" />
|
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.hero.url %}
|
||||||
</figure>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -90,30 +90,8 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
<h1 class="LP-Headline">{% trans 'Images' %}</h1>
|
{% translate 'Images' as t_images %}
|
||||||
<div class="LP-ImageGrid">
|
{% include 'partials/placeImageGrid.html' with headline=t_images image_list=place.placeimages.all%}
|
||||||
<ul class="LP-ImageGrid__Container">
|
|
||||||
{% for place_image in place.placeimages.all %}
|
|
||||||
<li class="LP-ImageGrid__Item">
|
|
||||||
<a href="{{ place_image.filename.large.url }}" class="LP-Link">
|
|
||||||
<img class="LP-Image" src="{{ place_image.filename.thumbnail.url }}">
|
|
||||||
</a>
|
|
||||||
{% if user.explorer == place_image.submitted_by or user.explorer == place.submitted_by %}
|
|
||||||
<span class="LP-ImageGrid__DeleteItem" title="Bild löschen">
|
|
||||||
<a href="{% url 'place_image_delete' pk=place_image.id %}" class="LP-Link">
|
|
||||||
<img class="LP-Icon" src="{% static 'icons/cancel.svg' %}" />
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
<li class="LP-ImageGrid__Item LP-ImageGrid__Item--add" title="Bild hinzufügen">
|
|
||||||
<a class="LP-Link" href="{% url 'place_image_create' place_id=place.id%}">
|
|
||||||
<img class="LP-Icon" src="{% static 'icons/plus.svg' %}" />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
@@ -8,7 +8,7 @@ with open('../Readme.md') as f:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='django-lostplaces',
|
name='django-lostplaces',
|
||||||
version='0.1.2 HotFix',
|
version='0.1.3',
|
||||||
description='A django app to manage lost places',
|
description='A django app to manage lost places',
|
||||||
author='Reverend',
|
author='Reverend',
|
||||||
author_email='reverend@reverend2048.de',
|
author_email='reverend@reverend2048.de',
|
||||||
|
Reference in New Issue
Block a user