From 60836459c826140322c7bd234c1ffdba29d7006d Mon Sep 17 00:00:00 2001 From: Annabell Date: Mon, 9 Sep 2024 17:38:53 -0300 Subject: [PATCH 1/9] Feat/publi artigos (#211) * insercao da rota da agenda * troquei a ordem na navbar, inseri censo e redirecionei botao da landing * extract common tasks aliases * criando a pagina dos artigos em publicacoes * criando pagina de artigos publicados em publicacoes * terceira atualizacao da pagina de artigos em publicacoes * criando a responsividade na tela dos artigos: tabela-responsiva e arquivo article.scss * format --------- Co-authored-by: Zoey de Souza Pessanha --- assets/css/app.scss | 1 + assets/css/article.scss | 46 +++++ assets/css/get_in_touch.scss | 2 +- .../templates/article_html/show.html.heex | 163 +++++++++++++++++- 4 files changed, 205 insertions(+), 7 deletions(-) create mode 100644 assets/css/article.scss diff --git a/assets/css/app.scss b/assets/css/app.scss index a46181bf..1cf71721 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -176,6 +176,7 @@ footer { @import "./agenda.scss"; @import "./contact.scss"; +@import "./article.scss"; @import "./boletins.scss"; // Com autenticação diff --git a/assets/css/article.scss b/assets/css/article.scss new file mode 100644 index 00000000..c25b9c59 --- /dev/null +++ b/assets/css/article.scss @@ -0,0 +1,46 @@ +.article-wrapper { + max-width: 100vw !important; + div { + max-width: 100vw; + } +} +.lighter-banner{ + display: flex; + flex-direction: column; + text-align: center; + justify-content: center; + gap: 20px; + height: 260px; + margin-bottom: 20px; + background: #0064c8b0; + background-blend-mode: multiply; + + .banner-img { + z-index: -1; + position: absolute; + width: 100vw; + height: 260px; +} +} +.publications { + .publications-text { + display: flex; + flex-direction: column; + align-items: center; + } +} + +/* Estilo padrão para telas grandes */ +.tabela-responsiva { + width: 85vw; + margin: 0 auto; +} + +/* Estilo para telas pequenas (móveis) */ +@media (max-width: 768px) { + .tabela-responsiva { + width: 95vw; + display: flex; + flex-wrap: wrap; + } +} diff --git a/assets/css/get_in_touch.scss b/assets/css/get_in_touch.scss index 3d35f0fc..db6862b7 100644 --- a/assets/css/get_in_touch.scss +++ b/assets/css/get_in_touch.scss @@ -73,4 +73,4 @@ } } } -} \ No newline at end of file +} diff --git a/lib/pescarte_web/templates/article_html/show.html.heex b/lib/pescarte_web/templates/article_html/show.html.heex index f52161e8..e24decb0 100644 --- a/lib/pescarte_web/templates/article_html/show.html.heex +++ b/lib/pescarte_web/templates/article_html/show.html.heex @@ -1,11 +1,16 @@ -
+
+
+ + <.text size="h2" color="text-white-100"> + Artigos Publicados + +
-
<.text size="h3" color="text-blue-100">Categoria: Artigos em Revistas +
+ +
@@ -58,6 +63,41 @@ + + + + + + + + + + + + + + + + @@ -137,8 +177,13 @@ -->
Título
2024 + + Leia aqui + +
2024 + + Leia aqui + +
+ UM OLHAR ESTATÍSTICO SOBRE A PESCA: A EXPERIÊNCIA DE + APLICAÇÃO DE CENSO EM COMUNIDADES PESQUEIRAS DO LITORAL FLUMINENSE". + 2022 + + Leia aqui + +
Atafona: records of a world in ruins 2023
- +
+
+
+
<.text size="h3" color="text-blue-100">Categoria: Capítulo de Livros +
+
@@ -189,7 +234,113 @@
Título
+
+
+
+
+ <.text size="h3" color="text-blue-100">Categoria: Relatórios Técnicos
+
+ + + + + + + + + + + +
TítuloAnoLink
+ Capital Social e Associativismo dos Pescadores Artesanais de Municípios Limítrofes à Bacia de Campos: análise a partir dos dados do PEA Pescarte + 2019 + + Leia aqui + +
+
+
+
+
+ <.text size="h3" color="text-blue-100">Categoria: Tese Doutoral +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
TítuloAnoLink
+ SEGURIDADE SOCIAL: o acesso aos direitos sociais pelas mulheres na atividade pesqueira + 2023 + + Leia aqui + +
+ Memórias e vivências na pesca em Gargaú: + tecendo circuitos laborais e ecossociais entre pescadores e pescadoras artesanais. + 2023 + + Leia aqui + +
+ ESCOLA E ESCOLARIZAÇÃO DE PESCADORES E PESCADORAS EM GARGAÚ/SÃO + FRANCISCO DE ITABAPOANA/RJ: NAVEGANDO POR MARES E MEMÓRIAS + 2023 + + Leia aqui + +
+ A Emancipação, Trabalho e Solidariedade como elementos centrais da Educação + Ambiental Crítica com Pescadoras Artesanais + 2021 + + Leia aqui + +
+
From a74bbf168d9205eb0284d72e825fc93ea47d717e Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Mon, 9 Sep 2024 18:15:42 -0300 Subject: [PATCH 2/9] fix: simplify CI --- .github/workflows/ci.yml | 188 ++++++++++++++++++++++++++++++++++----- Dockerfile | 4 +- Earthfile | 69 -------------- docker-compose.ci.yml | 13 --- 4 files changed, 168 insertions(+), 106 deletions(-) delete mode 100644 Earthfile delete mode 100644 docker-compose.ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d4da889..ade40e3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,7 @@ name: ci env: - EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - FORCE_COLOR: 1 + REGISTRY: ghcr.io + IMAGE_NAME: peapescarte/pescarte-plataforma on: push: @@ -14,35 +12,183 @@ on: jobs: lint: runs-on: ubuntu-latest + env: + MIX_ENV: dev + strategy: + matrix: + otp: [26.2.5] + elixir: [1.16.2] steps: - - uses: earthly/actions-setup@v1 + - uses: actions/checkout@v4 + + - uses: erlef/setup-beam@v1 with: - version: v0.8.14 - - uses: actions/checkout@v2 - - name: Run build - run: earthly --ci --build-arg MIX_ENV=dev +ci + otp-version: ${{ matrix.otp }} + elixir-version: ${{ matrix.elixir }} + + - name: Cache Elixir deps + uses: actions/cache@v1 + id: deps-cache + with: + path: deps + key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + + - name: Cache Elixir _build + uses: actions/cache@v1 + id: build-cache + with: + path: _build + key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + + - name: Install deps + if: steps.deps-cache.outputs.cache-hit != 'true' + run: | + mix local.rebar --force + mix local.hex --force + mix deps.get --only ${{ env.MIX_ENV }} + + - name: Compile deps + if: steps.build-cache.outputs.cache-hit != 'true' + run: mix deps.compile --warnings-as-errors + + - name: Run compiler checks + run: mix clean && mix compile --force --warning-as-errors + + - name: Run formatter check + run: mix format --check-formatted + + - name: Run static analysis + run: mix credo --strict test: runs-on: ubuntu-latest + env: + SUPABASE_KEY: "super-ci-key" + SUPABASE_URL: "http://localhost:123" + DATABASE_USER: "peapescarte" + DATABASE_PASS: "peapescarte" + MIX_ENV: test + strategy: + matrix: + otp: [26.2.5] + elixir: [1.16.2] + services: + postgres: + image: postgres:15 + ports: + - 5432:5432 + env: + POSTGRES_USER: peapescarte + POSTGRES_PASSWORD: peapescarte + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v4 + + - uses: erlef/setup-beam@v1 + with: + otp-version: ${{ matrix.otp }} + elixir-version: ${{ matrix.elixir }} + + - name: Cache Elixir deps + uses: actions/cache@v1 + id: deps-cache + with: + path: deps + key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + + - name: Cache Elixir _build + uses: actions/cache@v1 + id: build-cache + with: + path: _build + key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + + - name: Install deps + if: steps.deps-cache.outputs.cache-hit != 'true' + run: | + mix local.rebar --force + mix local.hex --force + mix deps.get --only ${{ env.MIX_ENV }} + + - name: Compile deps + if: steps.build-cache.outputs.cache-hit != 'true' + run: mix deps.compile --warnings-as-errors + + - name: Run tests + run: mix test + + build-dev: + runs-on: ubuntu-latest + needs: test + if: success() && github.ref == 'refs/heads/main' + permissions: + contents: read + packages: write + attestations: write + id-token: write steps: - - uses: earthly/actions-setup@v1 + - uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.GHCR_USERNAME }} + password: ${{ secrets.GHCR_TOKEN }} + + - name: Build and push Docker image (DEV) + id: push + uses: docker/build-push-action@v6 + with: + context: . + from: ./Dockerfile + push: true + tags: ${{ env.IMAGE_NAME }}:dev + build-args: MIX_ENV="dev" + target: builder + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 with: - version: v0.8.14 - - uses: actions/checkout@v2 - - name: Run build - run: earthly -P --ci --build-arg MIX_ENV=test +test + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true build-prod: runs-on: ubuntu-latest needs: test if: success() && github.ref == 'refs/heads/main' + permissions: + contents: read + packages: write + attestations: write + id-token: write steps: - - uses: earthly/actions-setup@v1 + - uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 with: - version: v0.8.14 - - uses: actions/checkout@v2 - - name: Docker Login - run: echo "$DOCKERHUB_TOKEN" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin - - name: Run build - run: earthly -P --ci --push --build-arg GITHUB_REPO=${{ github.repository }} +docker + registry: ${{ env.REGISTRY }} + username: ${{ secrets.GHCR_USERNAME }} + password: ${{ secrets.GHCR_TOKEN }} + - name: Build and push Docker image (PROD) + id: push + uses: docker/build-push-action@v6 + with: + context: . + from: ./Dockerfile + push: true + tags: ${{ env.IMAGE_NAME }}:prod + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true diff --git a/Dockerfile b/Dockerfile index d575fbc6..e3e273f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ ARG ELIXIR_VERSION=1.16.0 ARG OTP_VERSION=26.1.2 ARG ALPINE_VERSION=3.18.4 +ARG MIX_ENV=prod ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-alpine-${ALPINE_VERSION}" ARG RUNNER_IMAGE="alpine:${ALPINE_VERSION}" @@ -17,9 +18,6 @@ RUN apk add --no-cache build-base gcc curl git wget nodejs npm RUN mix local.hex --force && \ mix local.rebar --force -# set build ENV -ENV MIX_ENV="prod" - # install mix dependencies COPY mix.exs mix.lock ./ RUN mix deps.get --only $MIX_ENV diff --git a/Earthfile b/Earthfile deleted file mode 100644 index 2d28c529..00000000 --- a/Earthfile +++ /dev/null @@ -1,69 +0,0 @@ -VERSION 0.7 - -deps: - ARG ELIXIR=1.16.0 - ARG OTP=26.1.2 - ARG ALPINE_VERSION=3.18.4 - ARG MIX_ENV=test - FROM hexpm/elixir:${ELIXIR}-erlang-${OTP}-alpine-${ALPINE_VERSION} - RUN apk update --no-cache - RUN apk add --no-cache build-base gcc git curl - WORKDIR /src - COPY mix.exs mix.lock ./ - COPY --dir config . # check .earthlyignore - RUN mix local.rebar --force - RUN mix local.hex --force - RUN mix deps.get - RUN mix deps.compile - COPY --dir lib . - SAVE ARTIFACT /src/deps AS LOCAL deps - -ci: - FROM +deps --MIX_ENV=dev - COPY .credo.exs . - COPY .formatter.exs . - RUN mix clean - RUN mix compile --warning-as-errors - RUN mix format --check-formatted - RUN mix credo --strict - -test: - FROM +deps --MIX_ENV=test - RUN apk add postgresql-client - COPY --dir config ./ - RUN MIX_ENV=test mix deps.compile - COPY docker-compose.ci.yml ./docker-compose.yml - COPY mix.exs mix.lock ./ - COPY .env-sample ./ - COPY --dir lib priv test ./ - - WITH DOCKER --compose docker-compose.yml - RUN while ! pg_isready --host=localhost --port=5432 --quiet; do sleep 1; done; \ - SUPABASE_KEY="123" SUPABASE_URL="123" DATABASE_USER="peapescarte" DATABASE_PASS="peapescarte" mix test - END - -docker-prod: - FROM DOCKERFILE . - ARG GITHUB_REPO - SAVE IMAGE --push ghcr.io/$GITHUB_REPO:prod - -docker-dev: - FROM +deps --MIX_ENV=dev - RUN apk update --no-cache - RUN apk add --no-cache inotify-tools nodejs npm - ENV MIX_ENV=dev - COPY --dir config ./ - RUN mix deps.compile - COPY --dir assets ./ - COPY --dir priv ./ - RUN mix compile - CMD ["mix", "dev"] - ARG GITHUB_REPO=peapescarte/pescarte-plataforma - SAVE IMAGE --push ghcr.io/$GITHUB_REPO:dev - -docker-dev-arm: - BUILD --platform=linux/arm64/v8 +docker-dev - -docker: - BUILD +docker-dev - BUILD +docker-prod diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml deleted file mode 100644 index 1f43c860..00000000 --- a/docker-compose.ci.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: "3.8" - -services: - database: - image: postgres:14.6 - container_name: plataforma_pescarte_database - environment: - - POSTGRES_USER=peapescarte - - POSTGRES_PASSWORD=peapescarte - ports: - - 5432:5432 - volumes: - - .postgres:/var/lib/postgresql/data From e17ec73f8814156d70d52af25f8a4dfecd2e4c58 Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Mon, 9 Sep 2024 18:45:23 -0300 Subject: [PATCH 3/9] fix: re-state arg from env in Dockerfile --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e3e273f3..37f391be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ ARG MIX_ENV=prod ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-alpine-${ALPINE_VERSION}" ARG RUNNER_IMAGE="alpine:${ALPINE_VERSION}" -FROM ${BUILDER_IMAGE} as builder +FROM ${BUILDER_IMAGE} AS builder # prepare build dir WORKDIR /app @@ -14,6 +14,8 @@ WORKDIR /app RUN apk update --no-cache RUN apk add --no-cache build-base gcc curl git wget nodejs npm +ARG MIX_ENV + # install hex + rebar RUN mix local.hex --force && \ mix local.rebar --force @@ -52,12 +54,14 @@ RUN mix release # start a new build stage so that the final image will only contain # the compiled release and other runtime necessities -FROM ${RUNNER_IMAGE} +FROM ${RUNNER_IMAGE} AS runner RUN apk update --no-cache RUN apk add --no-cache tzdata openssl ncurses wget RUN apk add --no-cache chromium --repository=http://dl-cdn.alpinelinux.org/alpine/v3.18/community +ARG MIX_ENV + ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 @@ -69,7 +73,7 @@ RUN chown nobody /app ENV MIX_ENV="prod" # Only copy the final release from the build stage -COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/pescarte ./ +COPY --from=builder --chown=nobody:root /app/_build/$MIX_ENV/rel/pescarte ./ USER nobody From d8f6ff4a9130d2faf903bf678b0f45d142b69ce8 Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Mon, 9 Sep 2024 19:17:44 -0300 Subject: [PATCH 4/9] fix: define project env on compile-time --- .github/workflows/ci.yml | 4 +--- lib/pescarte.ex | 4 +++- lib/pescarte/application.ex | 5 ----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ade40e3a..dce3e47d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,10 +145,9 @@ jobs: uses: docker/build-push-action@v6 with: context: . - from: ./Dockerfile push: true tags: ${{ env.IMAGE_NAME }}:dev - build-args: MIX_ENV="dev" + build-args: MIX_ENV=dev target: builder - name: Generate artifact attestation @@ -182,7 +181,6 @@ jobs: uses: docker/build-push-action@v6 with: context: . - from: ./Dockerfile push: true tags: ${{ env.IMAGE_NAME }}:prod diff --git a/lib/pescarte.ex b/lib/pescarte.ex index 9645c217..94128fc5 100644 --- a/lib/pescarte.ex +++ b/lib/pescarte.ex @@ -1,6 +1,8 @@ defmodule Pescarte do + @environment Application.compile_env!(:pescarte, :env) + def env do - Application.get_env(:pescarte, :env) + @environment end def get_static_file_path(folder, file) do diff --git a/lib/pescarte/application.ex b/lib/pescarte/application.ex index a4081c88..8d3b37e2 100644 --- a/lib/pescarte/application.ex +++ b/lib/pescarte/application.ex @@ -33,10 +33,5 @@ defmodule Pescarte.Application do Pescarte.Supabase, {Finch, name: PescarteHTTPClient} ] - |> maybe_append_children(Pescarte.env()) end - - defp maybe_append_children(children, :test), do: children - # defp maybe_append_children(children, _), do: [ChromicPDF | children] - defp maybe_append_children(children, _), do: children end From 46f4e3e81b54038757fc0473937261de86ae26ab Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Mon, 9 Sep 2024 20:15:25 -0300 Subject: [PATCH 5/9] fix: ditch faker from dev env --- Dockerfile | 6 +++--- lib/mix/tasks/seed.ex | 1 - lib/pescarte/application.ex | 4 +--- lib/seeder/identidades/contato.ex | 20 +++++++++---------- lib/seeder/modulo_pesquisa/campus.ex | 4 ++-- lib/seeder/modulo_pesquisa/linha_pesquisa.ex | 17 ++++++++-------- lib/seeder/modulo_pesquisa/nucleo_pesquisa.ex | 17 ++++++++-------- mix.exs | 8 ++++++-- 8 files changed, 40 insertions(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index 37f391be..3ab6d464 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,9 +62,9 @@ RUN apk add --no-cache chromium --repository=http://dl-cdn.alpinelinux.org/alpin ARG MIX_ENV -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 WORKDIR "/app" RUN chown nobody /app diff --git a/lib/mix/tasks/seed.ex b/lib/mix/tasks/seed.ex index f854a48e..fd6fec69 100644 --- a/lib/mix/tasks/seed.ex +++ b/lib/mix/tasks/seed.ex @@ -9,7 +9,6 @@ defmodule Mix.Tasks.Seed do @impl Mix.Task def run(_args) do Mix.Task.run("app.start", ["--preload-modules"]) - Faker.start() :ok = contato_seeds() :ok = usuario_seeds() diff --git a/lib/pescarte/application.ex b/lib/pescarte/application.ex index 8d3b37e2..4b69ea64 100644 --- a/lib/pescarte/application.ex +++ b/lib/pescarte/application.ex @@ -21,9 +21,7 @@ defmodule Pescarte.Application do :ok end - defp children do - if Pescarte.env() == :dev, do: Faker.start() - + def children do [ Pescarte.Database.Supervisor, PescarteWeb.Telemetry, diff --git a/lib/seeder/identidades/contato.ex b/lib/seeder/identidades/contato.ex index 9a3ecbe7..c3430460 100644 --- a/lib/seeder/identidades/contato.ex +++ b/lib/seeder/identidades/contato.ex @@ -7,28 +7,28 @@ defmodule Seeder.Identidades.Contato do [ %Contato{ email_principal: "dev.admin@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "943 Schuppe Row Suite 906", + celular_principal: "(63) 5906-7216" }, %Contato{ email_principal: "dev.user@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "99981 Nicolas Orchard Apt. 060", + celular_principal: "(62) 9 0254-9051" }, %Contato{ email_principal: "dev.user1@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "2 Shanny Shore Apt. 674", + celular_principal: "(71) 3570-5710" }, %Contato{ email_principal: "dev.user2@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "74132 Alessandra Place Apt. 299", + celular_principal: "(86) 9 4994-3367" }, %Contato{ email_principal: "dev.user3@pescarte.org.br", - endereco: Faker.Address.street_address(true), - celular_principal: Faker.Phone.PtBr.phone() + endereco: "6864 Suzanne Overpass Apt. 273", + celular_principal: "(92) 4225-7846" } ] end diff --git a/lib/seeder/modulo_pesquisa/campus.ex b/lib/seeder/modulo_pesquisa/campus.ex index eff10e0c..03dc1b85 100644 --- a/lib/seeder/modulo_pesquisa/campus.ex +++ b/lib/seeder/modulo_pesquisa/campus.ex @@ -9,13 +9,13 @@ defmodule Seeder.ModuloPesquisa.Campus do acronimo: "UENF", nome: "Campos dos Goytacazes", nome_universidade: "Universidade Estadual do Norte Fluminense Darcy Ribeiro", - endereco: Faker.Address.street_address(true) + endereco: "57 Georgette Hill Apt. 898" }, %Campus{ acronimo: "UFSCar", nome: "Sorocaba", nome_universidade: "Universidade Federal de São Carlos", - endereco: Faker.Address.street_address(true) + endereco: "8 Morris Inlet Suite 355" } ] end diff --git a/lib/seeder/modulo_pesquisa/linha_pesquisa.ex b/lib/seeder/modulo_pesquisa/linha_pesquisa.ex index 0433e8ff..176cea96 100644 --- a/lib/seeder/modulo_pesquisa/linha_pesquisa.ex +++ b/lib/seeder/modulo_pesquisa/linha_pesquisa.ex @@ -14,26 +14,27 @@ defmodule Seeder.ModuloPesquisa.LinhaPesquisa do [ %LinhaPesquisa{ numero: 1, - desc: Faker.Lorem.sentence(1..25), - desc_curta: Faker.Lorem.sentence(1..10), + desc: + "Praesentium architecto est fugit modi repudiandae amet architecto dolorem corrupti voluptas consequatur eveniet?", + desc_curta: "Velit qui repellat sunt harum.", nucleo_pesquisa: nucleo_pesquisa_by(letra: "A") }, %LinhaPesquisa{ numero: 2, - desc: Faker.Lorem.sentence(1..25), - desc_curta: Faker.Lorem.sentence(1..10), + desc: "Debitis culpa ex accusamus sequi?", + desc_curta: "Aliquam dolores.", nucleo_pesquisa: nucleo_pesquisa_by(letra: "B") }, %LinhaPesquisa{ numero: 3, - desc: Faker.Lorem.sentence(1..25), - desc_curta: Faker.Lorem.sentence(1..10), + desc: "Aspernatur repudiandae rerum.", + desc_curta: "Natus commodi provident sint et recusandae!", nucleo_pesquisa: nucleo_pesquisa_by(letra: "C") }, %LinhaPesquisa{ numero: 4, - desc: Faker.Lorem.sentence(1..25), - desc_curta: Faker.Lorem.sentence(1..10), + desc: "Voluptatem est rerum sit quia aut autem vero esse odit est quam optio quo dolor?", + desc_curta: "Minus.", nucleo_pesquisa: nucleo_pesquisa_by(letra: "D") } ] diff --git a/lib/seeder/modulo_pesquisa/nucleo_pesquisa.ex b/lib/seeder/modulo_pesquisa/nucleo_pesquisa.ex index a34af06c..88279e4f 100644 --- a/lib/seeder/modulo_pesquisa/nucleo_pesquisa.ex +++ b/lib/seeder/modulo_pesquisa/nucleo_pesquisa.ex @@ -7,23 +7,24 @@ defmodule Seeder.ModuloPesquisa.NucleoPesquisa do def entries do [ %NucleoPesquisa{ - nome: Faker.Lorem.sentence(1..8), - desc: Faker.Lorem.sentence(1..25), + nome: "Voluptatem eaque aliquam error.", + desc: "Provident libero aliquid impedit explicabo voluptatibus ea fugit atque!", letra: "A" }, %NucleoPesquisa{ - nome: Faker.Lorem.sentence(1..8), - desc: Faker.Lorem.sentence(1..25), + nome: "In tempore?", + desc: "Culpa vero est perferendis natus aut.", letra: "B" }, %NucleoPesquisa{ - nome: Faker.Lorem.sentence(1..8), - desc: Faker.Lorem.sentence(1..25), + nome: "Voluptatem nobis molestias.", + desc: "Cumque commodi odio illum distinctio consequatur?", letra: "C" }, %NucleoPesquisa{ - nome: Faker.Lorem.sentence(1..8), - desc: Faker.Lorem.sentence(1..25), + nome: "Sit qui nesciunt sint?", + desc: + "Non veritatis similique exercitationem similique expedita et eos corporis architecto.", letra: "D" } ] diff --git a/mix.exs b/mix.exs index 13c6a53b..7a8b7042 100644 --- a/mix.exs +++ b/mix.exs @@ -22,11 +22,15 @@ defmodule Pescarte.MixProject do ] end + def cli do + [preferred_envs: [seed: :test]] + end + def application do [mod: {Pescarte.Application, []}, extra_applications: [:logger]] end - defp elixirc_paths(e) when e in [:dev, :test], do: ["lib", "test/support"] + defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] defp deps do @@ -74,7 +78,7 @@ defmodule Pescarte.MixProject do {:phoenix_html_helpers, "~> 1.0"}, {:nimble_csv, "~> 1.1"}, {:sentry, "~> 10.2.0"}, - {:faker, "~> 0.18", only: [:dev, :test]}, + {:faker, "~> 0.18", only: :test}, {:dialyxir, "~> 1.3", only: [:dev], runtime: false}, {:credo, "~> 1.5", only: [:dev, :test], runtime: false}, # {:ex_doc, "> 0.0.0", only: [:dev, :test], runtime: false}, From 1cf8ded035406f3ac9d48043742b8026c99cfef4 Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Mon, 9 Sep 2024 20:28:33 -0300 Subject: [PATCH 6/9] fix: please DOCKER SAVE ME FROM THIS CRUEL LIFE --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dce3e47d..0111a68f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: ci env: REGISTRY: ghcr.io IMAGE_NAME: peapescarte/pescarte-plataforma + TAG: ghcr.io/peapescarte/pescarte-plataforma on: push: @@ -146,7 +147,7 @@ jobs: with: context: . push: true - tags: ${{ env.IMAGE_NAME }}:dev + tags: ${{ env.TAG }}:dev build-args: MIX_ENV=dev target: builder @@ -182,7 +183,7 @@ jobs: with: context: . push: true - tags: ${{ env.IMAGE_NAME }}:prod + tags: ${{ env.TAG }}:prod - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 From 63713b979bfe270d0fbdcf32c769323f14c9b2b7 Mon Sep 17 00:00:00 2001 From: Juan Cristo <99986112+juanzeen@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:41:57 -0300 Subject: [PATCH 7/9] Feat/responsivity publications (#212) * extract common tasks aliases * feat: responsivity for item-cards * fix: mix format * bug: testing git hooks --------- Co-authored-by: Zoey de Souza Pessanha --- assets/css/boletins.scss | 27 +++++ assets/css/landing.scss | 114 ++++++++++++++++++ .../templates/livros_html/show.html.heex | 8 +- 3 files changed, 145 insertions(+), 4 deletions(-) diff --git a/assets/css/boletins.scss b/assets/css/boletins.scss index a8ce45d8..edb8eb9e 100644 --- a/assets/css/boletins.scss +++ b/assets/css/boletins.scss @@ -3,3 +3,30 @@ width: 15.5rem; } } + +@media (min-width: 530px) and (max-width: 770px){ + + .boletim-wrapper { + .links-item { + @apply flex flex-col justify-start items-start m-8; + width: 60%; + height: 16rem; + border-radius: 8px; + box-sizing: border-box; + background: linear-gradient(180deg, rgba(16, 16, 16, 0) 0%, #101010 100%); + } + } +} +@media (min-width: 350px) and (max-width: 529px){ + + .boletim-wrapper { + .links-item { + @apply flex flex-col justify-start items-start m-8; + width: 70%; + height: 13rem; + border-radius: 8px; + box-sizing: border-box; + background: linear-gradient(180deg, rgba(16, 16, 16, 0) 0%, #101010 100%); + } + } +} diff --git a/assets/css/landing.scss b/assets/css/landing.scss index 35d5f1f0..b4bdb2ab 100644 --- a/assets/css/landing.scss +++ b/assets/css/landing.scss @@ -34,7 +34,10 @@ img { width: 100%; height: 100%; + max-width: 1100px; + max-height: 600px; background-size: cover; + margin: 0 auto; } } @@ -141,6 +144,7 @@ display: flex; flex-direction: column; align-items: center; + width: 100%; .publications-main-text { margin: 5rem 30rem; @@ -493,3 +497,113 @@ width: 1360px; } } + +@media (min-width: 530px) and (max-width: 770px){ + .links-landing { + @apply flex flex-col justify-center items-center ; + width: 100%; + + .links-item { + @apply flex flex-col justify-start items-start m-8; + width: 60%; + height: 16rem; + border-radius: 8px; + box-sizing: border-box; + background: linear-gradient(180deg, rgba(16, 16, 16, 0) 0%, #101010 100%); + + a { + @apply flex flex-col mt-auto; + } + + img { + border-radius: 8px; + width: inherit; + height: inherit; + @apply absolute; + z-index: -10; + } + + h3 { + padding-left: 1rem; + } + + p { + text-wrap: wrap; + margin-top: 0.5rem; + padding: 0 1rem 1.5rem 1rem; + } + + button { + width: 100%; + padding: 0 1rem 1.5rem 0; + background-color: transparent; + + p { + display: inline-flex; + width: inherit; + + &:hover { + text-decoration: underline; + } + } + } + } + } + +} + +@media (min-width: 350px) and (max-width: 529px){ + + + + .links-landing { + @apply flex flex-col justify-center items-center; + width: 100%; + + .links-item { + @apply flex flex-col justify-start items-start m-8; + width: 70%; + height: 13rem; + border-radius: 8px; + box-sizing: border-box; + background: linear-gradient(180deg, rgba(16, 16, 16, 0) 0%, #101010 100%); + + a { + @apply flex flex-col mt-auto; + } + + img { + border-radius: 8px; + width: inherit; + height: inherit; + @apply absolute; + z-index: -10; + } + + h3 { + padding-left: 1rem; + } + + p { + text-wrap: wrap; + margin-top: 0.5rem; + padding: 0 1rem 1.5rem 1rem; + } + + button { + width: 100%; + padding: 0 1rem 1.5rem 0; + background-color: transparent; + + p { + display: inline-flex; + width: inherit; + + &:hover { + text-decoration: underline; + } + } + } + } + } +} diff --git a/lib/pescarte_web/templates/livros_html/show.html.heex b/lib/pescarte_web/templates/livros_html/show.html.heex index 5db0f2b2..b8257554 100644 --- a/lib/pescarte_web/templates/livros_html/show.html.heex +++ b/lib/pescarte_web/templates/livros_html/show.html.heex @@ -7,7 +7,7 @@
diff --git a/lib/pescarte_web/templates/landing_html/show.html.heex b/lib/pescarte_web/templates/landing_html/show.html.heex index 1f6e0ce8..84d7558d 100644 --- a/lib/pescarte_web/templates/landing_html/show.html.heex +++ b/lib/pescarte_web/templates/landing_html/show.html.heex @@ -2,8 +2,8 @@ <.flash :if={@error_message} id="login-error" kind={:error}> <%= @error_message %> - - +
<.text size="h2" color="text-blue-100">Notícias
@@ -286,10 +264,9 @@
- +