{% extends "base.html.twig" %}

{% block content %}
	<div class="all-page">
		<div class="categories">
			<h2 style="text-align: center;">Категории</h2>
			<a href="/">
				<div {% if selected_category == null %} class="selected" {% endif %}>
					Все
				</div>
			</a>
			{% for category in categories %}
				<a href="?category={{category.id}}">
					<div {% if selected_category == category.id %} class="selected" {% endif %}>
						{{category.name}}
					</div>
				</a>
			{% endfor %}
		</div>
		<div class="table">
			{% for product in products %}
				<div class="product">
					{% if product.img %}
						<img class="img" src="{{ product.img }}" alt="{{ product.img }}">
					{% endif %}

					<h2>{{product.name}}</h2>
					<div style="width:100%;">
						<div class="vars">
							<div>
								<h3>${{product.price}}</h3>
							</div>
							<div>
								<h3>{{product.weight}}
									г.</h3>
							</div>
						</div>


						<div class="buy">
							<a href="/product/{{product.id}}">
								<h1>Подробнее</h1>
							</a>
						</div>

					</div>
				</div>
			{% endfor %}
		</div>
	</div>
{% endblock %}
