Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make minor layout updates #134

Merged
merged 6 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/WebApp/Pages/Admin/Users/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@if (Model.DisplayStaff.Email!.ToLowerInvariant().Equals(User.Identity?.Name!.ToLowerInvariant()))
{
<a asp-page="/Account/Index">
<span class="badge bg-info-subtle border border-info-subtle text-info-emphasis rounded-pill">YOU</span>
<span class="badge bg-info-subtle border border-info-subtle text-info-emphasis text-uppercase rounded-pill">You</span>
</a>
}
</h2>
Expand Down
2 changes: 1 addition & 1 deletion src/WebApp/Pages/Admin/Users/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
@item.SortableFullName
@if (item.Email.ToLowerInvariant().Equals(User.Identity?.Name!.ToLowerInvariant()))
{
<span class="badge bg-info-subtle border border-info-subtle text-info-emphasis rounded-pill">YOU</span>
<span class="badge bg-info-subtle border border-info-subtle text-info-emphasis text-uppercase rounded-pill">You</span>
}
</td>
<td>@item.Email</td>
Expand Down
3 changes: 2 additions & 1 deletion src/WebApp/Pages/Shared/Components/MainMenu/Default.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
<a class="nav-link" asp-page="/Staff/WorkEntries/Add" title="Add New Work Entry">
<svg class="bi">
<use href="/images/app-icons.svg#app-icon-plus-lg"></use>
</svg>&nbsp;<span class="d-inline d-sm-none">Add&nbsp;</span>New <span class="d-inline d-sm-none d-lg-inline">Work Entry</span>
</svg>
<span class="d-inline d-sm-none">Add&nbsp;</span>New <span class="d-inline d-sm-none d-lg-inline">Work Entry</span>
</a>
</li>
}
Expand Down
12 changes: 6 additions & 6 deletions src/WebApp/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<footer class="footer pt-3">
<div class="bg-body-tertiary py-2 border-bottom d-print-none">
<div class="container">
<a href="#top" class="btn">
<a href="#top" class="footer-link link-body-emphasis icon-link ms-n1">
<svg class="bi">
<use href="@Url.Content("~/images/app-icons.svg")#app-icon-arrow-bar-up"></use>
</svg> Return to top
Expand All @@ -46,14 +46,14 @@
<small>
MY_APP_NAME
<span class="d-print-none">
| <a asp-page="/Support" class="text-decoration-hover link-offset-2">Support</a>
| <a href="https://epd.georgia.gov/" target="_blank" rel="noopener" class="text-decoration-hover link-offset-2">Environmental Protection Division</a>
| <a asp-page="/Support" class="footer-link text-decoration-hover link-offset-2">Support</a>
| <a href="https://epd.georgia.gov/" target="_blank" rel="noopener" class="footer-link text-decoration-hover link-offset-2">Environmental Protection Division</a>
</span>
<br />&copy; @DateTime.Now.Year.ToString() State of Georgia
<span class="d-print-none">
| <a href="https://georgia.gov/accessibility" target="_blank" rel="noopener" class="text-decoration-hover link-offset-2">Accessibility</a>
| <a href="https://gadnr.org/ada" target="_blank" rel="noopener" class="text-decoration-hover link-offset-2">DNR Accessibility Notice</a>
| <a href="https://georgia.gov/privacysecurity" target="_blank" rel="noopener" class="text-decoration-hover link-offset-2">Privacy/Security</a>
| <a href="https://georgia.gov/accessibility" target="_blank" rel="noopener" class="footer-link text-decoration-hover link-offset-2">Accessibility</a>
| <a href="https://gadnr.org/ada" target="_blank" rel="noopener" class="footer-link text-decoration-hover link-offset-2">DNR Accessibility Notice</a>
| <a href="https://georgia.gov/privacysecurity" target="_blank" rel="noopener" class="footer-link text-decoration-hover link-offset-2">Privacy/Security</a>
</span>
</small>
</div>
Expand Down
9 changes: 6 additions & 3 deletions src/WebApp/Pages/Shared/_SearchResultPartial.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@
<tbody>
@foreach (var item in Model.SearchResults.Items)
{
<tr class="@(item.IsDeleted ? "table-danger" : "")">
<tr>
<th scope="row">
<a asp-page="Details" asp-route-id="@item.Id.ToString()" class="btn btn-outline-primary btn-sm">@item.Id.ToString()</a>
<a asp-page="Details" asp-route-id="@item.Id.ToString()"
class="btn btn-sm @(item.IsDeleted ? "btn-outline-danger" : "btn-outline-primary")">
@item.Id.ToString()
</a>
</th>
<td class="text-nowrap">@Html.DisplayFor(_ => item.ReceivedDate, DisplayTemplate.ShortDate)</td>
<td>
@if (item.IsDeleted)
{
<strong>DELETED</strong>
<strong class="text-danger-emphasis">DELETED</strong>
<br />
}
@Html.DisplayFor(_ => item.Status)
Expand Down
2 changes: 1 addition & 1 deletion src/WebApp/Pages/Staff/WorkEntries/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<a asp-page="DownloadSearch" asp-all-route-data="Model.Spec.AsRouteValues()" class="btn btn-sm btn-outline-secondary">
<svg class="bi me-1">
<use href="/images/app-icons.svg#app-icon-download"></use>
</svg>&nbsp;Download search results
</svg> Download search results
</a>
</div>
}
Expand Down
19 changes: 16 additions & 3 deletions src/WebApp/Pages/Support.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,24 @@
<div class="callout">
<small>
The MY_APP_NAME was developed by Georgia EPD-IT.<br/>
@if (Model.Version is not null)
The Air Web application was developed by Georgia EPD-IT.<br />
@if (!string.IsNullOrEmpty(AppSettings.SupportSettings.InformationalVersion))
{
@:Current version: <em>@Model.Version</em>.<br/>
@:Current version: <em>@AppSettings.SupportSettings.InformationalVersion
@if (!string.IsNullOrEmpty(AppSettings.SupportSettings.InformationalBuild))
{
@:(@AppSettings.SupportSettings.InformationalBuild).
}

@:</em>
}
<br />
View the
<a href="https://github.com/gaepdit/template-app/blob/main/CHANGELOG.md" target="_blank" rel="noopener"
class="text-decoration-hover link-offset-2">Changelog</a>.
<br />
Source code available on
<a href="https://github.com/gaepdit/template-app" target="_blank" rel="noopener" class="text-decoration-hover link-offset-2">GitHub</a>.
<a href="https://github.com/gaepdit/template-app" target="_blank" rel="noopener"
class="text-decoration-hover link-offset-2">GitHub</a>.
</small>
</div>
14 changes: 13 additions & 1 deletion src/WebApp/Platform/AppConfiguration/BindingsConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using MyApp.WebApp.Platform.Settings;
using System.Reflection;

