Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrumar Bug da pagina catálogo e Estilização finais #21

Merged
merged 2 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/loja/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1>La Boleria Belle</h1>
seu paladar e transformar suas celebrações em momentos inesquecíveis.
Localizada no coração da cidade, nossa loja de bolos é o refúgio perfeito para quem valoriza a arte de saborear e celebrar a vida com os melhores sabores.
</p>
<button class="btn">Saiba Mais</button>
<a href="{% url 'catalogo' %}" class="btn">Saiba Mais</a>
</div>

<div class="stack">
Expand Down
6 changes: 5 additions & 1 deletion app/loja/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def catalogo(request):

@login_required
def basket(request):
return render(request, 'basket.html')
profile = Profile.objects.get(user=request.user)
carrinho = profile.listar_carrinho() # Obtém o carrinho do usuário
total = profile.obter_valor_total() # Calcula o total
return render(request, 'basket.html', {'carrinho': carrinho, 'total': total})


@login_required
def admin(request):
Expand Down
4 changes: 2 additions & 2 deletions app/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ header {
top: 0;
display: flex;
align-items: center;
background-color: var(--header-bg); /* Fundo branco para o cabeçalho */
background: linear-gradient(145deg, #f2f2f2 0%, #eaeaea 76%);
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1);
z-index: 2;
width: 100%; /* Garante que o cabeçalho preencha toda a largura da página */
Expand Down Expand Up @@ -186,7 +186,7 @@ header {
}

footer {
background-color: var(--footer-bg); /* Fundo branco para o rodapé */
background: linear-gradient(145deg, #f2f2f2 0%, #eaeaea 76%);
color: var(--text-color); /* Cor do texto */
text-align: center;
padding: 10px; /* Ajusta o padding conforme necessário */
Expand Down
11 changes: 8 additions & 3 deletions app/static/css/catalogo.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ header {

h1 {
font-family: "Dancing Script", cursive;
font-size: clamp(2.5rem, 4vw, 3rem);
font-size: clamp(2.5rem, 4vw, 6rem);
font-weight: 700;
color: var(--text-color);
margin-bottom: 20px;
background: -webkit-linear-gradient(0deg, #f4b942, #ff6f61);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 1.1;
margin-bottom: 36px;
padding-left: 10px;
}

nav {
Expand Down
1 change: 1 addition & 0 deletions app/static/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ main {
user-select: none;
-webkit-user-select: none;
pointer-events: auto;
text-decoration: none; /* Remove o sublinhado */
}

.btn:hover {
Expand Down
5 changes: 1 addition & 4 deletions app/static/js/catalogo.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ document.addEventListener('DOMContentLoaded', function () {
.then(response => response.json())
.then(data => {
if (data.success) {
alert('Bolo adicionado ao carrinho com sucesso!');
atualizarCarrinho(); // Atualiza o carrinho após adicionar um bolo
} else {
alert('Erro ao adicionar bolo ao carrinho.');
}
})
.catch(error => {
Expand All @@ -86,7 +83,7 @@ document.addEventListener('DOMContentLoaded', function () {
const carrinhoItens = document.getElementById('carrinho-itens');

if (parseFloat(totalElem.textContent.replace('R$ ', '')) > 0) {
alert('Compra finalizada!');
alert('Pedido Selecionado com Sucesso!');
fetch('/finalizar_compra/', {
method: 'POST',
headers: {
Expand Down