Internaly only view
Adds plan name and indicates when overrides exceed limits; cleans up UI at bit
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
.txt-ink { color: var(--color-ink); }
|
||||
.txt-reversed { color: var(--color-ink-inverted); }
|
||||
.txt-negative { color: var(--color-negative); }
|
||||
.txt-positive { color: var(--color-positive); }
|
||||
.txt-subtle { color: var(--color-ink-dark); }
|
||||
.txt-alert { color: var(--color-marker); }
|
||||
.txt-undecorated { text-decoration: none; }
|
||||
|
||||
@@ -1,46 +1,63 @@
|
||||
<div class="panel shadow center" style="--panel-size: 50ch;">
|
||||
<div class="flex flex-column gap txt-medium">
|
||||
<h1 class="txt-x-large font-weight-black margin-block-none">Edit Account <%= @account.external_account_id %></h1>
|
||||
<% @page_title = "Account admin" %>
|
||||
|
||||
<dl class="flex flex-column gap-half margin-block-none">
|
||||
<div class="flex gap-half">
|
||||
<dt class="font-weight-bold">Name:</dt>
|
||||
<dd class="margin-inline-start-none"><%= @account.name %></dd>
|
||||
</div>
|
||||
<div class="flex gap-half">
|
||||
<dt class="font-weight-bold">Actual card count:</dt>
|
||||
<dd class="margin-inline-start-none"><%= @account.cards_count %></dd>
|
||||
</div>
|
||||
<div class="flex gap-half">
|
||||
<dt class="font-weight-bold">Actual bytes used:</dt>
|
||||
<dd class="margin-inline-start-none"><%= storage_to_human_size(@account.bytes_used) %></dd>
|
||||
</div>
|
||||
</dl>
|
||||
<% content_for :header do %>
|
||||
<div class="header__actions header__actions--start">
|
||||
<%= back_link_to "Accounts", saas.admin_accounts_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="panel panel--wide shadow center">
|
||||
<div class="flex flex-column gap txt-medium">
|
||||
<h1 class="txt-x-large font-weight-black margin-none">Edit Account <%= @account.external_account_id %></h1>
|
||||
|
||||
<%= form_with model: @account, url: saas.admin_account_path(@account.external_account_id), class: "flex flex-column gap" do |form| %>
|
||||
<div class="flex align-center gap-half">
|
||||
<%= form.label :card_count, "Override card count", class: "font-weight-bold" %>
|
||||
<%= form.number_field :card_count, value: @account.overridden_limits&.card_count, class: "input" %>
|
||||
</div>
|
||||
<table class="txt-align-start">
|
||||
<tr>
|
||||
<td class="txt-subtle">Account Name:</td>
|
||||
<td class="margin-inline-start-none"><%= @account.name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="txt-subtle">Subscription plan:</td>
|
||||
<td class="margin-inline-start-none"><%= @account.plan.name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="txt-subtle">Actual card count:</td>
|
||||
<td class="margin-inline-start-none"><%= @account.cards_count %> cards </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="txt-subtle">Actual bytes used:</td>
|
||||
<td class="margin-inline-start-none"><%= storage_to_human_size(@account.bytes_used) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<%= form.label :card_count, class: "txt-subtle" do %>
|
||||
<span>Override card count</span><br><%= "(Exceeds plan limit)" if @account.exceeding_card_limit? %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= form.number_field :card_count, value: @account.overridden_limits&.card_count, class: "input" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<%= form.label :bytes_used, class: "txt-subtle" do %>
|
||||
<span>Override bytes used</span><br><%= "(Exceeds plan limit)" if @account.exceeding_storage_limit? %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= form.number_field :bytes_used, value: @account.overridden_limits&.bytes_used, class: "input" %></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="flex align-center gap-half">
|
||||
<%= form.label :bytes_used, "Override bytes used", class: "font-weight-bold" %>
|
||||
<%= form.number_field :bytes_used, value: @account.overridden_limits&.bytes_used, class: "input" %>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn--reversed">Save</button>
|
||||
<button type="submit" class="btn btn--link full-width">Save changes</button>
|
||||
<% end %>
|
||||
|
||||
<% if @account.overridden_limits %>
|
||||
<%= button_to "Reset limits", saas.admin_account_overridden_limits_path(@account.external_account_id), method: :delete, class: "btn btn--negative" %>
|
||||
<%= button_to "Reset limits", saas.admin_account_overridden_limits_path(@account.external_account_id), method: :delete, class: "btn btn--negative full-width" %>
|
||||
<% end %>
|
||||
|
||||
<% if @account.comped? %>
|
||||
<%= button_to "Uncomp account", saas.admin_account_billing_waiver_path(@account.external_account_id), method: :delete, class: "btn btn--negative" %>
|
||||
<%= button_to "Uncomp account", saas.admin_account_billing_waiver_path(@account.external_account_id), method: :delete, class: "btn btn--plain txt-negative txt-underline" %>
|
||||
<% else %>
|
||||
<%= button_to "Comp account", saas.admin_account_billing_waiver_path(@account.external_account_id), method: :post, class: "btn btn--positive" %>
|
||||
<%= button_to "Comp account", saas.admin_account_billing_waiver_path(@account.external_account_id), method: :post, class: "btn btn--plain txt-positive txt-underline" %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "Back to accounts", saas.admin_accounts_path, class: "btn btn--plain txt-link" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
<h1>Find Account</h1>
|
||||
<div class="panel panel--centered">
|
||||
<div class="flex flex-column gap txt-medium">
|
||||
<h1 class="txt-x-large font-weight-black margin-none">Find an account</h1>
|
||||
|
||||
<%= form_with url: saas.admin_account_search_path, class: "flex flex-column gap" do |form| %>
|
||||
<%= form.text_field :q, placeholder: "Account ID", autofocus: true, class: "input" %>
|
||||
<%= form.submit "Search", class: "btn btn--link" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<%= form_with url: saas.admin_account_search_path do |form| %>
|
||||
<%= form.text_field :q, placeholder: "Account ID", autofocus: true %>
|
||||
<%= form.submit "Search" %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user