<%= @classroom.name %>
<%= link_to edit_admin_classroom_path(@classroom),
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 %>
Edit
<% end %>
<%= classroom_archive_toggle_button(@classroom) %>
<%= link_to admin_classroom_path(@classroom),
data: { turbo_method: :delete, turbo_confirm: "Are you sure you want to delete this classroom?" },
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 %>
Delete
<% end %>
<%= admin_show_attributes(
@classroom,
attributes: %i[id name grades_display archived trading_enabled school_year created_at updated_at]
) %>
<% if @classroom.students.any? %>
Students (<%= @classroom.students.count %>)
<% @classroom.students.limit(10).each do |student| %>
-
<%= student.username %>
<% end %>
<% if @classroom.students.count > 10 %>
-
... and <%= @classroom.students.count - 10 %> more
<% end %>
<% else %>
No students in this classroom yet.
<% end %>
<% if @classroom.teachers.any? %>
Teachers
<% @classroom.teachers.each do |teacher| %>
-
<%= teacher.username %>
<% end %>
<% else %>
No teachers assigned to this classroom yet.
<% end %>