From 187ef5fd23531672af00dd8b02358754789f8775 Mon Sep 17 00:00:00 2001 From: Citra Pangestu Date: Tue, 9 Jun 2026 20:38:02 +0700 Subject: [PATCH] move js to external file --- Controllers/WebNew/BeritaController.cs | 15 +- Models/BeritaViewModel.cs | 19 +- Views/WebNew/Berita/Berita.cshtml | 78 +- Views/WebNew/Berita/DetailBerita.cshtml | 122 +-- Views/WebNew/Faq.cshtml | 43 +- Views/WebNew/FormReview.cshtml | 110 +-- Views/WebNew/Galeri.cshtml | 103 +-- Views/WebNew/Home/Index.cshtml | 771 +++++------------- Views/WebNew/Layanan/DetailItem.cshtml | 133 +-- Views/WebNew/Layanan/DetailLayanan.cshtml | 281 +------ Views/WebNew/Layanan/Layanan.cshtml | 32 +- Views/WebNew/Regulasi.cshtml | 278 +------ Views/WebNew/Shared/Section/_Footer.cshtml | 1 - Views/WebNew/Shared/Section/_Header.cshtml | 75 +- Views/WebNew/Video.cshtml | 49 +- .../webnew/assets/image/foto/gedungnew.jpeg | Bin 0 -> 6936947 bytes wwwroot/webnew/pages/berita/berita.js | 70 ++ wwwroot/webnew/pages/berita/detail-berita.js | 111 +++ wwwroot/webnew/pages/faq.js | 35 + wwwroot/webnew/pages/form-review.js | 100 +++ wwwroot/webnew/pages/galeri.js | 49 ++ wwwroot/webnew/pages/header.js | 70 ++ wwwroot/webnew/pages/home/index.js | 395 +++++++++ wwwroot/webnew/pages/layanan/detail-item.js | 123 +++ .../webnew/pages/layanan/detail-layanan.js | 297 +++++++ wwwroot/webnew/pages/layanan/layanan.js | 25 + wwwroot/webnew/pages/regulasi.js | 270 ++++++ wwwroot/webnew/pages/video.js | 40 + 28 files changed, 1845 insertions(+), 1850 deletions(-) create mode 100644 wwwroot/webnew/assets/image/foto/gedungnew.jpeg create mode 100644 wwwroot/webnew/pages/berita/berita.js create mode 100644 wwwroot/webnew/pages/berita/detail-berita.js create mode 100644 wwwroot/webnew/pages/faq.js create mode 100644 wwwroot/webnew/pages/form-review.js create mode 100644 wwwroot/webnew/pages/galeri.js create mode 100644 wwwroot/webnew/pages/header.js create mode 100644 wwwroot/webnew/pages/home/index.js create mode 100644 wwwroot/webnew/pages/layanan/detail-item.js create mode 100644 wwwroot/webnew/pages/layanan/detail-layanan.js create mode 100644 wwwroot/webnew/pages/layanan/layanan.js create mode 100644 wwwroot/webnew/pages/regulasi.js create mode 100644 wwwroot/webnew/pages/video.js diff --git a/Controllers/WebNew/BeritaController.cs b/Controllers/WebNew/BeritaController.cs index f57f2e6..71625eb 100644 --- a/Controllers/WebNew/BeritaController.cs +++ b/Controllers/WebNew/BeritaController.cs @@ -30,7 +30,7 @@ namespace WebApplication2.Controllers.WebNew return View("~/Views/WebNew/Berita/DetailBerita.cshtml"); } - [HttpGet("/WebNew/Berita/GetDetail/")] + [HttpGet("/WebNew/Berita/GetDetail/")] public IActionResult GetDetail(int id) { var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "berita.json"); @@ -40,9 +40,16 @@ namespace WebApplication2.Controllers.WebNew var json = System.IO.File.ReadAllText(path); - var data = JsonNode.Parse(json).AsArray(); + var data = JsonNode.Parse(json); - var result = data.FirstOrDefault(x => (int)x["id"] == id); + if (data == null) + return NotFound(); + + var array = data.AsArray(); + + var result = array.FirstOrDefault(x => + x?["id"]?.GetValue() == id + ); if (result == null) return NotFound(); @@ -50,7 +57,7 @@ namespace WebApplication2.Controllers.WebNew return Json(result); } - [HttpGet("/WebNew/Berita/GetAll")] + [HttpGet("/WebNew/Berita/GetAll")] public IActionResult GetAll() { var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "berita.json"); diff --git a/Models/BeritaViewModel.cs b/Models/BeritaViewModel.cs index d358356..cacd875 100644 --- a/Models/BeritaViewModel.cs +++ b/Models/BeritaViewModel.cs @@ -1,13 +1,12 @@ namespace WebApplication2.Models.ViewModels { - public class BeritaViewModel - { - public string Judul { get; set; } - public string Deskripsi { get; set; } - public string Gambar { get; set; } - public DateTime Tanggal { get; set; } - public string Slug { get; set; } - - public List GambarList { get; set; } - } + public class BeritaViewModel + { + public string Judul { get; set; } = ""; + public string Deskripsi { get; set; } = ""; + public string Gambar { get; set; } = ""; + public DateTime Tanggal { get; set; } + public string Slug { get; set; } = ""; + public List GambarList { get; set; } = new(); + } } \ No newline at end of file diff --git a/Views/WebNew/Berita/Berita.cshtml b/Views/WebNew/Berita/Berita.cshtml index 0c585f7..2da642f 100644 --- a/Views/WebNew/Berita/Berita.cshtml +++ b/Views/WebNew/Berita/Berita.cshtml @@ -10,6 +10,9 @@ } + @section Scripts { + + } @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Hero.cshtml", "Berita") @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Helpdesk.cshtml") @@ -28,77 +31,4 @@
- - - + \ No newline at end of file diff --git a/Views/WebNew/Berita/DetailBerita.cshtml b/Views/WebNew/Berita/DetailBerita.cshtml index 835c22c..188b530 100644 --- a/Views/WebNew/Berita/DetailBerita.cshtml +++ b/Views/WebNew/Berita/DetailBerita.cshtml @@ -6,6 +6,12 @@ } + +@section Scripts { + +} + + @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Helpdesk.cshtml") @@ -36,118 +42,4 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/Views/WebNew/Faq.cshtml b/Views/WebNew/Faq.cshtml index 20048be..02f9d56 100644 --- a/Views/WebNew/Faq.cshtml +++ b/Views/WebNew/Faq.cshtml @@ -7,6 +7,11 @@ } +@section Scripts { + +} + + @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Helpdesk.cshtml")
@@ -336,41 +341,3 @@
- - \ No newline at end of file diff --git a/Views/WebNew/FormReview.cshtml b/Views/WebNew/FormReview.cshtml index 5a18ed0..5b35d8d 100644 --- a/Views/WebNew/FormReview.cshtml +++ b/Views/WebNew/FormReview.cshtml @@ -22,6 +22,11 @@ } +@section Scripts { + +} + + @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Helpdesk.cshtml") @@ -137,107 +142,4 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/Views/WebNew/Galeri.cshtml b/Views/WebNew/Galeri.cshtml index dca2237..aa2a16c 100644 --- a/Views/WebNew/Galeri.cshtml +++ b/Views/WebNew/Galeri.cshtml @@ -7,6 +7,11 @@ } +@section Scripts { + +} + + @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Helpdesk.cshtml") @@ -34,101 +39,3 @@ *@ - - \ No newline at end of file diff --git a/Views/WebNew/Home/Index.cshtml b/Views/WebNew/Home/Index.cshtml index 7eca6e9..f0b99a3 100644 --- a/Views/WebNew/Home/Index.cshtml +++ b/Views/WebNew/Home/Index.cshtml @@ -2,6 +2,12 @@ Layout = "~/Views/WebNew/Shared/_Layout.cshtml"; ViewData["Title"] = "Beranda"; } + + +@section Scripts { + +} + @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Helpdesk.cshtml") @@ -45,7 +51,7 @@
@@ -627,200 +633,200 @@ @*
-
+
-

