Files
Disco/Disco.Web/Areas/Config/Views/DocumentTemplate/_ExpressionsTable.cshtml
T
Gary Sharp 5ea9a814d6 Pdf Import Rewrite
Pdf Import rewritten to greatly improve QR Code detection, reduce
reliance on iTextSharp and improve thumbnails. Fixes #50
2016-09-01 18:31:35 +10:00

79 lines
2.8 KiB
Plaintext

@model IEnumerable<Disco.Services.Expressions.Expression>
@{
Authorization.Require(Claims.Config.DocumentTemplate.Show);
}
<div class="expressionsTable">
@if (Model.Count() > 0)
{
<table class="expressionsTable">
<tr>
<th>
Name
</th>
<th>
Expression
</th>
<th>
Errors Allowed
</th>
</tr>
@foreach (var expression in Model.Where(m => m.IsDynamic))
{
var expressionParts = expression.Where(e => e.IsDynamic).ToArray();
<tr>
<td rowspan="@(expressionParts.Length)">
@expression.Name
</td>
@if (expressionParts[0].ParseError)
{
<td class="parseError">
@expressionParts[0].Source.ToMultilineString()
<div class="code">
<strong>Expression Compilation Error:</strong><br />
@expressionParts[0].ParseErrorMessage
</div>
</td>
}
else
{
<td>
@expressionParts[0].Source.ToMultilineString()
</td>
}
<td>
@(expressionParts[0].ErrorsAllowed ? "Yes" : "No")
</td>
</tr>
for (int expressionIndex = 1; expressionIndex < expressionParts.Length; expressionIndex++)
{
<tr>
@if (expressionParts[expressionIndex].ParseError)
{
<td class="parseError">
@expressionParts[expressionIndex].Source.ToMultilineString()
<div class="code">
<strong>Expression Compilation Error:</strong><br />
@expressionParts[expressionIndex].ParseErrorMessage
</div>
</td>
}
else
{
<td>
@expressionParts[expressionIndex].Source.ToMultilineString()
</td>
}
<td>
@(expressionParts[expressionIndex].ErrorsAllowed ? "Yes" : "No")
</td>
</tr>
}
}
</table>
}
else
{
<span class="smallMessage">No Expressions Found</span>
}
</div>