Skip to content
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
94 changes: 94 additions & 0 deletions app/assets/stylesheets/login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
body {
background: #efefef;
margin: 0;
font-family: Arial, sans-serif;
}

.login-container {
width: 90%;
max-width: 1100px;
height: 500px;

margin: 40px auto;

display: flex;

background: white;
border-radius: 10px;

overflow: hidden;
}

.login-form {
flex: 1;

display: flex;
flex-direction: column;
justify-content: center;

padding: 50px;
}

.login-form h1 {
text-align: center;
margin-bottom: 40px;
}

.field {
margin-bottom: 20px;
}

.field label {
display: block;
margin-bottom: 8px;
}

.field input {
width: 100%;
box-sizing: border-box;

padding: 12px;

border: 1px solid #ccc;
border-radius: 6px;
}

.btn-login {
width: 100%;

padding: 12px;

border: none;
border-radius: 6px;

background: #2ecc71;
color: white;

cursor: pointer;

font-size: 16px;
}

.btn-login:hover {
opacity: 0.9;
}

.btn-forgot {
margin-top: 15px;
}

.login-banner {
flex: 1;

background: #6d1f6d;

display: flex;
justify-content: center;
align-items: center;
}

.login-banner h2 {
color: white;
text-align: center;
font-size: 4rem;
}
83 changes: 83 additions & 0 deletions app/assets/stylesheets/redefinir_senha.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
html,
body {
margin: 0;
padding: 0;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
background-color: #f5f5f5;
}

.password-reset-container {
height: 100vh;

display: flex;
justify-content: center;
align-items: center;
}

.password-reset-box {
width: 100%;
max-width: 450px;

background: white;

padding: 40px;

border-radius: 10px;

box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

box-sizing: border-box;
}

.password-reset-box h1 {
text-align: center;

margin-top: 0;
margin-bottom: 30px;

font-size: 2rem;
font-weight: normal;
}

.field {
display: flex;
flex-direction: column;

margin-bottom: 20px;
}

.field label {
margin-bottom: 8px;
}

.field input {
padding: 12px;

border: 1px solid #d0d0d0;
border-radius: 6px;

font-size: 1rem;
box-sizing: border-box;
}

.btn-submit {
width: 100%;

padding: 12px;

border: none;
border-radius: 6px;

background-color: #6e1f69;
color: white;

font-size: 1rem;
font-weight: bold;

cursor: pointer;
}

.btn-submit:hover {
opacity: 0.9;
}
2 changes: 1 addition & 1 deletion app/models/discente.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Discente < Usuario
validates :curso_id, presence: true

Check failure on line 2 in app/models/discente.rb

View workflow job for this annotation

GitHub Actions / lint

Layout/TrailingWhitespace: Trailing whitespace detected.
has_and_belongs_to_many :turmas
has_and_belongs_to_many :turmas, join_table: "discentes_turmas"
end

Check failure on line 4 in app/models/discente.rb

View workflow job for this annotation

GitHub Actions / lint

Layout/TrailingEmptyLines: Final newline missing.
2 changes: 1 addition & 1 deletion app/models/docente.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Docente < Usuario
validates :formacao, presence: true
has_and_belongs_to_many :turmas
has_and_belongs_to_many :turmas, join_table: "docentes_turmas"
end
4 changes: 2 additions & 2 deletions app/models/turma.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Turma < ApplicationRecord
belongs_to :disciplina
has_many :formularios, dependent: :destroy
has_and_belongs_to_many :discentes
has_and_belongs_to_many :docentes
has_and_belongs_to_many :discentes, join_table: "discentes_turmas"
has_and_belongs_to_many :docentes, join_table: "docentes_turmas"

validates :numero_da_turma, presence: true, uniqueness: {
scope: [:semestre, :disciplina_id],
Expand Down
25 changes: 16 additions & 9 deletions app/views/redefinicao_senhas/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<h1>Redefinição de senha</h1>
<div class="password-reset-container">
<div class="password-reset-box">

<%= form_with url: redefinir_senha_path do %>
<div>
<%= label_tag :email, "Email" %>
<%= email_field_tag :email %>
</div>
<h1>Redefinição de senha</h1>

<%= form_with url: redefinir_senha_path do %>

<div class="field">
<%= label_tag :email, "Email" %>
<%= email_field_tag :email %>
</div>

<%= submit_tag "Solicitar redefinição",
class: "btn-submit" %>

<% end %>

<div>
<%= submit_tag "Solicitar redefinição" %>
</div>
<% end %>
</div>
39 changes: 25 additions & 14 deletions app/views/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
<h1>Login</h1>
<div class="login-container">
<div class="login-form">
<h1>LOGIN</h1>

<%= form_with url: login_path do %>
<div>
<%= label_tag :login, "Email ou matrícula" %>
<%= text_field_tag :login %>
</div>
<%= form_with url: login_path do %>

<div>
<%= label_tag :senha, "Senha" %>
<%= password_field_tag :senha %>
</div>
<div class="field">
<%= label_tag :login, "Email ou matrícula" %>
<%= text_field_tag :login, nil, placeholder: "aluno@aluno.unb.br" %>
</div>

<div class="field">
<%= label_tag :senha, "Senha" %>
<%= password_field_tag :senha, nil, placeholder: "Password" %>
</div>

<div>
<%= submit_tag "Entrar" %>
<%= submit_tag "Entrar", class: "btn-login" %>
<% end %>

<%= button_to "Esqueci minha senha", redefinir_senha_path, method: :get, class: "btn-forgot" %>
</div>
<% end %>

<%= button_to "Esqueci minha senha", redefinir_senha_path, method: :get %>
<div class="login-banner">
<h2>
Bem vindo<br>
ao<br>
Camaar
</h2>
</div>
</div>
4 changes: 2 additions & 2 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ default: &default
adapter: mysql2
encoding: utf8mb4
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username: root
password: root
username: camaar
password: senha_do_camaar
socket: /var/run/mysqld/mysqld.sock

development:
Expand Down
Loading
Loading