ubicloud/views/admin/index.erb
Jeremy Evans 750ebdc055 Change from erb_formatter to herb/formatter
Currently, herb/formatter has at least 4 bugs the prevent us from
switching to it (https://github.com/marcoroth/herb/issues 476, 477,
478, and 479). This includes manual fixes for each issue.

herb/formatter also introduces a rubocop violation for the
Layout/AssignmentIndentation cop. This disables that cop.
2025-09-05 14:01:01 -07:00

61 lines
1.6 KiB
Text

<% @content_class = "" %>
<% unless @grouped_pages.empty? %>
<table class="page-table">
<caption>Active Pages</caption>
<thead>
<tr>
<th>VmHost</th>
<th>UBID</th>
<th>Created At</th>
<th>Summary</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<% @grouped_pages.sort_by { |k,| k || "z" }.each do |vmh_ubid, pages| %>
<% pages.each_with_index do |page, index| %>
<tr>
<% if index == 0 %>
<td rowspan="<%= pages.size %>">
<% if vmh_ubid %>
<a href="/model/VmHost/<%= vmh_ubid %>"><%= vmh_ubid %></a>
<% end %>
</td>
<% end %>
<td><a href="/model/Page/<%= page.ubid %>"><%= page.ubid %></a></td>
<td><%= page.created_at.strftime("%F %T") %></td>
<td><%= page.summary %></td>
<td>
<%== h(page.details).gsub(/\b[a-tv-z0-9]{26}\b/) do
if (klass = UBID.class_for_ubid(it))
"<a href=\"/model/#{klass}/#{it}\">#{it}</a>"
else
it
end
end %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<% end %>
<div class="container">
<h2>Browse by Model Class</h2>
<ul id="model-class-list">
<% @classes.each do |klass| %>
<li><a href="/model/<%= klass %>"><%= klass %></a></li>
<% end %>
</ul>
<h2 class="container">Manage</h2>
<ul>
<li><a href="/change-password">Change Password</a></li>
<li><a href="/multifactor-manage">Manage Multifactor Authentication</a></li>
</ul>
</div>