diff --git a/app/assets/tailwind/application.css b/app/assets/tailwind/application.css index f1d8c73..4b1a3f8 100644 --- a/app/assets/tailwind/application.css +++ b/app/assets/tailwind/application.css @@ -1 +1,3 @@ @import "tailwindcss"; +@plugin "@tailwindcss/forms"; +@custom-variant dark (&:where(.dark, .dark *)); diff --git a/app/views/admin/applications/_form.html.erb b/app/views/admin/applications/_form.html.erb index 14ff96e..d79accf 100644 --- a/app/views/admin/applications/_form.html.erb +++ b/app/views/admin/applications/_form.html.erb @@ -2,24 +2,43 @@ <%= render "shared/form_errors", form: form %>
- <%= form.label :name, class: "block text-sm font-medium text-gray-700" %> - <%= form.text_field :name, required: true, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "My Application" %> + <%= form.label :name, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %> + <%= form.text_field :name, required: true, class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "My Application" %>
- <%= form.label :slug, class: "block text-sm font-medium text-gray-700" %> - <%= form.text_field :slug, required: true, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm font-mono", placeholder: "my-app" %> -

Lowercase letters, numbers, and hyphens only. Used in URLs and API calls.

+ <%= form.label :slug, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %> + <%= form.text_field :slug, required: true, class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm font-mono", placeholder: "my-app" %> +

Lowercase letters, numbers, and hyphens only. Used in URLs and API calls.

- <%= form.label :description, class: "block text-sm font-medium text-gray-700" %> - <%= form.text_area :description, rows: 3, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "Optional description of this application" %> + <% if application.persisted? %> + Application Type +
+ + <%= application.oidc? ? "OpenID Connect (OIDC)" : "Forward Auth (Reverse Proxy)" %> + +
+ <%= form.hidden_field :app_type %> + + <% else %> + <%= form.label :app_type, "Application Type", class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %> + <%= form.select :app_type, [["OpenID Connect (OIDC)", "oidc"], ["Forward Auth (Reverse Proxy)", "forward_auth"]], {}, { + class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", + data: { action: "change->application-form#updateFieldVisibility", application_form_target: "appTypeSelect" } + } %> + <% end %> +
+ +
+ <%= form.label :description, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %> + <%= form.text_area :description, rows: 3, class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "Optional description of this application" %>
- <%= form.label :icon, "Application Icon", class: "block text-sm font-medium text-gray-700" %> + <%= form.label :icon, "Application Icon", class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %> @@ -32,8 +51,8 @@ <%# Only show icon if we can successfully get its URL (blob is persisted) %> <% if application.icon.blob&.persisted? && application.icon.blob.key.present? %>
- <%= image_tag application.icon, class: "h-16 w-16 rounded-lg object-cover border border-gray-200", alt: "Current icon" %> -
+ <%= image_tag application.icon, class: "h-16 w-16 rounded-lg object-cover border border-gray-200 dark:border-gray-700", alt: "Current icon" %> +

Current icon

<%= number_to_human_size(application.icon.blob.byte_size) %>

@@ -42,7 +61,7 @@ <% rescue ArgumentError => e %> <%# Handle case where icon attachment exists but can't generate signed_id %> <% if e.message.include?("Cannot get a signed_id for a new record") %> -
+

Icon uploaded

File will be processed shortly

@@ -54,17 +73,17 @@ <% end %>
-
- + -
-