summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-03-10 01:53:51 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-03-10 01:53:51 -0500
commit0e504ce18aff14409c37b44462e58b94c1bbb9df (patch)
treeafd09db703a67ff1ec763f8aa2f27c3219d68859 /src
parent563eb26487113d69421e16ad08d115c0e41c00a7 (diff)
downloadSMAPI-0e504ce18aff14409c37b44462e58b94c1bbb9df.tar.gz
SMAPI-0e504ce18aff14409c37b44462e58b94c1bbb9df.tar.bz2
SMAPI-0e504ce18aff14409c37b44462e58b94c1bbb9df.zip
minor changes to new log section code (#626)
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml
index aa37fef2..36855768 100644
--- a/src/SMAPI.Web/Views/LogParser/Index.cshtml
+++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml
@@ -17,10 +17,10 @@
{
<meta name="robots" content="noindex" />
}
- <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190221" />
+ <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190310" />
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js" crossorigin="anonymous"></script>
- <script src="~/Content/js/log-parser.js?r=20190221"></script>
+ <script src="~/Content/js/log-parser.js?r=20190310"></script>
<script>
$(function() {
smapi.logParser({
@@ -263,18 +263,14 @@ else if (Model.ParsedLog?.IsValid == true)
{
string levelStr = message.Level.ToString().ToLower();
string sectionStartClass = message.IsStartOfSection ? "section-start" : null;
+ string sectionFilter = message.Section != null && !message.IsStartOfSection ? $"&& sectionsAllow('{message.Section}')" : null; // filter the message by section if applicable
- // filter the message by section if it has one
- string sectionFilter = message.Section != null ? $"&& sectionsAllow('{message.Section}')" : null;
- // always show the first message in the section regardless of section filters
- string sectionsAllow = message.IsStartOfSection ? null : sectionFilter;
-
- <tr class="@levelStr mod @sectionStartClass"
+ <tr class="mod @levelStr @sectionStartClass"
@if (message.IsStartOfSection)
{
<text>v-on:click="toggleSection('@message.Section')"</text>
}
- v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr') @sectionsAllow">
+ v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr') @sectionFilter">
<td v-pre>@message.Time</td>
<td v-pre>@message.Level.ToString().ToUpper()</td>
<td v-pre data-title="@message.Mod">@message.Mod</td>
@@ -282,14 +278,16 @@ else if (Model.ParsedLog?.IsValid == true)
<span v-pre class="log-message-text">@message.Text</span>
@if (message.IsStartOfSection)
{
- <span class="section-toggle-message" v-show="!sectionsAllow('@message.Section')">This section is hidden. Click here to show it.</span>
- <span class="section-toggle-message" v-show="sectionsAllow('@message.Section')">This section is shown. Click here to hide it.</span>
+ <span class="section-toggle-message">
+ <template v-if="sectionsAllow('@message.Section')">This section is shown. Click here to hide it.</template>
+ <template v-else>This section is hidden. Click here to show it.</template>
+ </span>
}
</td>
</tr>
if (message.Repeated > 0)
{
- <tr class="@levelStr mod mod-repeat" v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr') @sectionsAllow">
+ <tr class="@levelStr mod mod-repeat" v-show="filtersAllow('@Model.GetSlug(message.Mod)', '@levelStr') @sectionFilter">
<td colspan="3"></td>
<td v-pre><i>repeats [@message.Repeated] times.</i></td>
</tr>