Upgrade layout to grid+flex

This commit is contained in:
2023-12-04 20:36:03 +01:00
parent 8c6d296021
commit d98057caad
7 changed files with 178 additions and 136 deletions

View File

@@ -11,23 +11,24 @@
</head>
<body>
<div class="app-menu">
<header class="header">
<% if user_signed_in? %>
<%= image_link_to current_user.email, "account-wrench-outline",
edit_user_registration_path, current: :hide %>
<% if current_user_disguised? %>
<%= image_button_to t(".revert"), "incognito-off", revert_users_path %>
<% else %>
<%= image_button_to t(".sign_out"), "logout", destroy_user_session_path,
method: :delete %>
<% end %>
<%= image_link_to current_user.email, "account-wrench-outline",
edit_user_registration_path, current: :hide %>
<% else %>
<%= image_link_to t(:sign_in), "login", new_user_session_path, current: :hide %>
<%= image_link_to t(:register), "account-plus-outline", new_user_registration_path,
current: :hide %>
<%= image_link_to t(:sign_in), "login", new_user_session_path, current: :hide %>
<% end %>
</div>
</header>
<!--
<div class="flashes">
<% flash.each do |entry, message| %>
<div class="flash <%= entry %>">
@@ -35,12 +36,13 @@
<button tabindex="-1" onclick="this.parentElement.style.display='none';">&times;</button>
</div>
<% end %>
</div>
</div>
-->
<%# Allow overwriting/clearing navigation menu for some views %>
<div class="nav-menu">
<nav class="navigation">
<%= content_for(:navigation) || (navigation_menu if user_signed_in?) %>
</div>
</nav>
<%= yield %>
</body>

View File

@@ -1,10 +1,12 @@
<div class="contextual">
<div class="rightside">
<% if current_user.at_least(:active) %>
<%= image_link_to t(".add_unit"), "plus-outline", new_unit_path %>
<% end %>
</div>
<table class="items" id="units">
<%#= turbo_frame_tag 'unit_form' %>
<table class="main items" id="units">
<thead>
<tr>
<th><%= User.human_attribute_name(:symbol).capitalize %></th>
@@ -18,8 +20,9 @@
<tbody>
<% Unit.each_with_level(@units) do |unit, level| %>
<tr>
<td <%= "style=padding-left:0.5rem;" if level > 0 %>>
<%= link_to unit.symbol, edit_unit_path(unit) %>
<td>
<%= link_to unit.symbol, edit_unit_path(unit),
{style: level > 0 ? 'padding-left:0.6em;': ''} %>
</td>
<td><%= unit.name %></td>
<td class="number"><%= scientifize(unit.multiplier) unless unit.multiplier == 1 %></td>

View File

@@ -1,10 +1,10 @@
<table class="items" id="users">
<table class="main items" id="users">
<thead>
<tr>
<th><%= User.human_attribute_name(:email).capitalize %></th>
<th><%= User.human_attribute_name(:status).capitalize %></th>
<th><%= User.human_attribute_name(:confirmed_at).capitalize %></th>
<th><%= User.human_attribute_name(:created_at).capitalize %> <sup>UTC</sup></th>
<th><%= User.human_attribute_name(:created_at).capitalize %>&nbsp;<sup>UTC</sup></th>
<th><%= t :actions %></th>
</tr>
</thead>

View File

@@ -1,11 +1,11 @@
<% content_for :navigation, flush: true do %>
<div class="left">
<%= image_link_to t(:back), "arrow-left-bold-outline",
<%= image_link_to t(:back), 'arrow-left-bold-outline',
request.referer.present? ? :back : root_url %>
</div>
<div class="right">
<%= image_button_to t(".delete"), "account-remove-outline", user_registration_path,
class: "dangerous", method: :delete, onclick: {confirm: t(".confirm_delete")} %>
method: :delete, onclick: {confirm: t(".confirm_delete")} %>
</div>
<% end %>

View File

@@ -10,4 +10,4 @@
<% end %>
<%= content_tag :p, t(:or), style: "text-align: center;" %>
<%= image_link_to t(:recover_password), "lock-reset", new_user_password_path, class: "centered" %>
<%= image_link_to t(:recover_password), 'lock-reset', new_user_password_path, class: 'centered' %>