From ff7dfce5297f579cb7c608d1668da0206edfa5d5 Mon Sep 17 00:00:00 2001 From: smallbenji Date: Sun, 24 Nov 2024 20:13:51 +0100 Subject: [PATCH] misc. changes --- pointMaster/Controllers/HeaderNavController.cs | 2 ++ pointMaster/Controllers/PointController.cs | 10 +++++----- pointMaster/Views/Home/Index.cshtml | 6 +++--- pointMaster/Views/Point/GivPoint.cshtml | 2 +- pointMaster/Views/Point/SkiftPatrulje.cshtml | 10 ++++++---- .../Point/{SelectPoster.cshtml => SkiftPost.cshtml} | 8 ++++---- pointMaster/js/src/components/Stats.vue | 2 +- 7 files changed, 22 insertions(+), 18 deletions(-) rename pointMaster/Views/Point/{SelectPoster.cshtml => SkiftPost.cshtml} (77%) diff --git a/pointMaster/Controllers/HeaderNavController.cs b/pointMaster/Controllers/HeaderNavController.cs index 8e59ae1..0128535 100644 --- a/pointMaster/Controllers/HeaderNavController.cs +++ b/pointMaster/Controllers/HeaderNavController.cs @@ -24,10 +24,12 @@ namespace pointMaster.Controllers vm.links.Add(new NavUrl("Patruljer", "/Patrulje")); vm.links.Add(new NavUrl("Point", "/Point")); vm.links.Add(new NavUrl("Poster", "/Poster")); + vm.links.Add(new NavUrl("Statistikker", "/stats")); } if (User.Identity != null && User.Identity.IsAuthenticated) { vm.links.Add(new NavUrl("Giv point", "/point/givpoint")); + vm.links.Add(new NavUrl("Vælg post", "/point/skiftpost")); vm.links.Add(new NavUrl("Log ud", "/account/signout")); } else diff --git a/pointMaster/Controllers/PointController.cs b/pointMaster/Controllers/PointController.cs index 4f58872..e6156fd 100644 --- a/pointMaster/Controllers/PointController.cs +++ b/pointMaster/Controllers/PointController.cs @@ -38,7 +38,7 @@ namespace pointMaster.Controllers if (string.IsNullOrEmpty(Request.Cookies["Post"])) { - return RedirectToAction(nameof(SelectPoster)); + return RedirectToAction(nameof(SkiftPost)); } int.TryParse(Request.Cookies["Post"], out var postId); @@ -56,7 +56,7 @@ namespace pointMaster.Controllers { if (string.IsNullOrEmpty(Request.Cookies["Post"])) { - return RedirectToAction(nameof(SelectPoster)); + return RedirectToAction(nameof(SkiftPost)); } else { @@ -80,7 +80,7 @@ namespace pointMaster.Controllers if (postId == null) { - return RedirectToAction(nameof(SelectPoster)); + return RedirectToAction(nameof(SkiftPost)); } int.TryParse(postId, out var postIntId); @@ -129,7 +129,7 @@ namespace pointMaster.Controllers return RedirectToAction("Index"); } - public async Task SelectPoster() + public async Task SkiftPost() { var vm = new SelectPostViewModel(); @@ -147,7 +147,7 @@ namespace pointMaster.Controllers Response.Cookies.Append("Post", id.ToString(), cookieOptions); - return RedirectToAction(nameof(Index)); + return Redirect("/"); } public ActionResult DeletePoint(int id) diff --git a/pointMaster/Views/Home/Index.cshtml b/pointMaster/Views/Home/Index.cshtml index 9d76c0a..ddd96aa 100644 --- a/pointMaster/Views/Home/Index.cshtml +++ b/pointMaster/Views/Home/Index.cshtml @@ -13,7 +13,7 @@ - + @@ -35,7 +35,7 @@
# Patrulje Point
- + @@ -57,7 +57,7 @@
# Patrulje Point
- + diff --git a/pointMaster/Views/Point/GivPoint.cshtml b/pointMaster/Views/Point/GivPoint.cshtml index 11e3860..f59b1b1 100644 --- a/pointMaster/Views/Point/GivPoint.cshtml +++ b/pointMaster/Views/Point/GivPoint.cshtml @@ -28,7 +28,7 @@
Skift Patrulje diff --git a/pointMaster/Views/Point/SkiftPatrulje.cshtml b/pointMaster/Views/Point/SkiftPatrulje.cshtml index 9e430a7..97b7353 100644 --- a/pointMaster/Views/Point/SkiftPatrulje.cshtml +++ b/pointMaster/Views/Point/SkiftPatrulje.cshtml @@ -7,7 +7,9 @@

Du giver point som: @Model.post.Name

}

Vælg patrulje

-@foreach (var patrulje in Model.Patruljer) -{ - @patrulje.Name -} \ No newline at end of file +
    + @foreach (var patrulje in Model.Patruljer) + { + @patrulje.Name + } +
\ No newline at end of file diff --git a/pointMaster/Views/Point/SelectPoster.cshtml b/pointMaster/Views/Point/SkiftPost.cshtml similarity index 77% rename from pointMaster/Views/Point/SelectPoster.cshtml rename to pointMaster/Views/Point/SkiftPost.cshtml index 9cfb688..7e23014 100644 --- a/pointMaster/Views/Point/SelectPoster.cshtml +++ b/pointMaster/Views/Point/SkiftPost.cshtml @@ -3,9 +3,9 @@ ViewData["Title"] = "Vælg post"; }

Vælg post

+
    @foreach(var item in Model.Poster) { - -} \ No newline at end of file + @item.Name +} +
\ No newline at end of file diff --git a/pointMaster/js/src/components/Stats.vue b/pointMaster/js/src/components/Stats.vue index cfc41d0..bf89cea 100644 --- a/pointMaster/js/src/components/Stats.vue +++ b/pointMaster/js/src/components/Stats.vue @@ -1,7 +1,7 @@
# Patrulje Point