readd full page edit when validation fails (#671)

This commit is contained in:
Echo 2025-12-01 11:02:24 -05:00 committed by GitHub
parent de51ef0ce5
commit 558de82c96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,42 @@
<% content_for(:title) { "Edit Project Mapping" } %>
<div class="max-w-lg mx-auto mt-8">
<div class="bg-elevated rounded-xl p-6 border border-darkless">
<h1 class="text-2xl font-bold text-white mb-2">Edit Project Mapping</h1>
<p class="text-gray-400 mb-6">We try to autodetect your Git repository, but you can manually specify it if needed.</p>
<% if flash[:alert] %>
<div class="bg-red-900/50 border border-red-500 text-red-300 px-4 py-3 rounded-lg mb-4">
<%= flash[:alert] %>
</div>
<% end %>
<%= form_with model: @project_repo_mapping,
url: my_project_repo_mapping_path(CGI.escape(@project_repo_mapping.project_name)),
method: :patch,
local: true,
class: "w-full space-y-4" do |f| %>
<div class="space-y-2">
<%= f.label :project_name, "Project Name", class: "block text-sm font-semibold text-white" %>
<%= f.text_field :project_name,
value: @project_repo_mapping.project_name,
disabled: true,
class: "w-full px-4 py-3 bg-darkless text-secondary border border-darkless rounded-lg cursor-not-allowed" %>
<p class="text-xs text-gray-400">Project name cannot be changed.</p>
</div>
<div class="space-y-2 mb-4">
<%= f.label :repo_url, "Repository URL", class: "block text-sm font-semibold text-white" %>
<%= f.url_field :repo_url,
value: @project_repo_mapping.repo_url,
placeholder: "https://github.com/username/repo",
class: "w-full px-4 py-3 bg-darkless text-white border border-darkless rounded-lg focus:border-primary focus:outline-none transition-colors" %>
</div>
<div class="flex gap-3 justify-end">
<%= link_to "Cancel", my_projects_path, class: "px-4 py-2 border border-gray-600 text-gray-300 hover:bg-darkless rounded-lg transition-colors" %>
<%= f.submit "Update Project", class: "px-4 py-2 bg-primary text-white hover:bg-red rounded-lg font-medium cursor-pointer transition-colors" %>
</div>
<% end %>
</div>
</div>