namespace MyApp.WebApp.Platform.AppConfiguration;

Expand All @@ -12,10 +13,21 @@ public static void BindSettings(WebApplicationBuilder builder)
builder.Configuration.GetSection(nameof(AppSettings.RaygunSettings))
.Bind(AppSettings.RaygunSettings);

// App versioning
var versionSegments = (Assembly.GetEntryAssembly()?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
.InformationalVersion ?? Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "").Split('+');

AppSettings.SupportSettings.InformationalVersion = versionSegments[0];
if (versionSegments.Length > 0)
{
AppSettings.SupportSettings.InformationalBuild =
versionSegments[1][..Math.Min(7, versionSegments[1].Length)];
}

// Dev settings
var devConfig = builder.Configuration.GetSection(nameof(AppSettings.DevSettings));
var useDevConfig = devConfig.Exists() &&
Convert.ToBoolean(devConfig[nameof(AppSettings.DevSettings.UseDevSettings)]);
Convert.ToBoolean(devConfig[nameof(AppSettings.DevSettings.UseDevSettings)]);
if (useDevConfig)
devConfig.Bind(AppSettings.DevSettings);
else
Expand Down
2 changes: 2 additions & 0 deletions src/WebApp/Platform/Settings/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public record SupportSettingsSection
public string? CustomerSupportEmail { get; [UsedImplicitly] init; }
public string? TechnicalSupportEmail { get; [UsedImplicitly] init; }
public string? TechnicalSupportSite { get; [UsedImplicitly] init; }
public string? InformationalVersion { get; set; }
public string? InformationalBuild { get; set; }
}

