diff --git a/Controllers/LayananController.cs b/Controllers/LayananController.cs deleted file mode 100644 index ae8c4ea..0000000 --- a/Controllers/LayananController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -public class LayananController : Controller -{ - public IActionResult Index(string jenis) - { - ViewBag.Jenis = jenis; - return View(); - } - - public IActionResult GetData(string jenis) - { - var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json/Layanan", $"{jenis}.json"); - - if (!System.IO.File.Exists(path)) - return NotFound(); - - var json = System.IO.File.ReadAllText(path); - return Content(json, "application/json"); - } -} \ No newline at end of file diff --git a/Controllers/BeritaController.cs b/Controllers/WebNew/BeritaController.cs similarity index 70% rename from Controllers/BeritaController.cs rename to Controllers/WebNew/BeritaController.cs index ecf24f8..f57f2e6 100644 --- a/Controllers/BeritaController.cs +++ b/Controllers/WebNew/BeritaController.cs @@ -1,18 +1,20 @@ using Microsoft.AspNetCore.Mvc; using System.Text.Json.Nodes; -namespace WebApplication2.Controllers +namespace WebApplication2.Controllers.WebNew { public class BeritaController : Controller { - public IActionResult Index() + [HttpGet("/WebNew/Berita")] + public IActionResult Index() { - return View("~/Views/Berita/Berita.cshtml"); + return View("~/Views/WebNew/Berita/Berita.cshtml"); } + [HttpGet("/WebNew/Berita/GetBerita")] public IActionResult GetBerita() { - var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json", "berita.json"); + var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "berita.json"); if (!System.IO.File.Exists(path)) return NotFound(); @@ -21,15 +23,17 @@ namespace WebApplication2.Controllers return Content(json, "application/json"); } + [HttpGet("/WebNew/Berita/Detail/")] public IActionResult Detail(int id) { ViewBag.Id = id; - return View("~/Views/Berita/DetailBerita.cshtml"); + return View("~/Views/WebNew/Berita/DetailBerita.cshtml"); } + [HttpGet("/WebNew/Berita/GetDetail/")] public IActionResult GetDetail(int id) { - var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json", "berita.json"); + var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "berita.json"); if (!System.IO.File.Exists(path)) return NotFound(); @@ -46,9 +50,10 @@ namespace WebApplication2.Controllers return Json(result); } + [HttpGet("/WebNew/Berita/GetAll")] public IActionResult GetAll() { - var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json", "berita.json"); + var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "berita.json"); var json = System.IO.File.ReadAllText(path); return Content(json, "application/json"); } diff --git a/Controllers/DetailItemController.cs b/Controllers/WebNew/DetailItemController.cs similarity index 68% rename from Controllers/DetailItemController.cs rename to Controllers/WebNew/DetailItemController.cs index 7a29c76..265f465 100644 --- a/Controllers/DetailItemController.cs +++ b/Controllers/WebNew/DetailItemController.cs @@ -1,18 +1,20 @@ using Microsoft.AspNetCore.Mvc; -namespace WebApplication2.Controllers +namespace WebApplication2.Controllers.WebNew { public class DetailItemController : Controller { + [HttpGet("/WebNew/DetailItem/")] public IActionResult Index(string kode) { ViewBag.Kode = kode; - return View("~/Views/Layanan/DetailItem.cshtml"); + return View("~/Views/WebNew/Layanan/DetailItem.cshtml"); } + [HttpGet("/WebNew/DetailItem/GetDetail/")] public IActionResult GetDetail(string kode) { - var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json", "DetailItem.json"); + var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "DetailItem.json"); if (!System.IO.File.Exists(path)) return NotFound(); diff --git a/Controllers/GaleriController.cs b/Controllers/WebNew/GaleriController.cs similarity index 68% rename from Controllers/GaleriController.cs rename to Controllers/WebNew/GaleriController.cs index df22d34..634634e 100644 --- a/Controllers/GaleriController.cs +++ b/Controllers/WebNew/GaleriController.cs @@ -1,17 +1,19 @@ using Microsoft.AspNetCore.Mvc; -namespace WebApplication2.Controllers +namespace WebApplication2.Controllers.WebNew { public class GaleriController : Controller { + [HttpGet("/WebNew/Galeri")] public IActionResult Index() { - return View("~/Views/Galeri.cshtml"); + return View("~/Views/WebNew/Galeri.cshtml"); } + [HttpGet("/WebNew/Galeri/GetAll")] public IActionResult GetAll() { - var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json", "galeri.json"); + var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "galeri.json"); if (!System.IO.File.Exists(path)) return NotFound(); diff --git a/Controllers/HomeController.cs b/Controllers/WebNew/HomeController.cs similarity index 79% rename from Controllers/HomeController.cs rename to Controllers/WebNew/HomeController.cs index 1b1c2c1..9332d68 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/WebNew/HomeController.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc; using WebApplication2.Models; using WebApplication2.Models.ViewModels; -namespace WebApplication2.Controllers +namespace WebApplication2.Controllers.WebNew { public class HomeController : Controller { @@ -14,44 +14,45 @@ namespace WebApplication2.Controllers _logger = logger; } + [HttpGet("/")] public IActionResult Index() { var berita = GetData(); ViewBag.MainNews = berita.FirstOrDefault(); ViewBag.SideNews = berita.Skip(1).Take(4).ToList(); + return View("~/Views/WebNew/Home/Index.cshtml"); - return View(); } [HttpGet("/faq")] public IActionResult Faq() { - return View("~/Views/Faq.cshtml"); + return View("~/Views/WebNew/Faq.cshtml"); } [HttpGet("/kontak")] public IActionResult Kontak() { - return View("~/Views/Kontak.cshtml"); + return View("~/Views/WebNew/Kontak.cshtml"); } [HttpGet("/sertifikat")] public IActionResult Sertifikat() { - return View("~/Views/Sertifikat.cshtml"); + return View("~/Views/WebNew/Sertifikat.cshtml"); } [HttpGet("/tentang-kami")] public IActionResult TentangKami() { - return View("~/Views/TentangKami.cshtml"); + return View("~/Views/WebNew/TentangKami.cshtml"); } [HttpGet("/ulasan")] public IActionResult Ulasan() { - return View("~/Views/FormReview.cshtml"); + return View("~/Views/WebNew/FormReview.cshtml"); } public IActionResult Privacy() @@ -66,35 +67,35 @@ namespace WebApplication2.Controllers new BeritaViewModel { Judul = "Komitmen LLHD Terhadap Pemenuhan Permen LHK NO.23 TAHUN 2020", Deskripsi = "Komitmen Laboratorium Lingkungan Hidup Daerah (LLHD) Provinsi DKI Jakarta...", - Gambar = "/assets/image/foto/Berita komitmen llhd.png", + Gambar = "/webnew/assets/image/foto/Berita komitmen llhd.png", Tanggal = new DateTime(2025,3,4), Slug = "berita-1" }, new BeritaViewModel { Judul = "Lorem Ipsum Judul", Deskripsi = "Isi berita...", - Gambar = "/assets/image/foto/1.jpeg", + Gambar = "/webnew/assets/image/foto/1.jpeg", Tanggal = new DateTime(2025,3,4), Slug = "berita-2" }, new BeritaViewModel { Judul = "Lorem Ipsum Judul", Deskripsi = "Isi berita...", - Gambar = "/assets/image/foto/2.jpeg", + Gambar = "/webnew/assets/image/foto/2.jpeg", Tanggal = new DateTime(2025,3,4), Slug = "berita-3" }, new BeritaViewModel { Judul = "Lorem Ipsum Judul", Deskripsi = "Isi berita...", - Gambar = "/assets/image/foto/3.jpeg", + Gambar = "/webnew/assets/image/foto/3.jpeg", Tanggal = new DateTime(2025,3,4), Slug = "berita-4" }, new BeritaViewModel { Judul = "Lorem Ipsum Judul", Deskripsi = "Isi berita...", - Gambar = "/assets/image/foto/4.jpeg", + Gambar = "/webnew/assets/image/foto/4.jpeg", Tanggal = new DateTime(2025,3,4), Slug = "berita-5" } diff --git a/Controllers/WebNew/LayananController.cs b/Controllers/WebNew/LayananController.cs new file mode 100644 index 0000000..bed4724 --- /dev/null +++ b/Controllers/WebNew/LayananController.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Mvc; + +namespace WebApplication2.Controllers.WebNew +{ + public class LayananController : Controller + { + + [HttpGet("/WebNew/Layanan")] + public IActionResult Index(string jenis) + { + ViewBag.Jenis = jenis; + return View(); + } + + [HttpGet("/WebNew/Layanan/GetData")] + public IActionResult GetData(string jenis) + { + var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json/Layanan", $"{jenis}.json"); + + if (!System.IO.File.Exists(path)) + return NotFound(); + + var json = System.IO.File.ReadAllText(path); + return Content(json, "application/json"); + } + } + +} \ No newline at end of file diff --git a/Controllers/RegulasiController.cs b/Controllers/WebNew/RegulasiController.cs similarity index 67% rename from Controllers/RegulasiController.cs rename to Controllers/WebNew/RegulasiController.cs index e447141..fe2bf98 100644 --- a/Controllers/RegulasiController.cs +++ b/Controllers/WebNew/RegulasiController.cs @@ -1,17 +1,19 @@ using Microsoft.AspNetCore.Mvc; -namespace WebApplication2.Controllers +namespace WebApplication2.Controllers.WebNew { public class RegulasiController : Controller { + [HttpGet("/WebNew/Regulasi")] public IActionResult Index() { - return View("~/Views/Regulasi.cshtml"); + return View("~/Views/WebNew/Regulasi.cshtml"); } + [HttpGet("/WebNew/Regulasi/GetRegulasi")] public IActionResult GetRegulasi() { - var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json", "regulasi.json"); + var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "regulasi.json"); if (!System.IO.File.Exists(path)) return NotFound(); diff --git a/Controllers/VideoController.cs b/Controllers/WebNew/VideoController.cs similarity index 74% rename from Controllers/VideoController.cs rename to Controllers/WebNew/VideoController.cs index efa41bf..0de4b1b 100644 --- a/Controllers/VideoController.cs +++ b/Controllers/WebNew/VideoController.cs @@ -4,14 +4,16 @@ namespace WebApplication2.Controllers { public class VideoController : Controller { + [HttpGet("/WebNew/Video")] public IActionResult Index() { - return View("~/Views/Video.cshtml"); + return View("~/Views/WebNew/Video.cshtml"); } + [HttpGet("/WebNew/Video/GetAll")] public IActionResult GetAll() { - var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/json", "video.json"); + var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/webnew/json", "video.json"); if (!System.IO.File.Exists(path)) return NotFound(); diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index 52eafb9..8471ffb 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -13,7 +13,7 @@ "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "applicationUrl": "http://localhost:5117", + "applicationUrl": "http://localhost:5177", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } @@ -22,7 +22,7 @@ "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "applicationUrl": "https://localhost:7007;http://localhost:5117", + "applicationUrl": "https://localhost:7077;http://localhost:5177", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/Views/Shared/_ValidationScriptsPartial.cshtml b/Views/Shared/_ValidationScriptsPartial.cshtml deleted file mode 100644 index 5a16d80..0000000 --- a/Views/Shared/_ValidationScriptsPartial.cshtml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/Views/Berita/Berita.cshtml b/Views/WebNew/Berita/Berita.cshtml similarity index 97% rename from Views/Berita/Berita.cshtml rename to Views/WebNew/Berita/Berita.cshtml index d2dbd3f..411fdc7 100644 --- a/Views/Berita/Berita.cshtml +++ b/Views/WebNew/Berita/Berita.cshtml @@ -5,7 +5,7 @@ } @section Style { - + } @await Html.PartialAsync("Section/_Hero", "Berita") diff --git a/Views/Berita/DetailBerita.cshtml b/Views/WebNew/Berita/DetailBerita.cshtml similarity index 94% rename from Views/Berita/DetailBerita.cshtml rename to Views/WebNew/Berita/DetailBerita.cshtml index bdbdc3c..2abb08e 100644 --- a/Views/Berita/DetailBerita.cshtml +++ b/Views/WebNew/Berita/DetailBerita.cshtml @@ -1,9 +1,9 @@  @section Style { - + } -
+
@@ -21,7 +21,7 @@
-