Merge branch 'master' into app.wiai.de
This commit is contained in:
commit
0302612ee6
18
ofu_app/apps/food/migrations/0008_auto_20180201_1018.py
Normal file
18
ofu_app/apps/food/migrations/0008_auto_20180201_1018.py
Normal 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'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@ -60,11 +60,12 @@ def account_activation_sent(request):
|
|||||||
|
|
||||||
|
|
||||||
def account_view(request):
|
def account_view(request):
|
||||||
|
print("There it is ---------------------------------------------------------------------")
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
user = request.user
|
user = request.user
|
||||||
|
|
||||||
food_ratings = UserRating.objects.filter(user=user).order_by('food__name')
|
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)
|
print(food_images)
|
||||||
|
|
||||||
return render(request, 'registration/account_view.jinja',
|
return render(request, 'registration/account_view.jinja',
|
||||||
|
|||||||
@ -63,7 +63,7 @@
|
|||||||
{% if single_food.image %}
|
{% if single_food.image %}
|
||||||
<a href="{{ single_food.image.image.url }}" data-lightbox="{{ title }}"
|
<a href="{{ single_food.image.image.url }}" data-lightbox="{{ title }}"
|
||||||
data-title="{{ single_food.name }}">
|
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>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{{ static('img/food/default.jpg') }}" data-lightbox="{{ title }}"
|
<a href="{{ static('img/food/default.jpg') }}" data-lightbox="{{ title }}"
|
||||||
|
|||||||
@ -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">
|
<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>
|
<p>{{ image.food.name }}</p>
|
||||||
<div class="thumbnail">
|
<div class="thumbnail">
|
||||||
<a href="{{ image.image.url }}">
|
<a href="{{ image.image.image.url }}">
|
||||||
<img src="{{ image.image.url }}" alt="Lights" style="width:100%">
|
<img src="{{ image.image.thumb.url }}" alt="Lights" style="width:100%">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user