app/views/administrador/application/sidebars/_engine.html.haml in administrador-0.0.9.pre vs app/views/administrador/application/sidebars/_engine.html.haml in administrador-0.0.10.pre

- old
+ new

@@ -1,32 +1,33 @@ -%aside#engine-sidebar.py-2 +%aside#sidebar-engines.p-2.pr-0{ data: { sidebar: { position: :left, size: '20rem', state: :closed, mode: :push } } } .container-fluid .row .col-12 - administrador_helper(self).engines.each do |_, engine| - .administrador-engine-in-sidebar.mb-4{ id: dom_id(engine), class: dom_class(engine) } - %h5.administrador-engine-name= engine.translated_name - .list-group - %a.list-group-item.administrador-link-to-engine-home{ href: send(engine.router_name).root_path } - %i.fas.fa-home - %span.hidden-sm-down.small= t('.home') + .administrador-engine.mb-4.text-secondary{ id: dom_id(engine), class: dom_class(engine) } + %h6.text-uppercase.administrador-engine-name + %i.fas.fa-home + = link_to(send(engine.router_name).root_path, class: 'administrador-link-to-engine-home') do + = engine.translated_name + %ul.list-group.list-group-flush - engine.resources_controllers.each do |rc| - .list-group-item - %a.administrador-link-to-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :index) } - %i.fas.fa-folder - %span.hidden-sm-down.small= rc.resource_class.model_name.human(count: :other) - - if rc.available_rest_actions.include?(:new) - %a.float-right.btn.btn-xs.btn-primary.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) } - %i.fas.fa-plus - %span.administrador-object-count.float-right.badge.badge-pill.badge-light= rc.resource_count + %li.list-group-item + .administrador-engine-resources-count.float-right + %span.badge.badge-pill.badge-success= rc.resource_count + .administrador-engine-actions.float-right + - if rc.available_rest_actions.include?(:new) + %a.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) } + %i.fas.fa-plus + %a.administrador-link-to-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :index), class: "#{rc.name.underscore.gsub('_controller', '').split('/').last == controller_name ? 'current selected' : ''}" } + = rc.resource_class.model_name.human(count: :other) - engine.resource_controllers.each do |rc| - .list-group-item - %a.administrador-link-to-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :show) } - %i.fas.fa-file - %span.hidden-sm-down.small= rc.resource_class.model_name.human - - if rc.available_rest_actions.include?(:new) - %a.float-right.btn.btn-xs.btn-primary.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) } - %i.fas.fa-plus + %li.list-group-item + .administrador-engine-actions.float-right + - if rc.available_rest_actions.include?(:new) + %a.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) } + %i.fas.fa-plus + %a.administrador-link-to-resource{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :show) } + = rc.resource_class.model_name.human(count: :other) - engine.service_controllers.each do |sc| - %a.list-group-item{ href: send(engine.router_name).url_for(controller: "/#{sc.name.underscore.gsub('_controller', '')}", action: :new) } - %i.fas.fa-running - %span.hidden-sm-down.small= sc.service_class.model_name.human(count: :other) + %li.list-group-item + %a.administrador-link-to-service{ href: send(engine.router_name).url_for(controller: "/#{sc.name.underscore.gsub('_controller', '')}", action: :new) } + = sc.service_class.model_name.human(count: :other) \ No newline at end of file