chore: init commit
in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<%= form_with model: @school, url: @school.persisted? ? admin_school_path(@school) : admin_schools_path, builder: Admin::FormBuilder, class: "space-y-6" do |f| %>
|
||||
<div class="bg-white shadow-sm ring-1 ring-gray-900/5 rounded-lg">
|
||||
<div class="px-6 py-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-6">School Details</h3>
|
||||
|
||||
<%= f.text_field :name,
|
||||
label: "Name",
|
||||
hint: "Enter the school name",
|
||||
placeholder: "Lincoln Elementary School" %>
|
||||
|
||||
<%= f.collection_check_boxes :year_ids, @years, :id, :name,
|
||||
label: "Years",
|
||||
hint: "Select the school years this school will be active" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-end gap-x-4">
|
||||
<%= f.cancel_button "Cancel", url: @school.persisted? ? admin_school_path(@school) : admin_schools_path %>
|
||||
<%= f.submit_button @school.persisted? ? "Update School" : "Create School" %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,10 @@
|
||||
<div class="max-w-7xl mx-auto">
|
||||
<%= admin_breadcrumbs(@breadcrumbs) %>
|
||||
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-gray-900">Edit School</h1>
|
||||
<p class="text-gray-600 mt-2"><%= @school.name %></p>
|
||||
</div>
|
||||
|
||||
<%= render "form" %>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div class="max-w-7xl mx-auto">
|
||||
<%= admin_breadcrumbs(@breadcrumbs) %>
|
||||
|
||||
<%= admin_table(
|
||||
@schools,
|
||||
columns: [
|
||||
{ attribute: :id, label: "ID", sortable: true },
|
||||
{ attribute: :name, label: "Name", sortable: true },
|
||||
{ attribute: :created_at, label: "Created", sortable: true }
|
||||
],
|
||||
title: "Schools",
|
||||
actions: link_to(
|
||||
"New School",
|
||||
new_admin_school_path,
|
||||
class: "inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700"
|
||||
),
|
||||
empty_message: "No schools found. Create your first school to get started."
|
||||
) %>
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<div class="max-w-7xl mx-auto">
|
||||
<%= admin_breadcrumbs(@breadcrumbs) %>
|
||||
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-gray-900">New School</h1>
|
||||
</div>
|
||||
|
||||
<%= render "form" %>
|
||||
</div>
|
||||
@@ -0,0 +1,52 @@
|
||||
<div class="max-w-7xl mx-auto">
|
||||
<%= admin_breadcrumbs(@breadcrumbs) %>
|
||||
|
||||
<div class="bg-white shadow-sm ring-1 ring-gray-900/5 rounded-lg mb-6">
|
||||
<div class="px-6 py-6">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<h2 class="text-2xl font-bold text-gray-900"><%= @school.name %></h2>
|
||||
<div class="flex gap-3">
|
||||
<%= link_to edit_admin_school_path(@school),
|
||||
class: "inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50" do %>
|
||||
<i class="fas fa-edit -ml-1 mr-2 h-5 w-5 text-gray-500"></i>
|
||||
Edit
|
||||
<% end %>
|
||||
<%= link_to admin_school_path(@school),
|
||||
data: { turbo_method: :delete, turbo_confirm: "Are you sure you want to delete this school?" },
|
||||
class: "inline-flex items-center px-4 py-2 border border-red-300 shadow-sm text-sm font-medium rounded-md text-red-700 bg-white hover:bg-red-50" do %>
|
||||
<i class="fas fa-trash -ml-1 mr-2 h-5 w-5 text-red-500"></i>
|
||||
Delete
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= admin_show_attributes(
|
||||
@school,
|
||||
attributes: %i[id name created_at updated_at]
|
||||
) %>
|
||||
|
||||
<!-- Associated Years -->
|
||||
<% if @school.years.any? %>
|
||||
<div class="mt-6 pt-6 border-t border-gray-200">
|
||||
<h3 class="text-sm font-medium text-gray-500 mb-3">Associated Years</h3>
|
||||
<ul class="space-y-2">
|
||||
<% @school.years.each do |year| %>
|
||||
<li class="text-sm text-gray-900">
|
||||
<%= year.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="mt-6 pt-6 border-t border-gray-200">
|
||||
<p class="text-sm text-gray-500">No years associated with this school yet.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-3">
|
||||
<%= link_to "Back to Schools", admin_schools_path,
|
||||
class: "inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50" %>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user