- if can? :index, WorkflowInstance
  li.has-dropdown class=active_class('workflow_instance')
    = link_to WorkflowInstance.model_name.human_plural, '#'
    ul.dropdown
      - WorkflowInstance.scenario_classes.each do |scenario|
        - if can? :read, scenario
          li class=active_class("workflow_instance/#{scenario.process_name.pluralize}") = link_to scenario.model_name.human_plural, [main_app, scenario]
- if can? :index, WorkflowInstanceBatch
  li.has-dropdown class=active_class('workflow_instance_batch')
    = link_to WorkflowInstanceBatch.model_name.human_plural, '#'
    ul.dropdown
      - WorkflowInstance.scenario_classes.each do |scenario|
        - if can? :read, scenario.batch_class
          li class=active_class("workflow_instance_batch/#{scenario.batch_class.process_name.pluralize}") = link_to scenario.batch_class.model_name.human_plural, [main_app, scenario.batch_class]
/- if can? :index, WorkflowInstanceBatch
  li class=active_class('workflow_instance_batches') = link_to WorkflowInstanceBatch::Scenario1.model_name.human_plural, WorkflowInstanceBatch::Scenario1
- if can? :index, SourceFile or can? :index, TargetFile
  li.has-dropdown class=active_class('dunlop/source_files', 'dunlop/target_files')
    = link_to 'Files', '#'
    ul.dropdown
      li class=active_class('dunlop/source_files') = link_to SourceFile.model_name.human_plural, dunlop.source_files_path
      li class=active_class('dunlop/target_files') = link_to TargetFile.model_name.human_plural, dunlop.target_files_path
- if can? :index, :reports
  li class=active_class('dunlop/reports') = link_to t('dunlop.reports.title'), dunlop.reports_root_path
- if can? :index, User
  li class=active_class("dunlop/users") = link_to User.model_name.human_plural, dunlop.users_path
/li{ class: active_class('manual') }= link_to 'Manual', manual_root_path
.right
  li class=active_class('dunlop#changelog')
    = link_to Rails.application.config.git_version, dunlop.changelog_path, title: 'Current version, click for changelog'
  - if signed_in?
    li class=active_class('dunlop/users#profile', 'dunlop/users#edit_profile') = link_to 'Profile', dunlop.profile_users_path
    li= link_to 'Sign out', main_app.destroy_user_session_path, method: :delete
  - else
    li= link_to 'Sign In', main_app.new_user_session_path

