<% if notice.present? %>

<%= notice %>

<% end %>

Classrooms

<% if policy(Classroom).new? %> <%= link_to "New classroom", new_classroom_path, class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" %> <% end %>
<%= render "shared/table_container" do %> <%= sort_link(:name, "Name") %> Teacher(s) <%= sort_link(:student_count, "Student Count") %> <%= sort_link(:total_earnings, "Total Earnings") %> Edit <% if @classrooms.any? %> <% @classrooms.each do |classroom| %> <%= link_to classroom.name, classroom_path(classroom), class: "text-black underline hover:text-[var(--sitf-secondary-chart2)]" %>
<% if classroom.teachers.any? %> <% classroom.teachers.each do |teacher| %> <%= teacher.display_name %> <% end %> <% else %> No teacher assigned <% end %>
<%= classroom.students.count %> $<%= number_with_precision(classroom.students.sum { |s| s.portfolio&.calculate_total_value || 0 }, precision: 2) %> <% if policy(classroom).edit? %> <%= render partial: "components/action_icon_button", locals: { options: { path: edit_classroom_path(classroom), icon: "fa-pencil", title: "Edit classroom", aria_label: "Edit classroom", text_class: "text-black" } } %> <% else %> - <% end %> <% end %> <% else %>

No classrooms found

Create your first classroom to get started!

<% end %> <% end %>