ncbo/bioportal_web_ui

View on GitHub
app/views/admin/index.html.haml

Summary

Maintainability
Test Coverage
- @title = "BioPortal Administration"

%div.row
  %div.col
    %h3.my-4 Administration Console

%div.row
  %div.col-2
    %div#progress_message{:class => "alert-box progress_box"}
    %div#success_message{:class => "alert-box success"}
    %div#error_message{:class => "alert-box error"}
    %div#info_message{:class => "alert-box notice"}

%div.row
  %div.col
    %ul{class: "nav nav-tabs", id: "admin-tabs", role: "tablist"}
      %li{class: "nav-item", role: "presentation"}
        = tag.button("Site administration", class: "nav-link active", id: "site-admin-tab", "data-bs-toggle": "tab",
                     "data-bs-target": "#site-admin", type: "button", role: "tab", "aria-controls": "site-admin",
                     "aria-selected": "true")
      %li{class: "nav-item", role: "presentation"}
        = tag.button("Ontology administration", class: "nav-link", id: "ontology-admin-tab", "data-bs-toggle": "tab",
                     "data-bs-target": "#ontology-admin", type: "button", role: "tab",
                     "aria-controls": 'ontology-admin', "aria-selected": "false")
      %li{class: "nav-item", role: "presentation"}
        = tag.button("Licensing", class: "nav-link", id: "licensing-admin-tab", "data-bs-toggle": "tab",
                     "data-bs-target": "#licensing", type: "button", role: "tab", "aria-controls": "licensing",
                     "aria-selected": "false")
      %li{class: "nav-item", role: "presentation"}
        = tag.button("Users", class: "nav-link", id: "users-admin-tab", "data-bs-toggle": "tab",
                     "data-bs-target": "#users", type: "button", role: "tab", "aria-controls": "users",
                     "aria-selected": "false")
    %div#adminTabContent.tab-content

      -# Site Administration tab
      %div.tab-pane.active.show.fade{id: "site-admin", role: "tabpanel", aria: { labelledby: "site-admin-tab" }}
        
        -# Clear caches
        %div#site-admin-clear-caches.my-5
          %div.site-admin-page-header
            CACHE MANAGEMENT
          %dive.site-admin-page-section
            = link_to("Flush UI cache", "#", id: "flush_memcache_action", class: "btn btn-outline-secondary btn-sm admin-action-item",  role: "button")
            = link_to("Reset UI cache connection", "#", id: "reset_memcache_connection_action", class: "btn btn-outline-secondary btn-sm admin-action-item",  role: "button")
            = link_to("Flush GOO cache", "#", id: "flush_goo_cache_action", class: "btn btn-outline-secondary btn-sm admin-action-item",  role: "button")
            = link_to("Flush HTTP cache", "#", id: "flush_http_cache_action", class: "btn btn-outline-secondary btn-sm",  role: "button")
        
        -# Check for updates
        %div#site-admin-update-check.mb-5
          %div.site-admin-page-header
            VERSION MANAGEMENT
          %dive.site-admin-page-section
            = link_to("Check for updates", "#", id: "update_check_action", class: "btn btn-outline-secondary btn-sm",  role: "button")

        -# View appliance ID
        %div#site-admin-appliance-id.mb-5
          %div.site-admin-page-header
            APPLIANCE ID
          %dive.site-admin-page-section
            %div#appliance-id
              %span

      -# Ontology Administration tab
      %div.tab-pane.fade{id: "ontology-admin", role: "tabpanel", aria: { labelledby: "ontology-admin-tab" }}
        %div.ontologies_list_container.mt-3
          %table{:style => "float:left;"}
            %tr
              %td{:style => "white-space:nowrap;"}
                Report generated on:  
                %span.report_date_generated
                %a#refresh_report_action{:href => "javascript:;", :class => "link_button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only", :style => "margin-left:11px;"}
                  %span.ui-button-text{:class => "report_date_generated_button"}
          %p.tab_description{:style => "clear:both;"}
          %table#adminOntologies.zebra{:cellpadding => "0", :cellspacing => "0", :width => "100%"}

      -# Licensing tab
      %div.tab-pane.fade{id: "licensing", role: "tabpanel", aria: { labelledby: "licensing-admin-tab" }}
        %div#renew-license-notice

        %table.table.table-sm.table-bordered.mt-5#license-table
          %thead
            %tr
              %th{scope: "col"} Licensed to
              %th{scope: "col"} Appliance ID
              %th{scope: "col"} Valid till  
              %th{scope: "col"} Days remaining
          %tbody

        %div.mb-5#renew-license-button
          = link_to("Renew license", new_admin_license_path(), class: "btn btn-primary", role: "button", remote: "true")

        %div.mb-5#renew-license-form

      -# Users tab
      %div.tab-pane.fade{id: "users", role: "tabpanel", aria: { labelledby: "users-admin-tab" }}
        %div.ontologies_list_container.mt-3
          %table#adminUsers.zebra{:cellpadding => "0", :cellspacing => "0", :width => "100%"}