From eeec5705d98535f3b5e44dd8ccbccfa6eda1e223 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Thu, 9 Apr 2015 17:21:49 +0300 Subject: [PATCH] registrar flash cleanup --- app/controllers/registrar/depp_controller.rb | 4 ++++ app/controllers/registrar_controller.rb | 5 +++++ app/views/layouts/registrar/application.haml | 12 ++++-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/controllers/registrar/depp_controller.rb b/app/controllers/registrar/depp_controller.rb index 3d1fc2692..6d7b891d1 100644 --- a/app/controllers/registrar/depp_controller.rb +++ b/app/controllers/registrar/depp_controller.rb @@ -17,6 +17,10 @@ class Registrar::DeppController < RegistrarController # EPP controller redirect_to registrar_login_url and return unless depp_current_user end + def depp_controller? + true + end + def depp_current_user return nil unless current_user @depp_current_user ||= Depp::User.new( diff --git a/app/controllers/registrar_controller.rb b/app/controllers/registrar_controller.rb index 895f5c318..4e2def023 100644 --- a/app/controllers/registrar_controller.rb +++ b/app/controllers/registrar_controller.rb @@ -1,4 +1,9 @@ class RegistrarController < ApplicationController before_action :authenticate_user! layout 'registrar/application' + + helper_method :depp_controller? + def depp_controller? + false + end end diff --git a/app/views/layouts/registrar/application.haml b/app/views/layouts/registrar/application.haml index 9c011bec4..fbd4b8307 100644 --- a/app/views/layouts/registrar/application.haml +++ b/app/views/layouts/registrar/application.haml @@ -56,14 +56,10 @@ / /.nav-collapse .container - -# - if params[:controller].start_with?('depp/') - -# = render 'depp/shared/flash' - -# = render 'depp/shared/epp_results' - -# - else - - display = (flash.empty?) ? 'none' : 'block' - #flash{style: "display: #{display};"} - - type = (flash[:notice]) ? 'bg-success' : 'bg-danger' - .alert{class: type}= flash[:notice] || flash[:alert] + = render 'registrar/shared/flash' + - if depp_controller? + = render 'registrar/shared/epp_results' + = yield .footer.text-right