Add TSV support.

Import Upload
This commit is contained in:
2015-09-11 14:24:27 -04:00
parent bd397b390b
commit 4dcffda1f8
16 changed files with 574 additions and 24 deletions
+65
View File
@@ -0,0 +1,65 @@
@model IList<MileageTraker.Web.Models.FuelLog>
@{
ViewBag.Title = "Import Fuel Logs";
}
@section Styles
{
<link href="@Url.Content("~/Content/font-awesome.min.css")" rel="stylesheet" type="text/css" />
}
@{ Html.RenderPartial("BackToLogs"); }
@Html.Partial("_StatusMessage")
<h2>@ViewBag.Title</h2>
<p>Driver: <strong>@ViewData["UserFullName"]</strong></p>
<p id="page-import-status"></p>
<table id="logs" class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<th>Import Status</th>
<th style="width:20%"></th>
<th>Vehicle ID</th>
<th>End Odometer</th>
<th>Type</th>
<th>Destination City</th>
<th>Purpose</th>
<th>Notes</th>
<th>Gas Purchased</th>
<th>Date</th>
</tr>
</thead>
@for (var i = 0; i < Model.Count; i++)
{
var viewModel = Model[i];
<tr id="log-@i">
@using (Html.BeginForm("ImportCreate", "Log", FormMethod.Post))
{
@Html.EditorFor(x => viewModel)
}
<td class="import-status"></td>
<td class="import-message"></td>
<td>@Html.ValueFor(x => viewModel.VehicleId)</td>
<td>@Html.ValueFor(x => viewModel.EndOdometer)</td>
<td>@Html.ValueFor(x => viewModel.LogType)</td>
<td>@Html.ValueFor(x => viewModel.CityName)</td>
<td>@Html.ValueFor(x => viewModel.Purpose)</td>
<td>@Html.ValueFor(x => viewModel.Notes)</td>
<td>@Html.ValueFor(x => viewModel.GasPurchased)</td>
<td>@Html.ValueFor(x => viewModel.Date)</td>
</tr>
}
</table>
@section Scripts
{
<script src="@Url.Content("~/Scripts/Shared/ImportCreate.js")" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
importLogs("@ViewData["UserFullName"]");
});
</script>
}
+17
View File
@@ -0,0 +1,17 @@
@model MileageTraker.Web.ViewModels.FuelLog.FuelLogImportUploadViewModel
@{
ViewBag.Title = "Import Fuel Logs";
}
@Html.Partial("_StatusMessage")
<h2 class="center-content">@ViewBag.Title</h2>
@using (Html.BeginForm("Import", "FuelLog", FormMethod.Post, new { enctype="multipart/form-data", @class = "form-horizontal well center-content", style="max-width:440px"}))
{
@Html.Partial("_ValidationSummary")
@Html.EditorForModel()
<div class="form-actions">
<input type="submit" value="Import" class="btn btn-primary" />
</div>
}