Responsive queue page

This commit is contained in:
2020-02-25 11:08:27 -05:00
parent ef3370b940
commit 1c06fbbc32
8 changed files with 32 additions and 16 deletions
+5 -1
View File
@@ -4,6 +4,7 @@ using System.Web.Security;
using Hangfire; using Hangfire;
using LeafWeb.WebCms.Models; using LeafWeb.WebCms.Models;
using LeafWeb.WebCms.Services; using LeafWeb.WebCms.Services;
using log4net;
using MlkPwgen; using MlkPwgen;
using Umbraco.Core; using Umbraco.Core;
@@ -17,9 +18,12 @@ namespace LeafWeb.WebCms.Controllers
var memberService = ApplicationContext.Current.Services.MemberService; var memberService = ApplicationContext.Current.Services.MemberService;
var member = memberService.GetByEmail(email); var member = memberService.GetByEmail(email);
var logger = LogManager.GetLogger(GetType());
if (member == null) if (member == null)
{ {
TempData["StatusMessage"] = $"Sorry, user with email {email} not found. Please try to register again, or use Contact Us to resolve the issue.";
TempData["StatusMessage"] = $"Sorry, verification was not found. Please try to register again, or use Contact Us to resolve the issue.";
TempData["StatusMessage-Type"] = "alert-danger"; TempData["StatusMessage-Type"] = "alert-danger";
} }
else if (member.IsApproved) else if (member.IsApproved)
+12 -9
View File
@@ -1,8 +1,11 @@
@using LeafWeb.Core.Entities @using ClientDependency.Core.Mvc
@using LeafWeb.Core.Entities
@using LeafWeb.WebCms.Controllers @using LeafWeb.WebCms.Controllers
@model QueueViewModel @model QueueViewModel
@{ @{
Html.RequiresJs("~/scripts/Queue.js");
var grid = new WebGrid(Model.Items, rowsPerPage: 45); var grid = new WebGrid(Model.Items, rowsPerPage: 45);
} }
@@ -29,15 +32,15 @@
@if (Model.Items.Any()) @if (Model.Items.Any())
{ {
<div class="table-responsive"> <div id="queue" class="table-responsive">
@grid.Table(columns: @grid.Table(columns:
grid.Columns( grid.Columns(
grid.Column("Identifier", "Identifier"), grid.Column("Identifier", "Identifier"),
grid.Column("SiteId", "Site Id"), grid.Column("SiteId", "Site Id"),
grid.Column("Name", "Submitted By"), grid.Column("Name", "Submitted By" ),
grid.Column("TimeInProgress", "Statistics", item => Statistics(item.Value)), grid.Column("TimeInProgress", "Statistics", item => Statistics(item.Value), canSort: false),
grid.Column("CurrentStatus", "Status", item => Status(item.Value)), grid.Column("CurrentStatus", "Status", item => Status(item.Value), canSort: false),
grid.Column("Total Results: " + Model.Items.Count(), format: item => Actions(item.Value))), grid.Column("Total Results: " + Model.Items.Count(), format: item => Actions(item.Value), canSort: false)),
htmlAttributes: new {@class = "table table-sm table-striped table-bordered table-hover"} htmlAttributes: new {@class = "table table-sm table-striped table-bordered table-hover"}
) )
@grid.BootstrapPager() @grid.BootstrapPager()
@@ -58,8 +61,8 @@ else
<div class="btn-group text-nowrap" role="group"> <div class="btn-group text-nowrap" role="group">
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<button id="actions(@item.Id)" type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" <button id="actions(@item.Id)" type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Actions">
Actions <span class="d-none d-sm-inline">Actions</span>
</button> </button>
<div class="dropdown-menu" aria-labelledby="actions(@item.Id)"> <div class="dropdown-menu" aria-labelledby="actions(@item.Id)">
<button class="dropdown-item">@DetailsLink(item)</button> <button class="dropdown-item">@DetailsLink(item)</button>
@@ -123,7 +126,7 @@ else
} }
var summaryText = string.Join(Environment.NewLine, summary); var summaryText = string.Join(Environment.NewLine, summary);
<span class="text-nowrap" title="@summaryText"> <span class="text-nowrap" title="@summaryText">
<i class="fa fa-file-o"></i> @leafInput.InputFiles.Count @if(leafInput.InputFiles.Count > 1) {<text>LeafInputs</text>} else { <text>LeafInput</text>} <i class="fa fa-file-o"></i> @leafInput.InputFiles.Count @if(leafInput.InputFiles.Count > 1) {<text>inputs</text>} else { <text>input</text>}
<br /> <br />
@if (leafInput.TimeInProgress > TimeSpan.Zero) @if (leafInput.TimeInProgress > TimeSpan.Zero)
{ {
@@ -9,6 +9,6 @@
class="btn btn-outline-secondary @{if (xs) {<text>btn-sm</text>}} @{if (disabled) {<text>disabled</text>}}" class="btn btn-outline-secondary @{if (xs) {<text>btn-sm</text>}} @{if (disabled) {<text>disabled</text>}}"
role="button" role="button"
@{if (disabled) {<text>title="No chart has been generated"</text>}} > @{if (disabled) {<text>title="No chart has been generated"</text>}} >
<span class="fa fa-line-chart"></span> <span class="fa fa-line-chart" title="Charts"></span>
Chart <span class="d-none d-sm-inline">Charts</span>
</a> </a>
@@ -1,3 +1,4 @@
@using LeafWeb.Core.Utility @using LeafWeb.Core.Utility
@model string @model string
<span class="status status-@Model.ToLower()">@Model.SplitCamelCase()</span> <span class="status status-@Model.ToLower() d-none d-md-inline" title="@Model.SplitCamelCase()">@Model.SplitCamelCase()</span>
<span class="status status-@Model.ToLower() d-inline d-md-none" title="@Model.SplitCamelCase()"></span>
@@ -21,4 +21,4 @@
} }
@Html.Password("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes) @Html.Password("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
<p class="text-right pt-0 small">Forgot password? <a href="/membership/password-reset-request" class="small">Reset here</a></p> <p class="text-right pt-0 small"><a href="/membership/password-reset-request" class="small">Forgot password?</a></p>
+2 -2
View File
@@ -1,13 +1,13 @@
@if (TempData.ContainsKey("StatusMessage")) @if (TempData.ContainsKey("StatusMessage"))
{ {
<p class="alert @Html.Raw(TempData["StatusMessage-Type"])"> <p class="alert @Html.Raw(TempData["StatusMessage-Type"]) alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
@Html.Raw(TempData["StatusMessage"]) @Html.Raw(TempData["StatusMessage"])
</p> </p>
} }
else if (ViewBag.StatusMessage != null) else if (ViewBag.StatusMessage != null)
{ {
<p class="alert"> <p class="alert alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
@ViewBag.StatusMessage @ViewBag.StatusMessage
</p> </p>
+1
View File
@@ -892,6 +892,7 @@
<Content Include="scripts\jquery.validate.custom.js" /> <Content Include="scripts\jquery.validate.custom.js" />
<Content Include="scripts\jquery.validate.unobtrusive.js" /> <Content Include="scripts\jquery.validate.unobtrusive.js" />
<Content Include="scripts\jquery.validate.unobtrusive.min.js" /> <Content Include="scripts\jquery.validate.unobtrusive.min.js" />
<Content Include="scripts\Queue.js" />
<Content Include="scripts\LeafInputCreate.js" /> <Content Include="scripts\LeafInputCreate.js" />
<Content Include="scripts\popper-utils.js" /> <Content Include="scripts\popper-utils.js" />
<Content Include="scripts\popper-utils.min.js" /> <Content Include="scripts\popper-utils.min.js" />
+7
View File
@@ -0,0 +1,7 @@
$(function () {
$("#queue th:nth-child(4)").addClass("d-none d-md-table-cell");
$("#queue td:nth-child(4)").addClass("d-none d-md-table-cell");
$("#queue th:nth-child(3)").addClass("d-none d-sm-table-cell");
$("#queue td:nth-child(3)").addClass("d-none d-sm-table-cell");
});