- Ulasan Pelanggan -

+

+ Ulasan Pelanggan +

-
-
+
+
-
-
+
+
-
- - - - - -
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -

- -
- -
-
PT. ABC
+
+ + + + +
-
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +

+ +
+ +
+
PT. ABC
+
+
+ +
+
+ +
+
+ +
+ + + + + +
+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +

+ +
+ +
+
PT. ABC
+
+
+ +
+
+ +
+
+ +
+ + + + + +
+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +

+ +
+ +
+
PT. ABC
+
+
+ +
+
+ +
+
+ +
+ + + + + +
+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +

+ +
+ +
+
PT. ABC
+
+
+ +
+
+ +
+
+ +
+ + + + + +
+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +

+ +
+ +
+
PT. ABC
+
+
+ +
+
+ +
+
+ +
+ + + + + +
+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +

+ +
+ +
+
PT. ABC
+
+
+ +
+
+ +
+
+ +
+ + + + + +
+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +

+ +
+ +
+
PT. ABC
+
+
+ +
- -
-
- -
- - - - - -
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -

- -
- -
-
PT. ABC
-
-
- -
+ -
-
- -
- - - - - -
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -

- -
- -
-
PT. ABC
-
-
- -
-
- -
-
- -
- - - - - -
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -

- -
- -
-
PT. ABC
-
-
- -
-
- -
-
- -
- - - - - -
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -

