Adding LeafInput
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System.Web.Mvc;
|
||||
using LeafWeb.Web.ViewModels.LeafInput;
|
||||
|
||||
namespace LeafWeb.Web.Controllers
|
||||
{
|
||||
public class LeafInputController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Index(CreateViewModel viewModel)
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web;
|
||||
|
||||
namespace LeafWeb.Web.ViewModels.LeafInput
|
||||
{
|
||||
public class CreateViewModel
|
||||
{
|
||||
[Required]
|
||||
[Display(Name = "Your name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Your email address")]
|
||||
public string Email { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "A unique identifier for this data")]
|
||||
public string LeafInputId { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "The site's name/Fluxnet ID, if known")]
|
||||
public string SiteID { get; set; }
|
||||
|
||||
[Required]
|
||||
[UIHint("HttpPostedFileBase")]
|
||||
public HttpPostedFileBase Files { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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>*@
|
||||
@@ -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>
|
||||
}
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
|
||||
@@ -144,11 +144,13 @@
|
||||
<Compile Include="App_Start\RouteConfig.cs" />
|
||||
<Compile Include="Charter\LeafWebCharter.cs" />
|
||||
<Compile Include="Controllers\LeafCharterController.cs" />
|
||||
<Compile Include="Controllers\LeafInputController.cs" />
|
||||
<Compile Include="Controllers\PagesController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ViewModels\LeafInput\CreateViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\web.config" />
|
||||
@@ -163,6 +165,11 @@
|
||||
<Content Include="Views\Pages\DataRequirements.cshtml" />
|
||||
<Content Include="Scripts\jquery-1.9.1.min.map" />
|
||||
<Content Include="Views\LeafCharter\Index.cshtml" />
|
||||
<Content Include="Views\LeafInput\Index.cshtml" />
|
||||
<Content Include="Views\Shared\_ValidationSummary.cshtml" />
|
||||
<Content Include="Views\Shared\EditorTemplates\_FieldLayout.cshtml" />
|
||||
<Content Include="Views\Shared\EditorTemplates\HttpPostedFileBase.cshtml" />
|
||||
<Content Include="Views\Shared\EditorTemplates\String.cshtml" />
|
||||
<None Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
|
||||
Reference in New Issue
Block a user