Skip to content

Commit

Permalink
Fixes minor html / css issues (#126)
Browse files Browse the repository at this point in the history
Fixes for issues reported by https://validator.w3.org/
  • Loading branch information
axunonb authored Dec 2, 2023
1 parent 7ff0f40 commit 0744c12
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
5 changes: 4 additions & 1 deletion League/TagHelpers/SiteAuthorizeResourceTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace League.TagHelpers;
/// Show an "edit" link only if the policy for editing documents is fulfilled:
/// <code>&lt;a href="/edit" site-resource="document" site-policy="EditDocument"&gt;&lt;/a&gt;</code>
/// </example>
[HtmlTargetElement(Attributes = TagHelperAttributeName)]
[HtmlTargetElement("*", Attributes = TagHelperAttributeName)]
public class SiteAuthorizeResourceTagHelper : TagHelper
{
public const string TagHelperAttributeName = "site-authorize-resource";
Expand Down Expand Up @@ -47,6 +47,9 @@ public SiteAuthorizeResourceTagHelper(IHttpContextAccessor httpContextAccessor,

public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
{
// Remove the attribute "site-authorize-resource" from the output
output.Attributes.RemoveAll(TagHelperAttributeName);

if (Resource == null)
{
throw new ArgumentException("Resource cannot be null");
Expand Down
10 changes: 5 additions & 5 deletions League/Views/Match/Fixtures.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@
@foreach (var r in rounds)
{
<li class="nav-item">
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-controls="@r.RoundDescription" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
</li>
}
</ul>
<div class="tab-content mt-1" id="fixtures">
@foreach (var r in rounds)
{
<div class="tab-pane@{if (r.RoundId == activeRoundId) {<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel" aria-labelledby="@r.RoundDescription-tab">
<div class="tab-pane@{if (r.RoundId == activeRoundId) {<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel">
<div class="text-success">@r.RoundTypeDescription</div>
<div id="[email protected]" class="team-filter my-2 d-none" data-bs-toggle="tooltip" title="@Localizer["Remove filter for team"]" style="display: none" tabindex="0">
<i class="fas fa-1x fa-times-circle me-2"></i>
Expand All @@ -91,7 +91,7 @@
</thead>
<tbody>
@{
const int columnCount = 5;
const int columnCount = 4;
var matches = Model.PlannedMatches.Where(m => m.RoundId == r.RoundId).OrderBy(m => m.RoundLegSequenceNo).ThenBy(m => m.PlannedStart).ToList();
var legs = matches.GroupBy(m => m.RoundLegSequenceNo).ToList();
for (var i = 0; i < matches.Count; i++)
Expand Down Expand Up @@ -129,7 +129,7 @@
<a href="#" class="stretched-link" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v" style="font-size: .8rem"></i>
</a>
<div class="dropdown-menu shadow-lg" role="menu" aria-labelledby="dropdownMenuLink">
<div class="dropdown-menu shadow-lg" role="menu">
<a href="#" tabindex="0" data-round-id="@match.RoundId" data-team-name="@match.GuestTeamNameForRound" class="dropdown-item filter-link">@Localizer["Filter fixtures for this team"]</a>
<a href="#" tabindex="0" class="dropdown-item" onclick="this.href='@(TenantLink.Action(nameof(League.Controllers.Match.ReportSheet), nameof(League.Controllers.Match), new{ id = match.Id })!)';">@Localizer["Print match report sheet"]</a>
<a asp-action=@nameof(League.Controllers.Match.EditFixture) asp-controller=@nameof(League.Controllers.Match) asp-route-tenant="@tenantUrlSegment" asp-route-id=@match.Id tabindex="0" class="dropdown-item"
Expand Down Expand Up @@ -167,7 +167,7 @@
var venueCssClass = $".venue {{ width: {venueColWidth}%; }}";
var contextMenuCssClass = $".context-menu {{ text-align: center; width: {contextMenuColWidth}%;}}";
var dateCssClass = $".date {{ width: {dateColWidth}%;}}";
var opponentsCssClass = $".opponents {{width: {opponentColWidth}%);}}";
var opponentsCssClass = $".opponents {{width: {opponentColWidth}%;}}";
}
<style type="text/css">
#round-tabs .nav-link:not(.active) {border:solid 1px var(--bs-gray-500)}
Expand Down
8 changes: 4 additions & 4 deletions League/Views/Match/Results.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
@foreach (var r in rounds)
{
<li class="nav-item">
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-controls="@r.RoundDescription" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
</li>
}
</ul>
<div class="tab-content mt-1" id="match-results">
@foreach (var r in rounds)
{
<div class="tab-pane@{if (r.RoundId == activeRoundId) {<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel" aria-labelledby="@r.RoundDescription-tab">
<div class="tab-pane@{if (r.RoundId == activeRoundId) {<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel">
<div class="text-success">@r.RoundTypeDescription</div>
<div id="[email protected]" class="team-filter my-2 d-none" data-bs-toggle="tooltip" title="@Localizer["Remove filter for team"]" tabindex="0">
<i class="fas fa-1x fa-times-circle me-2"></i>
Expand Down Expand Up @@ -151,7 +151,7 @@
<a href="#" class="stretched-link" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v" style="font-size: .8rem"></i>
</a>
<div class="dropdown-menu shadow" role="menu" aria-labelledby="dropdownMenuLink">
<div class="dropdown-menu shadow" role="menu">
<a href="#" tabindex="0" data-round-id="@match.RoundId" data-team-name="@match.GuestTeamNameForRound" class="dropdown-item filter-link">@Localizer["Filter matches for this team"]</a>
<a asp-action=@nameof(League.Controllers.Match.EnterResult) asp-controller=@nameof(League.Controllers.Match) asp-route-tenant="@tenantUrlSegment" asp-route-id=@(match.Id)
tabindex="0" class="dropdown-item"
Expand Down Expand Up @@ -185,7 +185,7 @@
var resultCssClass = $".result {{ text-align: center; width: {resultColWidth}%;}}";
var contextMenuCssClass = $".context-menu {{ text-align: center; width: {contextMenuColWidth}%;}}";
var dateCssClass = $".date {{ width: {dateColWidth}%;}}";
var opponentsCssClass = $".opponents {{width: {opponentColWidth}%);}}";
var opponentsCssClass = $".opponents {{width: {opponentColWidth}%;}}";
}
<style type="text/css">
#round-tabs .nav-link:not(.active) {border:solid 1px var(--bs-gray-500)}
Expand Down
4 changes: 2 additions & 2 deletions League/Views/Ranking/AllTimeForTournament.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
@foreach (var r in rounds)
{
<li class="nav-item">
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-controls="@r.RoundDescription" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
</li>
}
</ul>

<div class="tab-content mt-1" id="ranking-table">
@foreach (var r in rounds)
{
<div class="tab-pane@{if (r.RoundId == activeRoundId) {<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel" aria-labelledby="@r.RoundDescription-tab">
<div class="tab-pane@{if (r.RoundId == activeRoundId) {<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel">
<div class="text-success">@r.RoundTypeDescription</div>
<div class="rounded table-responsive">
<table class="table table-sm">
Expand Down
4 changes: 2 additions & 2 deletions League/Views/Ranking/Table.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
@foreach (var r in rounds)
{
<li class="nav-item">
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-controls="@r.RoundDescription" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
</li>
}
</ul>
<div class="tab-content mt-1" id="ranking-table">
@foreach (var r in rounds)
{
<div class="tab-pane@{if (r.RoundId == activeRoundId) {<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel" aria-labelledby="@r.RoundDescription-tab">
<div class="tab-pane@{if (r.RoundId == activeRoundId) {<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel">
<div class="text-success">@r.RoundTypeDescription</div>
<div class="rounded table-responsive">
<table class="table table-sm">
Expand Down
8 changes: 4 additions & 4 deletions League/Views/Team/List.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
@foreach (var r in rounds)
{
<li class="nav-item">
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-controls="@r.RoundDescription" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
<a class="nav-link py-1@{if (r.RoundId == activeRoundId){<text> active</text>}}" id="tab-link-@(r.RoundId)" data-bs-toggle="tab" href="#tab-@(r.RoundId)" role="tab" aria-selected="@(r.RoundId == activeRoundId ? "true" : "false")">@r.RoundDescription</a>
</li>
}
</ul>
<div class="tab-content" id="round-list">
<div class="tab-content" id="team-list">
@foreach (var r in rounds)
{
<div class="tab-pane@{if (r.RoundId == activeRoundId){<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel" aria-labelledby="@r.RoundDescription-tab">
<div class="tab-pane@{if (r.RoundId == activeRoundId){<text> show active</text>}}" id="tab-@(r.RoundId)" role="tabpanel">
<div class="text-success">@r.RoundTypeDescription</div>
<div id="team-list" class="rounded table-responsive">
<div class="rounded table-responsive">
<table class="table table-sm">
<thead class="rounded">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion League/Views/Team/MyTeam.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
var teamPhotoInfo = Model.TeamPhotoStaticFile!.GetUriInfo(teamVenueInfo.TeamId);
var zonedLastModified = Model.TimeZoneConverter.ToZonedTime(teamPhotoInfo.Date)!;

<div class="tab-pane@{if (Model.TeamUserRoundInfos.Any(tvr => tvr.TeamId == Model.ActiveTeamId)){<text> show active</text>}}" id="tab-@(teamVenueInfo.TeamId)" role="tabpanel" aria-labelledby="@teamVenueInfo.TeamName-tab">
<div class="tab-pane@{if (Model.TeamUserRoundInfos.Any(tvr => tvr.TeamId == Model.ActiveTeamId)){<text> show active</text>}}" id="tab-@(teamVenueInfo.TeamId)" role="tabpanel">
<div class="card pb-2 mb-3">
<div class="card-header px-2 py-1">
<div class="d-flex justify-content-between align-items-baseline">
Expand Down

0 comments on commit 0744c12

Please sign in to comment.