Adding LeafInput

This commit is contained in:
2016-01-11 23:11:38 -05:00
parent df8256f09b
commit 79baded8b1
14 changed files with 153 additions and 8 deletions
+17
View File
@@ -0,0 +1,17 @@
@model LeafWeb.Web.ViewModels.LeafInput.CreateViewModel
<h1>Submitting Data and Retrieving EDO Results</h1>
<p>
There is no limit on the number of files you may submit for analysis. Keep selecting files and hitting the Add button until all of the files you need to upload are shown in the list. Then enter an identifier for this set of data and click the Upload button.
</p>
@using (Html.BeginForm("Index", "LeafInput", FormMethod.Post, new { @class = "form-horizontal well" }))
{
@Html.Partial("_ValidationSummary")
<fieldset>
<legend></legend>
@Html.EditorForModel()
<div class="form-actions">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
</fieldset>
}
@@ -0,0 +1,5 @@
@model HttpPostedFileBase
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
}
<input type="file" name="@ViewData.ModelMetadata.PropertyName" />
@@ -0,0 +1,5 @@
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
}
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue)
@@ -0,0 +1,41 @@
@{
Layout = null;
var lowerPropertyName = @LeafWeb.Core.Utility.StringExtensions.LowercaseFirst(ViewData.ModelMetadata.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;
}
@RenderBody()
@*<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>*@
+3 -3
View File
@@ -30,9 +30,9 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Leaf Data <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Leaf Input</a></li>
<li><a href="#">Leaf Output</a></li>
<li><a href="/Pages/LeafCharter">Leaf Charts</a></li>
<li><a href="/LeafInput">Leaf Input</a></li>
<li><a href="/LeafOutput">Leaf Output</a></li>
<li><a href="/LeafCharter">Leaf Charts</a></li>
</ul>
</li>
<li class="dropdown">
@@ -0,0 +1,7 @@
@if (ViewData.ModelState[""] != null && ViewData.ModelState[""].Errors.Any())
{
<div class="alert alert-error">
<a class="close" data-dismiss="alert">×</a>
@Html.ValidationSummary(true)
</div>
}