denny/ShinyCMS-ruby

View on GitHub
plugins/ShinyCMS/app/views/shinycms/admin/layouts/admin_area.html.erb

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<!-- CoreUI - Free Bootstrap Admin Template
     @version v3.0.0
     @link https://coreui.io
     Copyright (c) 2019 creativeLabs Ɓukasz Holeczek
     Licensed under MIT (https://coreui.io/license)
-->
<%# Adapted for use in the ShinyCMS admin area by Denny de la Haye.
    Please raise any issues with ShinyCMS first, even if they look
    like CoreUI bugs; they're more likely to be integration issues.
    https://github.com/denny/ShinyCMS-ruby / https://shinycms.org
-%>
<html lang="<%= I18n.locale.to_s %>">
  <head>
    <%= csrf_meta_tags %>
    <%= csp_meta_tag   %>

    <% page_title = @page_title || t( "#{current_plugin_name.underscore}.admin.#{controller_name}.#{action_name}.title" ) %>

    <%= component 'admin/head/blazer', root_path: main_app.root_path if current_plugin_name == 'Blazer' %>

    <%= component 'admin/head', page_title: page_title, with_html_editor: try( :with_html_editor? ) %>
  </head>

  <body class="c-app">
    <div id="sidebar" class="c-sidebar c-sidebar-dark c-sidebar-fixed c-sidebar-lg-show">
      <%= component 'admin/sidebar', current_user: current_user %>
    </div>

    <div class="c-wrapper">
      <header class="c-header c-header-light c-header-fixed">
        <button class="c-header-toggler c-class-toggler d-lg-none mr-auto"   type="button" data-target="#sidebar" data-class="c-sidebar-show"><span class="c-header-toggler-icon"></span></button>
        <button class="c-header-toggler c-class-toggler ml-3 d-md-down-none" type="button" data-target="#sidebar" data-class="c-sidebar-lg-show" responsive="true"><span class="c-header-toggler-icon"></span></button>

        <%= component 'admin/breadcrumbs',
                      page_title:      page_title,
                      section_path:    controller.try( :breadcrumb_section_path ),
                      controller_name: controller_name,
                      plugin_name:     current_plugin_name %>

        <%= component 'admin/user_menu',  if: user_signed_in?,
                      user: current_user, hide_pic: !shinycms_admin_controller? %>
      </header>

      <div class="c-body">
        <main>
          <%= component 'admin/alerts', flash: flash.to_h %>

          <%= yield %>
        </main>
      </div>

      <footer class="c-footer">
        <div class="ml-auto">
          Powered by <a href="https://shinycms.org/">ShinyCMS</a>
          (<a href="https://github.com/denny/ShinyCMS-ruby/releases/tag/v<%= shinycms_version %>"><%= shinycms_version %></a>)
        </div>
      </footer>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.15.0/umd/popper.min.js" integrity="sha384-L2pyEeut/H3mtgCBaUNw7KWzp5n9&#43;4pDQiExs933/5QfaTh8YStYFFkOzSoXjlTb" crossorigin="anonymous"></script>
    <script src="https://unpkg.com/@coreui/coreui@3.0.0-beta.1/dist/js/coreui.min.js"></script>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

    <script src='/js/shinycms/admin_area.js'></script>
  </body>
</html>