47 lines
2.2 KiB
Plaintext
47 lines
2.2 KiB
Plaintext
<div class="mx-auto w-full flex">
|
|
<div class="mx-auto w-full">
|
|
<% 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 %>
|
|
|
|
<div class="flex gap-4 items-center justify-between my-6">
|
|
<div class="flex gap-4">
|
|
<h1 class="text-3xl font-bold">
|
|
<%= [
|
|
@classroom.name,
|
|
("Grade #{@classroom.grades_display}" if @classroom.grades_display.present?),
|
|
@classroom.year_name
|
|
].compact.join(', ') %>
|
|
</h1>
|
|
|
|
<%= form_with url: toggle_trading_classroom_path(@classroom), method: :patch, class: "contents" do %>
|
|
<label class="inline-flex items-center cursor-pointer">
|
|
<%= check_box_tag "trading", "1", @classroom.trading_enabled?, class: "sr-only peer", disabled: !policy(@classroom).toggle_trading?, onchange: "this.form.requestSubmit()" %>
|
|
<span class="select-none text-sm font-medium">Trading:</span>
|
|
<div class="relative ms-1 w-9 h-5 bg-gray-300 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-buffer after:content-[''] after:absolute after:top-0.5 after:start-0.5 after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-green-600"></div>
|
|
</label>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% if @can_manage_students %>
|
|
<div class="flex justify-end gap-3">
|
|
<%= link_to "Add Student", new_classroom_student_path(@classroom),
|
|
class: "tw-btn-primary" %>
|
|
<% if policy(@classroom).edit? %>
|
|
<%= link_to "Edit Class", edit_classroom_path(@classroom), class: "tw-btn-secondary !rounded-lg !py-3 !px-5 !text-base !text-black !ring-black" %>
|
|
<% end %>
|
|
<!-- TODO: Add bulk functionality in future PR -->
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="flex gap-8">
|
|
<div class="flex-1">
|
|
<%= render 'classroom_students_table', students: @classroom.users %>
|
|
</div>
|
|
<!-- Temporary UI, remove when tabbed table is wired up: -->
|
|
<%= render "grade_books_list", grade_books: @classroom.grade_books %>
|
|
</div>
|
|
</div>
|
|
</div>
|