diff --git a/.gitmodules b/.gitmodules index e69de29..80a8784 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,7 @@ +[submodule "MaxPowerLevel/Views/bulma"] + path = MaxPowerLevel/Views/bulma + url = https://github.com/jgthms/bulma.git + branch = 0.9.2 +[submodule "MaxPowerLevel/Views/bulmaswatch"] + path = MaxPowerLevel/Views/bulmaswatch + url = https://github.com/jenil/bulmaswatch.git diff --git a/Dockerfile b/Dockerfile index 611e2d3..60b0eb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build +RUN apt-get update && apt-get install -y ruby-sass WORKDIR /app # copy everything and build app diff --git a/MaxPowerLevel/MaxPowerLevel.csproj b/MaxPowerLevel/MaxPowerLevel.csproj index d110809..415d0a1 100644 --- a/MaxPowerLevel/MaxPowerLevel.csproj +++ b/MaxPowerLevel/MaxPowerLevel.csproj @@ -1,11 +1,35 @@ + - - netcoreapp3.1 - ed64c0be-3d6b-4283-b887-4dcb9de6293a - - - - - - + + netcoreapp3.1 + ed64c0be-3d6b-4283-b887-4dcb9de6293a + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MaxPowerLevel/Views/Shared/_Layout.cshtml b/MaxPowerLevel/Views/Shared/_Layout.cshtml index b2dd3f3..03fc4f2 100644 --- a/MaxPowerLevel/Views/Shared/_Layout.cshtml +++ b/MaxPowerLevel/Views/Shared/_Layout.cshtml @@ -11,7 +11,20 @@ - + @{ var themeFromCookie = Context.Request.Cookies["theme"]; + var themeCSS = "bulma-auto.css"; + // Check cookie value against an explicit whitelist in order to avoid + // potential code injection. + switch (themeFromCookie) + { + case "light": + themeCSS = "bulma-default.css"; + break; + case "dark": + themeCSS = "bulma-dark.css"; + break; + } } + @@ -28,13 +41,19 @@ Destiny 2 Utilities - @if(User.Identity.IsAuthenticated){ - @@ -45,7 +64,7 @@ -