Compare commits
No commits in common. "201ef736392840310018c29b2656fff7ce5d74ee" and "d35cb8131ac8ddaab58ab3481f2e79773079bad1" have entirely different histories.
201ef73639
...
d35cb8131a
@ -67,14 +67,14 @@ class PlaceForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Place
|
||||
fields = '__all__'
|
||||
exclude = ['submitted_by']
|
||||
exclude = ['submitted_by', 'latitude', 'longitute']
|
||||
|
||||
latitude = forms.DecimalField(
|
||||
widget=forms.NumberInput(attrs={'min':-90,'max': 90,'type': 'number', 'step': 'any'})
|
||||
latitude = forms.IntegerField(
|
||||
widget=forms.NumberInput(attrs={'min':-90,'max': 90,'type': 'number'})
|
||||
)
|
||||
|
||||
longitude = forms.DecimalField(
|
||||
widget=forms.NumberInput(attrs={'min':-180,'max': 180,'type': 'number', 'step': 'any'})
|
||||
longitude = forms.IntegerField(
|
||||
widget=forms.NumberInput(attrs={'min':-180,'max': 180,'type': 'number'})
|
||||
)
|
||||
|
||||
class PlaceImageForm(forms.ModelForm):
|
||||
|
@ -48,6 +48,7 @@ class Place(Submittable, Taggable, Mapable):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
def generate_place_image_filename(instance, filename):
|
||||
"""
|
||||
Callback for generating filename for uploaded place images.
|
||||
@ -56,9 +57,6 @@ def generate_place_image_filename(instance, filename):
|
||||
|
||||
return 'places/' + str(instance.place.pk) + '-' + str(instance.place.name) + '.' + filename.split('.')[-1]
|
||||
|
||||
def generate_image_upload_path(instance, filename):
|
||||
return generate_place_image_filename(instance, filename)
|
||||
|
||||
class PlaceAsset(Submittable):
|
||||
"""
|
||||
Assets to a place, i.e. images
|
||||
|
@ -33,10 +33,5 @@
|
||||
</div>
|
||||
</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>
|
@ -3,7 +3,7 @@
|
||||
<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%}
|
||||
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %}
|
||||
{% else %}
|
||||
<img class="LP-Image" src="{% static 'images/missing_image.png' %}" />
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user