Update: Error UI Updated
This commit is contained in:
@@ -45,25 +45,26 @@ namespace Disco.Services.Authorization
|
||||
|
||||
#region Token Accessors
|
||||
|
||||
internal const string RequireAuthenticationMessage = "This Disco feature requires authentication.";
|
||||
internal const string RequireDiscoAuthorizationMessage = "Your account does not have the required permission to access this Disco feature. This feature requires your account to be included in at least one Disco Authorization Role.";
|
||||
internal const string RequireMessageTemplate = "Your account does not have the required permission ({0}) to access this Disco feature.";
|
||||
internal const string RequireAllMessageTemplate = "Your account does not have the required permission to access this Disco feature. This feature requires permission for: {0}.";
|
||||
internal const string RequireAnyMessageTemplate = "Your account does not have the required permission to access this Disco feature. This feature requires at least one of these permissions: {0}.";
|
||||
internal const string RequireAuthenticationMessage = "This feature requires authentication.";
|
||||
internal const string RequireDiscoAuthorizationMessage = "Your account does not have the required permission to access this feature. This feature requires your account to be included in at least one Disco Authorization Role.";
|
||||
internal const string RequireMessageTemplate = "Your account does not have the required permission to access this feature.\r\n";
|
||||
internal const string RequireMessageSingleTemplate = RequireMessageTemplate + "This feature requires the following permission:\r\n- {0}";
|
||||
internal const string RequireAllMessageTemplate = RequireMessageTemplate + "This feature requires permission for:{0}.";
|
||||
internal const string RequireAnyMessageTemplate = RequireMessageTemplate + "This feature requires at least one of these permissions:{0}.";
|
||||
|
||||
internal static string BuildRequireMessage(string ClaimKey)
|
||||
{
|
||||
return string.Format(RequireMessageTemplate, Claims.GetClaimDetails(ClaimKey).Item1);
|
||||
return string.Format(RequireMessageSingleTemplate, Claims.GetClaimDetails(ClaimKey).Item1);
|
||||
}
|
||||
internal static string BuildRequireAllMessage(IEnumerable<string> ClaimKeys)
|
||||
{
|
||||
var claimFriendlyNames = ClaimKeys.Select(ck => Claims.GetClaimDetails(ck).Item1);
|
||||
return string.Format(RequireAllMessageTemplate, string.Join("; ", claimFriendlyNames));
|
||||
return string.Format(RequireAllMessageTemplate, string.Join("\r\n- ", claimFriendlyNames));
|
||||
}
|
||||
internal static string BuildRequireAnyMessage(IEnumerable<string> ClaimKeys)
|
||||
{
|
||||
var claimFriendlyNames = ClaimKeys.Select(ck => Claims.GetClaimDetails(ck).Item1);
|
||||
return string.Format(RequireAnyMessageTemplate, string.Join("; ", claimFriendlyNames));
|
||||
return string.Format(RequireAnyMessageTemplate, string.Join("\r\n- ", claimFriendlyNames));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Mvc;
|
||||
@@ -34,30 +35,44 @@ namespace Disco.Services.Authorization
|
||||
protected sealed override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
|
||||
{
|
||||
string resultMessage = HandleUnauthorizedMessage();
|
||||
string resultResource = BuildAuthorizeResource(filterContext);
|
||||
|
||||
LogAccessDenied(filterContext, resultMessage);
|
||||
// Log Access Denied
|
||||
if (Token != null) // Don't log anonymous
|
||||
AuthorizationLog.LogAccessDenied(Token.User.Id, resultResource, resultMessage);
|
||||
|
||||
filterContext.Result = new HttpUnauthorizedResult(resultMessage);
|
||||
// Build Response View
|
||||
var ex = new AccessDeniedException(resultMessage, resultResource);
|
||||
HandleErrorInfo model = new HandleErrorInfo(ex, filterContext.ActionDescriptor.ControllerDescriptor.ControllerName, filterContext.ActionDescriptor.ActionName);
|
||||
ViewResult result = new ViewResult
|
||||
{
|
||||
ViewName = "Error",
|
||||
MasterName = Token == null ? "_PublicLayout" : "_Layout",
|
||||
ViewData = new ViewDataDictionary<HandleErrorInfo>(model),
|
||||
TempData = filterContext.Controller.TempData
|
||||
};
|
||||
|
||||
filterContext.Result = result;
|
||||
var contextResponse = filterContext.HttpContext.Response;
|
||||
contextResponse.Clear();
|
||||
contextResponse.StatusCode = (int)HttpStatusCode.Unauthorized;
|
||||
contextResponse.TrySkipIisCustomErrors = true;
|
||||
}
|
||||
|
||||
public void LogAccessDenied(AuthorizationContext FilterContext, string ResultMessage)
|
||||
private string BuildAuthorizeResource(AuthorizationContext FilterContext)
|
||||
{
|
||||
// Don't log anonymous
|
||||
if (Token != null)
|
||||
var authResource = AuthorizeResource;
|
||||
var url = FilterContext.HttpContext.Request.RawUrl;
|
||||
|
||||
if (authResource == null)
|
||||
{
|
||||
// Calculate Authorize Resource
|
||||
if (AuthorizeResource == null)
|
||||
{
|
||||
var controllerName = FilterContext.ActionDescriptor.ControllerDescriptor.ControllerName;
|
||||
var actionName = FilterContext.ActionDescriptor.ActionName;
|
||||
var controllerName = FilterContext.ActionDescriptor.ControllerDescriptor.ControllerName;
|
||||
var actionName = FilterContext.ActionDescriptor.ActionName;
|
||||
|
||||
AuthorizeResource = string.Format("{0}::{1}", controllerName, actionName);
|
||||
}
|
||||
|
||||
var resource = string.Format("{0} [{1}]", AuthorizeResource, FilterContext.HttpContext.Request.RawUrl);
|
||||
|
||||
AuthorizationLog.LogAccessDenied(Token.User.Id, resource, ResultMessage);
|
||||
authResource = string.Format("{0}::{1}", controllerName, actionName);
|
||||
}
|
||||
|
||||
return string.Format("{0} [{1}]", authResource, url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Disco.Services.Web
|
||||
|
||||
string controllerName = (string)filterContext.RouteData.Values["controller"];
|
||||
string actionName = (string)filterContext.RouteData.Values["action"];
|
||||
HandleErrorInfo model = new HandleErrorInfo(ex, controllerName, actionName);
|
||||
HandleErrorInfo model = new HandleErrorInfo(ex, controllerName ?? "Unknown", actionName ?? "Unknown");
|
||||
ViewResult result = new ViewResult
|
||||
{
|
||||
ViewName = "Error",
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
@{
|
||||
Layout = "~/Areas/Public/Views/Shared/_Layout.cshtml";
|
||||
Layout = "~/Views/Shared/_PublicLayout.cshtml";
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18051
|
||||
// Runtime Version:4.0.30319.34003
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -45,7 +45,7 @@ namespace Disco.Web.Areas.Public.Views
|
||||
|
||||
#line 1 "..\..\Areas\Public\Views\_ViewStart.cshtml"
|
||||
|
||||
Layout = "~/Areas/Public/Views/Shared/_Layout.cshtml";
|
||||
Layout = "~/Views/Shared/_PublicLayout.cshtml";
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -1446,6 +1446,31 @@ header .watermark,
|
||||
-webkit-border-radius: 0 0 6px 6px;
|
||||
border-radius: 0 0 6px 6px;
|
||||
}
|
||||
#layout_Error {
|
||||
min-height: 200px;
|
||||
}
|
||||
#layout_Error table {
|
||||
background-color: #fff;
|
||||
}
|
||||
#layout_Error h1,
|
||||
#layout_Error h2,
|
||||
#layout_Error h3,
|
||||
#layout_Error h4,
|
||||
#layout_Error h5 {
|
||||
color: #fff;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
#layout_Error h2.error {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#layout_Error .stacktrace {
|
||||
white-space: pre;
|
||||
overflow: auto;
|
||||
}
|
||||
#layout_Error > div {
|
||||
margin: 0 auto;
|
||||
width: 650px;
|
||||
}
|
||||
#layout_uiExtensions {
|
||||
display: none;
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -268,6 +268,31 @@ header .watermark,
|
||||
-webkit-border-radius: 0 0 6px 6px;
|
||||
border-radius: 0 0 6px 6px;
|
||||
}
|
||||
#layout_Error {
|
||||
min-height: 200px;
|
||||
}
|
||||
#layout_Error table {
|
||||
background-color: #fff;
|
||||
}
|
||||
#layout_Error h1,
|
||||
#layout_Error h2,
|
||||
#layout_Error h3,
|
||||
#layout_Error h4,
|
||||
#layout_Error h5 {
|
||||
color: #fff;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
#layout_Error h2.error {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#layout_Error .stacktrace {
|
||||
white-space: pre;
|
||||
overflow: auto;
|
||||
}
|
||||
#layout_Error > div {
|
||||
margin: 0 auto;
|
||||
width: 650px;
|
||||
}
|
||||
#layout_uiExtensions {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -200,6 +200,33 @@ header, #header {
|
||||
.border-radius4(0, 0, 6px, 6px);
|
||||
}
|
||||
|
||||
#layout_Error {
|
||||
min-height: 200px;
|
||||
|
||||
table {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5 {
|
||||
color: #fff;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
h2.error {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.stacktrace {
|
||||
white-space: pre;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
& > div {
|
||||
margin: 0 auto;
|
||||
width: 650px;
|
||||
}
|
||||
}
|
||||
|
||||
#layout_uiExtensions {
|
||||
display: none;
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -509,8 +509,18 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Public\Views\Shared\_Layout.generated.cs">
|
||||
<DependentUpon>_Layout.cshtml</DependentUpon>
|
||||
<Compile Include="Views\Shared\DisplayTemplates\AccessDeniedException.generated.cs">
|
||||
<DependentUpon>AccessDeniedException.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Views\Shared\DisplayTemplates\Exception.generated.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Exception.cshtml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Shared\_PublicLayout.generated.cs">
|
||||
<DependentUpon>_PublicLayout.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
@@ -1778,9 +1788,17 @@
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Licence.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Areas\Public\Views\Shared\_Layout.cshtml">
|
||||
<Content Include="Views\Shared\DisplayTemplates\AccessDeniedException.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>_Layout.generated.cs</LastGenOutput>
|
||||
<LastGenOutput>AccessDeniedException.generated.cs</LastGenOutput>
|
||||
</Content>
|
||||
<None Include="Views\Shared\DisplayTemplates\Exception.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Exception.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Views\Shared\_PublicLayout.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>_PublicLayout.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Areas\Public\Views\UserHeldDevices\Index.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
@@ -1915,6 +1933,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Areas\API\Models\WirelessCertificate\" />
|
||||
<Folder Include="Areas\Public\Views\Shared\" />
|
||||
<Folder Include="Areas\Services\Models\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -1968,7 +1987,7 @@
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" />
|
||||
<UserProperties BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
@model Disco.Services.Authorization.AccessDeniedException
|
||||
@{
|
||||
ViewBag.Title = "Authorization Required";
|
||||
Disco.Services.Authorization.AccessDeniedException ex = (Disco.Services.Authorization.AccessDeniedException)Model;
|
||||
}
|
||||
<i class="icon accessDenied"></i>
|
||||
<div>
|
||||
<h2 class="error">@ex.Message</h2>
|
||||
<h4>Feature:</h4>
|
||||
<div class="code stacktrace" style="width: 560px;">@ex.Resource</div>
|
||||
</div>
|
||||
@@ -0,0 +1,91 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34003
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Shared.DisplayTemplates
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Shared/DisplayTemplates/AccessDeniedException.cshtml")]
|
||||
public partial class AccessDeniedException : Disco.Services.Web.WebViewPage<Disco.Services.Authorization.AccessDeniedException>
|
||||
{
|
||||
public AccessDeniedException()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Views\Shared\DisplayTemplates\AccessDeniedException.cshtml"
|
||||
|
||||
ViewBag.Title = "Authorization Required";
|
||||
Disco.Services.Authorization.AccessDeniedException ex = (Disco.Services.Authorization.AccessDeniedException)Model;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<i");
|
||||
|
||||
WriteLiteral(" class=\"icon accessDenied\"");
|
||||
|
||||
WriteLiteral("></i>\r\n<div>\r\n <h2");
|
||||
|
||||
WriteLiteral(" class=\"error\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 8 "..\..\Views\Shared\DisplayTemplates\AccessDeniedException.cshtml"
|
||||
Write(ex.Message);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</h2>\r\n <h4>Feature:</h4>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"code stacktrace\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 560px;\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 10 "..\..\Views\Shared\DisplayTemplates\AccessDeniedException.cshtml"
|
||||
Write(ex.Resource);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n</div>");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,52 @@
|
||||
@model System.Exception
|
||||
@{
|
||||
var ex = Model;
|
||||
}
|
||||
<i class="icon"></i>
|
||||
@while (ex != null)
|
||||
{
|
||||
<div class="form" style="width: 650px">
|
||||
<h2 class="error">@ex.Message</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Details <a href="#" class="toClipboard smallMessage">(Copy to Clipboard)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="code stacktrace" style="width: 638px;">@ex.Message
|
||||
[@ex.GetType().FullName]
|
||||
|
||||
Stack Trace:
|
||||
@ex.StackTrace</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
ex = ex.InnerException;
|
||||
}
|
||||
<script>
|
||||
$(function () {
|
||||
var toClipboardLinks = $('#layout_Error').find('a.toClipboard');
|
||||
|
||||
if (window.clipboardData) {
|
||||
// Clipboard access available
|
||||
toClipboardLinks.click(function (e) {
|
||||
$this = $(this);
|
||||
|
||||
var details = $this.closest('table').find('div.stacktrace').text();
|
||||
details = $.trim(details).replace(/\n/gm, '\r\n');
|
||||
window.clipboardData.setData('Text', details);
|
||||
|
||||
alert('Details copied to Clipboard');
|
||||
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
// No Clipboard access available - hide links
|
||||
toClipboardLinks.hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,166 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34003
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Shared.DisplayTemplates
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Shared/DisplayTemplates/Exception.cshtml")]
|
||||
public partial class Exception : Disco.Services.Web.WebViewPage<System.Exception>
|
||||
{
|
||||
public Exception()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Views\Shared\DisplayTemplates\Exception.cshtml"
|
||||
|
||||
var ex = Model;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<i");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 6 "..\..\Views\Shared\DisplayTemplates\Exception.cshtml"
|
||||
while (ex != null)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 650px\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2");
|
||||
|
||||
WriteLiteral(" class=\"error\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 9 "..\..\Views\Shared\DisplayTemplates\Exception.cshtml"
|
||||
Write(ex.Message);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</h2>\r\n <table>\r\n <tr>\r\n <td>\r\n " +
|
||||
" Details <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"toClipboard smallMessage\"");
|
||||
|
||||
WriteLiteral(">(Copy to Clipboard)</a>\r\n </td>\r\n </tr>\r\n <" +
|
||||
"tr>\r\n <td>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"code stacktrace\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 638px;\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 18 "..\..\Views\Shared\DisplayTemplates\Exception.cshtml"
|
||||
Write(ex.Message);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n[");
|
||||
|
||||
|
||||
#line 19 "..\..\Views\Shared\DisplayTemplates\Exception.cshtml"
|
||||
Write(ex.GetType().FullName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]\r\n\r\nStack Trace:\r\n");
|
||||
|
||||
|
||||
#line 22 "..\..\Views\Shared\DisplayTemplates\Exception.cshtml"
|
||||
Write(ex.StackTrace);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 27 "..\..\Views\Shared\DisplayTemplates\Exception.cshtml"
|
||||
|
||||
ex = ex.InnerException;
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"<script>
|
||||
$(function () {
|
||||
var toClipboardLinks = $('#layout_Error').find('a.toClipboard');
|
||||
|
||||
if (window.clipboardData) {
|
||||
// Clipboard access available
|
||||
toClipboardLinks.click(function (e) {
|
||||
$this = $(this);
|
||||
|
||||
var details = $this.closest('table').find('div.stacktrace').text();
|
||||
details = $.trim(details).replace(/\n/gm, '\r\n');
|
||||
window.clipboardData.setData('Text', details);
|
||||
|
||||
alert('Details copied to Clipboard');
|
||||
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
// No Clipboard access available - hide links
|
||||
toClipboardLinks.hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -1,38 +1,15 @@
|
||||
@model System.Web.Mvc.HandleErrorInfo
|
||||
@{
|
||||
ViewBag.Title = "Server Error";
|
||||
|
||||
ViewBag.Title = "An Error Occurred";
|
||||
|
||||
var ex = Model.Exception;
|
||||
|
||||
|
||||
while (ex != null)
|
||||
{
|
||||
|
||||
<div class="form" style="width: 650px">
|
||||
<h2 style="white-space: pre;">@ex.Message</h2>
|
||||
<table style="background-color: #fff;">
|
||||
<tr>
|
||||
<th style="width: 40px;">Type:</th>
|
||||
<td>
|
||||
@ex.GetType().Name
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Stack:
|
||||
</th>
|
||||
<td>
|
||||
<div class="code" style="width: 560px; white-space: pre; overflow: auto;">@ex.StackTrace</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
ex = ex.InnerException;
|
||||
}
|
||||
}
|
||||
<script>
|
||||
$(function () {
|
||||
$('#layout_PageHeading').css({ 'background': '#C80000', 'color': '#fff' });
|
||||
$('#layout_Page').css({ 'background': 'linear-gradient(to top, #F2B0B0, #C80000 200px)' }).find('h2').css({ 'color': '#fff' });
|
||||
});
|
||||
</script>
|
||||
<div id="layout_Error">
|
||||
@Html.DisplayFor(m => m.Exception)
|
||||
<script>
|
||||
$(function () {
|
||||
$('#layout_PageHeading').css({ 'background': '#C80000', 'color': '#fff' });
|
||||
$('#layout_Page').css({ 'background': 'linear-gradient(to top, #F2B0B0, #C80000 200px)' });
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
@@ -45,91 +45,36 @@ namespace Disco.Web.Views.Shared
|
||||
|
||||
#line 2 "..\..\Views\Shared\Error.cshtml"
|
||||
|
||||
ViewBag.Title = "Server Error";
|
||||
|
||||
ViewBag.Title = "An Error Occurred";
|
||||
|
||||
var ex = Model.Exception;
|
||||
|
||||
|
||||
while (ex != null)
|
||||
{
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
WriteLiteral(" id=\"layout_Error\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 650px\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(">\r\n <h2");
|
||||
|
||||
WriteLiteral(" style=\"white-space: pre;\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 12 "..\..\Views\Shared\Error.cshtml"
|
||||
Write(ex.Message);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</h2>\r\n <table");
|
||||
|
||||
WriteLiteral(" style=\"background-color: #fff;\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 40px;\"");
|
||||
|
||||
WriteLiteral(">Type:</th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 17 "..\..\Views\Shared\Error.cshtml"
|
||||
Write(ex.GetType().Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||
">Stack:\r\n </th>\r\n <td>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 560px; white-space: pre; overflow: auto;\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\Shared\Error.cshtml"
|
||||
Write(ex.StackTrace);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 29 "..\..\Views\Shared\Error.cshtml"
|
||||
|
||||
ex = ex.InnerException;
|
||||
}
|
||||
#line 8 "..\..\Views\Shared\Error.cshtml"
|
||||
Write(Html.DisplayFor(m => m.Exception));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"
|
||||
<script>
|
||||
$(function () {
|
||||
$('#layout_PageHeading').css({ 'background': '#C80000', 'color': '#fff' });
|
||||
$('#layout_Page').css({ 'background': 'linear-gradient(to top, #F2B0B0, #C80000 200px)' }).find('h2').css({ 'color': '#fff' });
|
||||
});
|
||||
</script>
|
||||
");
|
||||
<script>
|
||||
$(function () {
|
||||
$('#layout_PageHeading').css({ 'background': '#C80000', 'color': '#fff' });
|
||||
$('#layout_Page').css({ 'background': 'linear-gradient(to top, #F2B0B0, #C80000 200px)' });
|
||||
});
|
||||
</script>
|
||||
</div>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+21
-21
@@ -2,14 +2,14 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18051
|
||||
// Runtime Version:4.0.30319.34003
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Public.Views.Shared
|
||||
namespace Disco.Web.Views.Shared
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -34,16 +34,16 @@ namespace Disco.Web.Areas.Public.Views.Shared
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Public/Views/Shared/_Layout.cshtml")]
|
||||
public partial class Layout : Disco.Services.Web.WebViewPage<dynamic>
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Shared/_PublicLayout.cshtml")]
|
||||
public partial class PublicLayout : Disco.Services.Web.WebViewPage<dynamic>
|
||||
{
|
||||
public Layout()
|
||||
public PublicLayout()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 1 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 1 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
|
||||
Html.BundleDeferred("~/Style/Site");
|
||||
Html.BundleDeferred("~/ClientScripts/Core");
|
||||
@@ -64,7 +64,7 @@ WriteLiteral(" content=\"IE=edge\"");
|
||||
WriteLiteral(" />\r\n <title>Disco - ");
|
||||
|
||||
|
||||
#line 10 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 10 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(CommonHelpers.BreadcrumbsTitle(ViewBag.Title));
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ WriteLiteral("</title>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 11 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 11 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(Html.BundleRenderDeferred());
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ WriteLiteral("\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 12 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 12 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(RenderSection("head", false));
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ WriteLiteral(">\r\n <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 535), Tuple.Create("\"", 580)
|
||||
|
||||
#line 19 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 19 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 542), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Public.Public.Index())
|
||||
|
||||
#line default
|
||||
@@ -124,7 +124,7 @@ WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 612), Tuple.Create("\"", 662)
|
||||
|
||||
#line 20 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 20 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 618), Tuple.Create<System.Object, System.Int32>(Links.ClientSource.Style.Images.Heading_png
|
||||
|
||||
#line default
|
||||
@@ -146,7 +146,7 @@ WriteLiteral(" id=\"menu\"");
|
||||
WriteLiteral(">\r\n <li>");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 27 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(Html.ActionLink("Public Reports", MVC.Public.Public.Index()));
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ WriteLiteral(" style=\"margin-left: 10px;\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 29 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 29 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(Html.ActionLink("Disco Administration", MVC.Job.Index(), accesskey: "1"));
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ WriteLiteral(" id=\"layout_PageHeading\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 33 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(CommonHelpers.Breadcrumbs(ViewBag.Title));
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ WriteLiteral(">\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 35 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 35 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(RenderBody());
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("\r\n </section>\r\n <footer>\r\n Disco v");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 38 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(Disco.Web.DiscoApplication.Version);
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("@ ");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 38 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(Disco.Web.DiscoApplication.OrganisationName);
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ WriteLiteral("@ ");
|
||||
WriteLiteral(" | ");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 38 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(Html.ActionLink("Credits", MVC.Public.Public.Credits()));
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ WriteLiteral(" | ");
|
||||
WriteLiteral(" | ");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 38 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Write(Html.ActionLink("Licence", MVC.Public.Public.Licence()));
|
||||
|
||||
|
||||
@@ -239,13 +239,13 @@ WriteLiteral(" | ");
|
||||
WriteLiteral("\r\n </footer>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 41 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 41 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 41 "..\..\Areas\Public\Views\Shared\_Layout.cshtml"
|
||||
#line 41 "..\..\Views\Shared\_PublicLayout.cshtml"
|
||||
Disco.Services.Plugins.Features.UIExtension.UIExtensions.ExecuteExtensionResult(this);
|
||||
|
||||
#line default
|
||||
Reference in New Issue
Block a user