Initial
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
@model DateTime
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.TextBox("", (Model != DateTime.MinValue ? Model.ToShortDateString() : string.Empty ))
|
||||
@@ -0,0 +1,4 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue)
|
||||
@@ -0,0 +1,18 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model Enum
|
||||
@{
|
||||
var listItems = Model.GetSelectListItems();
|
||||
var prefix = ViewData.TemplateInfo.HtmlFieldPrefix;
|
||||
ViewData.TemplateInfo.HtmlFieldPrefix = string.Empty;
|
||||
var index = 0;
|
||||
|
||||
foreach (var li in listItems)
|
||||
{
|
||||
var fieldName = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}_{1}", prefix.Replace('.', '_'), index++);
|
||||
<span class="radiobutton">
|
||||
@Html.RadioButton(prefix, li.Value, li.Selected, new { @id = fieldName })
|
||||
@Html.Label(fieldName, li.Text)
|
||||
</span>
|
||||
}
|
||||
ViewData.TemplateInfo.HtmlFieldPrefix = prefix;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model Enum
|
||||
@{
|
||||
var emptyItem = new SelectListItem{Text="Type", Value=""};
|
||||
var listItems = new []{emptyItem}.Concat(Model.GetSelectListItems());
|
||||
@Html.ListBox("", listItems)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
@Html.Hidden("", ViewData.TemplateInfo.FormattedModelValue)
|
||||
@@ -0,0 +1,7 @@
|
||||
@using MileageTraker.Web.Models
|
||||
@using MileageTraker.Web.Utility
|
||||
@model MileageTraker.Web.ViewModels.LogResultsViewModel
|
||||
|
||||
@Html.DropDownList("Year", new SelectList(Model.Years, Model.SelectedYear))
|
||||
@Html.DropDownList("Month", new SelectList(Model.Months, Model.SelectedMonth))
|
||||
@Html.DropDownList("LogType", typeof(MileageLogType).ToSelectList(Model.SelectedLogType, "Log Type"))
|
||||
@@ -0,0 +1,6 @@
|
||||
@using MileageTraker.Web.Models
|
||||
@model MileageLogTypeWrapper
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.EditorFor(model => model.Enum, "Enum")
|
||||
@@ -0,0 +1,8 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && !pm.ModelType.IsCollection()))
|
||||
{
|
||||
@Html.Editor(prop.PropertyName)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@if (!(Model is Enum))
|
||||
{
|
||||
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue)
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.Editor("", "Enum")
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@{
|
||||
Layout = null;
|
||||
var lowerPropertyName = @CustomExtensions.LowercaseFirst(ViewData.ModelMetadata.PropertyName);
|
||||
var units = (string)ViewData.ModelMetadata.AdditionalValues["Units"];
|
||||
var formatHint = (string)ViewData.ModelMetadata.AdditionalValues["FormatHint"];
|
||||
var editLabel = (bool)ViewData.ModelMetadata.AdditionalValues["EditLabel"];
|
||||
}
|
||||
|
||||
<div class="editor-field-container @lowerPropertyName">
|
||||
@if (editLabel) {
|
||||
<div class="editor-label">
|
||||
@Html.LabelForModel()
|
||||
</div>
|
||||
}
|
||||
<div class="editor-field">
|
||||
@RenderBody()
|
||||
@if (!string.IsNullOrEmpty(units)) {
|
||||
<span class="units">@units</span>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(formatHint)) {
|
||||
<div class="format-hint">@formatHint</div>
|
||||
}
|
||||
@Html.ValidationMessage("")
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user