diff --git a/Core/Core.csproj b/Core/Core.csproj index b595753..65b2f41 100644 --- a/Core/Core.csproj +++ b/Core/Core.csproj @@ -63,6 +63,7 @@ + diff --git a/Core/Models/FluxnetSite.cs b/Core/Models/FluxnetSite.cs new file mode 100644 index 0000000..49d23aa --- /dev/null +++ b/Core/Models/FluxnetSite.cs @@ -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; } + } +} diff --git a/Web/Scripts/filebutton.js b/Web/Scripts/filebutton.js index 5960010..85ea50c 100644 --- a/Web/Scripts/filebutton.js +++ b/Web/Scripts/filebutton.js @@ -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]); - }); \ No newline at end of file + 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); + }); +}); \ No newline at end of file diff --git a/Web/Utility/DateTimeExtensions.cs b/Web/Utility/DateTimeExtensions.cs deleted file mode 100644 index 7ddc448..0000000 --- a/Web/Utility/DateTimeExtensions.cs +++ /dev/null @@ -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); - } - } -} diff --git a/Web/Utility/LocalizationHelper.cs b/Web/Utility/LocalizationHelper.cs deleted file mode 100644 index f682d69..0000000 --- a/Web/Utility/LocalizationHelper.cs +++ /dev/null @@ -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 is obsolete. Use instead")] - public static IHtmlString MetaContentLanguage(this HtmlHelper html) - { - var acceptLang = HttpUtility.HtmlAttributeEncode(Thread.CurrentThread.CurrentUICulture.ToString()); - return new HtmlString(string.Format("", acceptLang)); - } - - public static string Lang - { - get - { - return HttpUtility.HtmlAttributeEncode(Thread.CurrentThread.CurrentUICulture.ToString()); - } - } - } -} \ No newline at end of file diff --git a/Web/Views/LeafInput/Index.cshtml b/Web/Views/LeafInput/Index.cshtml index 316a1fd..7ea5d93 100644 --- a/Web/Views/LeafInput/Index.cshtml +++ b/Web/Views/LeafInput/Index.cshtml @@ -4,19 +4,21 @@

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.

-@using (Html.BeginForm("Index", "LeafInput", FormMethod.Post, new { @class = "form-horizontal well" })) -{ - @Html.Partial("_ValidationSummary") -
- - @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) -
- -
-
-} +
+
+ @using (Html.BeginForm("Index", "LeafInput", FormMethod.Post, new {@class = "form-horizontal well", enctype= "multipart/form-data" })) + { + @Html.Partial("_ValidationSummary") +
+ @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) +
+ +
+
+ }
+
\ No newline at end of file diff --git a/Web/Views/Shared/EditorTemplates/EmailAddress.cshtml b/Web/Views/Shared/EditorTemplates/EmailAddress.cshtml index c2ab437..ff607af 100644 --- a/Web/Views/Shared/EditorTemplates/EmailAddress.cshtml +++ b/Web/Views/Shared/EditorTemplates/EmailAddress.cshtml @@ -27,7 +27,4 @@ } } -@Html.TextBox( - "", - ViewData.TemplateInfo.FormattedModelValue, - htmlAttributes) \ No newline at end of file +@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes) \ No newline at end of file diff --git a/Web/Views/Shared/EditorTemplates/Int32.cshtml b/Web/Views/Shared/EditorTemplates/Int32.cshtml index c7782ab..9c83278 100644 --- a/Web/Views/Shared/EditorTemplates/Int32.cshtml +++ b/Web/Views/Shared/EditorTemplates/Int32.cshtml @@ -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) { diff --git a/Web/Views/Shared/EditorTemplates/Single.cshtml b/Web/Views/Shared/EditorTemplates/Single.cshtml index 1caac7e..648c9e9 100644 --- a/Web/Views/Shared/EditorTemplates/Single.cshtml +++ b/Web/Views/Shared/EditorTemplates/Single.cshtml @@ -3,14 +3,7 @@ @{ float f; - if (!Model.HasValue) - { - f = 0.0f; - } - else - { - f = Model.Value; - } + f = !Model.HasValue ? 0.0f : Model.Value; }
diff --git a/Web/Views/Shared/EditorTemplates/String.cshtml b/Web/Views/Shared/EditorTemplates/String.cshtml index 9dbb1e3..3218ba2 100644 --- a/Web/Views/Shared/EditorTemplates/String.cshtml +++ b/Web/Views/Shared/EditorTemplates/String.cshtml @@ -22,5 +22,4 @@ } } - -@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes) +@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes) \ No newline at end of file diff --git a/Web/Views/Shared/EditorTemplates/_FieldLayout.cshtml b/Web/Views/Shared/EditorTemplates/_FieldLayout.cshtml index 44629ca..ba5ecb2 100644 --- a/Web/Views/Shared/EditorTemplates/_FieldLayout.cshtml +++ b/Web/Views/Shared/EditorTemplates/_FieldLayout.cshtml @@ -11,10 +11,8 @@ }
@Html.LabelForModel(new { @class = "control-label" }) -
- @RenderBody() - @Html.ValidationMessage("", new { @class = "help-block"}) -
+ @RenderBody() + @Html.ValidationMessage("", new { @class = "help-block"})
diff --git a/Web/Web.csproj b/Web/Web.csproj index e39b1ad..0dcc9e9 100644 --- a/Web/Web.csproj +++ b/Web/Web.csproj @@ -618,8 +618,6 @@ Global.asax - -