<commit_before>%ul.nav.navbar-nav.navbar-right.root_links
  %button#nav-drawer-toggle.btn.a.navbar-brand.toggle-btn
    %i.fa.fa-fw.fa-navicon

%ul#nav-drawer.drawer
  #nav-links
    %li.first
      %a{ href: ENV['PORTAL_URL'] || 'http://cenithub.com', target: '_blank' }
        %i.fa.fa-fw.fa-sticky-note-o{title: t('admin.misc.overview')}
        %span=t('admin.misc.overview')
    %li
      %a#take-tour{'href'=> '#'}
        %i.fa.fa-fw.fa-bus{title: t('admin.misc.tour')}
        %span=t('admin.misc.tour')
    -#- actions(:root).each do |action|
      %li
        =link_to url_for(action: action.action_name, class: 'pjax') do
          %i{class: "#{action.link_icon} fa-fw", title: wording_for(:menu, action)}
          %span=wording_for(:menu, action)
    %li
      =link_to "#{ENV['DOCS_URL'] || 'http://cenit-io.github.io'}/docs/api", target: '_blank' do
        %i.fa.fa-fw.fa-send-o{title: t('admin.misc.api')}
        %span=t('admin.misc.api')
    %li
      =link_to "#{ENV['DOCS_URL'] || 'http://cenit-io.github.io'}/docs", target: '_blank' do
        %i.fa.fa-fw.fa-file-text{title: t('admin.misc.docs')}
        %span=t('admin.misc.docs')
    %li
      =link_to "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/blog", target: '_blank' do
        %i.fa.fa-fw.fa-newspaper-o{title: t('admin.misc.blog')}
        %span=t('admin.misc.blog')
    %li
      - if _current_user.present?
        =link_to 'http://cenitio.slack.com', target: '_blank' do
          %i.fa.fa-fw.fa-slack{title: 'Slack'}
          %span='Slack'
      - else
        =link_to 'http://cenit-slack.herokuapp.com', target: '_blank' do
          %i.fa.fa-fw.fa-slack{title: 'join our slack'}
          %span='Join our Slack'
    %li
      =link_to "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/prices", target: '_blank' do
        %i.fa.fa-fw.fa-credit-card{title: t('admin.misc.prices')}
        %span=t('admin.misc.prices')
    %li
      =link_to "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/directory", target: '_blank' do
        %i.fa.fa-fw.fa-folder-open-o{title: t('admin.misc.directory')}
        %span=t('admin.misc.directory')
    %li
      =link_to "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/terms_of_service", target: '_blank' do
        %i.fa.fa-fw.fa-institution{title: t('admin.misc.terms')}
        %span=t('admin.misc.terms')
    = render partial: 'shared/socials'


- if _current_user.present?
  - acc_am = RailsAdmin::Config.model(Cenit::MultiTenancy.tenant_model).abstract_model
  %ul#tenant-nav.nav.navbar-nav.navbar-right
    %li.dropdown
      %a.dropdown-toggle{href:'#', role:'button','data-toggle':'dropdown','aria-haspopup':'true','aria-expanded':'false'}
        %i.fa.fa-fw.fa-home
        = _current_user.account.name
        %span.caret
      %ul#tenant-menu.dropdown-menu
        - _current_user.accounts.each do | a |
          - if a != _current_user.account
            %li= link_to a.name, inspect_path(model_name: acc_am.to_param, id: a.id)
        - if (new_action = action(:new, acc_am))
          %li.divider{role:'separator'}
          .actions.clearfix
            %li= link_to(t('admin.misc.add_tenant'), url_for(action: new_action.action_name, model_name: acc_am.to_param))

  %ul#user-nav.nav.navbar-nav.navbar-right
    %li.dropdown
      %a.dropdown-toggle{href:'#', role:'button','data-toggle':'dropdown','aria-haspopup':'true','aria-expanded':'false'}
        %i.fa.fa-fw.fa-user
        - if _current_user.name.present?
          = _current_user.name
        - else
          = _current_user.email.split('@')[0]
        %span.caret
      %ul#user-menu.dropdown-menu
        - if (user_link = edit_user_link)
          - user_link = [user_link] unless user_link.is_a?(Enumerable)
          %li.edit_user_root_link{style: 'padding-right:5px'}= user_link.shift
          - user_link.each do |link|
            %li= link

        %li.divider{role:'separator'}
        .actions.clearfix
          %li.terms.pull-left
            %small= link_to t('admin.misc.terms'), "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/terms_of_service", class: 'text-muted', target: '_blank'
          - if logout_path.present?
            %li.pull-right= link_to t('admin.misc.log_out'), logout_path, method: logout_method, class: 'btn btn-xs btn-danger'

  %ul#help-nav.nav.navbar-nav.navbar-right
    %li.dropdown
      %a.dropdown-toggle{href:'#', role:'button','data-toggle':'dropdown','aria-haspopup':'true','aria-expanded':'false'}
        %i.fa.fa-fw.fa-question-circle
        = t('help.label')
        %span.caret
      %ul#help-menu.dropdown-menu
        %li
          = link_to 'https://github.com/cenit-io/cenit', target: '_blank' do
            %i.fa.fa-fw.fa-github-alt
            = t('help.open_source')<commit_msg>Swapping user and accounts links<commit_after>%ul.nav.navbar-nav.navbar-right.root_links
  %button#nav-drawer-toggle.btn.a.navbar-brand.toggle-btn
    %i.fa.fa-fw.fa-navicon

