chore: init commit

in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
2026-08-11 14:44:09 -04:00
parent 0012380fd3
commit 392781f7aa
781 changed files with 65944 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<div class="flex flex-wrap gap-3">
<% if actions.include?(:edit) %>
<%= link_to [:edit, :admin, resource], 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 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" do %>
<i class="fas fa-edit -ml-1 mr-2 h-5 w-5 text-gray-500"></i>
Edit
<% end %>
<% end %>
<% if actions.include?(:delete) %>
<%= link_to [:admin, resource],
data: { turbo_method: :delete, turbo_confirm: "Are you sure you want to delete this #{resource.class.name.downcase}?" },
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 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" do %>
<i class="fas fa-trash -ml-1 mr-2 h-5 w-5 text-red-500"></i>
Delete
<% end %>
<% end %>
<% custom_actions.each do |action| %>
<%= link_to action[:path],
method: action[:method] || :get,
data: action[:data] || {},
class: "inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md #{action[:class] || 'text-gray-700 bg-white hover:bg-gray-50'} focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" do %>
<% if action[:icon] %>
<i class="<%= action[:icon] %> -ml-1 mr-2 h-5 w-5"></i>
<% end %>
<%= action[:label] %>
<% end %>
<% end %>
</div>

View File

@@ -0,0 +1,25 @@
<nav class="flex mb-6" aria-label="Breadcrumb">
<ol class="inline-flex items-center space-x-1 md:space-x-3">
<li class="inline-flex items-center">
<%= link_to admin_root_path, class: "inline-flex items-center text-sm font-medium text-gray-700 hover:text-blue-600" do %>
<i class="fas fa-home w-4 h-4 mr-2"></i>
Dashboard
<% end %>
</li>
<% breadcrumbs.each_with_index do |crumb, index| %>
<li>
<div class="flex items-center">
<i class="fas fa-chevron-right w-3 h-3 text-gray-400 mx-1"></i>
<% if index == breadcrumbs.length - 1 %>
<span class="ml-1 text-sm font-medium text-gray-500 md:ml-2">
<%= crumb[:label] %>
</span>
<% else %>
<%= link_to crumb[:label], crumb[:path], class: "ml-1 text-sm font-medium text-gray-700 hover:text-blue-600 md:ml-2" %>
<% end %>
</div>
</li>
<% end %>
</ol>
</nav>

View File

@@ -0,0 +1,92 @@
<div class="space-y-6">
<!-- Dashboard -->
<div>
<%= link_to root_path, class: "flex items-center px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 rounded-lg transition-colors" do %>
<i class="fas fa-home w-5 mr-3 text-gray-500"></i>
Dashboard
<% end %>
</div>
<!-- Academic Section -->
<div>
<h3 class="px-3 text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2">
Academic
</h3>
<div class="space-y-1">
<%= link_to admin_classrooms_path, class: "flex items-center px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 rounded-lg transition-colors" do %>
<i class="fas fa-chalkboard w-5 mr-3 text-gray-500"></i>
Classrooms
<% end %>
<%= link_to admin_schools_path, class: "flex items-center px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 rounded-lg transition-colors" do %>
<i class="fas fa-school w-5 mr-3 text-gray-500"></i>
Schools
<% end %>
<%= link_to admin_school_years_path, class: "flex items-center px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 rounded-lg transition-colors" do %>
<i class="fas fa-calendar-check w-5 mr-3 text-gray-500"></i>
School Years
<% end %>
</div>
</div>
<!-- Users Section -->
<div>
<h3 class="px-3 text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2">
Users
</h3>
<div class="space-y-1">
<%= link_to admin_students_path, class: "flex items-center px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 rounded-lg transition-colors" do %>
<i class="fas fa-user-graduate w-5 mr-3 text-gray-500"></i>
Students
<% end %>
<%= link_to admin_teachers_path, class: "flex items-center px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 rounded-lg transition-colors" do %>
<i class="fas fa-chalkboard-teacher w-5 mr-3 text-gray-500"></i>
Teachers
<% end %>
<%= link_to admin_users_path, class: "flex items-center px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 rounded-lg transition-colors" do %>
<i class="fas fa-users w-5 mr-3 text-gray-500"></i>
Users
<% end %>
</div>
</div>
<!-- Portfolio Section -->
<div>
<h3 class="px-3 text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2">
Portfolio
</h3>
<div class="space-y-1">
<%= link_to admin_stocks_path, class: "flex items-center px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 rounded-lg transition-colors" do %>
<i class="fas fa-chart-line w-5 mr-3 text-gray-500"></i>
Stocks
<% end %>
</div>
</div>
<!-- Content Section -->
<div>
<h3 class="px-3 text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2">
Content
</h3>
<div class="space-y-1">
<%= link_to admin_announcements_path, class: "flex items-center px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900 rounded-lg transition-colors" do %>
<i class="fas fa-bullhorn w-5 mr-3 text-gray-500"></i>
Announcements
<% end %>
</div>
</div>
<!-- Development Section (remove in production) -->
<% if Rails.env.development? %>
<div>
<h3 class="px-3 text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2">
Development
</h3>
<div class="space-y-1">
<%= link_to admin_component_demo_index_path, class: "flex items-center px-3 py-2 text-sm font-medium text-purple-700 hover:bg-purple-50 hover:text-purple-900 rounded-lg transition-colors" do %>
<i class="fas fa-flask w-5 mr-3 text-purple-500"></i>
Component Demo
<% end %>
</div>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,32 @@
<% if collection.respond_to?(:total_pages) && collection.total_pages > 1 %>
<nav class="flex items-center justify-between" aria-label="Pagination">
<div class="hidden sm:block">
<p class="text-sm text-gray-700">
Showing
<span class="font-medium"><%= collection.offset_value + 1 %></span>
to
<span class="font-medium"><%= [collection.offset_value + collection.limit_value, collection.total_count].min %></span>
of
<span class="font-medium"><%= collection.total_count %></span>
results
</p>
</div>
<div class="flex flex-1 justify-between sm:justify-end">
<% if collection.prev_page %>
<%= link_to "Previous", request.params.merge(page: collection.prev_page), class: "relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50" %>
<% else %>
<span class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-400 bg-gray-100 cursor-not-allowed">
Previous
</span>
<% end %>
<% if collection.next_page %>
<%= link_to "Next", request.params.merge(page: collection.next_page), class: "ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50" %>
<% else %>
<span class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-400 bg-gray-100 cursor-not-allowed">
Next
</span>
<% end %>
</div>
</nav>
<% end %>

