diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 0c4b4a8933..8c765297dd 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -1,4 +1,5 @@ class PasswordsController < ApplicationController + layout "login" allow_unauthenticated_access before_action :set_user_by_token, only: %i[ edit update ] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be7945c..4a67dcafa3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/views/avaliacoes/gestao_envios.html.erb b/app/views/avaliacoes/gestao_envios.html.erb index 418a0b3d9f..b53729dc4e 100644 --- a/app/views/avaliacoes/gestao_envios.html.erb +++ b/app/views/avaliacoes/gestao_envios.html.erb @@ -1,3 +1,4 @@ +<% content_for :page_title, "Gerenciamento - Gestão de Envios" %>

Gestão de Envios

diff --git a/app/views/avaliacoes/index.html.erb b/app/views/avaliacoes/index.html.erb index 1db9241a8d..03d1cbf398 100644 --- a/app/views/avaliacoes/index.html.erb +++ b/app/views/avaliacoes/index.html.erb @@ -1,3 +1,4 @@ +<% content_for :page_title, "Avaliações" %>

Minhas Turmas

diff --git a/app/views/avaliacoes/resultados.html.erb b/app/views/avaliacoes/resultados.html.erb index 616a8bb53c..532c50a395 100644 --- a/app/views/avaliacoes/resultados.html.erb +++ b/app/views/avaliacoes/resultados.html.erb @@ -1,3 +1,4 @@ +<% content_for :page_title, "Gerenciamento - Gestão de Envios - Resultados" %>

Resultados da Avaliação

diff --git a/app/views/components/_dashBoardAdmin.html.erb b/app/views/components/_dashBoardAdmin.html.erb index d590155a30..085150d91a 100644 --- a/app/views/components/_dashBoardAdmin.html.erb +++ b/app/views/components/_dashBoardAdmin.html.erb @@ -1,3 +1,4 @@ +<% content_for :page_title, "Gerenciamento" %>
diff --git a/app/views/components/_frameBrancoMenuLateral.html.erb b/app/views/components/_frameBrancoMenuLateral.html.erb deleted file mode 100644 index de705b7d8f..0000000000 --- a/app/views/components/_frameBrancoMenuLateral.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<%= link_to "Gerenciamento", root_path, - class: "flex items-center justify-center - w-[257px] h-[46px] - bg-white - text-black - font-roboto - py-[11px] px-[50px] - border-b border-transparent - shadow-lg - rounded - cursor-pointer - gap-[10px] opacity-100 hover:bg-gray-100 no-underline" -%> \ No newline at end of file diff --git a/app/views/components/_frameRoxoMenuLateral.html.erb b/app/views/components/_frameRoxoMenuLateral.html.erb deleted file mode 100644 index 56b3971a14..0000000000 --- a/app/views/components/_frameRoxoMenuLateral.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<%= link_to "Avaliações", avaliacoes_path, - class: "flex items-center justify-center - w-[257px] h-[46px] - bg-project-purple - text-white - font-roboto - py-[11px] px-[50px] - border-b border-transparent - shadow-lg - rounded - cursor-pointer - gap-[10px] opacity-100 hover:bg-project-purple-dark no-underline" -%> \ No newline at end of file diff --git a/app/views/components/_framesMenuLateral.html.erb b/app/views/components/_framesMenuLateral.html.erb new file mode 100644 index 0000000000..de1d9ad4dc --- /dev/null +++ b/app/views/components/_framesMenuLateral.html.erb @@ -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 %> + + + + + + + diff --git a/app/views/components/_header.html.erb b/app/views/components/_header.html.erb index 03def9e420..655c3e14d7 100644 --- a/app/views/components/_header.html.erb +++ b/app/views/components/_header.html.erb @@ -17,7 +17,7 @@

- Avaliações + <%= content_for?(:page_title) ? yield(:page_title) : "" %>

diff --git a/app/views/components/_sidebar.html.erb b/app/views/components/_sidebar.html.erb index c98d168397..3cf72f0168 100644 --- a/app/views/components/_sidebar.html.erb +++ b/app/views/components/_sidebar.html.erb @@ -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"> \ No newline at end of file diff --git a/app/views/modelos/index.html.erb b/app/views/modelos/index.html.erb index 9967136e5e..8e6b9b8662 100644 --- a/app/views/modelos/index.html.erb +++ b/app/views/modelos/index.html.erb @@ -1,4 +1,5 @@ <%# app/views/modelos/index.html.erb %> +<% content_for :page_title, "Gerenciamento - Modelos de Formulário" %>
diff --git a/app/views/respostas/new.html.erb b/app/views/respostas/new.html.erb index 2f275b5a56..354840a0d1 100644 --- a/app/views/respostas/new.html.erb +++ b/app/views/respostas/new.html.erb @@ -1,4 +1,5 @@ <%# app/views/respostas/new.html.erb - Feature 99: Responder Avaliação %> +<% content_for :page_title, "Avaliações - Respostas" %>

diff --git a/app/views/sigaa_imports/new.html.erb b/app/views/sigaa_imports/new.html.erb index e2235d602e..19a1b15afc 100644 --- a/app/views/sigaa_imports/new.html.erb +++ b/app/views/sigaa_imports/new.html.erb @@ -1,3 +1,4 @@ +<% content_for :page_title, "Gerenciamento - Importar dados" %>

Importar Dados do SIGAA

diff --git a/app/views/sigaa_imports/success.html.erb b/app/views/sigaa_imports/success.html.erb index 999665e34b..94a2cd69fc 100644 --- a/app/views/sigaa_imports/success.html.erb +++ b/app/views/sigaa_imports/success.html.erb @@ -1,3 +1,4 @@ +<% content_for :page_title, "Gerenciamento - Importar dados - Sucesso" %>