From e440fbe6023c6e687966e748964ab490700d784f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=B6hm?= Date: Mon, 16 Sep 2024 13:40:04 +0200 Subject: [PATCH] Added some dasboard items --- .../admin/dashboards_controller.rb | 2 ++ app/views/admin/dashboards/show.html.erb | 31 ++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/dashboards_controller.rb b/app/controllers/admin/dashboards_controller.rb index 6cd87cf..0644486 100644 --- a/app/controllers/admin/dashboards_controller.rb +++ b/app/controllers/admin/dashboards_controller.rb @@ -1,6 +1,8 @@ class Admin::DashboardsController < ApplicationController before_action :authorize! def show + @user = User.all + @jobs = Job.currently_working_on end def authorize! diff --git a/app/views/admin/dashboards/show.html.erb b/app/views/admin/dashboards/show.html.erb index daa4224..b3d055c 100644 --- a/app/views/admin/dashboards/show.html.erb +++ b/app/views/admin/dashboards/show.html.erb @@ -7,4 +7,33 @@
  • Übersicht Tutoren (Statistiken/Jobs)
  • Drucker?(Statistiken/Jobs/Verbrauchsmaterialien )
  • - \ No newline at end of file + +
    + <%= link_to admin_users_path() do %> +
    +

    Benutzer:

    +

    <%= @user.count %>

    +
    + <% end %> + <%= link_to admin_users_path() do %> +
    +

    Tutoren:

    +

    <%= @user.operator.count %>

    +
    + <% end %> + <%= link_to admin_users_path() do %> +
    +

    Admins:

    +

    <%= @user.admin.count %>

    +
    + <% end %> +
    +
    +

    Aktueller Monat

    + <%= link_to admin_users_path() do %> +
    +

    aktuelle Druckaufträge:

    +

    <%= @jobs.count %>

    +
    + <% end %> +