Registrar refactor

This commit is contained in:
Priit Tark 2015-04-09 17:09:18 +03:00
parent 6573d81b94
commit ec4c06bb06
95 changed files with 564 additions and 539 deletions

View file

@ -28,39 +28,42 @@
- if current_user
.navbar-collapse.collapse
%ul.nav.navbar-nav.public-nav
- active_class = %w(depp/domains depp/check depp/renew depp/tranfer depp/keyrelays).include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:domains), depp.domains_path
- active_class = ['depp/contacts'].include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:contacts), depp.contacts_path
- if can? :view, Depp::Domain
- active_class = %w(registrar/domains registrar/check registrar/renew registrar/tranfer registrar/keyrelays).include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:domains), registrar_domains_path
- if can? :view, Depp::Contact
- active_class = ['registrar/contacts'].include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:contacts), registrar_contacts_path
- if can? :show, Invoice
- active_class = ['registrar/invoices'].include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t('invoices'), main_app.registrar_invoices_path
- active_class = ['depp/xml_consoles'].include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:xml_console), depp.xml_console_path
- if can? :view, :registrar_xml_console
- active_class = ['registrar/xml_consoles'].include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:xml_console), registrar_xml_console_path
%ul.nav.navbar-nav.navbar-right
%li= link_to t('log_out', user: current_user), '/registrar/logout'
%li.dropdown
= link_to 'Registrar <span class="caret"></span>'.html_safe, '#',
class: 'dropdown-toggle', 'data-toggle': 'dropdown', role: 'button'
%ul.dropdown-menu{'role': 'menu'}
%li.dropdown-header= t(:switch_to) + ':'
%li= link_to t(:registrant), '#'
%li= link_to t(:registrar), '#'
- if user_signed_in?
%li= link_to t('log_out', user: current_user), '/registrar/logout'
-# %li.dropdown
-# = link_to 'Registrar <span class="caret"></span>'.html_safe, '#',
-# class: 'dropdown-toggle', 'data-toggle': 'dropdown', role: 'button'
-# %ul.dropdown-menu{'role': 'menu'}
-# %li.dropdown-header= t(:switch_to) + ':'
-# %li= link_to t(:registrant), '#'
-# %li= link_to t(:registrar), '#'
/ /.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]
-# - 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]
= yield
.footer.text-right