Skip to content

Commit

Permalink
Merge pull request #47 from biacosta7/pos_deploy
Browse files Browse the repository at this point in the history
adjustments
  • Loading branch information
biacosta7 authored Oct 17, 2024
2 parents 8093725 + 809f231 commit f57cabf
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 69 deletions.
120 changes: 62 additions & 58 deletions project/areas/templates/area_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,69 +24,73 @@
{% endblock %}

{% block content %}
<h1 class="mt-1 ml-5 text-xl font-semibold">
<a href="{% url 'dashboard' community.id %}" class="text-green-600 hover:underline">Dashboard &gt;</a>
<a href="{% url 'area_manage' community.id %}" class="text-green-600 hover:underline">Áreas &gt;</a>
</h1>
<div class="flex-1 p-2 lg:p-6">
<div class="flex items-center justify-between">
<h1 class="mt-1 ml-5 text-xl font-semibold">
<a href="{% url 'dashboard' community.id %}" class="text-green-600 hover:underline">Dashboard &gt;</a>
<a href="{% url 'area_manage' community.id %}" class="text-green-600 hover:underline">Áreas &gt;</a>
</h1>

<!-- Barra de pesquisa e ícone de notificações alinhados à direita -->
<div class="flex items-center ml-auto mr-5">
<form class="relative flex-shrink-0">
<input type="text" placeholder="Buscar canteiros..." class="border border-gray-300 rounded-md py-1 px-2 focus:outline-none focus:ring-2 focus:ring-green-500">
<button type="submit" class="ml-1 absolute top-1 right-1 text-gray-500">
<span class="material-icons">search</span>
</button>
</form>
<a href="#" class="ml-1 text-gray-700 ml-2">
<span class="material-icons">notifications</span>
</a>
</div>
</div>

<!-- Barra de pesquisa abaixo do botão de criar canteiro -->
<div class="flex justify-end mt-4 mr-5">
<form class="relative flex-shrink-0">
<input type="text" placeholder="Buscar canteiros..." class="border border-gray-300 rounded-md py-1 px-2 focus:outline-none focus:ring-2 focus:ring-green-500">
<button type="submit" class="absolute top-1 right-1 text-gray-500">
<span class="material-icons">search</span>
</button>
</form>
<a href="#" class="text-gray-700 pl-4 pt-1.5">
<span class="material-icons">notifications</span>
</a>
</div>
<br>
<div class="flex justify-between items-center">
<h2 class="ml-5 mt-2 text-4xl font-bold">{{ area.name }}</h2>
<div class="flex items-center space-x-4 mr-5">
<a href="{% url 'create_seedbed' community.id area.pk %}" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md">
Criar novo canteiro
</a>
<div class="mt-3 flex justify-between items-center mb-4">
<h2 class="ml-5 text-4xl font-bold">{{ area.name }}</h2>
<!-- Botão de criar novo canteiro alinhado à direita -->
<div class="ml-7">
<a href="{% url 'create_seedbed' community.id area.pk %}" class="mr-6 bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md">
Criar novo canteiro
</a>
</div>
</div>
</div>

<br>
<div class="ml-5 container mx-auto mt-5">
<!-- Listagem dos canteiros -->
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 mt-4">
{% for seedbed in area.seedbeds.all %}
<div class="bg-white border border-gray-300 rounded-md p-4 shadow-sm flex flex-col justify-between">
<div class="flex-grow">
<h3 class="text-2xl font-semibold">
<a href="{% url 'seedbed_detail' community.id area.pk seedbed.id %}" class="text-blue-500 hover:underline">{{ seedbed.nome }}</a>
</h3>
<a href="{% url 'update_seedbed' community.id area.pk seedbed.id %}">Editar</a> |
<a href="{% url 'delete_seedbed' community.id area.pk seedbed.id %}">Deletar</a>
<br>
<div class="ml-5 container mx-auto mt-5">
<!-- Listagem dos canteiros -->
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 mt-4">
{% for seedbed in area.seedbeds.all %}
<div class="bg-white border border-gray-300 rounded-md p-4 shadow-sm flex flex-col justify-between">
<div class="flex-grow">
<h3 class="text-2xl font-semibold">
<a href="{% url 'seedbed_detail' community.id area.pk seedbed.id %}" class="text-blue-500 hover:underline">{{ seedbed.nome }}</a>
</h3>
<a href="{% url 'update_seedbed' community.id area.pk seedbed.id %}">Editar</a> |
<a href="{% url 'delete_seedbed' community.id area.pk seedbed.id %}">Deletar</a>