// Raygun client settings
Expand Down
2 changes: 1 addition & 1 deletion src/WebApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
.AddRaygun(opts =>
{
opts.ApiKey = AppSettings.RaygunSettings.ApiKey;
opts.ApplicationVersion = Assembly.GetEntryAssembly()?.GetName().Version?.ToString(3);
opts.ApplicationVersion = AppSettings.SupportSettings.InformationalVersion;
opts.ExcludeErrorsFromLocal = AppSettings.RaygunSettings.ExcludeErrorsFromLocal;
opts.IgnoreFormFieldNames = ["*Password"];
opts.EnvironmentVariables.Add("ASPNETCORE_*");
Expand Down
2 changes: 1 addition & 1 deletion src/WebApp/WebApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<AssemblyVersion>2024.11.6</AssemblyVersion>
<InformationalVersion>2024.11.6</InformationalVersion>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
31 changes: 25 additions & 6 deletions src/WebApp/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,23 @@
background-color: var(--bs-secondary-bg-subtle) !important;
}

/* Accessibility fix for "warning" button on medium/light background
/* Accessibility fixes for outlined buttons
-------------------------------------------------------------------- */
html:not([data-bs-theme="dark"]) .btn-outline-warning {
--bs-btn-color: #b98b00;
--bs-btn-border-color: #b98b00;
--bs-btn-bg: #fff;
}

.btn-outline-info {
--bs-btn-color: var(--bs-body-color);
}

.btn-outline-primary {
--bs-btn-color: rgb( var(--bs-link-color-rgb));
--bs-btn-border-color: rgb( var(--bs-link-color-rgb));
}

/* Adjust font sizing
-------------------------------------------------- */
html {
Expand Down Expand Up @@ -187,7 +196,7 @@ html:not([data-bs-theme="dark"]) .bg-dark-subtle .text-danger-emphasis {
margin-right: 2px;
}

/* Additional font style utilities
/* Text utilities
-------------------------------------------------- */
.font-weight-medium {
font-weight: 500 !important;
Expand All @@ -205,14 +214,24 @@ html:not([data-bs-theme="dark"]) .bg-dark-subtle .text-danger-emphasis {
text-decoration: underline !important;
}

.text-dotted-underline {
text-decoration: underline dotted;
}

/* Spacing utilities
-------------------------------------------------- */
.ms-n1 {
margin-left: -0.25rem !important;
}

/* External links
-------------------------------------------------- */
a[target]::after {
content: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='hsl(216, 100%, 50%)' viewBox='0 0 16 16'><path fill-rule='evenodd' d='M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5'/><path fill-rule='evenodd' d='M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z'/></svg>");
margin-left: .2em;
}

/* Suppress external link icon */
/* Optionally suppress external link icon */
footer a[target]::after, a[target].no-external-link::after {
content: none;
}
Expand Down Expand Up @@ -365,17 +384,17 @@ label:has([disabled]), label:has(:disabled) {

/* Footer links
-------------------------------------------------- */
footer a {
.footer-link {
text-decoration: none;
padding: .25rem;
border-radius: 8px;
}

footer a:hover {
.footer-link:hover {
background: hsla(0, 0%, 0%, 0.04);
}

[data-bs-theme="dark"] footer a:hover {
[data-bs-theme="dark"] .footer-link:hover {
background: hsla(0, 0%, 100%, 0.04);
}

Expand Down
Loading