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
1 change: 1 addition & 0 deletions app/controllers/passwords_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class PasswordsController < ApplicationController
layout "login"
allow_unauthenticated_access
before_action :set_user_by_token, only: %i[ edit update ]

Expand Down
14 changes: 14 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
module ApplicationHelper
# Adicionamos o argumento 'active_condition: false'
def menu_button_classes(path, active_condition: false)
base_classes = "flex items-center justify-center w-[257px] h-[46px] font-roboto py-[11px] px-[50px] border-b border-transparent shadow-lg rounded cursor-pointer gap-[10px] opacity-100 no-underline"

active_style = "bg-project-purple text-white hover:bg-project-purple-dark"
inactive_style = "bg-white text-black hover:bg-gray-100"

# O botão fica roxo se: for a página exata OU a condição extra for verdadeira
if current_page?(path) || active_condition
"#{base_classes} #{active_style}"
else
"#{base_classes} #{inactive_style}"
end
end
end
1 change: 1 addition & 0 deletions app/views/avaliacoes/gestao_envios.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% content_for :page_title, "Gerenciamento - Gestão de Envios" %>
<div class="container mx-auto px-4 py-8">
<div class="flex justify-between items-center mb-6">
<h1 class="text-3xl font-bold text-gray-800">Gestão de Envios</h1>
Expand Down
1 change: 1 addition & 0 deletions app/views/avaliacoes/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% content_for :page_title, "Avaliações" %>
<div class="min-h-screen bg-gray-50 p-6">
<div class="max-w-7xl mx-auto">
<h1 class="text-3xl font-bold text-gray-900 mb-8">Minhas Turmas</h1>
Expand Down
1 change: 1 addition & 0 deletions app/views/avaliacoes/resultados.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% content_for :page_title, "Gerenciamento - Gestão de Envios - Resultados" %>
<div class="container mx-auto px-4 py-8">
<div class="flex justify-between items-center mb-6">
<h1 class="text-3xl font-bold text-gray-800">Resultados da Avaliação</h1>
Expand Down
1 change: 1 addition & 0 deletions app/views/components/_dashBoardAdmin.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% content_for :page_title, "Gerenciamento" %>
<div class="flex items-center justify-center font-roboto">
<div class="bg-white w-[462px] h-[655px] flex item-center justify-center">
<div class="flex flex-col items-center justify-center space-y-2 text-white font-bold">
Expand Down
13 changes: 0 additions & 13 deletions app/views/components/_frameBrancoMenuLateral.html.erb

This file was deleted.

13 changes: 0 additions & 13 deletions app/views/components/_frameRoxoMenuLateral.html.erb

This file was deleted.

25 changes: 25 additions & 0 deletions app/views/components/_framesMenuLateral.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<%
gerenciamento_controllers = ['sigaa_imports', 'modelos', 'dashboard', 'home']
avaliacoes_controllers = ['avaliacoes', 'respostas']
actions_gerenciamento_em_avaliacoes = ['gestao_envios', 'resultados']

is_gerenciamento_active = controller_name.in?(gerenciamento_controllers) ||
(controller_name.in?(avaliacoes_controllers) && action_name.in?(actions_gerenciamento_em_avaliacoes))

is_avaliacoes_active = (controller_name.in?(avaliacoes_controllers) && !action_name.in?(actions_gerenciamento_em_avaliacoes))
%>

<%= link_to "Avaliações", avaliacoes_path,
class: menu_button_classes(avaliacoes_path, active_condition: is_avaliacoes_active) %>

<% if Current.session&.user&.eh_admin? %>
<%= link_to "Gerenciamento", root_path,
class: menu_button_classes(root_path, active_condition: is_gerenciamento_active) %>
<% end %>







2 changes: 1 addition & 1 deletion app/views/components/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<!-- Tab / Page Title -->
<h1 class="font-roboto text-xl font-normal text-gray-900 truncate">
Avaliações
<%= content_for?(:page_title) ? yield(:page_title) : "" %>
</h1>
</div>

Expand Down
5 changes: 1 addition & 4 deletions app/views/components/_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
class="w-[257px] bg-white h-full flex flex-col shadow-lg overflow-hidden flex-shrink-0 relative z-10 transition-[width] duration-300 ease-in-out border-r border-gray-200">

<nav class="flex-1 flex flex-col overflow-y-auto">
<%= render "components/frameRoxoMenuLateral"%>
<% if Current.session&.user&.eh_admin? %>
<%= render "components/frameBrancoMenuLateral" %>
<% end %>
<%= render "components/framesMenuLateral"%>
</nav>

</aside>
1 change: 1 addition & 0 deletions app/views/modelos/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<%# app/views/modelos/index.html.erb %>
<% content_for :page_title, "Gerenciamento - Modelos de Formulário" %>
<div class="mb-8">
<div class="flex justify-between items-center mb-6">
<div>
Expand Down
1 change: 1 addition & 0 deletions app/views/respostas/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<%# app/views/respostas/new.html.erb - Feature 99: Responder Avaliação %>
<% content_for :page_title, "Avaliações - Respostas" %>
<div class="max-w-4xl mx-auto p-6">
<div class="mb-6 bg-white rounded-lg shadow-sm p-6">
<h1 class="text-2xl font-bold text-gray-900 mb-2">
Expand Down
1 change: 1 addition & 0 deletions app/views/sigaa_imports/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% content_for :page_title, "Gerenciamento - Importar dados" %>
<div class="max-w-2xl mx-auto p-6">
<div class="bg-white rounded-lg shadow-md p-8">
<h1 class="text-2xl font-bold text-gray-900 mb-6">Importar Dados do SIGAA</h1>
Expand Down
1 change: 1 addition & 0 deletions app/views/sigaa_imports/success.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% content_for :page_title, "Gerenciamento - Importar dados - Sucesso" %>
<div class="min-h-screen bg-gray-50 p-6">
<div class="max-w-5xl mx-auto">
<div class="bg-white rounded-lg shadow-lg p-8">
Expand Down