diff --git a/.gitignore b/.gitignore index add57be..72f8d1b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ bin/ obj/ /packages/ riderModule.iml -/_ReSharper.Caches/ \ No newline at end of file +/_ReSharper.Caches/ +/node_modules +/wwwroot/node_modules diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index 5f70416..94b5505 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -4,15 +4,19 @@ using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -using pwa_0x01_2._1.Models; +using pwt_0x01.Models; -namespace pwa_0x01_2._1.Controllers +namespace pwt_0x01.Controllers { public class HomeController : Controller { + private IList Carousels = CarouselHelper.GenerateCarousel(); + public IActionResult Index() { - return View(); + CarouselViewModel carousel = new CarouselViewModel(); + carousel.Carousels = Carousels; + return View(carousel); } public IActionResult About() @@ -37,7 +41,7 @@ namespace pwa_0x01_2._1.Controllers [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { - return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + return View(new ErrorViewModel {RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier}); } } } diff --git a/Models/Carousel.cs b/Models/Carousel.cs index 0dc71bf..6b1ecd1 100644 --- a/Models/Carousel.cs +++ b/Models/Carousel.cs @@ -1,7 +1,10 @@ -namespace pwa_0x01_2._1.Models +namespace pwt_0x01.Models { public class Carousel { - + public string DataTarget { get; set; } + public string ImageSrc { get; set; } + public string ImageAlt { get; set; } + public string CarouselContent { get; set; } } -} \ No newline at end of file +} diff --git a/Models/CarouselHelper.cs b/Models/CarouselHelper.cs index 379a510..b43dbce 100644 --- a/Models/CarouselHelper.cs +++ b/Models/CarouselHelper.cs @@ -1,7 +1,19 @@ -namespace pwa_0x01_2._1.Models +using System.Collections.Generic; + +namespace pwt_0x01.Models { public class CarouselHelper { - + public static IList GenerateCarousel() + { + IList carousel = new List() + { + new Carousel() {DataTarget = "#myCarousel", ImageSrc = "/images/banner1.svg", ImageAlt = "img1", CarouselContent = "Learn how to build ASP.NET apps that can run anywhere. Learn More"}, + new Carousel() {DataTarget = "#myCarousel", ImageSrc = "/images/banner2.svg", ImageAlt = "img2", CarouselContent = "There are powerful new features in Visual Studio for building modern web apps. Learn More"}, + new Carousel() {DataTarget = "#myCarousel", ImageSrc = "/images/banner3.svg", ImageAlt = "img3", CarouselContent = "Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.Learn More"}, + new Carousel() {DataTarget = "#myCarousel", ImageSrc = "/images/ms_loves_linux.jpeg", ImageAlt = "ms loves linux", CarouselContent = "m$ loves linux, reportedlyLearn More"} + }; + return carousel; + } } -} \ No newline at end of file +} diff --git a/Models/CarouselViewModel.cs b/Models/CarouselViewModel.cs index da71d5d..d6262f4 100644 --- a/Models/CarouselViewModel.cs +++ b/Models/CarouselViewModel.cs @@ -1,7 +1,9 @@ -namespace pwa_0x01_2._1.Models +using System.Collections.Generic; + +namespace pwt_0x01.Models { public class CarouselViewModel { - + public IList Carousels { get; set; } } -} \ No newline at end of file +} diff --git a/Models/ErrorViewModel.cs b/Models/ErrorViewModel.cs index 3b1a1b9..5437cab 100644 --- a/Models/ErrorViewModel.cs +++ b/Models/ErrorViewModel.cs @@ -1,6 +1,6 @@ using System; -namespace pwa_0x01_2._1.Models +namespace pwt_0x01.Models { public class ErrorViewModel { @@ -8,4 +8,4 @@ namespace pwa_0x01_2._1.Models public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } -} \ No newline at end of file +} diff --git a/Program.cs b/Program.cs index b6a486a..eeed0a1 100644 --- a/Program.cs +++ b/Program.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; -namespace pwa_0x01_2._1 +namespace pwt_0x01 { public class Program { diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index c5f5f1e..b60cfaf 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -1,7 +1,7 @@ { "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, + "windowsAuthentication": false, + "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:28296", "sslPort": 44327 @@ -15,7 +15,7 @@ "ASPNETCORE_ENVIRONMENT": "Development" } }, - "pwa_0x01_2._1": { + "pwt_0x01": { "commandName": "Project", "launchBrowser": true, "applicationUrl": "https://localhost:5001;http://localhost:5000", @@ -24,4 +24,4 @@ } } } -} \ No newline at end of file +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..fb17b25 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# pwa-0x01 + +this repo holds *sawce* for a 0x01 .netcore mvc webapp for PWA lessons diff --git a/Startup.cs b/Startup.cs index 78c85ce..9946e94 100644 --- a/Startup.cs +++ b/Startup.cs @@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace pwa_0x01_2._1 +namespace pwt_0x01 { public class Startup { diff --git a/Views/Home/About.cshtml b/Views/Home/About.cshtml index 3674e37..6229fde 100644 --- a/Views/Home/About.cshtml +++ b/Views/Home/About.cshtml @@ -4,4 +4,4 @@

@ViewData["Title"]

@ViewData["Message"]

-

Use this area to provide additional information.

+

Use this area to provide additional information.

\ No newline at end of file diff --git a/Views/Home/Contact.cshtml b/Views/Home/Contact.cshtml index a11a186..f578ea2 100644 --- a/Views/Home/Contact.cshtml +++ b/Views/Home/Contact.cshtml @@ -5,13 +5,13 @@

@ViewData["Message"]

- One Microsoft Way
- Redmond, WA 98052-6399
+ One Microsoft Way
+ Redmond, WA 98052-6399
P: 425.555.0100
- Support: Support@example.com
+ Support: Support@example.com
Marketing: Marketing@example.com -
+ \ No newline at end of file diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index f42d2a0..e2e5e58 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -1,47 +1,40 @@ -@{ +@using Microsoft.AspNetCore.Razor.Language.Intermediate +@model CarouselViewModel +@{ ViewData["Title"] = "Home Page"; } diff --git a/Views/Home/Privacy.cshtml b/Views/Home/Privacy.cshtml index 7bd3861..a36971f 100644 --- a/Views/Home/Privacy.cshtml +++ b/Views/Home/Privacy.cshtml @@ -3,4 +3,4 @@ }

@ViewData["Title"]

-

Use this page to detail your site's privacy policy.

+

Use this page to detail your site's privacy policy.

\ No newline at end of file diff --git a/Views/Shared/Error.cshtml b/Views/Shared/Error.cshtml index ec2ea6b..60518e8 100644 --- a/Views/Shared/Error.cshtml +++ b/Views/Shared/Error.cshtml @@ -19,4 +19,4 @@

Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. -

+

\ No newline at end of file diff --git a/Views/Shared/_CookieConsentPartial.cshtml b/Views/Shared/_CookieConsentPartial.cshtml index bbfbb09..a1a5b7e 100644 --- a/Views/Shared/_CookieConsentPartial.cshtml +++ b/Views/Shared/_CookieConsentPartial.cshtml @@ -17,7 +17,9 @@ - + + +