[go: up one dir, main page]

Skip to content

Commit

Permalink
Workshop finalizado
Browse files Browse the repository at this point in the history
  • Loading branch information
darrow12 committed Oct 19, 2020
1 parent aa04626 commit 386a077
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.vscode
node_modules
.
node_modules
8 changes: 7 additions & 1 deletion public/css/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@
cursor: pointer;
}

.button-select button.active {
.button-select button.active:first-child {
background: #edfff6;
border: 1px solid #a1e9c5;
color: #37c77f;
}

.button-select button.active:last-child {
background: #ffeded;
border: 1.8px solid #e9a1a1;
color: #c73737;
}

.button-select button:first-child {
border-radius: 02rem 0 0 2rem;
}
Expand Down
2 changes: 1 addition & 1 deletion public/scripts/page-create-orphanage.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function toggleSelect(event) {
button.classList.add('active');

// Atualizar o meu input hidden com o valor selecionado
const input = document.querySelectorAll('[name="open_on_weekends"]')
const input = document.querySelector('[name="open_on_weekends"]')

input.value = button.dataset.value

Expand Down
Binary file modified src/database/database.sqlite
Binary file not shown.
1 change: 1 addition & 0 deletions src/database/fakedata.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = [
open_on_weekends: "1"
},


{
id: 2,
lat: "-23.453535",
Expand Down
2 changes: 1 addition & 1 deletion src/database/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Database.then(async db => {
lng: "-46.5466249",
name: "Lar das meninas",
about: "Presta assistência a crianças de 06 a 15 anos que se encontre em situação de risco e/ou vulnerabilidade social.",
whatsapp: "99878978979",
whatsapp: "11 999999999",
images: [
"https://images.unsplash.com/photo-1551966775-a4ddc8df052b?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",

Expand Down
39 changes: 19 additions & 20 deletions src/server.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
// NPM = Node Package Manager
// Algo mais ou menos como Gerenciador de pacotes Node


// Importar dependência
const express = require('express');
const path = require('path');
const pages = require('./pages.js');
const express = require("express");
const path = require("path");
const pages = require("./pages.js");

console.log(pages)
// Iniciando o express
console.log(pages);
// Iniciando o express
const server = express();

server
// Utilizar body do req
.use(express.urlencoded({ extended: true }))
// Utilizando os arquivos estáticos
.use(express.static('public')) // Express cria todas as rotas que precisa no public
// Utilizar body do req
.use(express.urlencoded({ extended: true }))
// Utilizando os arquivos estáticos
.use(express.static("public")) // Express cria todas as rotas que precisa no public

// Configurar template engine
.set('views', path.join(__dirname, "views"))
.set('view engine', 'hbs')
// Configurar template engine
.set("views", path.join(__dirname, "views"))
.set("view engine", "hbs")

// rotas da aplicação
.get('/', pages.index)
.get('/orphanage', pages.orphanage)
.get('/orphanages', pages.orphanages)
.get('/create-orphanage', pages.createOrphanage)
.post('/save-orphanage', pages.saveOrphanage)
// rotas da aplicação
.get("/", pages.index)
.get("/orphanage", pages.orphanage)
.get("/orphanages", pages.orphanages)
.get("/create-orphanage", pages.createOrphanage)
.post("/save-orphanage", pages.saveOrphanage);

// Ligar o servidor
server.listen(5500)
server.listen(5500);
4 changes: 2 additions & 2 deletions src/views/orphanage.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
{{/if}}
</div>

<a href="https://api.whatsapp.com/send?l=pt_BR&phone={{orphanage.whatsapp}}&text=Oi, quero conversar sobre as visitas no {{orphanage.name}}" target="_blank"
class="primary-button" type="button">
<a href="https://api.whatsapp.com/send?l=pt_BR&phone={{orphanage.whatsapp}}&text=Oi, quero conversar sobre as visitas no {{orphanage.name}}"
target="_blank" class="primary-button" type="button">
<img src="/images/whatsapp.svg" alt="Chamar no WhatsApp" />
Entrar em contato
</a>
Expand Down

0 comments on commit 386a077

Please sign in to comment.