chore: init commit
in worker.../repo/GITFOLDER.zip is the .git folder.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<%= button_to "Finalize Grades", finalize_classroom_grade_book_path(@classroom, @grade_book),
|
||||
disabled: @grade_book.completed?,
|
||||
class: @grade_book.completed? ? "tw-btn-primary-disabled" : "tw-btn-primary",
|
||||
data: {
|
||||
autosave_target: "button",
|
||||
turbo_frame: "_top",
|
||||
turbo_confirm: "Are you sure you want to finalize these grades? This action cannot be undone."
|
||||
},
|
||||
form: { id: "finalize-button" } %>
|
||||
@@ -0,0 +1,38 @@
|
||||
<tr id="<%= dom_id(entry) %>">
|
||||
<%= fields_for "grade_entries[]", entry do |f| %>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
<%= entry.username.presence || content_tag(:span, "No username set", class: "text-gray-400 italic") %>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
<%= f.select :math_grade,
|
||||
options_for_select(GradeEntry::GRADE_OPTIONS, entry.math_grade),
|
||||
{ include_blank: true },
|
||||
disabled:,
|
||||
class: "block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",
|
||||
data: { testid: "math-grade-select" } %>
|
||||
</td>
|
||||
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
<%= f.select :reading_grade,
|
||||
options_for_select(GradeEntry::GRADE_OPTIONS, entry.reading_grade),
|
||||
{ include_blank: true },
|
||||
disabled:,
|
||||
class: "block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",
|
||||
data: { testid: "reading-grade-select" } %>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
<%= f.number_field :attendance_days,
|
||||
class: "block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",
|
||||
disabled:,
|
||||
min: 0,
|
||||
data: { testid: "attendance-days-input" } %>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
<%= f.checkbox :is_perfect_attendance,
|
||||
disabled:,
|
||||
class: "block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm",
|
||||
data: { testid: "perfect-attendance-checkbox" } %>
|
||||
</td>
|
||||
|
||||
<% end %>
|
||||
</tr>
|
||||
@@ -0,0 +1,7 @@
|
||||
<div id="submit-button">
|
||||
<%= button_tag "Save Grades",
|
||||
type: "submit",
|
||||
disabled: @grade_book.completed?,
|
||||
class: @grade_book.completed? ? "tw-btn-primary-disabled" : "tw-btn-primary",
|
||||
data: { autosave_target: "button" } %>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Student</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Math Grade</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Reading Grade</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Attendance Days</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Perfect Attendance?</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
<%= render partial: "grade_entry", collection: grade_book.grade_entries.sort_by { it.user.username }, as: :entry, locals: { disabled: grade_book.completed? } %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<% if grade_book.grade_entries.empty? %>
|
||||
<div class="text-center py-8">
|
||||
<p class="text-gray-500">No grade entries for this grade book yet.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,39 @@
|
||||
<% if notice.present? %>
|
||||
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
|
||||
<% end %>
|
||||
<% if alert.present? %>
|
||||
<p class="py-2 px-3 bg-red-50 mb-5 text-red-500 font-medium rounded-lg inline-block" id="alert"><%= alert %></p>
|
||||
<% end %>
|
||||
|
||||
<%= turbo_frame_tag @grade_book do %>
|
||||
<div class="mt-8"
|
||||
<% unless @grade_book.completed? %>
|
||||
data-controller="autosave"
|
||||
data-autosave-interval-value="30000"
|
||||
<% end %>>
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h3 class="text-lg font-medium text-gray-900">Grade Book</h3>
|
||||
<div data-autosave-target="status" class="text-sm text-gray-500"></div>
|
||||
</div>
|
||||
|
||||
<%= form_with model: [@classroom, @grade_book],
|
||||
url: classroom_grade_book_path(@classroom, @grade_book),
|
||||
method: :patch,
|
||||
html: { data: { autosave_target: "form" } } do |f| %>
|
||||
|
||||
<%= render partial: "table", locals: { grade_book: @grade_book } %>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<%= render partial: "submit_button" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if current_user.admin? %>
|
||||
<div class="flex flex-col items-center pt-4">
|
||||
<%= render partial: "finalize_button" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,3 @@
|
||||
<%= turbo_stream.replace "submit-button", partial: "grade_books/submit_button" %>
|
||||
<%= turbo_stream.replace "finalize-button", partial: "grade_books/finalize_button" %>
|
||||
|
||||
Reference in New Issue
Block a user