Skip to content

Commit

Permalink
Make Wiki diff collapsable and collapsed by default (#2029)
Browse files Browse the repository at this point in the history
* make wiki diff collapsable and collapsed by default

* it needs this class for the chevron to work correctly
  • Loading branch information
Masterjun3 authored Nov 7, 2024
1 parent 6993db5 commit fe25813
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions TASVideos/TagHelpers/DiffPanelTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,22 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
{
ViewContext.ViewData.UseDiff();
output.TagName = "div";
output.AddCssClass("card mt-4");

output.Content.AppendHtml(
"""
<div id="diff-view" class="mt-3 border border-secondary d-none"></div>
<div id="diff-options" class="d-none py-3">
<label><input name="diff-type" type="radio" value="1" checked="checked" /> Inline</label>
<label><input name="diff-type" type="radio" value="0" /> Side by Side</label>
<label><input name="context-size" type="number" value="5" min="0" max="9999" /> Context Size</label>
<div class="card-header">
<a class="text-body collapsed" data-bs-toggle="collapse" data-bs-target="#diff-container" role="button"><i class="fa fa-chevron-circle-down"></i> Diff</a>
</div>
<div class="card-body py-0 bg-dark-subtle">
<div id="diff-container" class="collapse">
<div id="diff-view" class="border border-dark-subtle mt-3"></div>
<div id="diff-options" class="py-3">
<label><input name="diff-type" type="radio" value="1" checked="checked" /> Inline</label>
<label><input name="diff-type" type="radio" value="0" /> Side by Side</label>
<label><input name="context-size" type="number" value="5" min="0" max="9999" /> Context Size</label>
</div>
</div>
</div>
""");
}
Expand Down

0 comments on commit fe25813

Please sign in to comment.