Migrate to bootstrap 4 in LeafWeb

This commit is contained in:
2019-12-06 22:29:15 -05:00
parent f9a452045f
commit 88469b19be
248 changed files with 20293 additions and 21639 deletions
@@ -15,5 +15,5 @@
grid.Column("Description"),
grid.Column("Details")
),
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed" }
htmlAttributes: new { @class = "table table-sm table-striped table-bordered table-hover" }
)
@@ -3,9 +3,9 @@
@{
switch (Model)
{
case Priority.Normal:<span class="glyphicon glyphicon-unchecked"></span>break;
case Priority.Low:<span class="glyphicon glyphicon-collapse-down"></span>break;
case Priority.High:<span class="glyphicon glyphicon-collapse-up"></span>break;
case Priority.Normal:<span class="fa fa-square-o"></span>break;
case Priority.Low:<span class="fa fa-caret-square-o-down"></span>break;
case Priority.High:<span class="fa fa-caret-square-o-up"></span>break;
default:
throw new ArgumentOutOfRangeException();
}
@@ -4,13 +4,13 @@
var leafInputId = Model.Item1;
var identifier = Model.Item2;
// true for a link, false for a button
var buttonType = Model.Item3 ? "btn-link" : "btn-default";
var buttonType = Model.Item3 ? "btn-link" : "btn-outline-secondary";
}
@using (Html.BeginUmbracoForm<QueueController>("Cancel", null,
new { @class = "confirm clearfix", confirm_msg = "Cancelling cannot be undone! Confirm cancelling '" + identifier + "'." }))
{
<input type="hidden" name="id" value="@leafInputId"/>
<button type="submit" class="btn @buttonType">
<span class="glyphicon glyphicon-ban-circle"></span> Cancel
<span class="fa fa-ban"></span> Cancel
</button>
}
@@ -6,9 +6,9 @@
var xs = ViewData.ContainsKey("xs") && (bool) ViewData["xs"];
}
<a href="@url?leafInputId=@Model"
class="btn btn-default @{if (xs) {<text>btn-xs</text>}} @{if (disabled) {<text>disabled</text>}}"
class="btn btn-outline-secondary @{if (xs) {<text>btn-sm</text>}} @{if (disabled) {<text>disabled</text>}}"
role="button"
@{if (disabled) {<text>title="No chart has been generated"</text>}} >
<span class="glyphicon glyphicon-stats"></span>
<span class="fa fa-line-chart"></span>
Chart
</a>
@@ -4,6 +4,6 @@
var url = UmbracoContext.Current.UrlProvider.GetUrl(LeafWebPageIds.Chart);
}
<a href="@url?leafInputId=@Model">
<span class="glyphicon glyphicon-stats"></span>
<span class="fa fa-line-chart"></span>
Chart
</a>
@@ -5,13 +5,13 @@
var identifier = Model.Item2;
var isDeletable = Model.Item3;
// true for a link, false for a button
var buttonType = Model.Item4 ? "btn-link" : "btn-default";
var buttonType = Model.Item4 ? "btn-link" : "btn-outline-secondary";
}
@using (Html.BeginUmbracoForm<QueueController>("Delete", null,
new { @class = "confirm clearfix", confirm_msg = "Deletion cannot be undone! Confirm deleting '" + identifier + "'." }))
{
<input type="hidden" name="id" value="@leafInputId"/>
<button type="submit" class="btn @buttonType" @{if (!isDeletable) { <text> disabled="disabled" </text> }}>
<span class="glyphicon glyphicon-remove"></span> Delete
<span class="fa fa-remove"></span> Delete
</button>
}
@@ -3,5 +3,5 @@
var url = UmbracoContext.Current.UrlProvider.GetUrl(1111);
}
<a href="@url?id=@Model">
<span class="glyphicon glyphicon-edit"></span> Details
<span class="fa fa-edit"></span> Details
</a>
@@ -9,11 +9,11 @@
// string units = (string)ViewData.ModelMetadata.AdditionalValues.ContainsKey("Units") ? ["Units"];
}
<dl class="dl-horizontal @lowerPropertyName">
<dt>
<dl class="row @lowerPropertyName">
<dt class="col-sm-3">
@displayName
</dt>
<dd>
<dd class="col-sm-9">
@RenderBody()
</dd>
</dl>
@@ -2,10 +2,10 @@
@model Tuple<LeafInput,TimeInProgressEstimater>
@{
var leafInput = Model.Item1;
var estimater = Model.Item2;
var estimator = Model.Item2;
var totalTimeEstimate = estimater.EstimateTimeInProgress(leafInput);
TimeSpan remaining = totalTimeEstimate - leafInput.TimeInProgress;
var totalTimeEstimate = estimator.EstimateTimeInProgress(leafInput);
var remaining = totalTimeEstimate - leafInput.TimeInProgress;
if (remaining > TimeSpan.Zero)
{
<text>@remaining.ToRoundedReadableString()</text>
@@ -16,6 +16,6 @@
"",
Model.HasValue && Model.Value,
htmlAttributes)
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
</div>
</div>
@@ -14,7 +14,7 @@
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " error has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
@Html.TextBoxFor(m => m, new { @class="form-control datepicker", data_provide="datepicker", data_date_language="globalize", data_date=dt, data_date_format=System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern.Replace("M", "m"), data_date_today_highlight="true", data_date_today_btn="false" })
@Html.ValidationMessageFor(m => m, null, new { @class="help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class="form-text" })
</div>
@@ -2,12 +2,12 @@
@model decimal?
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
<div class="input-group">
<span class="input-group-addon">&euro;@Html.TextBox(
"",
Model == null ? "" : String.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:F2}", ViewData.ModelMetadata.Model),
ViewBag.ClearTextField == true ? new { @class = "form-control clear-text-field input-block-level" } : new { @class = "form-control input-block-level" })</span>
</div>
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
</div>
@@ -3,7 +3,7 @@
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
@Html.EnumDropDownListFor(m => m, new { @class = "form-control" })
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
</div>
@@ -3,6 +3,6 @@
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
}
<span class="btn btn-default btn-file">
Browse <input type="file" name="@ViewData.ModelMetadata.PropertyName" class="btn-default btn-file" />
<span class="btn btn-outline-secondary btn-file">
Browse <input type="file" name="@ViewData.ModelMetadata.PropertyName" class="btn-outline-secondary btn-file" />
</span>
@@ -19,12 +19,12 @@
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
<div class="controls">
@Html.TextBox(
"",
ViewData.TemplateInfo.FormattedModelValue,
htmlAttributes)
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
</div>
</div>
@@ -7,13 +7,13 @@
<link rel="stylesheet" type="text/css" href="/Scripts/mdd_styles.css" />
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
<div class="mdd_toolbar"></div>
@Html.TextAreaFor(
m => m,
8, 15,
ViewBag.ClearTextField == true ? new { @class = "form-control mdd_editor clear-text-field", data_mdd_preview = "#" + guidID } : new { @class = "form-control mdd_editor", data_mdd_preview = "#" + guidID })
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
<br />
<label>Preview</label>
<hr />
@@ -2,12 +2,12 @@
@model object
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
<div class="controls">
@Html.TextAreaFor(
m => m,
8, 8,
ViewBag.ClearTextField == true ? new { @class = "form-control input-block-level clear-text-field" } : new { @class = "form-control input-block-level" } )
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
</div>
</div>
@@ -15,12 +15,12 @@
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
<div class="controls">
@Html.Password(
"",
ViewData.TemplateInfo.FormattedModelValue,
htmlAttributes)
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
</div>
</div>
@@ -7,11 +7,11 @@
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
<div class="input-group">
@Html.TextBox(
"", f,
ViewBag.ClearTextField == true ? new { @class = "form-control clear-text-field input-block-level" } : new { @class = "form-control input-block-level" })<span class="input-group-addon">0,00</span>
</div>
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
</div>
@@ -13,9 +13,9 @@
I agree to the
<a href="@UmbracoContext.Current.UrlProvider.GetUrl(1115)" target="_blank">
Terms of Service
<span class="glyphicon glyphicon-new-window" aria-hidden="true"></span>
<span class="fa fa-new-window" aria-hidden="true"></span>
</a>
</label>
</div>
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
</div>
@@ -2,12 +2,12 @@
@model object
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
<div class="controls">
@Html.TextBox(
"",
ViewData.TemplateInfo.FormattedModelValue,
ViewBag.ClearTextField == true ? new { @class = "form-control clear-text-field input-block-level" } : new { @class = "form-control input-block-level" } )
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class = "form-text" })
</div>
</div>
@@ -15,9 +15,9 @@
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.LabelFor(m => m)
<div class="controls">
@Html.TextBoxFor(m => m, "hh\\:mm", new { @Value = ts.ToString("hh\\:mm"), @class="form-control timepicker", data_provide="timepicker", data_minute_step="5", data_show_meridian="false", data_disable_focus="true", data_template = "dropdown", data_default_time="value" })
@Html.ValidationMessageFor(m => m, null, new { @class="help-block" })
@Html.ValidationMessageFor(m => m, null, new { @class="form-text" })
</div>
</div>
@@ -12,40 +12,7 @@
var hasErrorClass = hasError ? "has-error" : string.Empty;
}
<div class="form-group @lowerPropertyName @hasErrorClass">
@Html.LabelForModel(new { @class = "control-label" })
@Html.LabelForModel()
@RenderBody()
@Html.ValidationMessage("", new { @class = "help-block"})
@Html.ValidationMessage("", new { @class = "form-text"})
</div>
@*<div class="form-group @lowerPropertyName">
@if (editLabel)
{
@Html.LabelForModel()
}
<div class="input-group">
@if (!string.IsNullOrEmpty(units))
{
<div class="input-append">
@RenderBody()
<span class="add-on">@units</span>
</div>
}
else if (!string.IsNullOrEmpty(currency))
{
<div class="input-prepend">
<span class="add-on">@currency</span>
@RenderBody()
</div>
}
else
{
@RenderBody()
}
@if (!string.IsNullOrEmpty(formatHint))
{
<div><small><em>@formatHint</em></small></div>
}
<span class="help-block">@Html.ValidationMessage("")</span>
</div>
</div>*@
+1 -1
View File
@@ -4,7 +4,7 @@
}
@if (ViewData.ModelState[fieldName] != null && ViewData.ModelState[fieldName].Errors.Any())
{
<span class="help-block field-validation-error">
<span class="form-text field-validation-error">
@foreach (var error in ViewData.ModelState[fieldName].Errors)
{
<span id="@fieldName-error" class="text-danger">@error.ErrorMessage</span>