@if(childPage.DocumentTypeAlias == "LandingPage")
{
@@ -36,20 +36,26 @@
@helper childPages(dynamic pages)
{
@* Ensure that we have a collection of pages *@
- if (pages.Any())
+ if (pages.Where("Visible").Any())
{
@* Get the first page in pages and get the level *@
var naviLevel = pages.First().Level;
@* Add in level for a CSS hook *@
- @foreach (var page in pages)
+ @foreach (var page in pages.Where("Visible"))
{
+ if (library.IsProtected(page.id, page.path)
+ && !library.HasAccess(page.id, page.path))
+ {
+ continue;
+ }
+
@page.Name
@* if the current page has any children *@
- @if (page.Children.Any())
+ @if (page.Children.Where("Visible").Any())
{
@* Call our helper to display the children *@
@childPages(page.Children)
@@ -58,4 +64,4 @@
}
}
-}
\ No newline at end of file
+}
diff --git a/WebCms/Views/Queue/Details.cshtml b/WebCms/Views/Queue/Details.cshtml
new file mode 100644
index 0000000..2e38b4c
--- /dev/null
+++ b/WebCms/Views/Queue/Details.cshtml
@@ -0,0 +1,3 @@
+@model LeafWeb.WebCms.Models.LeafInputCreate
+
+@Html.DisplayForModel()
diff --git a/WebCms/Views/Queue/DownloadNotFound.cshtml b/WebCms/Views/Queue/DownloadNotFound.cshtml
new file mode 100644
index 0000000..031fe62
--- /dev/null
+++ b/WebCms/Views/Queue/DownloadNotFound.cshtml
@@ -0,0 +1,10 @@
+@{
+ ViewBag.Title = "Not Found";
+}
+
+
+ @ViewBag.Title
+
+
+The given download link was not found. Please contact administrator, referencing the following url:
+@Html.Raw(Request.Url)
\ No newline at end of file
diff --git a/WebCms/Views/Queue/Index.cshtml b/WebCms/Views/Queue/Index.cshtml
new file mode 100644
index 0000000..ae4e231
--- /dev/null
+++ b/WebCms/Views/Queue/Index.cshtml
@@ -0,0 +1,49 @@
+@model IEnumerable
+
+@{
+ 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", item => statusFormat(item)),
+ grid.Column("Chart", "Chart", item => chartLink(item)),
+ grid.Column("Total Results: " + Model.Count(), format: item => btns(item))),
+ htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed" }
+ )
+
+@helper btns(dynamic item)
+{
+
+ @Html.ActionLink("Details", "Details", new { id = item.LeafInputId }, new { @class = "btn btn-default btn-xs", role = "button" })
+
+
+ Download
+
+
+
+
+
+ @Html.ActionLink("Delete", "Delete", new { id = item.LeafInputId }, new { @class = "btn btn-default btn-xs", role = "button" })
+
+}
+
+
+@helper chartLink(dynamic item)
+{
+if (item.HasLeafChart)
+{
+ Chart
+}
+}
+
+@helper statusFormat(dynamic item)
+{
+ @item.CurrentStatus
+}
\ No newline at end of file
diff --git a/WebCms/Views/Results/Index.cshtml b/WebCms/Views/Results/Index.cshtml
index d4efb07..0e7ed90 100644
--- a/WebCms/Views/Results/Index.cshtml
+++ b/WebCms/Views/Results/Index.cshtml
@@ -9,11 +9,21 @@
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(""))
+ grid.Column("CurrentStatus", "Status", item => statusFormat(item)),
+ grid.Column("Chart", "Chart", item => chartLink(item))
),
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed" }
)
+
+@helper chartLink(dynamic item)
+{
+if (item.HasLeafChart)
+{
+ Chart
+}
+}
+
+@helper statusFormat(dynamic item)
+{
+ @item.CurrentStatus
+}
\ No newline at end of file
diff --git a/WebCms/Views/Shared/_StatusMessage.cshtml b/WebCms/Views/Shared/_StatusMessage.cshtml
index ab19134..614d72b 100644
--- a/WebCms/Views/Shared/_StatusMessage.cshtml
+++ b/WebCms/Views/Shared/_StatusMessage.cshtml
@@ -11,4 +11,4 @@ else if (ViewBag.StatusMessage != null)
×
@ViewBag.StatusMessage
-}
+}
\ No newline at end of file
diff --git a/WebCms/Views/TextPage.cshtml b/WebCms/Views/TextPage.cshtml
index 7d7d0bb..b158b37 100644
--- a/WebCms/Views/TextPage.cshtml
+++ b/WebCms/Views/TextPage.cshtml
@@ -3,6 +3,7 @@
Layout = "Master.cshtml";
var leafInputBackload = GetBoolProperty(Model.Content.Properties, "leafInputBackload");
+ var chart = GetBoolProperty(Model.Content.Properties, "chart");
}
@section Styles
@@ -10,7 +11,9 @@
@if (leafInputBackload) { @Styles.Render("~/backload/blueimp/bootstrap/BasicPlusUI/css") }
}
-@CurrentPage.GetGridHtml("content", "fanoe")
+
+ @CurrentPage.GetGridHtml("content", "fanoe")
+
@section Scripts
{
@@ -18,6 +21,7 @@
@if (leafInputBackload) { @Scripts.Render("~/backload/blueimp/bootstrap/BasicPlusUI") }
@if (leafInputBackload) { }
+ @if (chart) { }
@if (leafInputBackload)
{
diff --git a/WebCms/WebCms.csproj b/WebCms/WebCms.csproj
index 257b47b..515e881 100644
--- a/WebCms/WebCms.csproj
+++ b/WebCms/WebCms.csproj
@@ -619,6 +619,7 @@
+
@@ -690,6 +691,17 @@
+
+
+
+
+
+
+
+
+
+
+
Web.config
@@ -740,9 +752,12 @@
+
+
+
diff --git a/WebCms/scripts/Chart.js b/WebCms/scripts/Chart.js
new file mode 100644
index 0000000..3b17875
--- /dev/null
+++ b/WebCms/scripts/Chart.js
@@ -0,0 +1,42 @@
+var getUrlParameter = function getUrlParameter(sParam) {
+ var sPageURL = decodeURIComponent(window.location.search.substring(1)),
+ sURLVariables = sPageURL.split('&'),
+ sParameterName,
+ i;
+
+ for (i = 0; i < sURLVariables.length; i++) {
+ sParameterName = sURLVariables[i].split('=');
+
+ if (sParameterName[0] === sParam) {
+ return sParameterName[1] === undefined ? true : sParameterName[1];
+ }
+ }
+};
+
+$(function () {
+ var baseUrl = "/umbraco/surface/Chart/ChartCurve";
+ $('#CurveId')
+ .change(function () {
+ $('#chart-error').removeClass('text-danger').text('');
+ var $chart = $("#chart");
+ $chart.removeAttr('src');
+
+ var curveId = $("option:selected", this).text();
+ if (curveId === "@Html.Raw(selectText)") {
+ return;
+ }
+ var $spinner = $(this).after(' ').next('i');
+
+ var leafInputId = getUrlParameter("leafInputId");
+ var url = baseUrl + "?leafInputId=" + leafInputId + "&curveId=" + curveId;
+ $chart.load(function () {
+ $spinner.remove();
+ })
+ .error(function () {
+ $chart.removeAttr('src');
+ $spinner.remove();
+ $('#chart-error').addClass('text-danger').text('A problem was encountered loading this chart.');
+ })
+ .attr('src', url);
+ });
+});
\ No newline at end of file