Added Fluxnet Site

This commit is contained in:
2016-01-18 13:45:43 -05:00
parent 048327666f
commit 2c73fb6883
12 changed files with 43 additions and 102 deletions
+1
View File
@@ -63,6 +63,7 @@
<Compile Include="Models\CntrlComparison.cs" />
<Compile Include="Models\CntrlComparisonFittingInfo.cs" />
<Compile Include="Models\CntrlComparisonPhotosyntheticInfo.cs" />
<Compile Include="Models\FluxnetSite.cs" />
<Compile Include="Models\LeafInput.cs" />
<Compile Include="Models\LeafInputData.cs" />
<Compile Include="Models\LeafInputFile.cs" />
+10
View File
@@ -0,0 +1,10 @@
namespace LeafWeb.Core.Models
{
public class FluxnetSite
{
public string FluxnetId { get; set; }
public string SiteName { get; set; }
public string Country { get; set; }
public string LandUnit { get; set; }
}
}
+8 -1
View File
@@ -4,5 +4,12 @@ $(document)
var input = $(this),
numFiles = input.get(0).files ? input.get(0).files.length : 1,
label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
input.trigger('fileselect', [numFiles, label]);
input.trigger('fileselect', [input, numFiles, label]);
});
$(document).ready(function () {
$('.btn-file :file').on('fileselect', function (event, input, numFiles, label) {
console.log(numFiles);
console.log(label);
});
});
-29
View File
@@ -1,29 +0,0 @@
using System;
using System.Configuration;
namespace LeafWeb.Web.Utility
{
public static class DateTimeExtensions
{
static string timeZoneId = ConfigurationManager.AppSettings["TimeZoneId"] ?? "W. Europe Standard Time";
public static DateTime ToLocalTime(this DateTime dt)
{
// dt.DateTimeKind should be Utc!
var tzi = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
return TimeZoneInfo.ConvertTimeFromUtc(DateTime.SpecifyKind(dt, DateTimeKind.Utc), tzi);
}
public static DateTime ToUtcTime(this DateTime dt)
{
var tzi = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
return TimeZoneInfo.ConvertTimeToUtc(dt, tzi);
}
public static DateTime RoundDown(this DateTime dateTime, int minutes)
{
return new DateTime(dateTime.Year, dateTime.Month,
dateTime.Day, dateTime.Hour, (dateTime.Minute / minutes) * minutes, 0);
}
}
}
-25
View File
@@ -1,25 +0,0 @@
using System;
using System.Threading;
using System.Web;
using System.Web.Mvc;
namespace LeafWeb.Web.Utility
{
public static class LocalizationHelper
{
[Obsolete("specifying the language through <meta http-equiv=\"content-language\" content= > is obsolete. Use <html lang=> instead")]
public static IHtmlString MetaContentLanguage(this HtmlHelper html)
{
var acceptLang = HttpUtility.HtmlAttributeEncode(Thread.CurrentThread.CurrentUICulture.ToString());
return new HtmlString(string.Format("<meta http-equiv=\"content-language\" content=\"{0}\"/>", acceptLang));
}
public static string Lang
{
get
{
return HttpUtility.HtmlAttributeEncode(Thread.CurrentThread.CurrentUICulture.ToString());
}
}
}
}
+13 -11
View File
@@ -4,19 +4,21 @@
<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" }))
{
<div class="row">
<div class="col-md-5">
@using (Html.BeginForm("Index", "LeafInput", FormMethod.Post, new {@class = "form-horizontal well", enctype= "multipart/form-data" }))
{
@Html.Partial("_ValidationSummary")
<fieldset>
<legend></legend>
@Html.EditorFor(m=> m.Name)
@Html.EditorFor(m=> m.Email)
@Html.EditorFor(m=> m.EmailConfirm)
@Html.EditorFor(m=> m.LeafInputId)
@Html.EditorFor(m=> m.SiteID)
@Html.EditorFor(m=> m.Files)
@Html.EditorFor(m => m.Name)
@Html.EditorFor(m => m.Email)
@Html.EditorFor(m => m.EmailConfirm)
@Html.EditorFor(m => m.LeafInputId)
@Html.EditorFor(m => m.SiteID)
@Html.EditorFor(m => m.Files)
<div class="form-actions">
<input type="submit" value="Create" class="btn btn-primary" />
<input type="submit" value="Create" class="btn btn-primary"/>
</div>
</fieldset>
}
}</div>
</div>
@@ -27,7 +27,4 @@
}
}
@Html.TextBox(
"",
ViewData.TemplateInfo.FormattedModelValue,
htmlAttributes)
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
@@ -2,16 +2,6 @@
@model int?
@{
int i;
if (!Model.HasValue)
{
i = 0;
}
else
{
i = Model.Value;
}
var htmlAttributes = new RouteValueDictionary();
if (ViewBag.@class != null)
{
@@ -3,14 +3,7 @@
@{
float f;
if (!Model.HasValue)
{
f = 0.0f;
}
else
{
f = Model.Value;
}
f = !Model.HasValue ? 0.0f : Model.Value;
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@@ -22,5 +22,4 @@
}
}
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
@@ -11,10 +11,8 @@
}
<div class="form-group @lowerPropertyName">
@Html.LabelForModel(new { @class = "control-label" })
<div class="controls">
@RenderBody()
@Html.ValidationMessage("", new { @class = "help-block"})
</div>
</div>
-2
View File
@@ -618,8 +618,6 @@
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utility\DateTimeExtensions.cs" />
<Compile Include="Utility\LocalizationHelper.cs" />
<Compile Include="Utility\MarkdownHelper.cs" />
<Compile Include="Utility\Validation.cs" />
<Compile Include="ViewModels\LeafInput\CreateViewModel.cs" />