Leaf Input and Submit

This commit is contained in:
2016-12-06 11:53:30 -05:00
parent a3b8b7a881
commit 6fd7e46f5d
74 changed files with 56144 additions and 1291 deletions
+28 -1
View File
@@ -2,5 +2,32 @@
@{
Layout = "Master.cshtml";
}
<div class="home">
@CurrentPage.GetGridHtml("content", "fanoe")
</div>
@{
var blogSelection = CurrentPage.Site().FirstChild("BlogPostRepository").Children("BlogPost").Where("Visible");
}
<div role="content">
@CurrentPage.GetGridHtml("content", "fanoe")
<section class="light blogarchive equalizer">
<div class="container">
<div class="row">
@foreach(var post in blogSelection)
{
<div class="col-sm-6">
<div class="content equal">
<a href="@post.Url">
<div class="date">@post.CreateDate.ToLongDateString()</div>
<h2>@post.Name</h2>
<p>@Umbraco.Truncate(post.Introduction, 240, true)</p>
</a>
</div>
</div>
}
</div>
</div>
</section>
</div>
+17 -14
View File
@@ -16,16 +16,20 @@
<span>Add files...</span>
<input type="file" name="files[]" multiple>
</span>
<button type="button" class="btn btn-default delete">
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
</button>
<input type="checkbox" class="toggle">
<!-- The global file processing state -->
<span class="fileupload-process"></span>
</div>
<div class="col-lg-6 pull-right">
<span class="pull-right"> Select all <input type="checkbox" class="toggle"></span>
<button type="button" class="btn btn-default delete pull-right">
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
</button>
</div>
<!-- The global progress state -->
<div class="col-lg-7 fileupload-progress fade">
<div class="col-lg-12 fileupload-progress fade">
<!-- The global progress bar -->
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-success" style="width: 0%;"></div>
@@ -42,18 +46,18 @@
@using (Html.BeginUmbracoForm("Submit", "LeafInput", FormMethod.Post))
{
@Html.EditorFor(m => m.PhotosynthesisType)
@*@Html.EditorFor(m => m.Identifier)
@Html.EditorFor(m => m.SiteId)*@
@Html.EditorFor(m => m.Identifier)
@Html.EditorFor(m => m.SiteId)
@Html.EditorFor(m => m.Name)
@*@Html.EditorFor(m => m.Email)
@Html.EditorFor(m => m.EmailConfirm)*@
<input type="submit" id="submit-form" class="hidden" />}
@Html.EditorFor(m => m.Email)
@Html.EditorFor(m => m.EmailConfirm)
<input type="submit" id="submit-form" class="hidden"/>
}
<label for="submit-form" class="btn btn-primary pull-right">Submit...</label>
</div>
</div>
</div>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
@@ -123,6 +127,5 @@
</tr>
{% } %}
</script>
<script src="~/scripts/LeafInputCreate.js"></script>
</script>
@@ -0,0 +1,5 @@
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
Html.RenderAction("Index", "Results");
}
+9 -7
View File
@@ -1,7 +1,7 @@
@inherits UmbracoTemplatePage
@{
Layout = null;
var home = @CurrentPage.Site();
var home = CurrentPage.Site();
}
<!DOCTYPE html>
@@ -21,9 +21,9 @@
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet" type="text/css">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/css/site.css">
<link rel="stylesheet" type="text/css" href="/css/style.css">
<link href="~/Content/bootstrap.min.css" type="text/css" rel="stylesheet" />
<link href="~/Content/site.css" type="text/css" rel="stylesheet" />
<link href="~/Content/style.css" type="text/css" rel="stylesheet" />
@RenderSection("Styles", false)
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
@@ -57,7 +57,9 @@
<a href="#" class="cross"><span></span></a>
</div>
</header>
@Html.Partial("_StatusMessage")
@RenderBody()
<footer class="field dark">
@@ -71,8 +73,8 @@
</footer>
<!-- Javascripts -->
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="~/scripts/jquery-1.11.1.js"></script>
<script src="~/scripts/bootstrap.min.js"></script>
<script src="/scripts/site.js"></script>
@RenderSection("Scripts", false)
</body>
@@ -0,0 +1,10 @@
@{
ViewBag.Title = "Not Found";
}
<h1>
@ViewBag.Title
</h1>
<p>The given download link was not found. Please contact administrator, referencing the following url:</p>
<code>@Html.Raw(Request.Url)</code>
+19
View File
@@ -0,0 +1,19 @@
@model IEnumerable<LeafWeb.WebCms.Models.ResultStatusViewModel>
@{
var grid = new WebGrid(Model, rowsPerPage: 45);
}
@grid.GetHtml(columns:
grid.Columns(
grid.Column("LeafInputIdentifier", "Identifier"),
grid.Column("LeafInputSiteId", "Site Id"),
grid.Column("LeafInputName", "Submitted By"),
grid.Column("CurrentStatus", "Status"),
grid.Column("Chart", "Chart", item =>
item.HasLeafChart
? Html.ActionLink("Chart", "Index", "Chart", new {leafInputId = item.LeafInputId}, new {})
: Html.Raw(""))
),
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed" }
)
+30 -11
View File
@@ -1,11 +1,13 @@
@inherits UmbracoTemplatePage
@{
Layout = "Master.cshtml";
var leafInputBackload = GetBoolProperty(Model.Content.Properties, "leafInputBackload");
}
@section Styles
{
@Styles.Render("~/backload/blueimp/bootstrap/BasicPlusUI/css")
@if (leafInputBackload) { @Styles.Render("~/backload/blueimp/bootstrap/BasicPlusUI/css") }
}
@CurrentPage.GetGridHtml("content", "fanoe")
@@ -13,15 +15,32 @@
@section Scripts
{
<!-- Scripts for the jQquery File Upload Plugin in Basic Plus UI style* -->
@Scripts.Render("~/backload/blueimp/bootstrap/BasicPlusUI")
@if (leafInputBackload) { @Scripts.Render("~/backload/blueimp/bootstrap/BasicPlusUI") }
<!-- jQuery autocomplete* -->
@Scripts.Render("~/bundles/autocomplete")
<!-- The application script -->
<script src="/Scripts/LeafInput.js"></script>
<script type="text/javascript">
initFileUpload("@Session.SessionID");
$('input#SiteId').autocomplete({
serviceUrl: '/FluxnetSite/Autocomplete'
});
</script>
@if (leafInputBackload) { <script src="~/scripts/jquery.autocomplete.min.js"></script> }
@if (leafInputBackload)
{
<script src="~/scripts/LeafInputCreate.js"></script>
<script type="text/javascript">
$(function () {
initFileUpload("@Session.SessionID");
$('input#SiteId').autocomplete({
serviceUrl: '/umbraco/surface/FluxnetSite/Autocomplete'
});
});
</script>
}
}
@functions {
private static bool GetBoolProperty(ICollection<IPublishedProperty> props, string propertyTypeAlias)
{
var backload =
props.FirstOrDefault(p => p.PropertyTypeAlias.Equals(propertyTypeAlias)) != null
? (bool)props.FirstOrDefault(p => p.PropertyTypeAlias.Equals(propertyTypeAlias)).Value
: false;
return backload;
}
}