Merge branch 'master' into app.wiai.de

This commit is contained in:
Michael Götz 2018-02-01 11:44:13 +01:00
commit 0302612ee6
4 changed files with 23 additions and 4 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 2.0.1 on 2018-02-01 10:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('food', '0007_auto_20180117_0137'),
]
operations = [
migrations.AlterField(
model_name='singlefood',
name='allergens',
field=models.ManyToManyField(blank=True, to='food.Allergene'),
),
]

View File

@ -60,11 +60,12 @@ def account_activation_sent(request):
def account_view(request):
print("There it is ---------------------------------------------------------------------")
if request.user.is_authenticated:
user = request.user
food_ratings = UserRating.objects.filter(user=user).order_by('food__name')
food_images = UserFoodImage.objects.filter(user=user)
food_images = UserFoodImage.objects.filter(user=user.id)
print(food_images)
return render(request, 'registration/account_view.jinja',

View File

@ -63,7 +63,7 @@
{% if single_food.image %}
<a href="{{ single_food.image.image.url }}" data-lightbox="{{ title }}"
data-title="{{ single_food.name }}">
<img src="{{ single_food.image.image.url }}" class="media-object" alt="Bild" width="80px">
<img src="{{ single_food.image.thumb.url }}" class="media-object" alt="Bild" width="80px">
</a>
{% else %}
<a href="{{ static('img/food/default.jpg') }}" data-lightbox="{{ title }}"

View File

@ -28,8 +28,8 @@
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-4 p-3 bg-light text-dark">
<p>{{ image.food.name }}</p>
<div class="thumbnail">
<a href="{{ image.image.url }}">
<img src="{{ image.image.url }}" alt="Lights" style="width:100%">
<a href="{{ image.image.image.url }}">
<img src="{{ image.image.thumb.url }}" alt="Lights" style="width:100%">
</a>
</div>
</div>