Skip to content

Commit

Permalink
filtro network
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmspter committed Oct 26, 2024
1 parent 06455f7 commit 71c7838
Show file tree
Hide file tree
Showing 20 changed files with 219 additions and 93 deletions.
49 changes: 36 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
# README

This README would normally document whatever steps are necessary to get the
application up and running.
# Rookie Coder Network

Things you may want to cover:

* Ruby version
O Rookie Coder Network é um ambicioso projeto dedicado a oferecer suporte gratuito e personalizado para aqueles que estão dando os primeiros passos na área de Tecnologia da Informação (TI). Nosso principal objetivo é proporcionar um ambiente acolhedor e educacional, onde iniciantes possam trilhar caminhos específicos de aprendizado de acordo com suas áreas de interesse.

* System dependencies
Nossa abordagem inovadora se baseia em fornecer roadmaps personalizados, elaborados cuidadosamente para atender às necessidades individuais de cada estudante. Ao identificar a área específica de interesse, seja desenvolvimento de software, administração de sistemas, segurança cibernética ou outros campos, oferecemos direcionamentos claros e recursos relevantes para impulsionar o aprendizado.

* Configuration

* Database creation
## Demonstração

* Database initialization
![alt text](https://github.com/Rafazg/open-source/blob/main/DesignPaginaInicialFigma.png?raw=true)

* How to run the test suite

* Services (job queues, cache servers, search engines, etc.)

* Deployment instructions

* ...
## FAQ

### Quais recursos são oferecidos pelo Rookie Coder Network?

Oferecemos roadmaps personalizados com base nas áreas de interesse de cada estudante, orientações de mentores experientes, uma comunidade ativa para interação e troca de conhecimentos, além de recursos educacionais gratuitos.

### Como posso obter um roadmap personalizado?

Ao se juntar à nossa comunidade, você terá acesso a um quiz que nos ajudarão a entender suas áreas de interesse e nível de conhecimento. Com base nessas informações, criaremos um roadmap personalizado para você.

### O suporte do Rookie Coder Network é gratuito?

Sim, todo o suporte e recursos oferecidos pelo Rookie Coder Network são totalmente gratuitos. Acreditamos que o acesso à educação de qualidade em TI não deve ser um impedimento, e nosso compromisso é fornecer apoio sem custos.

### Há oportunidades para interação com outros membros da comunidade?

Sim, encorajamos ativamente a interação entre os membros. Temos fóruns de discussão, canais de chat e eventos online onde os estudantes podem compartilhar experiências, fazer perguntas e colaborar em projetos.

### Como posso contribuir para o Rookie Coder Network?

Se você é um profissional experiente disposto a se tornar mentor, ou se deseja contribuir com recursos educacionais, entre em contato conosco. Valorizamos a colaboração e a construção coletiva do conhecimento.

## Autores

- [@Rafazg](https://github.com/Rafazg)
- [@MattSouza14](https://github.com/MattSouza14)
- [@AnaLuiza]()
- [@IsabeladpCastro](https://github.com/IsabeladpCastro)
- [@JamesPeter](https://github.com/Jmspter)
- [@Saymonmedeiros](https://github.com/saymonmedeiros)

1 change: 1 addition & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
//= link actiontext.css
//= link_tree ../builds
9 changes: 1 addition & 8 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ trix-toolbar .trix-button--icon-bullet-list {
trix-toolbar .trix-button--icon-number-list {
display: none !important;
}

/* Ocultar o botão de diminuir nível (decrease level) */
trix-toolbar .trix-button--icon-decrease-indent {
display: none !important;
}

/* Ocultar o botão de aumentar nível (increase level) */
trix-toolbar .trix-button--icon-increase-indent {
trix-button .trix-button--icon .trix-button--icon-increase-nesting-level{
display: none !important;
}
38 changes: 38 additions & 0 deletions app/assets/stylesheets/application.tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,42 @@
@tailwind components;
@tailwind utilities;

@import 'actiontext.css';

/* Estilizando o fundo e o texto do editor */
trix-editor {
background-color: #1e1e1e;
/* Cor de fundo escura */
color: #d4d4d4;
/* Cor do texto clara */
}

/* Estilizando a barra de ferramentas */
trix-toolbar {
border: none;
/* Remover a borda se necessário */
}

/* Estilizando os ícones do FontAwesome */
trix-toolbar .trix-button-icon i {
color: #d4d4d4;
/* Cor dos ícones */
font-size: 1rem;
/* Ajuste o tamanho se necessário */
}

trix-toolbar .trix-button-group button {
background-color: whitesmoke;
}

trix-toolbar .trix-button--icon-bullet-list {
display: none !important;
}

/* Ocultar o botão de lista numerada (numbers) */
trix-toolbar .trix-button--icon-number-list {
display: none !important;
}
trix-button .trix-button--icon .trix-button--icon-increase-nesting-level{
display: none !important;
}
6 changes: 4 additions & 2 deletions app/controllers/articles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ class ArticlesController < ApplicationController
# GET /articles or /articles.json
def index
@active_nav_item = 'network'

if params[:category]
@articles = Article.where(category: params[:category])
@articles = Article.where(category: params[:category]).order(created_at: :desc)
else
@articles = Article.all
@articles = Article.all.order(created_at: :desc)
end
end



# GET /articles/1 or /articles/1.json
def show
Expand Down
32 changes: 26 additions & 6 deletions app/views/articles/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<div class="w-3/4 text-white h-screen ml-5">


<% content_for :title, "Articles" %>

<h1 class="font-bold text-4xl">Network</h1>
<h1 class="font-bold text-4xl text-center">Network</h1>

<%= form_with url: articles_path, method: :get, local: true, class: "my-5" do %>
<%= select_tag :category, options_for_select(Article::CATEGORIES, params[:category]), prompt: "Filtrar por categoria", class: "bg-zinc-700 text-white rounded-md py-2 px-4" %>
<%= submit_tag 'Filtrar', class: "ml-2 bg-lime-600 text-white rounded-md py-2 px-4" %>
<%= form_with url: articles_path, method: :get, local: true, class: "my-5 mx-5" do %>
<%= select_tag :category, options_for_select(Article::CATEGORIES, params[:category]), prompt: "Filtrar por categoria", id: "category_select", class: "bg-zinc-700 text-white rounded-md py-2 px-4" %>
<%= submit_tag 'Filtrar', id: "filter_button", class: "ml-2 bg-lime-600 text-white rounded-md py-2 px-4", disabled: true %>

<% if params[:category].present? %>
<%= link_to 'Limpar', articles_path, class: "ml-2 bg-red-600 text-white rounded-md py-2 px-4" %>
<% end %>
<% end %>

<div class="w-3/4 text-white h-screen ml-5">
<div id="articles" class="min-w-full">
<% @articles.each do |article| %>
<div class="my-5 p-4 bg-zinc-700 rounded-md">
Expand All @@ -26,3 +30,19 @@
<% end %>

</div>

<script type="module">
document.addEventListener('turbo:load', () => {
const select = document.getElementById('category_select');
const filterButton = document.getElementById('filter_button');

select.addEventListener('change', () => {
if (select.value) {
filterButton.disabled = false;
} else {
filterButton.disabled = true;
}
});
});
</script>

6 changes: 3 additions & 3 deletions app/views/devise/mailer/confirmation_instructions.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>Welcome <%= @email %>!</p>
<p>Bem-vindo <%= @resource.name %>!</p>

<p>You can confirm your account email through the link below:</p>
<p>Você pode confirmar o e-mail da sua conta através do link abaixo:</p>

<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
<p><%= link_to 'Confirmar minha conta', confirmation_url(@resource, confirmation_token: @token) %></p>
6 changes: 3 additions & 3 deletions app/views/devise/mailer/email_changed.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p>Hello <%= @email %>!</p>
<p>Olá <%= @resource.name %>!</p>

<% if @resource.try(:unconfirmed_email?) %>
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
<p>Estamos entrando em contato com você para notificá-lo de que seu e-mail será alterado para <%= @resource.unconfirmed_email %>.</p>
<% else %>
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
<p>Estamos entrando em contato com você para notificá-lo de que seu e-mail foi alterado para <%= @resource.email %>.</p>
<% end %>
4 changes: 2 additions & 2 deletions app/views/devise/mailer/password_change.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>Hello <%= @resource.email %>!</p>
<p>Olá <%= @resource.name %>!</p>

<p>We're contacting you to notify you that your password has been changed.</p>
<p>Estamos entrando em contato com você para notificá-lo de que sua senha foi alterada.</p>
10 changes: 5 additions & 5 deletions app/views/devise/mailer/reset_password_instructions.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<p>Hello <%= @resource.email %>!</p>
<p>Olá <%= @resource.name %>!</p>

<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p>Alguém solicitou um link para alterar sua senha. Você pode fazer isso através do link abaixo.</p>

<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p><%= link_to 'Alterar minha senha', edit_password_url(@resource, reset_password_token: @token) %></p>

<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
<p>Se você não solicitou isso, ignore este e-mail.</p>
<p>Sua senha não será alterada até que você acesse o link acima e crie uma nova.</p>
8 changes: 4 additions & 4 deletions app/views/devise/mailer/unlock_instructions.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p>Hello <%= @resource.email %>!</p>
<p>Olá <%= @resource.name %>!</p>

<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
<p>Sua conta foi bloqueada devido a um número excessivo de tentativas de login malsucedidas.</p>

<p>Click the link below to unlock your account:</p>
<p>Clique no link abaixo para desbloquear sua conta:</p>

<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
<p><%= link_to 'Desbloquear minha conta', unlock_url(@resource, unlock_token: @token) %></p>
59 changes: 35 additions & 24 deletions app/views/devise/passwords/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
<h2>Change your password</h2>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<%= f.hidden_field :reset_password_token %>

<div class="field">
<%= f.label :password, "New password" %><br />
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
<% end %>
<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
<section>
<div class="flex flex-col items-center justify-center px-6 py-8 mx-auto md:h-screen lg:py-0">
<a href="/" class="flex items-center mb-6 w-40">
<%= image_tag "rokie.png" %>
</a>
<div class="w-full p-6 rounded-lg shadow border md:mt-0 sm:max-w-md bg-gray-800 border-gray-700 sm:p-8">
<h2 class="mb-1 text-xl font-bold leading-tight tracking-tight md:text-2xl text-white">
Alterar a senha
</h2>
<div class="flex items-center p-4 mb-4 text-sm text-yellow-800 border border-yellow-300 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300 dark:border-yellow-800" role="alert">
<svg class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
</svg>
<span class="sr-only">Info</span>
<div>
<span class="font-medium">Alerta de aviso! </span>mínimo de caracteres: <%= @minimum_password_length %>
</div>
</div>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<div class="mt-4 space-y-4 lg:mt-5 md:space-y-5">
<%= render "devise/shared/error_messages", resource: resource %>
<%= f.hidden_field :reset_password_token %>
<div>
<%= f.label :password, "Nova Senha", class:"block mb-2 text-sm font-medium dark:text-white" %>
<%= f.password_field :password, autofocus: true, autocomplete: "new-password", placeholder:"••••••", class:"border border-gray-600 text-sm rounded-lg focus:border-lime-500 block w-full p-2.5 bg-gray-700 placeholder-gray-400 text-white focus:ring-lime-500" %>
</div>
<div>
<%= f.label :password_confirmation, "Confirme a nova senha", class:"block mb-2 text-sm font-medium dark:text-white" %>
<%= f.password_field :password_confirmation, autocomplete: "new-password", placeholder:"••••••", class:"border border-gray-600 text-sm rounded-lg focus:border-lime-500 block w-full p-2.5 bg-gray-700 placeholder-gray-400 text-white focus:ring-lime-500" %>
</div>
<%= f.submit "Redefinir senha", class:"w-full text-white bg-lime-600 hover:bg-lime-700 focus:ring-4 focus:outline-none focus:ring-lime-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center" %>
</div>
<% end %>
</div>
</div>

<div class="field">
<%= f.label :password_confirmation, "Confirm new password" %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
</div>

<div class="actions">
<%= f.submit "Change my password" %>
</div>
<% end %>

<%= render "devise/shared/links" %>
</section>
37 changes: 22 additions & 15 deletions app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
<h2>Forgot your password?</h2>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>

<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
<section>
<div class="flex flex-col items-center justify-center px-6 py-8 mx-auto md:h-screen lg:py-0">
<a href="/" class="flex items-center mb-6 w-40">
<%= image_tag "rokie.png" %>
</a>
<div class="w-full p-6 rounded-lg shadow border md:mt-0 sm:max-w-md bg-gray-800 border-gray-700 sm:p-8">
<h1 class="mb-1 text-xl font-bold leading-tight tracking-tight md:text-2xl text-white">
Esqueceu sua senha?
</h1>
<p class="font-light text-gray-400">Não se preocupe! Basta digitar seu e-mail e enviaremos um código para redefinir sua senha!</p>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<div class="mt-4 space-y-4 lg:mt-5 md:space-y-5">
<%= render "devise/shared/error_messages", resource: resource %>
<div>
<%= f.label :email, class:"block mb-2 text-sm font-medium dark:text-white" %>
<%= f.email_field :email, autofocus: true, autocomplete: "email", class:"bg-gray-700 border border-gray-600 text-sm rounded-lg block w-full p-2.5 placeholder-gray-400 text-white focus:ring-lime-500 focus:border-lime-500", placeholder:"[email protected]" %>
</div>
<%= f.submit "Redefinir senha", class:"w-full text-white bg-lime-600 hover:bg-lime-700 focus:ring-4 focus:outline-none focus:ring-lime-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center focus:ring-lime-800" %>
</div>
<% end %>
</div>
</div>

<div class="actions">
<%= f.submit "Send me reset password instructions" %>
</div>
<% end %>

<%= render "devise/shared/links" %>
</section>
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div>
<div class="flex items-center justify-between">
<%= f.label :password, 'Senha', class:"block text-sm font-medium leading-6 text-gray-50" %>
<div class="text-sm hidden">
<div class="text-sm">
<%= link_to "Esqueceu sua senha?", new_password_path(resource_name), class:"font-semibold text-lime-600 hover:text-lime-500" %>
</div>
</div>
Expand Down
16 changes: 14 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,23 @@
</head>

<body class="bg-gray-950 text-white">
<p class="alert"><%= alert %></p>
<main class="bg-gray-950 text-white">
<%= render 'layouts/nav' %>
<% if alert.present? %>
<div class="relative py-2 px-3 bg-red-50 mb-5 text-red-500 font-medium rounded-lg inline-block" id="alert">
<span><%= alert %></span>
<button class="absolute top-0 right-0 mt-1 mr-1 text-red-500 hover:text-red-700 text-2xl leading-none" onclick="document.getElementById('alert').style.display = 'none';">
&times;
</button>
</div>
<% end %>
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<div class="relative py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice">
<span class="pr-2"><%= notice %></span>
<button class="absolute top-0 right-0 mt-1 mr-1 text-green-500 hover:text-green-700 text-2xl leading-none" onclick="document.getElementById('notice').style.display = 'none';">
&times;
</button>
</div>
<% end %>
<%= yield %>
<%= render 'layouts/footer' %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="md:w-1/2 mx-5">
<h1 class="mb-4 text-4xl font-extrabold leading-none tracking-tight md:text-5xl lg:text-6xl">JUNTOS, VAMOS TRANSFORMAR CÓDIGOS EM CONQUISTAS!</h1>
<p class="mb-6 text-lg font-normal text-gray-400 lg:text-xl">Empoderando novos desenvolvedores a trilharem seu caminho no mundo da programação!</p>
<a href="#" class="inline-flex items-center justify-center px-5 py-3 text-base font-medium text-center bg-lime-700 rounded-lg hover:bg-lime-800 focus:ring-4 focus:ring-lime-300 dark:focus:ring-lime-900">
<a href="/articles" class="inline-flex items-center justify-center px-5 py-3 text-base font-medium text-center bg-lime-700 rounded-lg hover:bg-lime-800 focus:ring-4 focus:ring-lime-300 dark:focus:ring-lime-900">
Bora começar
<svg class="w-3.5 h-3.5 ms-2 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
Expand Down
4 changes: 2 additions & 2 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
default: &default
adapter: postgresql
encoding: unicode
username:
password:
username: postgres
password: Jam10Bi@
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>


Expand Down
Loading

0 comments on commit 71c7838

Please sign in to comment.