Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/controllers/admin/dashboards_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Admin::DashboardsController < Admin::ApplicationController
def show
end
end
2 changes: 0 additions & 2 deletions app/views/admin/allocation_categories/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<h1 class="mt-1 text-2xl font-semibold tracking-tight text-ink">Allocation categories</h1>
</div>
<div class="flex items-center gap-3">
<%= link_to "← Dashboard", admin_scenarios_path,
class: "rounded border border-line px-2.5 py-1.5 text-sm text-ink-soft hover:bg-surface-soft hover:text-ink" %>
<%= link_to "New category", new_admin_allocation_category_path,
data: { controller: "typed-link", action: "tabs:change@window->typed-link#update",
typed_link_base_path_value: new_admin_allocation_category_path,
Expand Down
24 changes: 24 additions & 0 deletions app/views/admin/dashboards/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<% content_for :title, "Dashboard" %>

<div class="mx-auto max-w-6xl w-full px-6 py-10">
<div class="flex flex-wrap items-end justify-between gap-4 border-b border-line pb-5">
<div>
<p class="text-xs font-semibold uppercase tracking-wider text-ink-faint">Admin</p>
<h1 class="mt-1 text-2xl font-semibold tracking-tight text-ink">Dashboard</h1>
</div>
</div>

<div class="mt-6 grid gap-4 sm:grid-cols-2">
<%= link_to admin_scenarios_path,
class: "block rounded-lg border border-line bg-surface p-5 hover:bg-surface-soft transition" do %>
<h2 class="text-lg font-semibold text-ink">Scenarios</h2>
<p class="mt-1 text-sm text-ink-soft">View and manage scenarios across the organization.</p>
<% end %>

<%= link_to admin_allocation_categories_path,
class: "block rounded-lg border border-line bg-surface p-5 hover:bg-surface-soft transition" do %>
<h2 class="text-lg font-semibold text-ink">Allocation categories</h2>
<p class="mt-1 text-sm text-ink-soft">Manage the categories used in allocations.</p>
<% end %>
</div>
</div>
2 changes: 0 additions & 2 deletions app/views/admin/scenarios/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<h1 class="mt-1 text-2xl font-semibold tracking-tight text-ink">Scenarios</h1>
</div>
<div class="flex items-center gap-3">
<%= link_to "Manage categories", admin_allocation_categories_path,
class: "rounded border border-line px-2.5 py-1.5 text-sm text-ink-soft hover:bg-surface-soft hover:text-ink" %>
<%= form_with url: admin_scenarios_path, method: :get,
data: { controller: "debounced-form", action: "input->debounced-form#submit",
turbo_frame: "scenarios_table", turbo_action: "advance" } do |form| %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<% if authenticated? %>
<%= link_to "Explore options", scenarios_path, class: "text-ink-soft hover:text-ink" %>
<% if Current.user&.admin_of?(Current.organization) %>
<%= link_to "Admin Dashboard", admin_scenarios_path, class: "text-ink-soft hover:text-ink" %>
<%= link_to "Admin Dashboard", admin_dashboard_path, class: "text-ink-soft hover:text-ink" %>
<%= link_to "Members", organization_memberships_path, class: "text-ink-soft hover:text-ink" %>
<% end %>
<%= link_to "Profile", users_profile_path, class: "text-ink-soft hover:text-ink" %>
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
end

namespace :admin do
resource :dashboard, only: :show
resources :scenarios, only: :index
resources :allocation_categories, only: %i[ index new create edit update destroy ]
end
Expand Down
Loading