Add Photosynthesis Type
This commit is contained in:
@@ -48,6 +48,16 @@
|
||||
</dl>
|
||||
@Html.HiddenFor(m => m.SiteId)
|
||||
|
||||
<dl class="dl-horizontal siteId">
|
||||
<dt class="small">
|
||||
@Html.DisplayNameFor(m => m.PhotosynthesisType)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayTextFor(m => m.PhotosynthesisType.SelectedItem.Text)
|
||||
</dd>
|
||||
</dl>
|
||||
<input type="hidden" name="PhotosynthesisType.Selected" value="@Model.PhotosynthesisType.Selected" />
|
||||
|
||||
<dl class="dl-horizontal files">
|
||||
<dt>
|
||||
Files
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
@Html.EditorFor(m => m.EmailConfirm)
|
||||
@Html.EditorFor(m => m.Identifier)
|
||||
@Html.EditorFor(m => m.SiteId)
|
||||
@Html.EditorFor(m => m.PhotosynthesisType)
|
||||
<input type="submit" id="submit-form" class="hidden" />
|
||||
}
|
||||
<!-- The file upload form used as target for the file upload widget -->
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
@model LeafWeb.Web.ViewModels.SelectListViewModel
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@{
|
||||
var prefix = ViewData.TemplateInfo.HtmlFieldPrefix;
|
||||
ViewData.TemplateInfo.HtmlFieldPrefix = string.Empty;
|
||||
|
||||
foreach (var li in Model.ListItems)
|
||||
{
|
||||
<div class="radio">
|
||||
<label class="radio">
|
||||
@Html.RadioButton(prefix + ".Selected", li.Value, li.Selected) @li.Text
|
||||
</label>
|
||||
</div>
|
||||
}
|
||||
ViewData.TemplateInfo.HtmlFieldPrefix = prefix;
|
||||
}
|
||||
@@ -2,14 +2,17 @@
|
||||
@model object
|
||||
@{
|
||||
Layout = null;
|
||||
var lowerPropertyName = @LeafWeb.Core.Utility.StringExtensions.LowercaseFirst(ViewData.ModelMetadata.PropertyName);
|
||||
var propertyName = ViewData.ModelMetadata.PropertyName;
|
||||
var lowerPropertyName = @LeafWeb.Core.Utility.StringExtensions.LowercaseFirst(propertyName);
|
||||
var values = ViewData.ModelMetadata.AdditionalValues;
|
||||
var units = values.ContainsKey("Units") ? (string)values["Units"] : null;
|
||||
var currency = values.ContainsKey("Currency") ? (string)values["Currency"] : null;
|
||||
var formatHint = values.ContainsKey("FormatHint") ? (string)values["FormatHint"] : null;
|
||||
var editLabel = values.ContainsKey("EditLabel") ? (bool)values["EditLabel"] : true;
|
||||
var hasError = ViewData.ModelState[propertyName] != null && ViewData.ModelState[propertyName].Errors.Any();
|
||||
var hasErrorClass = hasError ? "has-error" : string.Empty;
|
||||
}
|
||||
<div class="form-group @lowerPropertyName">
|
||||
<div class="form-group @lowerPropertyName @hasErrorClass">
|
||||
@Html.LabelForModel(new { @class = "control-label" })
|
||||
@RenderBody()
|
||||
@Html.ValidationMessage("", new { @class = "help-block"})
|
||||
|
||||
Reference in New Issue
Block a user