Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/javascript/controllers/field_picker_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default class extends Controller {
if (headerCounts[header] > 1) {
field.classList.add("border-warning")
const warning = document.createElement("span")
warning.className = "duplicate-warning badge bg-warning text-dark ms-2"
warning.className = "duplicate-warning badge bg-warning text-dark ms-2 me-2"
warning.textContent = "Duplicate"
headerInput.after(warning)
}
Expand Down
32 changes: 30 additions & 2 deletions app/views/codeplug_layouts/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
</h6>
<small class="text-muted">Drag to reorder</small>
</div>
<div class="card-body">
<div class="layout-builder-container" style="min-height: 200px;">
<div class="card-body d-flex flex-column">
<div class="layout-builder-container flex-grow-1 d-flex flex-column">
<div class="list-group" data-field-picker-target="layoutBuilder">
<%# Layout fields will be rendered by JavaScript %>
</div>
Expand Down Expand Up @@ -168,6 +168,34 @@
max-width: 200px;
}

/* Make the list-group fill the entire card body for easier dropping */
.layout-builder-container .list-group {
flex: 1;
min-height: 150px;
border: 2px dashed #dee2e6;
border-radius: 0.25rem;
padding: 0.5rem;
transition: border-color 0.2s, background-color 0.2s;
}

.layout-builder-container .list-group:empty {
display: flex;
align-items: center;
justify-content: center;
}

/* Highlight the drop zone when dragging over it */
.layout-builder-container .list-group.sortable-ghost-class,
.layout-builder-container .list-group:has(.sortable-ghost) {
border-color: #0d6efd;
background-color: #f8f9ff;
}

.layout-builder-container .list-group:not(:empty) {
border-style: solid;
border-color: #dee2e6;
}

.layout-builder-container .list-group:not(:empty) + .empty-message {
display: none;
}
Expand Down