Skip to content

Commit

Permalink
Feat/equipes images (#187)
Browse files Browse the repository at this point in the history
* feat: add supabase storage lib

* feat: add team members

* feat: add images

* remove images and uploaded to supabase storage

* update image path

* remove module supabase storage

* fix button 'fale conosco' layout

* add nucleo sul and norte

* remove big files

* feat: add storage module
  • Loading branch information
douglastofoli authored Aug 25, 2024
1 parent e8aae8f commit bb7bcdf
Show file tree
Hide file tree
Showing 125 changed files with 1,178 additions and 363 deletions.
39 changes: 3 additions & 36 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use flake
source .env.dev

export GPG_TTY="$(tty)"

# this allows mix to work on the local directory
Expand All @@ -8,9 +11,6 @@ export ERL_AFLAGS="-kernel shell_history enabled"

export LANG=en_US.UTF-8

source .env.dev

use flake

# Install mix dependencies
if ! test -d deps; then
Expand All @@ -21,36 +21,3 @@ fi
if ! test -d assets/node_modules && test -f assets/package.json; then
cd assets && npm install && cd $PWD
fi

USE_LOCAL_POSTGRES=false

# Setup postgresql
if test -d "/Applications/Postgres.app"; then
export DATABASE_USER="$(whoami)"
export DATABASE_PASS=""
elif $USE_LOCAL_POSTGRES; then
# postges related
export DATABASE_USER="peapescarte"
export DATABASE_PASS="peapescarte"
export DATABASE_NAME="peapescarte_dev"
# keep all your db data in a folder inside the project
export PGHOST="$PWD/.postgres"
export PGDATA="$PGHOST/data"
export PGLOG="$PGHOST/server.log"

if [[ ! -d "$PGDATA" ]]; then
# initital set up of database server
initdb --auth=trust --no-locale --encoding=UTF8 -U=$DATABASE_USER >/dev/null

# point to correct unix sockets
echo "unix_socket_directories = '$PGHOST'" >> "$PGDATA/postgresql.conf"
# creates loacl database user
echo "CREATE USER $DATABASE_USER SUPERUSER;" | postgres --single -E postgres
# creates local databse
echo "CREATE DATABASE $DATABASE_NAME;" | postgres --single -E postgres
fi
else
export DATABASE_USER="postgres"
export DATABASE_PASS="postgres"
export DATABASE_NAME="peapescarte_dev"
fi
4 changes: 4 additions & 0 deletions assets/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ body {
footer {
@apply border-black-10;
border-top-width: 1px;

img {
z-index: -99;
}
}

.grid {
Expand Down
3 changes: 3 additions & 0 deletions assets/css/get_in_touch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@
padding: 1rem 1.5rem 1rem 1.5rem;
cursor: pointer;
text-decoration: none;
height: 3rem;
gap: 0.5rem;

p {
@apply text-orange-100;
font-size: 16px;
}

svg {
Expand Down
12 changes: 11 additions & 1 deletion assets/css/landing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@
margin-bottom: 2.5rem;
}


.linha-pesquisa {
@apply flex;
flex-direction: column;
Expand Down Expand Up @@ -445,6 +444,17 @@
}
}

.membro-circle-transparent {
@apply flex;
justify-content: center;
width: 3.75rem;
height: auto;

img {
width: 100%;
}
}

.membro-description {
@apply flex;
flex-direction: column;
Expand Down
4 changes: 4 additions & 0 deletions lib/pescarte/supabase.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ defmodule Pescarte.Supabase do
use Supabase.GoTrue, client: Pescarte.Supabase.Auth
end

defmodule Storage do
use Supabase.Storage, client: Pescarte.Supabase.Auth
end

def start_link(_opts) do
children = [__MODULE__.Auth]
opts = [strategy: :one_for_one, name: __MODULE__]
Expand Down
37 changes: 31 additions & 6 deletions lib/pescarte_web/controllers/equipes_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,38 @@ defmodule PescarteWeb.EquipesController do

def show(conn, _params) do
current_path = conn.request_path
linhas_pesquisas = get_data_from_file("linhas_pesquisas.json")
membros = get_data_from_file("membros.json")

{:ok, data} =
"equipes"
|> Pescarte.get_static_file_path("equipes.json")
|> File.read!()
|> Jason.decode()
nucleo_norte = [
"Equipe de Campo - Campos dos Goytacazes",
"Equipe de Campo - Quissamã",
"Equipe de Campo - São João da Barra",
"Equipe de Campo - São Francisco de Itabapoana"
]

render(conn, :show, data: data, error_message: nil, current_path: current_path)
nucleo_sul = [
"Equipe de Campo - Carapebus/Macaé",
"Equipe de Campo - Rio das Ostras",
"Equipe de Campo - Arraial do Cabo",
"Equipe de Campo - Cabo Frio",
"Equipe de Campo - Armação dos Búzios"
]

render(conn, :show,
linhas_pesquisas: linhas_pesquisas,
membros: membros,
nucleo_norte: nucleo_norte,
nucleo_sul: nucleo_sul,
error_message: nil,
current_path: current_path
)
end

defp get_data_from_file(file_name) do
"equipes"
|> Pescarte.get_static_file_path(file_name)
|> File.read!()
|> Jason.decode!()
end
end
3 changes: 2 additions & 1 deletion lib/pescarte_web/design_system/get_in_touch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ defmodule PescarteWeb.DesignSystem.GetInTouch do
Mas, se preferir, entre em contato diretamente.
</.text>
<DesignSystem.link href={~p"/contato"} class="contact-btn">
<Lucideicons.message_square /> Clique Para Expandir
<Lucideicons.message_square />
<p>Fale Conosco</p>
</DesignSystem.link>
</div>
</div>
Expand Down
Loading

0 comments on commit bb7bcdf

Please sign in to comment.