Skip to content

Commit

Permalink
Add titlebar
Browse files Browse the repository at this point in the history
  • Loading branch information
zentron committed Jun 14, 2024
1 parent 1b31e86 commit 79b82ea
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions OctopusSamples.OctoPetShop.Web/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ public class AppSettings
public string EnvironmentName { get; set; }
public string ProductServiceBaseUrl { get; set; }
public string ShoppingCartServiceBaseUrl { get; set; }
public string TitleBarColor { get; set; }
public string HelloText { get; set; }
}
}
6 changes: 4 additions & 2 deletions OctopusSamples.OctoPetShop.Web/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
ViewData["Title"] = "Home Page";
}

@using Microsoft.EntityFrameworkCore.Metadata.Internal
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using Microsoft.Extensions.Options
@inject IOptions<AppSettings> Settings
@model List<ProductViewModel>

<h2>Welcome to the Octo Pet Shop!</h2>
<h2>@{Settings.Value.HelloText}</h2>

<p>The Octo Pet Shop has a great selection of your favourite pet and pet products. Browse our most popular products below. </p>

Expand Down
2 changes: 1 addition & 1 deletion OctopusSamples.OctoPetShop.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</environment>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<nav class="navbar navbar-inverse navbar-fixed-top" style="background-color: @(Settings.Value.TitleBarColor)">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
Expand Down
4 changes: 2 additions & 2 deletions OctopusSamples.OctoPetShop.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"AllowedHosts": "*",

"AppSettings": {
"TitleBarColor": "#f5ce42",
"TitleBarText": "LocalDev",
"TitleBarColor": "#222",
"HelloText": "Welcome to the Octo Pet Shop!",
"AppVersion": "0.0.0",
"EnvironmentName": "localhost",
"ProductServiceBaseUrl": "http://localhost:58239/",
Expand Down

0 comments on commit 79b82ea

Please sign in to comment.