<!-- Listando os produtos associados ao canteiro -->
<br><br>
<ul class="list-disc list-inside">
{% for product in seedbed.products_in_seedbed.all %}
<li>{{ product.type_product.name }}</li>
{% empty %}
<p>Nenhum cultivo cadastrado</p>
{% endfor %}
</ul>
</div>
<!-- Listando os produtos associados ao canteiro -->
<br><br>
<ul class="list-disc list-inside">
{% for product in seedbed.products_in_seedbed.all %}
<li>{{ product.type_product.name }}</li>
{% empty %}
<p>Nenhum cultivo cadastrado</p>
{% endfor %}
</ul>
</div>

<!-- Botão fixo ao fim do card -->
<div class="flex mt-5 justify-center">
<a href="{% url 'seedbed_detail' community.id area.pk seedbed.id %}"
class="inline-block bg-green-600 text-white py-2 px-4 rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 w-2/4 text-center">
Visualizar
</a>
</div>
</div>
{% empty %}
<p>Nenhum canteiro cadastrado</p>
{% endfor %}
<!-- Botão fixo ao fim do card -->
<div class="flex mt-5 justify-center">
<a href="{% url 'seedbed_detail' community.id area.pk seedbed.id %}"
class="inline-block bg-green-600 text-white py-2 px-4 rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 w-2/4 text-center">
Visualizar
</a>
</div>
</div>
{% empty %}
<p>Nenhum canteiro cadastrado</p>
{% endfor %}
</div>
</div>
</div>

{% endblock content %}
27 changes: 18 additions & 9 deletions project/areas/templates/area_manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,37 @@
</form>
</div>
</div>

<!-- Main content -->
<div class="flex-1 p-6 lg:p-10">

<!-- Título e Barra de pesquisa -->
<div class="flex justify-between items-center">
<h2 class="ml-5 mt-2 text-4xl font-bold">Área de Plantio</h2>
<h1 class="mt-1 ml-5 text-xl font-semibold">
<a href="{% url 'dashboard' community.id %}" class="text-green-600 hover:underline">Dashboard &gt;</a>
</h1>
<!-- Barra de pesquisa e notificação -->
<div class="flex items-center ml-auto mr-5">
<form class="relative flex-shrink-0">
<input type="text" placeholder="Buscar áreas..." class="border border-gray-300 rounded-md py-1 px-2 focus:outline-none focus:ring-2 focus:ring-green-500">
<button type="submit" class="absolute top-1 text-gray-500">
<button type="submit" class="ml-1 absolute top-1 right-1 text-gray-500">
<span class="material-icons">search</span>
</button>
</form>
<a href="#" class="text-gray-700 pl-7 pt-1.5">
<a href="#" class="text-gray-700 pl-2 pt-1.5">
<span class="material-icons">notifications</span>
</a>
</div>
</div>

<br>
<div class="flex justify-end">
<div class="mt-3 flex justify-between items-center mb-4">
<h2 class="ml-5 text-4xl font-bold">Área de Plantio</h2> <!-- Placeholder para ocupar espaço à esquerda -->
<!-- Botão Criar nova Área -->
<a href="{% url 'create_area' community.id %}" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md">
<a href="{% url 'create_area' community.id %}" class="mr-6 bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md">
Criar nova Área
</a>
</div>
<br>
<div class="ml-5 mt-5">
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 mt-4">
{% for area in areas %}
Expand All @@ -69,11 +73,16 @@ <h3 class="text-lg lg:text-xl mt-3 font-semibold">

<ul class="list-disc list-inside mt-2 text-sm lg:text-base">
{% for seedbed in area.seedbeds.all %}
<li>{{ seedbed.nome }} ✦ ✦ ✦ ✦</li>
<li>
{{ seedbed.nome }}
{% for product in seedbed.products_in_seedbed.all %}
🌱
{% endfor %}
</li>
{% empty %}
<li>Nenhum canteiro cadastrado</li>
{% endfor %}
</ul>
</ul>
<div class="flex mt-5 justify-center">
<a href="{% url 'area_detail' community.id area.id %}" class="inline-block bg-green-600 text-white py-2 px-4 rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 w-2/4 text-center">
Visualizar
Expand Down
Binary file modified project/db.sqlite3
Binary file not shown.
4 changes: 2 additions & 2 deletions project/seedbeds/templates/seedbed_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h2 class="ml-5 mt-2 text-4xl font-bold">{{ seedbed.nome }}</h2>
</div>
</div>
</div>

<br>
{% if seedbed.products_in_seedbed.all %}
<div class="flex items-center justify-center">
<div class="bg-[#fafafa] p-6 rounded-lg shadow-lg" style="max-width: 1200px; width: 90%; height: 450px; overflow: auto;">
Expand All @@ -135,7 +135,7 @@ <h2 class="ml-5 mt-2 text-4xl font-bold">{{ seedbed.nome }}</h2>
</div>
</div>
</form>

<!-- Detalhes do produto selecionado -->
{% if selected_product %}
<div class="product-info mt-6">
Expand Down

0 comments on commit f57cabf

Please sign in to comment.