diff --git a/Gemfile b/Gemfile index 2a607980..f41c8896 100644 --- a/Gemfile +++ b/Gemfile @@ -49,6 +49,9 @@ gem 'bootstrap', '~> 4.3.1' gem 'devise-bootstrap-views', '~> 1.0' gem 'devise-i18n' gem 'jquery-rails' +# Jquery datatables ruby gems for assets pipeline, https://datatables.net/ +# https://github.com/mkhairi/jquery-datatables +gem 'jquery-datatables' # Ruby interface to the VMware vSphere API # https://github.com/vmware/rbvmomi diff --git a/Gemfile.lock b/Gemfile.lock index 1703f752..50b667cf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,6 +172,7 @@ GEM jbuilder (2.8.0) activesupport (>= 4.2.0) multi_json (>= 1.2) + jquery-datatables (1.10.19.1) jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -435,6 +436,7 @@ DEPENDENCIES git guard jbuilder (~> 2.5) + jquery-datatables jquery-rails listen (>= 3.0.5, < 3.2) mina diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 274b05dc..50073a3d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -17,12 +17,13 @@ //= require popper //= require bootstrap //= require doughnut_chart -//= require filter_table -//= require sort_table //= require prevent_anchor_reload -//= require_tree . //= require select2 //= require clipboard +// Contains code for initializing and configuring datatables +// app/assets/javascripts/datatables.js +//= require datatables +//= require_tree . // With Turbolinks, jQuery $(document).ready events fire only in response // to the initial page load, not after any subsequent page changes diff --git a/app/assets/javascripts/datatables.js b/app/assets/javascripts/datatables.js new file mode 100644 index 00000000..6889b74f --- /dev/null +++ b/app/assets/javascripts/datatables.js @@ -0,0 +1,29 @@ +//= require datatables/jquery.dataTables +//= require datatables/dataTables.bootstrap4 + +// Global settings and initializer for all datatables +$.extend( $.fn.dataTable.defaults, { + // https://datatables.net/reference/option/responsive + responsive: true, + // https://datatables.net/reference/option/pagingType + pagingType: 'simple_numbers' + // https://datatables.net/reference/option/dom + //dom: + // "<'row'<'col-sm-4 text-left'f><'right-action col-sm-8 text-right'<'buttons'B> <'select-info'> >>" + + // "<'row'<'dttb col-12 px-0'tr>>" + + // "<'row'<'col-sm-12 table-footer'lip>>" +}); + +// Initialization on turbolinks load +$(document).on('turbolinks:load', function() { + if (!$.fn.DataTable.isDataTable('table[data-toggle="datatable"]')) { + $('table[data-toggle="datatable"]').DataTable(); + } +}); + +// Turbolinks cache fix +// https://stackoverflow.com/questions/41070556 +$(document).on('turbolinks:before-cache', function() { + $($.fn.dataTable.tables(true)).DataTable().destroy(); +}); + diff --git a/app/assets/javascripts/filter_table.js b/app/assets/javascripts/filter_table.js deleted file mode 100644 index da3a4fe5..00000000 --- a/app/assets/javascripts/filter_table.js +++ /dev/null @@ -1,54 +0,0 @@ -function hide(htmlElm) { - htmlElm.style.display = 'none'; -} - -function unhide(htmlElm) { - htmlElm.style.display = ''; -} - -function someCellInRowContains(row, searchTexts) { - let remainingFilters = searchTexts.filter(searchText => - !Array.prototype.some.call(row, cell => { - let txtValue = (cell.dataset && cell.dataset.filterValue) || cell.textContent || cell.innerText; - return txtValue.toUpperCase().includes(searchText); - }) - ); - return remainingFilters.length === 0; -} - - -function filterTable(inputId, tableId) { - const input = document.getElementById(inputId); - const table = document.getElementById(tableId); - if (!table || !input) { - return; - } - - const filters = input.value.toUpperCase().split(/[ ,]+/); - const rows = table.getElementsByTagName('tr'); - let invisible = 0; - - // Loop through all table rows, and hide those who don't match the search query ignoring the headline - for (let i = 1; i < rows.length; i++) { - const cells = rows[i].getElementsByTagName('td'); - - if (someCellInRowContains(cells, filters)) { - unhide(rows[i]); - } else { - hide(rows[i]); - invisible++; - } - } - - if (invisible === rows.length - 1) { - hide(table); - } else { - unhide(table); - } -} - -function filterTables(inputId, tableIds) { - for (const tableID of tableIds) { - filterTable(inputId, tableID) - } -} \ No newline at end of file diff --git a/app/assets/javascripts/sort_table.js b/app/assets/javascripts/sort_table.js deleted file mode 100644 index d615733c..00000000 --- a/app/assets/javascripts/sort_table.js +++ /dev/null @@ -1,8 +0,0 @@ -function sortWithoutHTML(a, b) { - function stripHTML(html) { - let tmp = document.createElement("DIV"); - tmp.innerHTML = html; - return tmp.textContent || tmp.innerText || ""; - } - return stripHTML(a).localeCompare(stripHTML(b)) -} \ No newline at end of file diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 72123cee..88eac47b 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -20,7 +20,24 @@ $danger: #a80833; $primary-active: #1f6993; $primary-hover: #1a5b82; +// https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails +// Custom bootstrap variables must be set or imported *before* bootstrap. @import "bootstrap"; +// Bootstrap styling for datatables +// https://github.com/mkhairi/jquery-datatables#stylesheets +@import 'datatables/dataTables.bootstrap4'; +// optional datatables styles for extensions, include when used +//@import 'datatables/extensions/AutoFill/autoFill.bootstrap4'; +//@import 'datatables/extensions/Buttons/buttons.bootstrap4'; +//@import 'datatables/extensions/ColReorder/colReorder.bootstrap4'; +//@import 'datatables/extensions/FixedColumns/fixedColumns.bootstrap4'; +//@import 'datatables/extensions/FixedHeader/fixedHeader.bootstrap4'; +//@import 'datatables/extensions/KeyTable/keyTable.bootstrap4'; +//@import 'datatables/extensions/Responsive/responsive.bootstrap4'; +//@import 'datatables/extensions/RowGroup/rowGroup.bootstrap4'; +//@import 'datatables/extensions/RowReorder/rowReorder.bootstrap4'; +//@import 'datatables/extensions/Scroller/scroller.bootstrap4'; +//@import 'datatables/extensions/Select/select.bootstrap4'; th { @extend .text-white; @@ -34,13 +51,12 @@ html, body { } .page-container { - margin: 50px 0 0 50px; + margin: 25px 0 0 50px; width: calc(100% - 100px); } h1 { color: $primary; - margin-bottom: .5em; } .dashboard-header-link { @@ -83,33 +99,10 @@ body { width: auto; } -.empty-table-label { - text-align: center; - padding-top: 1.2em; -} - -.table-bar { - width: auto; - border: 0; - margin: 1.5em 0 1em; - - td { - padding-right: 20px; - } -} - -.table-flex-width { - width: auto; -} - .unread { background-color: #e6f3ff; } -.bulletless { - list-style-type: none; -} - #menu-profile-dropdown { padding-top: 3px; } diff --git a/app/assets/stylesheets/requests.scss b/app/assets/stylesheets/requests.scss index bd36f34a..252bdaf6 100644 --- a/app/assets/stylesheets/requests.scss +++ b/app/assets/stylesheets/requests.scss @@ -30,10 +30,6 @@ label { margin-right: 5px; } -h1{ - margin-bottom: 1em; -} - /* Selected items on top */ .select2-selection__choice { background-color: #0C415F !important; diff --git a/app/assets/stylesheets/vms.scss b/app/assets/stylesheets/vms.scss index dec2f161..493ccb7c 100644 --- a/app/assets/stylesheets/vms.scss +++ b/app/assets/stylesheets/vms.scss @@ -7,25 +7,6 @@ flex: 1; } -.table-bar { - width: auto; - border: 0; - margin: 1.5em 0 1em; - - td { - padding-right: 20px; - } -} - -.create-form { - width: auto; - padding-bottom: 1.5em; -} - -.login-form-group { - padding-bottom: 1.5em; -} - .round { height: 1rem; width: 1rem; @@ -34,7 +15,3 @@ margin-right: 0.5rem; display: inline-block; } - -.script-doc::before { - content: "\1F4CE"; -} \ No newline at end of file diff --git a/app/views/application/_footer.html.erb b/app/views/application/_footer.html.erb index 7d49a634..71df46c9 100644 --- a/app/views/application/_footer.html.erb +++ b/app/views/application/_footer.html.erb @@ -15,13 +15,3 @@ - - - - - - \ No newline at end of file diff --git a/app/views/dashboard/_widget.erb b/app/views/dashboard/_widget.erb index 21655314..b3e4d250 100644 --- a/app/views/dashboard/_widget.erb +++ b/app/views/dashboard/_widget.erb @@ -8,7 +8,8 @@ <% end %>
Name | -Vendor | -Model | -Status | -||||
---|---|---|---|---|---|---|---|
Name | +Vendor | +Model | +Status | +||||
- <%= link_to host.name, {controller: :hosts, action: 'show', id: host.name}, method: :get %> - | -<%= host.vendor %> | -<%= host.model %> | -
-
-
+ | <%= link_to host.name, host_path(host.name) %> | +<%= host.vendor %> | +<%= host.model %> | ++ <%= content_tag :div, nil, + title: host.connection_state, + :data => { toggle: 'tooltip', placement: 'right' }, + class: "round #{host.connection_state == 'connected' ? 'bg-success' : 'bg-warning'}" %> |
- <%=link_to(fa_icon('plus'), - {controller: :operating_systems, action: 'new'}, - method: :get, class: 'btn btn-primary', id: 'createNewProjectButton') %> - | -
Name | -+ <%# https://datatables.net/reference/option/columns.orderable %> + | Actions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<%= operating_system.name %> | -<%= link_to 'Edit', edit_operating_system_path(operating_system), class: "btn btn-primary" %> | -<%= link_to 'Delete', operating_system, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %> | +<%= os.name %> | ++ <%= link_to fa_icon('pencil'), edit_operating_system_path(os), + title: 'Edit', + class: "btn btn-sm btn-primary" %> + <%= link_to fa_icon('trash'), os, method: :delete, + title: 'Delete', + data: { confirm: "Are you sure you want to delete '#{os.name}'?" }, + class: "btn btn-sm btn-danger" %> + |
<%= User.human_attribute_name('name') %> | -<%= User.human_attribute_name('description') %> | -<%= User.human_attribute_name('responsible_users') %> | - - - <% projects.each do |project| %> -
---|---|---|
<%= link_to project.name, project_path(project) %> | -<%= project.description %> | -
-
|
-
<%= User.human_attribute_name('name') %> | +<%= User.human_attribute_name('description') %> | +<%= User.human_attribute_name('responsible_users') %> | +
---|---|---|
<%= link_to project.name, project_path(project) %> | +<%= truncate(project.description, length: 100) %> | +
+ <%# https://getbootstrap.com/docs/4.0/content/typography/#inline %>
+
|
+
No projects created yet
-<% end %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index caf0a3c7..b57eee30 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -13,9 +13,10 @@- <%=link_to(fa_icon('plus'), - new_request_template_path, class: 'btn btn-primary') %> - | -- <%= link_to 'Requests', requests_path, class: 'btn btn-primary' %> - | -
Template name | CPU cores | -RAM in GB | -Storage in GB | -Operating system | +RAM | +Storage | +Operating system | +Actions | ||
---|---|---|---|---|---|---|---|---|---|---|
<%= link_to request_template.name, edit_request_template_path(request_template) %> | - <% else %> -<%= request_template.name %> | - <% end %> +<%= request_template.name %> | <%= request_template.cpu_cores %> | -<%= request_template.ram_gb %> | -<%= request_template.storage_gb %> | +<%= request_template.ram_gb %> GB | +<%= request_template.storage_gb %> GB | <%= request_template.operating_system %> | - <% if current_user.admin? %> -- <%= link_to 'Delete', - request_template, - method: :delete, - data: { confirm: 'Are you sure?' }, - id: "deleteRequestTemplateButton-#{request_template.id}", - class: 'btn btn-danger' - %> - | - <% end %> ++ <% if current_user.admin? %> + <%= link_to fa_icon('pencil'), edit_request_template_path(request_template), + title: 'Edit', + class: "btn btn-sm btn-primary" %> + <%= link_to fa_icon('trash'), request_template, method: :delete, + title: 'Delete', + data: { confirm: "Are you sure you want to delete '#{request_template.name}'?" }, + id: "deleteRequestTemplateButton-#{request_template.id}", + class: "btn btn-sm btn-danger" %> + <% end %> + |
No templates created yet
-<% end %> diff --git a/app/views/requests/index.html.erb b/app/views/requests/index.html.erb index 373869f4..5282a29b 100644 --- a/app/views/requests/index.html.erb +++ b/app/views/requests/index.html.erb @@ -1,89 +1,87 @@ +VM Name | -CPU Cores | -RAM | -HDD | -OS | -Port | -Application Name | -Comment | +VM Name | +CPU Cores | +RAM | +HDD | +OS | +Port | +Application Name | +Comment |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<%= link_to request.name, request_path(request) %> | -<%= request.cpu_cores %> | -<%= request.ram_gb %> GB | -<%= request.storage_gb %> GB | -<%= request.operating_system %> | -<%= request.port %> | -<%= request.application_name %> | -<%= request.comment %> | -||||||||
<%= link_to request.name, request_path(request) %> | +<%= request.cpu_cores %> | +<%= request.ram_gb %> GB | +<%= request.storage_gb %> GB | +<%= request.operating_system %> | +<%= request.port %> | +<%= request.application_name %> | +<%= request.comment %> | +
VM Name | -CPU Cores | -RAM | -HDD | -OS | -Port | -Application Name | -Comment | -Status | +VM Name | +CPU Cores | +RAM | +HDD | +OS | +Port | +Application Name | +Comment | +Status | +Actions |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<%= link_to request.name, request_path(request) %> | -<%= request.cpu_cores %> | -<%= request.ram_gb %> GB | -<%= request.storage_gb %> GB | -<%= request.operating_system %> | -<%= request.port %> | -<%= request.application_name %> | -<%= request.comment %> | -
-
-
+ <% @resolved_requests&.each do |request| %>
+ | ||||||||||
<%= link_to request.name, request_path(request) %> | +<%= request.cpu_cores %> | +<%= request.ram_gb %> GB | +<%= request.storage_gb %> GB | +<%= request.operating_system %> | +<%= request.port %> | +<%= request.application_name %> | +<%= request.comment %> | + <%# https://datatables.net/manual/data/orthogonal-data#HTML-5 %> ++ <%= content_tag :div, nil, + title: request.status, + :data => { toggle: 'tooltip', placement: 'right' }, + class: "round #{request.accepted? ? 'bg-success' : 'bg-warning'}" %> + | +
<% if request.accepted? %>
- >
+ >
tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
@@ -110,6 +108,6 @@
<% end %>
|
VM Name | diff --git a/app/views/servers/index.html.erb b/app/views/servers/index.html.erb index db1345e2..7e7b3b97 100644 --- a/app/views/servers/index.html.erb +++ b/app/views/servers/index.html.erb @@ -1,32 +1,29 @@ -
Name | -Vendor | -Model | -Responsible | +Name | +Vendor | +Model | +Responsible |
---|---|---|---|---|---|---|---|
<%= link_to server.name, server %> | -<%= server.vendor %> | -<%= server.model %> | -<%= server.responsible&.name %> | +<%= link_to server.name, server_path(server) %> | +<%= server.vendor %> | +<%= server.model %> | +<%= server.responsible.name %> |
<%= User.human_attribute_name('name') %> | -<%= User.human_attribute_name('email') %> | -<%= User.human_attribute_name('role') %> | -<%= User.human_attribute_name('last_sign_in_at') %> | +<%= User.human_attribute_name('name') %> | +<%= User.human_attribute_name('email') %> | +<%= User.human_attribute_name('role') %> | +<%= User.human_attribute_name('last_sign_in_at') %> | <% @users.each do |user| %>
---|---|---|---|---|---|
<%= link_to user.name, user_path(user) %> | <%= user.email %> | -
-
- <%= user.role %> -
- <% User.roles.map(&:first).each do |role| %>
- <% if editable_for user %>
- <%= link_to role.capitalize,
- update_role_user_path(user, role: role),
- method: :patch,
- id: "btn-#{role}-#{user.id}",
- class: "btn
- btn-#{if user.role == role then 'primary' else 'light' end}"
- %>
- <% else %>
-
- <% end %>
- <% end %>
-
- | <%= user.current_sign_in_at %> | + <%# https://datatables.net/manual/data/orthogonal-data#HTML-5 %> +
+
+ <% User.roles.map(&:first).each do |role| %>
+ <% if editable_for user %>
+ <%= link_to role.capitalize,
+ update_role_user_path(user, role: role),
+ method: :patch,
+ id: "btn-#{role}-#{user.id}",
+ class: "btn btn-#{if user.role == role then 'primary' else 'light' end}" %>
+ <% else %>
+
+ <%= role.capitalize %>
+
+ <% end %>
+ <% end %>
+
+ | + <%= I18n.l(user.current_sign_in_at, format: :long) if user.current_sign_in_at %> + |
You are not part of any projects. All your projects will be shown here.
@@ -62,5 +58,5 @@This user is not part of any projects. All his projects will be shown here.
<% end %> <% else %> - <%= render 'projects/list', projects: @user.responsible_projects %> + <%= render 'projects/table', projects: @user.responsible_projects %> <% end %> diff --git a/app/views/vms/_archive_buttons.erb b/app/views/vms/_archive_buttons.erb index 2198700d..29ccc8bd 100644 --- a/app/views/vms/_archive_buttons.erb +++ b/app/views/vms/_archive_buttons.erb @@ -1,14 +1,16 @@ <%if current_user.admin? && vm.archivable? %> - <%= link_to '', + <%= link_to fa_icon('archive'), {controller: :vms, action: 'archive_vm', id: vm.name}, method: :post, - data: { confirm: "Are you sure you want to archive '#{vm.name}'?" }, + data: { confirm: "Are you sure you want to archive '#{vm.name}'?", + toggle: 'tooltip', placement: 'top' }, title: "Archive VM", - class: "btn btn-primary btn-sm fa fa-archive" %> + class: "btn btn-primary btn-sm" %> <% end %> -<%= link_to '', +<%= link_to fa_icon('arrow-circle-up'), {controller: :vms, action: 'revive_vm', id: vm.name}, method: :post, - data: { confirm: "Are you sure you want to revive '#{vm.name}'?" }, + data: { confirm: "Are you sure you want to revive '#{vm.name}'?", + toggle: 'tooltip', placement: 'top' }, title: "Revive VM", - class: "btn btn-primary btn-sm fa fa-arrow-circle-up" %> \ No newline at end of file + class: "btn btn-primary btn-sm" %> \ No newline at end of file diff --git a/app/views/vms/_revive_buttons.erb b/app/views/vms/_revive_buttons.erb index f19b3f13..9f1c7c55 100644 --- a/app/views/vms/_revive_buttons.erb +++ b/app/views/vms/_revive_buttons.erb @@ -1,15 +1,17 @@ <% if current_user.admin? %> - <%= link_to '', + <%= link_to fa_icon('arrow-circle-up'), {controller: :vms, action: 'revive_vm', id: vm.name}, method: :post, - data: { confirm: "Are you sure you want to revive '#{vm.name}'?" }, + data: { confirm: "Are you sure you want to revive '#{vm.name}'?", + toggle: 'tooltip', placement: 'top' }, title: "Revive VM", - class: "btn btn-primary btn-sm fa fa-arrow-circle-up" %> + class: "btn btn-primary btn-sm" %> <% else %> - <%= link_to '', + <%= link_to fa_icon('arrow-circle-up'), {controller: :vms, action: 'request_vm_revive', id: vm.name}, method: :post, - data: { confirm: "Are you sure you want to request revival of '#{vm.name}'?" }, + data: { confirm: "Are you sure you want to request revival of '#{vm.name}'?", + toggle: 'tooltip', placement: 'top' }, title: "Request revival", - class: "btn btn-primary btn-sm fa fa-arrow-circle-up" %> + class: "btn btn-primary btn-sm" %> <% end %> \ No newline at end of file diff --git a/app/views/vms/_running_vm_buttons.erb b/app/views/vms/_running_vm_buttons.erb index 94e4842f..ababec5f 100644 --- a/app/views/vms/_running_vm_buttons.erb +++ b/app/views/vms/_running_vm_buttons.erb @@ -1,19 +1,21 @@ <% if current_user.admin? || vm.sudo_users.include?(current_user) %> <% if vm.vm_ware_tools? %> <% vm_powered_on = vm.powered_on? %> - <%= link_to '', + <%= link_to (vm_powered_on ? fa_icon('stop') : fa_icon('play')), {controller: :vms, action: 'change_power_state', id: vm.name}, method: :post, - data: {confirm: "Are you sure you want to #{ vm_powered_on ? 'stop' : 'start' } '#{vm.name}'?"}, + data: { confirm: "Are you sure you want to #{ vm_powered_on ? 'stop' : 'start' } '#{vm.name}'?", + toggle: 'tooltip', placement: 'top' }, title: "#{ vm_powered_on ? 'Stop' : 'Start' } VM", - class: "btn btn-primary btn-sm fa #{ vm_powered_on ? 'fa-stop' : 'fa-play' }" %> + class: "btn btn-primary btn-sm" %> <% if vm.powered_on? %> - <%= link_to '', + <%= link_to fa_icon('repeat'), {controller: :vms, action: 'reboot_guest_os', id: vm.name}, method: :post, - data: {confirm: "Are you sure you want to reboot the guest OS of '#{vm.name}'?"}, + data: { confirm: "Are you sure you want to reboot the guest OS of '#{vm.name}'?", + toggle: 'tooltip', placement: 'top' }, title: 'Reboot VM', - class: "btn btn-primary btn-sm fa fa-repeat" %> + class: "btn btn-primary btn-sm" %> <% end %> <% end %> <% end %> \ No newline at end of file diff --git a/app/views/vms/_section.erb b/app/views/vms/_section.erb index 4c9245f0..f92fa53c 100644 --- a/app/views/vms/_section.erb +++ b/app/views/vms/_section.erb @@ -1,6 +1,6 @@ <% if should_be_shown vms %> -Status | -Name | -Project | -Responsible | +Status | +Name | +Project | +Responsible | <% unless buttons.nil? %> -Actions | +Actions | <% end %> - <%# Element hidden, used for search %> -Description |
---|---|---|---|---|---|---|---|---|---|---|
- <%= vm.status %> -
-
- |
- - <%= link_to vm.name, {controller: :vms, action: 'show', id: vm.name}, method: :get %> - | -- <% if vm.project.nil? %> - No project found! - <% else %> - <%= link_to vm.project.name, vm.project %> - <% end %> - | -
- <% if vm.responsible_users.empty? %>
- No responsible users found!
- <% else %>
- <%# https://getbootstrap.com/docs/4.0/content/typography/#inline %>
-
|
- <% unless buttons.nil? %>
- - <%= render buttons.to_s, vm: vm %> + <% vms.each do |vm| %> + | ||||||
+ <%= content_tag :div, nil, + title: vm.status, + :data => { toggle: 'tooltip', placement: 'right' }, + class: "round #{vm.archived? ? 'bg-secondary' : (vm.powered_on? ? 'bg-success' : 'bg-danger')}" %> + | + <%# Allow also searching for description %> ++ <%= link_to vm.name, vm_path(vm.name) %> | - <% end %> - <%# Element hidden, used for search %> -<%= vm.config&.description %> | -+ <% if vm.project.nil? %> + No project found! + <% else %> + <%= link_to vm.project.name, project_path(vm.project) %> + <% end %> + | +
+ <% if vm.responsible_users.empty? %>
+ No responsible users found!
+ <% else %>
+ <%# https://getbootstrap.com/docs/4.0/content/typography/#inline %>
+
|
+ <% unless buttons.nil? %>
+ <%= render buttons.to_s, vm: vm %> | + <% end %> + + <% end %> <%# vms.each %>