This repository has been archived on 2021-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
greenlight/app/views/shared/modals/_create_room_modal.html.erb

47 lines
1.8 KiB
Plaintext
Raw Normal View History

2018-05-28 18:10:20 -04:00
<div class="modal fade" id="createRoomModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content text-center">
<div class="modal-body">
<div class="card-body p-6">
2018-06-12 17:28:02 -04:00
<div class="card-title">
2018-05-28 18:10:20 -04:00
<h3>Create New Room</h3>
</div>
2018-05-29 16:51:18 -04:00
<%= form_for(:room, url: rooms_path) do |f| %>
2018-05-28 18:10:20 -04:00
<div class="input-icon">
<span class="input-icon-addon">
<i class="fas fa-chalkboard-teacher"></i>
</span>
2018-06-13 13:27:29 -04:00
<%= f.text_field :name, id: "room-name", class: "form-control", value: "", placeholder: "Enter a room name...", autocomplete: :off %>
2018-06-01 17:28:39 -04:00
<div class="invalid-feedback text-left">Room name cannot be blank.</div>
2018-05-31 16:54:48 -04:00
</div>
2018-05-28 19:12:24 -04:00
<label class="custom-switch mt-5 mb-5 float-left">
2018-07-04 15:22:59 -04:00
<%= f.check_box :auto_join, class: "custom-switch-input", checked: false %>
2018-05-28 19:12:24 -04:00
<span class="custom-switch-indicator"></span>
2018-05-31 15:04:18 -04:00
<span class="custom-switch-description">Automatically join me into the room.</span>
2018-05-28 19:12:24 -04:00
</label>
2018-05-28 18:10:20 -04:00
<div class="form-footer">
2018-05-31 15:04:18 -04:00
<%= f.submit "Create Room", id: "create-room-submit", class: "btn btn-outline-primary btn-block btn-pill" %>
2018-05-28 18:10:20 -04:00
</div>
2018-05-29 15:28:29 -04:00
<% end %>
2018-05-28 18:10:20 -04:00
</div>
<div class="card-footer">
<p>You will be free to delete this room at any time.</p>
</div>
</div>
</div>
</div>
</div>
2018-05-31 15:04:18 -04:00
<script>
2018-06-13 14:43:08 -04:00
// Handle validation messages client-side because
// form is served in modal, and they are minimal.
2018-05-31 15:04:18 -04:00
var roomCreateValidations = function(){
if($('#room-name').val().length == 0){
$('#room-name').addClass("is-invalid");
}
}
$('#create-room-submit').on('click', roomCreateValidations);
</script>