Files
once-campfire/app/views/rooms/layouts/_form.html.erb
Kevin McConnell df76a227dc Hello world
First open source release of Campfire 🎉
2025-08-21 09:31:59 +01:00

27 lines
919 B
Plaintext

<%= form_with model: room do |form| %>
<div class="flex align-center gap">
<% if Current.user.can_administer?(room) %>
<%= translation_button(:room_name) %>
<label class="flex-item-grow txt-large">
<%= form.text_field :name, name: "room[name]", id: "room_name", class: "input full-width",
required: true, autofocus: true, placeholder: "Name the room",
data: { turbo_permanent: true, action: "keydown.enter->form#submit:prevent" } %>
<span class="for-screen-reader">Name this room</span>
</label>
<% else %>
<h1 class="flex-item-grow txt-x-large">
<%= room.name %>
</h1>
<% end %>
</div>
<hr class="margin-block borderless">
<section class="room-access margin-block pad-inline fill-shade border-radius">
<%= yield %>
</section>
<%= submit_room_button_tag if Current.user.can_administer?(room) %>
<% end %>