Skip to content

Commit 0b80714

Browse files
committed
Styling views with bootstrap
1 parent 1ece66e commit 0b80714

File tree

6 files changed

+78
-57
lines changed

6 files changed

+78
-57
lines changed

OdeToFoodRider/OdeToFoodRider/Views/Home/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
@Html.Partial("_Summary", restaurant)
1212
}
1313

14-
<div ><a asp-action="Create">Add Restaurant</a></div>
14+
<div ><a class="btn btn-primary" asp-action="Create">Add Restaurant</a></div>

OdeToFoodRider/OdeToFoodRider/Views/Home/_Summary.cshtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
@model Restaurant
22

3-
<section>
4-
<h3>@Model.Name</h3>
5-
<div>
3+
<section class="panel panel-default">
4+
<h3 class="panel-heading">@Model.Name</h3>
5+
<div class="panel-body">
66
Cuisine: @Model.Cuisine
77
</div>
8-
<div>
9-
<a asp-action="Details" asp-route-id="@Model.Id">More</a>
10-
<a asp-page="/Restaurants/Edit" asp-route-id="@Model.Id">Edit</a>
8+
<div class="panel-footer">
9+
<a class="btn btn-default" asp-action="Details" asp-route-id="@Model.Id">More</a>
10+
<a class="btn btn-default" asp-page="/Restaurants/Edit" asp-route-id="@Model.Id">Edit</a>
1111
</div>
1212

1313
</section>

OdeToFoodRider/OdeToFoodRider/Views/Shared/_Layout.cshtml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,40 @@
66
<link href="~/node_modules/bootstrap/dist/css/bootstrap.css" rel="stylesheet"/>
77
</head>
88
<body>
9-
<div>
9+
<nav class="navbar navbar-default">
10+
<div class="container-fluid">
11+
<div class="navbar-header">
12+
<a class="navbar-brand" href="/">OdeToFood Rider</a>
13+
</div>
14+
<div class="navbar-right">
15+
<a class="btn btn-default" href="#">Login</a>
16+
</div>
17+
</div>
18+
</nav>
19+
<div class="container">
1020
@RenderBody()
11-
</div>
12-
<footer>
13-
@RenderSection("footer", required: false)
14-
@await Component.InvokeAsync("Greeter")
15-
<vc:greeter></vc:greeter>
16-
@if (User.Identity.IsAuthenticated)
17-
{
18-
foreach (var identity in User.Identities)
21+
<footer>
22+
@RenderSection("footer", required: false)
23+
@await Component.InvokeAsync("Greeter")
24+
@if (User.Identity.IsAuthenticated)
25+
{
26+
foreach (var identity in User.Identities)
27+
{
28+
<h3>@identity.Name</h3>
29+
<ul>
30+
@foreach (var claim in identity.Claims)
31+
{
32+
<li>@claim.Type - @claim.Value</li>
33+
}
34+
</ul>
35+
}
36+
}
37+
else
1938
{
20-
<h3>@identity.Name</h3>
21-
<ul>
22-
@foreach (var claim in identity.Claims)
23-
{
24-
<li>@claim.Type - @claim.Value</li>
25-
}
26-
</ul>
39+
<div>You are anonymous</div>
2740
}
28-
}
29-
else {
30-
<div>You are anonymous</div>
31-
}
32-
</footer>
41+
</footer>
42+
43+
</div>
3344
</body>
3445
</html>

OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
}
1313

1414
<div>
15-
<a asp-action="Create">Add Restaurant</a>
15+
<a class="btn btn-primary" asp-action="Create">Add Restaurant</a>
1616
</div>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
@model Restaurant
22

3-
<section>
4-
<h3>@Model.Name</h3>
5-
<div>
3+
<section class="panel panel-default">
4+
<h3 class="panel-heading">@Model.Name</h3>
5+
<div class="panel-body">
66
Cuisine: @Model.Cuisine
77
</div>
8-
<div>
9-
<a asp-action="Details" asp-route-id="@Model.Id">More</a>
10-
<a asp-page="/Restaurants/Edit" asp-route-id="@Model.Id">Edit</a>
8+
<div class="panel-footer">
9+
<a class="btn btn-default" asp-action="Details" asp-route-id="@Model.Id">More</a>
10+
<a class="btn btn-default" asp-page="/Restaurants/Edit" asp-route-id="@Model.Id">Edit</a>
1111
</div>
1212

1313
</section>

OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Shared/_Layout.cshtml

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,40 @@
77
<link href="~/node_modules/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
88
</head>
99
<body>
10-
<div>
10+
<nav class="navbar navbar-default">
11+
<div class="container-fluid">
12+
<div class="navbar-header">
13+
<a class="navbar-brand" href="/">OdeToFood Visual Studio</a>
14+
</div>
15+
<div class="navbar-right">
16+
<a class="btn btn-default" href="#">Login</a>
17+
</div>
18+
</div>
19+
</nav>
20+
<div class="container">
1121
@RenderBody()
12-
</div>
13-
<footer>
14-
@RenderSection("footer", required: false)
15-
@await Component.InvokeAsync("Greeter")
16-
<vc:greeter></vc:greeter>
17-
@if (User.Identity.IsAuthenticated)
18-
{
19-
foreach (var identity in User.Identities)
22+
<footer>
23+
@RenderSection("footer", required: false)
24+
@await Component.InvokeAsync("Greeter")
25+
@if (User.Identity.IsAuthenticated)
26+
{
27+
foreach (var identity in User.Identities)
28+
{
29+
<h3>@identity.Name</h3>
30+
<ul>
31+
@foreach (var claim in identity.Claims)
32+
{
33+
<li>@claim.Type - @claim.Value</li>
34+
}
35+
</ul>
36+
}
37+
}
38+
else
2039
{
21-
<h3>@identity.Name</h3>
22-
<ul>
23-
@foreach (var claim in identity.Claims)
24-
{
25-
<li>@claim.Type - @claim.Value</li>
26-
}
27-
</ul>
40+
<div>You are anonymous</div>
2841
}
29-
}
30-
else
31-
{
32-
<div>You are anonymous</div>
33-
}
34-
</footer>
42+
</footer>
43+
44+
</div>
3545
</body>
3646
</html>

0 commit comments

Comments
 (0)