- -
- -
-
PT. ABC
-
-
- -
-
- -
-
- -
- - - - - -
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -

- -
- -
-
PT. ABC
-
-
- -
-
- -
-
- -
- - - - - -
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -

- -
- -
-
PT. ABC
-
-
- -
-
- -
-
-
*@ + *@
@@ -858,402 +864,3 @@
-@section Scripts { - -} diff --git a/Views/WebNew/Layanan/DetailItem.cshtml b/Views/WebNew/Layanan/DetailItem.cshtml index 6d13117..f4f786a 100644 --- a/Views/WebNew/Layanan/DetailItem.cshtml +++ b/Views/WebNew/Layanan/DetailItem.cshtml @@ -7,6 +7,11 @@ } + +@section Scripts { + +} + @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Helpdesk.cshtml") @@ -54,130 +59,4 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/Views/WebNew/Layanan/DetailLayanan.cshtml b/Views/WebNew/Layanan/DetailLayanan.cshtml index 39043a9..d2560e3 100644 --- a/Views/WebNew/Layanan/DetailLayanan.cshtml +++ b/Views/WebNew/Layanan/DetailLayanan.cshtml @@ -69,7 +69,7 @@ Download Excel - + @@ -89,281 +89,4 @@ * Parameter yang tebal (bold) telah terakreditasi oleh KAN - - + diff --git a/Views/WebNew/Layanan/Layanan.cshtml b/Views/WebNew/Layanan/Layanan.cshtml index 5be424a..6146f03 100644 --- a/Views/WebNew/Layanan/Layanan.cshtml +++ b/Views/WebNew/Layanan/Layanan.cshtml @@ -1,4 +1,8 @@  +@section Scripts { + +} +
@@ -106,31 +110,3 @@
- - diff --git a/Views/WebNew/Regulasi.cshtml b/Views/WebNew/Regulasi.cshtml index 4c8f44d..7eb5536 100644 --- a/Views/WebNew/Regulasi.cshtml +++ b/Views/WebNew/Regulasi.cshtml @@ -7,6 +7,11 @@ } +@section Scripts { + +} + + @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Hero.cshtml", "Regulasi") @await Html.PartialAsync("~/Views/WebNew/Shared/Section/_Helpdesk.cshtml") @@ -54,276 +59,3 @@ - - \ No newline at end of file diff --git a/Views/WebNew/Shared/Section/_Footer.cshtml b/Views/WebNew/Shared/Section/_Footer.cshtml index b4ba176..e55db0b 100644 --- a/Views/WebNew/Shared/Section/_Footer.cshtml +++ b/Views/WebNew/Shared/Section/_Footer.cshtml @@ -1,6 +1,5 @@