%ul#nav-drawer.drawer
  #nav-links
    %li.first
      %a{ href: ENV['PORTAL_URL'] || 'http://cenithub.com', target: '_blank' }
        %i.fa.fa-fw.fa-sticky-note-o{title: t('admin.misc.overview')}
        %span=t('admin.misc.overview')
    %li
      %a#take-tour{'href'=> '#'}
        %i.fa.fa-fw.fa-bus{title: t('admin.misc.tour')}
        %span=t('admin.misc.tour')
    -#- actions(:root).each do |action|
      %li
        =link_to url_for(action: action.action_name, class: 'pjax') do
          %i{class: "#{action.link_icon} fa-fw", title: wording_for(:menu, action)}
          %span=wording_for(:menu, action)
    %li
      =link_to "#{ENV['DOCS_URL'] || 'http://cenit-io.github.io'}/docs/api", target: '_blank' do
        %i.fa.fa-fw.fa-send-o{title: t('admin.misc.api')}
        %span=t('admin.misc.api')
    %li
      =link_to "#{ENV['DOCS_URL'] || 'http://cenit-io.github.io'}/docs", target: '_blank' do
        %i.fa.fa-fw.fa-file-text{title: t('admin.misc.docs')}
        %span=t('admin.misc.docs')
    %li
      =link_to "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/blog", target: '_blank' do
        %i.fa.fa-fw.fa-newspaper-o{title: t('admin.misc.blog')}
        %span=t('admin.misc.blog')
    %li
      - if _current_user.present?
        =link_to 'http://cenitio.slack.com', target: '_blank' do
          %i.fa.fa-fw.fa-slack{title: 'Slack'}
          %span='Slack'
      - else
        =link_to 'http://cenit-slack.herokuapp.com', target: '_blank' do
          %i.fa.fa-fw.fa-slack{title: 'join our slack'}
          %span='Join our Slack'
    %li
      =link_to "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/prices", target: '_blank' do
        %i.fa.fa-fw.fa-credit-card{title: t('admin.misc.prices')}
        %span=t('admin.misc.prices')
    %li
      =link_to "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/directory", target: '_blank' do
        %i.fa.fa-fw.fa-folder-open-o{title: t('admin.misc.directory')}
        %span=t('admin.misc.directory')
    %li
      =link_to "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/terms_of_service", target: '_blank' do
        %i.fa.fa-fw.fa-institution{title: t('admin.misc.terms')}
        %span=t('admin.misc.terms')
    = render partial: 'shared/socials'


- if _current_user.present?
  %ul#user-nav.nav.navbar-nav.navbar-right
    %li.dropdown
      %a.dropdown-toggle{href:'#', role:'button','data-toggle':'dropdown','aria-haspopup':'true','aria-expanded':'false'}
        %i.fa.fa-fw.fa-user
        - if _current_user.name.present?
          = _current_user.name
        - else
          = _current_user.email.split('@')[0]
        %span.caret
      %ul#user-menu.dropdown-menu
        - if (user_link = edit_user_link)
          - user_link = [user_link] unless user_link.is_a?(Enumerable)
          %li.edit_user_root_link{style: 'padding-right:5px'}= user_link.shift
          - user_link.each do |link|
            %li= link

        %li.divider{role:'separator'}
        .actions.clearfix
          %li.terms.pull-left
            %small= link_to t('admin.misc.terms'), "#{ENV['PORTAL_URL'] || 'https://cenit.io'}/terms_of_service", class: 'text-muted', target: '_blank'
          - if logout_path.present?
            %li.pull-right= link_to t('admin.misc.log_out'), logout_path, method: logout_method, class: 'btn btn-xs btn-danger'

  - acc_am = RailsAdmin::Config.model(Cenit::MultiTenancy.tenant_model).abstract_model
  %ul#tenant-nav.nav.navbar-nav.navbar-right
    %li.dropdown
      %a.dropdown-toggle{href:'#', role:'button','data-toggle':'dropdown','aria-haspopup':'true','aria-expanded':'false'}
        %i.fa.fa-fw.fa-home
        = _current_user.account.name
        %span.caret
      %ul#tenant-menu.dropdown-menu
        - _current_user.accounts.each do | a |
          - if a != _current_user.account
            %li= link_to a.name, inspect_path(model_name: acc_am.to_param, id: a.id)
        - if (new_action = action(:new, acc_am))
          %li.divider{role:'separator'}
          .actions.clearfix
            %li= link_to(t('admin.misc.add_tenant'), url_for(action: new_action.action_name, model_name: acc_am.to_param))

  %ul#help-nav.nav.navbar-nav.navbar-right
    %li.dropdown
      %a.dropdown-toggle{href:'#', role:'button','data-toggle':'dropdown','aria-haspopup':'true','aria-expanded':'false'}
        %i.fa.fa-fw.fa-question-circle
        = t('help.label')
        %span.caret
      %ul#help-menu.dropdown-menu
        %li
          = link_to 'https://github.com/cenit-io/cenit', target: '_blank' do
            %i.fa.fa-fw.fa-github-alt
            = t('help.open_source')
{'fraction_non_alphanumeric': 0.19204389574759945, 'fraction_numerical': 0.00042207449614857024, 'mean_word_length': 2.6865033061065735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3400900', 'n_tokens_mistral': 3616, 'n_tokens_neox': 3521, 'n_words': 461}