Skip to content

Commit

Permalink
Remove extra spacing around editing contents, flows and bag part (#12585
Browse files Browse the repository at this point in the history
)
  • Loading branch information
MikeAlhayek authored Nov 3, 2022
1 parent b75873b commit 1107fc1
Show file tree
Hide file tree
Showing 14 changed files with 165 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,26 @@
flex-direction: row;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
> .edit-body{
width:100%;

> .edit-body {
width: 100%;
}

&.sidebar > .edit-sidebar {
visibility: visible;
}
&.sidebar > .edit-sidebar{
visibility:visible;

&:not(.sidebar) > .edit-sidebar {
visibility: hidden;
}
&:not(.sidebar) > .edit-sidebar{
visibility: hidden;
}
width: 100%;

width: 100%;
}

.edit-body {
display: -ms-flexbox;
display:flex;
display: flex;
flex-direction: column;
padding: 8px;
}

.edit-sidebar-handler {
Expand All @@ -38,7 +41,7 @@
visibility: hidden;
vertical-align: top;
display: -ms-flexbox;
display:flex;
display: flex;
padding-left: 8px;
flex-direction: column;
}
Expand All @@ -54,28 +57,31 @@

@media (min-width: 768px) {
.edit-container {
&.sidebar > .edit-body{
&.sidebar > .edit-body {
flex: 0 0 75%;
width:75%;
width: 75%;
}
&:not(.sidebar) > .edit-body{

&:not(.sidebar) > .edit-body {
flex: 0 0 100%;
}
&:not(.sidebar) > .edit-sidebar{

&:not(.sidebar) > .edit-sidebar {
visibility: hidden;
}
&.sidebar > .edit-sidebar{

&.sidebar > .edit-sidebar {
flex: 0 0 24.42141%;
order: 2;
padding-left: 15px;
padding-left: 15px;
}

&.sidebar > .edit-sidebar-handler {
display: block;
}
}

.edit-body {
order: 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<zone Name="Title"><h1>@RenderTitleSegments(T["New {0}", typeDisplayName])</h1></zone>

<form asp-action="Create" asp-route-returnUrl="@Context.Request.Query["ReturnUrl"]" method="post" enctype="multipart/form-data" class="no-multisubmit">
@Html.ValidationSummary()
@if (!ViewContext.ModelState.IsValid)
{
@Html.ValidationSummary()
}
@await DisplayAsync(Model)
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<zone Name="Title"><h1>@RenderTitleSegments(T["Edit {0}", typeDisplayName])</h1></zone>

<form asp-action="Edit" asp-route-contentitemid="@contentItem.ContentItemId" asp-route-returnUrl="@Context.Request.Query["ReturnUrl"]" method="post" enctype="multipart/form-data" class="no-multisubmit">
@Html.ValidationSummary()
@if (!ViewContext.ModelState.IsValid)
{
@Html.ValidationSummary()
}
@await DisplayAsync(Model)
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
display: -ms-flexbox;
display: flex;
flex-direction: column;
padding: 8px;
}

.edit-sidebar-handler {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions src/OrchardCore.Modules/OrchardCore.Flows/Views/BagPart.Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
{
var type = Model.ContainedContentTypeDefinitions.First();

<a class="btn btn-primary add-widget btn-sm"
<a class="btn btn-primary add-widget btn-sm mt-1"
data-target-id="@widgetTemplatePlaceholderId"
data-html-field-prefix="@htmlFieldPrefix"
data-prefixes-name="@Html.NameFor(x => x.Prefixes)"
Expand All @@ -70,14 +70,14 @@
}
else if (totalItems > 1)
{
<div class="btn-group btn-bag-add">
<div class="btn-group btn-bag-add mt-1">
<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@T["Add Item"]
</button>
<div class="dropdown-menu">
@foreach (var type in Model.ContainedContentTypeDefinitions)
{
<a class="dropdown-item add-widget btn-sm"
<a class="dropdown-item add-widget btn-sm"
data-target-id="@widgetTemplatePlaceholderId"
data-html-field-prefix="@htmlFieldPrefix"
data-prefixes-name="@Html.NameFor(x => x.Prefixes)"
Expand Down Expand Up @@ -120,32 +120,32 @@

<script at="Foot">
@* Only apply sortable if element is present in dom, do not call sortable on scripts for mock widgets *@
if ($('#@widgetTemplatePlaceholderId').length == 1) {
if ($('#@widgetTemplatePlaceholderId').length == 1) {
$("#@widgetTemplatePlaceholderId").sortable({
handle: ".widget-editor-handle",
cursor: "move",
opacity: 0.7,
tolerance: "pointer",
placeholder: {
element: function(currentItem) {
element: function (currentItem) {
return $('<div class="widget-dragdrop-placeholder"><div></div></div>')[0];
},
update: function(container, p) {
update: function (container, p) {
return;
}
},
toleranceElement: '> div',
start: function(event, ui) {
start: function (event, ui) {
widgetDragItem = ui.item;
lastContainer = ui.item.parent();
lastContainer.toggleClass('widget-dropzone-hint');
widgetDragItem.find('.card').first().toggleClass('border-primary');
var classList = widgetDragItem.attr('class').split(' ');
$.each(classList, function(id, item) {
$.each(classList, function (id, item) {
if (item.indexOf('col-md-') === 0) ui.placeholder.addClass(item);
});
},
stop: function(event, ui) {
stop: function (event, ui) {
lastContainer.toggleClass('widget-dropzone-hint');
widgetDragItem.find('.card').first().toggleClass('border-primary');
//clear the global variables
Expand All @@ -155,7 +155,7 @@
widgetItemDestId = null;
$(document).trigger('contentpreview:render');
},
over: function(event, ui) {
over: function (event, ui) {
var $self = $(this);
if (lastContainer[0] != this) {
lastContainer.toggleClass('widget-dropzone-hint');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}
}

<div class="widget widget-editor card my-1@(collapsed ? " collapsed" : String.Empty)">
<div class="widget-editor-header card-header text-muted py-1 ps-3 pe-1">
<div class="widget widget-editor card@(collapsed ? " collapsed" : String.Empty)">
<div class="widget-editor-header card-header text-muted py-1 ps-2 pe-1">
@if (Model.CanMove)
{
<div class="widget-editor-handle"><i class="fas fa-arrows-alt" aria-hidden="true"></i></div>
Expand All @@ -30,7 +30,7 @@
</div>
}
</div>
<div class="widget-editor-body card-body px-2 py-1">
<div class="widget-editor-body card-body">
<div class="w-100">
@if (Model.ContentEditor != null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@* This template can be Overridden to change the row behavior of widget collection *@
@* For ROOT DIV its CSS classes widget-template and col-md-* are required - Do not remove then in customization*@
<div class="widget-template col-md-12 px-1">
<div class="widget-template col-md-12 px-0">
@await DisplayAsync(Model.ChildContent)
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
var editorId = "contentEditor_" + Model.PrefixValue;
}

<div class="widget widget-editor card my-1 @(Model.Inline != true ? "collapsed" : "")">
<div class="widget-editor-header card-header text-muted py-1 ps-3 pe-1">
<div class="widget widget-editor card my-1@(Model.Inline ? " collapsed" : String.Empty)">
<div class="widget-editor-header card-header text-muted py-1 ps-2 pe-1">
@if (Model.CanMove != false)
{
<div class="widget-editor-handle"><i class="fas fa-arrows-alt" aria-hidden="true"></i></div>
Expand Down Expand Up @@ -63,7 +63,7 @@
}
</div>
</div>
<div class="widget-editor-body card-body px-2 py-1">
<div class="widget-editor-body card-body">
<div class="w-100">
@if (Model.ContentEditor != null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@* This template can be Overridden to change the row behavior of widget collection *@
@* For ROOT DIV its CSS classes widget-template and col-md-* are required - Do not remove then in customization*@
<div class="widget-template col-md-@Model.ColumnSize px-1">
<div class="widget-template col-md-@Model.ColumnSize px-0">
@await DisplayAsync(Model.ChildContent)
</div>
Loading

0 comments on commit 1107fc1

Please sign in to comment.