forked from External/greenlight
		
	add delete confirmation modal
This commit is contained in:
		@@ -25,15 +25,15 @@
 | 
			
		||||
          <% if room != current_user.main_room %>
 | 
			
		||||
            <div class="item-action dropdown">
 | 
			
		||||
              <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fas fa-ellipsis-v"></i></a>
 | 
			
		||||
              <div class="dropdown-menu dropdown-menu-right">
 | 
			
		||||
              <div class="dropdown-menu">
 | 
			
		||||
                <!--
 | 
			
		||||
                <%= link_to room, class: "dropdown-item" do %>
 | 
			
		||||
                  <i class="dropdown-icon fas fa-cog"></i> Room Settings
 | 
			
		||||
                <% end %>
 | 
			
		||||
                -->
 | 
			
		||||
                <%= button_to room, method: :delete, data: { confirm: 'Are you sure?' }, class: "dropdown-item" do %>
 | 
			
		||||
                <a href="" data-toggle="modal" data-target="#deleteRoomModal_<%= room.uid %>"class="dropdown-item">
 | 
			
		||||
                  <i class="dropdown-icon far fa-trash-alt"></i> Delete
 | 
			
		||||
                <% end %>
 | 
			
		||||
                </a>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          <% end %>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								app/views/shared/modals/_delete_room_modal.html.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								app/views/shared/modals/_delete_room_modal.html.erb
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
<div class="modal fade" id="deleteRoomModal_<%= room.uid %>" 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">
 | 
			
		||||
          <div class="card-title">
 | 
			
		||||
            <h3>Are you sure you want to delete <%= room.name %>?</h3>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <button type="button" class="btn btn-pill btn-info my-1 btn-del-room" data-dismiss="modal">
 | 
			
		||||
            On second thought, I'll keep it.
 | 
			
		||||
          </button>
 | 
			
		||||
 | 
			
		||||
          <%= button_to room, method: :delete, id: "delete-confirm", class: "btn btn-pill btn-danger my-1 btn-del-room" do %>
 | 
			
		||||
            I'm sure, delete this room.
 | 
			
		||||
          <% end %>
 | 
			
		||||
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="card-footer">
 | 
			
		||||
          <p>You will <b>not</b> be able to recover this room or any of its associated recordings.</p>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
		Reference in New Issue
	
	Block a user