chore: init commit
in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<%= form_with model: @school_year, url: @school_year.persisted? ? admin_school_year_path(@school_year) : admin_school_years_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 Year Details</h3>
|
||||
|
||||
<%= f.base_errors %>
|
||||
|
||||
<%= f.select :school_id,
|
||||
options_from_collection_for_select(
|
||||
School.order(:name),
|
||||
:id,
|
||||
:name,
|
||||
@school_year.school_id
|
||||
),
|
||||
label: "School",
|
||||
hint: "Select the school for this school year",
|
||||
include_blank: "Select a school" %>
|
||||
|
||||
<%= f.select :year_id,
|
||||
options_from_collection_for_select(
|
||||
Year.ordered_by_start_year,
|
||||
:id,
|
||||
:name,
|
||||
@school_year.year_id
|
||||
),
|
||||
label: "Year",
|
||||
hint: "Select the year for this school year",
|
||||
include_blank: "Select a year" %>
|
||||
|
||||
<% if @school_year.new_record? %>
|
||||
<div class="mt-6 pt-6 border-t border-gray-200">
|
||||
<p class="text-sm text-gray-600">
|
||||
<i class="fas fa-info-circle mr-1"></i>
|
||||
Four quarters will be automatically created for this school year.
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-end gap-x-4">
|
||||
<%= f.cancel_button "Cancel", url: @school_year.persisted? ? admin_school_year_path(@school_year) : admin_school_years_path %>
|
||||
<%= f.submit_button @school_year.persisted? ? "Update School Year" : "Create School Year" %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="max-w-7xl mx-auto">
|
||||
<%= admin_breadcrumbs(@breadcrumbs) %>
|
||||
|
||||
<h1 class="text-3xl font-bold text-gray-900 mb-8">Edit School Year</h1>
|
||||
|
||||
<%= render "form", school_year: @school_year %>
|
||||
</div>
|
||||
@@ -0,0 +1,79 @@
|
||||
<div class="max-w-7xl mx-auto">
|
||||
<%= admin_breadcrumbs(@breadcrumbs) %>
|
||||
|
||||
<div class="bg-white shadow-sm ring-1 ring-gray-900/5 rounded-lg overflow-hidden">
|
||||
<div class="px-4 py-5 sm:px-6 border-b border-gray-200 flex justify-between items-center">
|
||||
<h3 class="text-lg font-semibold text-gray-900">School Years</h3>
|
||||
<div class="flex gap-2">
|
||||
<%= link_to "New School Year", new_admin_school_year_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" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-300">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||
<%= sort_link(:id, "ID") %>
|
||||
</th>
|
||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||
School
|
||||
</th>
|
||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||
Year
|
||||
</th>
|
||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
|
||||
<%= sort_link(:created_at, "Created At") %>
|
||||
</th>
|
||||
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
||||
<span class="sr-only">Actions</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 bg-white">
|
||||
<% if @school_years.any? %>
|
||||
<% @school_years.each do |school_year| %>
|
||||
<tr class="hover:bg-gray-50 transition-colors cursor-pointer"
|
||||
data-controller="clickable-row"
|
||||
data-clickable-row-url-value="<%= admin_school_year_path(school_year) %>"
|
||||
data-action="click->clickable-row#navigate">
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900">
|
||||
<%= school_year.id %>
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900">
|
||||
<%= school_year.school_name %>
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900">
|
||||
<%= school_year.year_name %>
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900">
|
||||
<%= school_year.created_at.strftime("%B %d, %Y") %>
|
||||
</td>
|
||||
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
|
||||
<div class="flex justify-end gap-2">
|
||||
<%= link_to "View", admin_school_year_path(school_year), class: "text-blue-600 hover:text-blue-800" %>
|
||||
<%= link_to "Edit", edit_admin_school_year_path(school_year), class: "text-gray-600 hover:text-gray-800" %>
|
||||
<%= link_to "Delete", admin_school_year_path(school_year),
|
||||
data: { turbo_method: :delete, turbo_confirm: "Are you sure?" },
|
||||
class: "text-red-600 hover:text-red-800" %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="5" class="px-3 py-12 text-center text-sm text-gray-500">
|
||||
<div class="flex flex-col items-center">
|
||||
<i class="fas fa-inbox text-4xl text-gray-300 mb-3"></i>
|
||||
<p class="font-medium">No records found</p>
|
||||
<p class="text-gray-400 mt-1">No school years found. Create your first school year to get started.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="max-w-7xl mx-auto">
|
||||
<%= admin_breadcrumbs(@breadcrumbs) %>
|
||||
|
||||
<h1 class="text-3xl font-bold text-gray-900 mb-8">New School Year</h1>
|
||||
|
||||
<%= render "form", school_year: @school_year %>
|
||||
</div>
|
||||
@@ -0,0 +1,71 @@
|
||||
<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_year.school_name} (#{@school_year.year_name})" %></h2>
|
||||
<div class="flex gap-3">
|
||||
<%= link_to edit_admin_school_year_path(@school_year),
|
||||
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_year_path(@school_year),
|
||||
data: { turbo_method: :delete, turbo_confirm: "Are you sure you want to delete this school year?" },
|
||||
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_year,
|
||||
attributes: %i[id school_name year_name created_at updated_at]
|
||||
) %>
|
||||
|
||||
<!-- Associated Classrooms -->
|
||||
<% if @school_year.classrooms.any? %>
|
||||
<div class="mt-6 pt-6 border-t border-gray-200">
|
||||
<h3 class="text-sm font-medium text-gray-500 mb-3">Classrooms (<%= @school_year.classrooms.count %>)</h3>
|
||||
<ul class="space-y-2">
|
||||
<% @school_year.classrooms.limit(10).each do |classroom| %>
|
||||
<li class="text-sm text-gray-900">
|
||||
<%= classroom.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @school_year.classrooms.count > 10 %>
|
||||
<li class="text-sm text-gray-500">
|
||||
... and <%= @school_year.classrooms.count - 10 %> more
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="mt-6 pt-6 border-t border-gray-200">
|
||||
<p class="text-sm text-gray-500">No classrooms associated with this school year yet.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!-- Associated Quarters -->
|
||||
<% if @school_year.quarters.any? %>
|
||||
<div class="mt-6 pt-6 border-t border-gray-200">
|
||||
<h3 class="text-sm font-medium text-gray-500 mb-3">Quarters</h3>
|
||||
<ul class="space-y-2">
|
||||
<% @school_year.quarters.order(:number).each do |quarter| %>
|
||||
<li class="text-sm text-gray-900">
|
||||
<%= quarter.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-3">
|
||||
<%= link_to "Back to School Years", admin_school_years_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