View File

@@ -0,0 +1,38 @@
<% filters ||= [] %>
<% search_placeholder ||= "Search..." %>
<div class="bg-white p-4 shadow-sm ring-1 ring-gray-900/5 rounded-lg mb-6">
<%= form_with url: request.path, method: :get, class: "space-y-4 sm:space-y-0 sm:flex sm:items-center sm:gap-4" do |form| %>
<!-- Search Field -->
<div class="flex-1">
<label for="search" class="sr-only">Search</label>
<div class="relative">
<div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-5">
<i class="fas fa-search h-4 w-4 text-gray-400"></i>
</div>
<%= form.text_field :search,
value: params[:search],
placeholder: search_placeholder,
class: "block w-full rounded-md border-0 py-2 pl-14 pr-3 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6" %>
</div>
</div>
<!-- Filter Dropdowns -->
<% filters.each do |filter| %>
<div class="sm:w-48">
<label for="<%= filter[:name] %>" class="sr-only"><%= filter[:label] %></label>
<%= form.select filter[:name],
options_for_select(filter[:options], params[filter[:name]]),
{ include_blank: filter[:label] },
class: "block w-full rounded-md border-0 py-2 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6" %>
</div>
<% end %>
<!-- Action Buttons -->
<div class="flex gap-2">
<%= form.submit "Filter", class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" %>
<% if params[:search].present? || filters.any? { |f| params[f[:name]].present? } %>
<%= link_to "Clear", request.path, class: "inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" %>
<% end %>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,16 @@
<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">
<dl class="divide-y divide-gray-200">
<% attributes.each do |attribute| %>
<div class="py-4 sm:grid sm:grid-cols-3 sm:gap-4" data-testid="<%= attribute %>">
<dt class="text-sm font-medium text-gray-500">
<%= attribute.to_s.humanize %>
</dt>
<dd class="mt-1 text-sm text-gray-900 sm:col-span-2 sm:mt-0">
<%= format_attribute(resource, attribute) %>
</dd>
</div>
<% end %>
</dl>
</div>
</div>

View File

@@ -0,0 +1,86 @@
<div class="bg-white shadow-sm ring-1 ring-gray-900/5 rounded-lg overflow-hidden">
<% if local_assigns[:title] || local_assigns[:actions] %>
<div class="px-4 py-5 sm:px-6 border-b border-gray-200 flex justify-between items-center">
<% if local_assigns[:title] %>
<h3 class="text-lg font-semibold text-gray-900"><%= title %></h3>
<% end %>
<% if local_assigns[:actions] %>
<div class="flex gap-2">
<%= actions %>
</div>
<% end %>
</div>
<% end %>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-300">
<thead class="bg-gray-50">
<tr>
<% columns.each do |column| %>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
<% if column[:sortable] %>
<%= sort_link(column[:attribute], column[:label]) %>
<% else %>
<%= column[:label] %>
<% end %>
</th>
<% end %>
<% if options[:show_actions] != false %>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
<span class="sr-only">Actions</span>
</th>
<% end %>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
<% if collection.any? %>
<% collection.each do |record| %>
<tr id="<%= dom_id(record) %>" class="hover:bg-gray-50 transition-colors cursor-pointer"
data-controller="clickable-row"
data-clickable-row-url-value="<%= url_for([:admin, route_model(record)]) %>"
data-action="click->clickable-row#navigate">
<% columns.each do |column| %>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900" data-testid="<%= column[:attribute] %>">
<% if column[:link] %>
<%= link_to format_attribute(record, column[:attribute]), [:admin, route_model(record)], class: "text-blue-600 hover:text-blue-800 font-medium" %>
<% else %>
<%= format_attribute(record, column[:attribute]) %>
<% end %>
</td>
<% end %>
<% if options[:show_actions] != false %>
<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, route_model(record)], class: "text-blue-600 hover:text-blue-800" %>
<%= link_to "Edit", [:edit, :admin, route_model(record)], class: "text-gray-600 hover:text-gray-800" %>
<%= link_to "Delete", [:admin, route_model(record)],
data: { turbo_method: :delete, turbo_confirm: "Are you sure?" },
class: "text-red-600 hover:text-red-800" %>
</div>
</td>
<% end %>
</tr>
<% end %>
<% else %>
<tr>
<td colspan="<%= columns.length + (options[:show_actions] == false ? 0 : 1) %>" 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>
<% if options[:empty_message] %>
<p class="text-gray-400 mt-1"><%= options[:empty_message] %></p>
<% end %>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% if collection.respond_to?(:total_pages) && collection.total_pages > 1 %>
<div class="px-4 py-3 border-t border-gray-200 sm:px-6">
<%= render "admin/shared/pagination", collection: collection %>
</div>
<% end %>
</div>