From 371fdc4dad89039dfb142d2bc80a471dbca6028e Mon Sep 17 00:00:00 2001 From: kwokkan Date: Thu, 24 Oct 2019 21:56:50 +0100 Subject: [PATCH] #113: Remove non main project as it contans non public packages. (#114) * #113: Remove non main project as it contans non public packages. * Remove another unused project. * Removed another non used project. * Removed another unused project. * Removed another unused project. * Removed unused file. --- CardHero.sln | 36 ---- apps/CardHero.NetCoreApp.Mvc/.bowerrc | 3 - .../Attributes/ChartJsAttribute.cs | 14 -- .../CardHero.NetCoreApp.Mvc.csproj | 44 ---- .../Constants/CardHeroConstants.cs | 7 - .../Controllers/AccountController.cs | 24 --- .../Controllers/Api/CardsController.cs | 83 -------- .../Controllers/Api/DecksController.cs | 43 ---- .../Api/GameTripleTriadApiController.cs | 42 ---- .../Controllers/CardController.cs | 62 ------ .../Controllers/CardHeroController.cs | 42 ---- .../Controllers/DeckController.cs | 126 ------------ .../Controllers/GameController.cs | 141 ------------- .../Controllers/HomeController.cs | 31 --- .../Controllers/ProfileController.cs | 26 --- .../CardCollectionViewModelExtensions.cs | 35 ---- .../Extensions/CardViewModelExtensions.cs | 31 --- .../Extensions/DeckViewModelExtensions.cs | 28 --- .../Extensions/GameViewModelExtensions.cs | 23 --- .../Extensions/HttpRequestExtensions.cs | 25 --- .../Extensions/IChartJsExtensions.cs | 63 ------ .../IServiceCollectionExtensions.cs | 16 -- .../Models/Card/CardCollectionViewModel.cs | 11 - .../Models/Card/CardSearchViewModel.cs | 11 - .../Models/Card/CardViewModel.cs | 59 ------ .../Models/ChartJs/ChartViewModel.cs | 11 - .../Models/ChartJs/DataViewModel.cs | 11 - .../Models/ChartJs/DatasetViewModel.cs | 21 -- .../Models/ChartJs/IChartJs.cs | 6 - .../Models/ChartJs/OptionsViewModel.cs | 7 - .../Models/ChartJs/ScaleViewModel.cs | 7 - .../Models/ChartJs/TicksViewModel.cs | 9 - .../Models/Deck/DeckCreateViewModel.cs | 9 - .../Models/Deck/DeckEditViewModel.cs | 15 -- .../Models/Deck/DeckSearchViewModel.cs | 11 - .../Models/Deck/DeckViewModel.cs | 25 --- .../Models/Game/GameCreateViewModel.cs | 17 -- .../Models/Game/GameSearchViewModel.cs | 21 -- .../Models/Game/GameViewModel.cs | 26 --- .../GameTripleTriadMoveViewModel.cs | 16 -- .../TripleTriad/GameTripleTriadViewModel.cs | 16 -- .../Models/JsonViewModel.cs | 9 - .../Models/SortableViewModel.cs | 26 --- apps/CardHero.NetCoreApp.Mvc/Program.cs | 38 ---- .../Properties/launchSettings.json | 26 --- apps/CardHero.NetCoreApp.Mvc/Startup.cs | 188 ------------------ .../ViewComponents/MenuViewComponent.cs | 17 -- .../ViewComponents/MenuViewComponentModel.cs | 6 - .../Views/Card/Index.cshtml | 86 -------- .../Views/Card/View.cshtml | 86 -------- .../Views/Deck/Create.cshtml | 21 -- .../Views/Deck/Index.cshtml | 67 ------- .../Views/Deck/View.cshtml | 68 ------- .../Views/Game/Create.cshtml | 26 --- .../Views/Game/Index.cshtml | 90 --------- .../Views/Game/View.cshtml | 73 ------- .../Views/Game/_ViewTripleTriad.cshtml | 40 ---- .../Views/Home/About.cshtml | 7 - .../Views/Home/Contact.cshtml | 17 -- .../Views/Home/Index.cshtml | 40 ---- .../Views/Profile/Index.cshtml | 23 --- .../Shared/Components/Menu/Default.cshtml | 63 ------ .../Views/Shared/Error.cshtml | 14 -- .../Views/Shared/_Layout.cshtml | 82 -------- .../Shared/_ValidationScriptsPartial.cshtml | 18 -- .../Views/_ViewImports.cshtml | 9 - .../Views/_ViewStart.cshtml | 3 - .../appsettings.Development.json | 10 - apps/CardHero.NetCoreApp.Mvc/appsettings.json | 34 ---- apps/CardHero.NetCoreApp.Mvc/bower.json | 5 - .../CardHero.NetCoreApp.Mvc/bundleconfig.json | 98 --------- .../wwwroot/css/site.css | 65 ------ .../wwwroot/favicon.ico | Bin 32038 -> 0 bytes .../CardHero.NetCoreApp.Mvc/wwwroot/js/_ns.js | 7 - .../wwwroot/js/cards/_init.js | 1 - .../wwwroot/js/cards/favourite.js | 17 -- .../wwwroot/js/charts/_init.js | 6 - .../wwwroot/js/charts/charts.js | 23 --- .../wwwroot/js/decks/favourite.js | 17 -- .../wwwroot/js/decks/page/view.js | 35 ---- .../wwwroot/js/games/page/view.tripletriad.js | 53 ----- .../wwwroot/js/games/tripletriad/_init.js | 6 - .../wwwroot/js/games/tripletriad/_ns.js | 9 - .../wwwroot/js/games/tripletriad/api.js | 28 --- .../wwwroot/js/modals/_init.js | 20 -- .../wwwroot/js/modals/_ns.js | 9 - .../wwwroot/js/modals/modal.js | 65 ------ .../wwwroot/js/site.js | 1 - .../wwwroot/modules/cards/_.min.js | 1 - .../wwwroot/modules/charts/_.min.js | 1 - .../wwwroot/modules/core/_.min.css | 1 - .../wwwroot/modules/core/_.min.js | 1 - .../wwwroot/modules/decks/_.min.js | 1 - .../modules/games/tripletriad/_.min.js | 1 - .../wwwroot/modules/modals/_.min.js | 19 -- .../Extensions/HtmlHelperExtensions.cs | 99 --------- .../KwokKan.AspNetCore.Mvc.Sortable.csproj | 29 --- .../CardHero.AspNetCore.Mvc.Common.csproj | 38 ---- .../Controllers/AccountController.cs | 27 --- .../Controllers/Api/CardApiController.cs | 39 ---- .../Controllers/Api/DeckApiController.cs | 87 -------- .../Controllers/Api/GameApiController.cs | 48 ----- .../Controllers/Api/GamePlayApiController.cs | 36 ---- .../Controllers/BaseController.cs | 40 ---- .../Controllers/CardController.cs | 41 ---- .../Controllers/DeckController.cs | 63 ------ .../Controllers/GameController.cs | 97 --------- .../Controllers/TokenController.cs | 27 --- .../Models/Account/LoginViewModel.cs | 15 -- .../Models/Card/CardCollectionViewModel.cs | 11 - .../Models/Card/CardViewModel.cs | 15 -- .../Models/Card/SearchCardViewModel.cs | 19 -- .../Components/MenuViewComponentModel.cs | 17 -- .../Deck/DeckCardCollectionViewModel.cs | 7 - .../Models/Deck/DeckViewModel.cs | 15 -- .../Models/Deck/EditDeckViewModel.cs | 9 - .../Models/Game/CreateGameViewModel.cs | 13 -- .../Models/Game/GameViewModel.cs | 29 --- .../Models/Game/SearchGameViewModel.cs | 28 --- .../Models/GamePlay/MoveViewModel.cs | 13 -- .../Properties/AssemblyInfo.cs | 19 -- .../ViewComponents/MenuViewComponent.cs | 19 -- .../CardHero.AspNetCore.Mvc.Helpers.csproj | 31 --- .../Extensions/HtmlHelperExtensions.cs | 63 ------ .../Extensions/UrlHelperExtensions.cs | 23 --- .../Properties/AssemblyInfo.cs | 19 -- .../CardHero.AspNetCore.Mvc.TagHelpers.csproj | 31 --- .../Extensions/ServiceCollectionExtensions.cs | 19 -- .../Options/AssetTagHelperOptions.cs | 7 - .../Properties/AssemblyInfo.cs | 19 -- .../TagHelpers/AssetTagHelper.cs | 56 ------ .../TagHelpers/HideIfNullTagHelper.cs | 19 -- .../TagHelpers/HideIfTagHelper.cs | 19 -- .../TagHelpers/ShowIfTagHelper.cs | 19 -- .../TagHelpers/ShowifNullTagHelper.cs | 19 -- 135 files changed, 4175 deletions(-) delete mode 100644 apps/CardHero.NetCoreApp.Mvc/.bowerrc delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Attributes/ChartJsAttribute.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/CardHero.NetCoreApp.Mvc.csproj delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Constants/CardHeroConstants.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/AccountController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/Api/CardsController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/Api/DecksController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/Api/GameTripleTriadApiController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/CardController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/CardHeroController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/DeckController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/GameController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/HomeController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Controllers/ProfileController.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Extensions/CardCollectionViewModelExtensions.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Extensions/CardViewModelExtensions.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Extensions/DeckViewModelExtensions.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Extensions/GameViewModelExtensions.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Extensions/HttpRequestExtensions.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Extensions/IChartJsExtensions.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Extensions/IServiceCollectionExtensions.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Card/CardCollectionViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Card/CardSearchViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Card/CardViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/ChartViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/DataViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/DatasetViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/IChartJs.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/OptionsViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/ScaleViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/TicksViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckCreateViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckEditViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckSearchViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Game/GameCreateViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Game/GameSearchViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Game/GameViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Game/TripleTriad/GameTripleTriadMoveViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/Game/TripleTriad/GameTripleTriadViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/JsonViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Models/SortableViewModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Program.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Properties/launchSettings.json delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Startup.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/ViewComponents/MenuViewComponent.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/ViewComponents/MenuViewComponentModel.cs delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Card/Index.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Card/View.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Deck/Create.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Deck/Index.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Deck/View.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Game/Create.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Game/Index.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Game/View.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Game/_ViewTripleTriad.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Home/About.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Home/Contact.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Home/Index.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Profile/Index.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Shared/Components/Menu/Default.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Shared/Error.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Shared/_Layout.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/_ViewImports.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/Views/_ViewStart.cshtml delete mode 100644 apps/CardHero.NetCoreApp.Mvc/appsettings.Development.json delete mode 100644 apps/CardHero.NetCoreApp.Mvc/appsettings.json delete mode 100644 apps/CardHero.NetCoreApp.Mvc/bower.json delete mode 100644 apps/CardHero.NetCoreApp.Mvc/bundleconfig.json delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/css/site.css delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/favicon.ico delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/_ns.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/cards/_init.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/cards/favourite.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/charts/_init.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/charts/charts.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/decks/favourite.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/decks/page/view.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/games/page/view.tripletriad.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/games/tripletriad/_init.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/games/tripletriad/_ns.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/games/tripletriad/api.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/modals/_init.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/modals/_ns.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/modals/modal.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/js/site.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/cards/_.min.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/charts/_.min.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/core/_.min.css delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/core/_.min.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/decks/_.min.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/games/tripletriad/_.min.js delete mode 100644 apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/modals/_.min.js delete mode 100644 shared/KwokKan.AspNetCore.Mvc.Sortable/Extensions/HtmlHelperExtensions.cs delete mode 100644 shared/KwokKan.AspNetCore.Mvc.Sortable/KwokKan.AspNetCore.Mvc.Sortable.csproj delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/CardHero.AspNetCore.Mvc.Common.csproj delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/AccountController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/CardApiController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/DeckApiController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/GameApiController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/GamePlayApiController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/BaseController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/CardController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/DeckController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/GameController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Controllers/TokenController.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Account/LoginViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Card/CardCollectionViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Card/CardViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Card/SearchCardViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Components/MenuViewComponentModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Deck/DeckCardCollectionViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Deck/DeckViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Deck/EditDeckViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Game/CreateGameViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Game/GameViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/Game/SearchGameViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Models/GamePlay/MoveViewModel.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/Properties/AssemblyInfo.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Common/ViewComponents/MenuViewComponent.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Helpers/CardHero.AspNetCore.Mvc.Helpers.csproj delete mode 100644 src/CardHero.AspNetCore.Mvc.Helpers/Extensions/HtmlHelperExtensions.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Helpers/Extensions/UrlHelperExtensions.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.Helpers/Properties/AssemblyInfo.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.TagHelpers/CardHero.AspNetCore.Mvc.TagHelpers.csproj delete mode 100644 src/CardHero.AspNetCore.Mvc.TagHelpers/Extensions/ServiceCollectionExtensions.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.TagHelpers/Options/AssetTagHelperOptions.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.TagHelpers/Properties/AssemblyInfo.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/AssetTagHelper.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/HideIfNullTagHelper.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/HideIfTagHelper.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/ShowIfTagHelper.cs delete mode 100644 src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/ShowifNullTagHelper.cs diff --git a/CardHero.sln b/CardHero.sln index 99f41756a..3ccd66d21 100644 --- a/CardHero.sln +++ b/CardHero.sln @@ -9,31 +9,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig global.json = global.json - servers.bat = servers.bat EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CardHero.Core.Abstractions", "src\CardHero.Core.Abstractions\CardHero.Core.Abstractions.csproj", "{E8920830-F404-4823-BB11-59620591A32D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CardHero.Core.SqlServer", "src\CardHero.Core.SqlServer\CardHero.Core.SqlServer.csproj", "{C67F810B-06EE-46A3-92D7-4BEAE10F4104}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CardHero.AspNetCore.Mvc.Helpers", "src\CardHero.AspNetCore.Mvc.Helpers\CardHero.AspNetCore.Mvc.Helpers.csproj", "{7EE02878-3B35-4070-B315-AF99B5740800}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Debug.NetCoreApp", "apps\Debug.NetCoreApp\Debug.NetCoreApp.csproj", "{1575B740-A1B7-4743-BE6B-5122DE5184B4}" EndProject Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "CardHero.Database.SqlServer", "databases\CardHero.Database.SqlServer\CardHero.Database.SqlServer.sqlproj", "{8060AFDA-F43C-4727-8ECB-2418D488ECDD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "databases", "databases", "{7873589A-4C80-4D59-86A7-E9080D9AE1C1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CardHero.AspNetCore.Mvc.Common", "src\CardHero.AspNetCore.Mvc.Common\CardHero.AspNetCore.Mvc.Common.csproj", "{B1007CC1-DC39-464F-B0C8-8B411D05C153}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CardHero.AspNetCore.Mvc.TagHelpers", "src\CardHero.AspNetCore.Mvc.TagHelpers\CardHero.AspNetCore.Mvc.TagHelpers.csproj", "{9D990D6C-1319-4E6A-B526-2D688044EAC1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CardHero.NetCoreApp.Mvc", "apps\CardHero.NetCoreApp.Mvc\CardHero.NetCoreApp.Mvc.csproj", "{0BE2E05B-325D-481D-A7E2-8CBAC780678F}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{3FA74E7C-AA3C-4BE7-A1D1-05C90EF0EF4E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KwokKan.AspNetCore.Mvc.Sortable", "shared\KwokKan.AspNetCore.Mvc.Sortable\KwokKan.AspNetCore.Mvc.Sortable.csproj", "{5D70CA12-7BDA-4A8D-82AB-FA383E7FEB1B}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KwokKan.Sortable", "shared\KwokKan.Sortable\KwokKan.Sortable.csproj", "{050A1E03-69EA-4977-B68F-3A0645919E3C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "apps", "apps", "{3F283EB3-43A5-4B64-801A-27D8D38D8D1A}" @@ -72,10 +61,6 @@ Global {C67F810B-06EE-46A3-92D7-4BEAE10F4104}.Debug|Any CPU.Build.0 = Debug|Any CPU {C67F810B-06EE-46A3-92D7-4BEAE10F4104}.Release|Any CPU.ActiveCfg = Release|Any CPU {C67F810B-06EE-46A3-92D7-4BEAE10F4104}.Release|Any CPU.Build.0 = Release|Any CPU - {7EE02878-3B35-4070-B315-AF99B5740800}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7EE02878-3B35-4070-B315-AF99B5740800}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7EE02878-3B35-4070-B315-AF99B5740800}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7EE02878-3B35-4070-B315-AF99B5740800}.Release|Any CPU.Build.0 = Release|Any CPU {1575B740-A1B7-4743-BE6B-5122DE5184B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1575B740-A1B7-4743-BE6B-5122DE5184B4}.Debug|Any CPU.Build.0 = Debug|Any CPU {1575B740-A1B7-4743-BE6B-5122DE5184B4}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -86,22 +71,6 @@ Global {8060AFDA-F43C-4727-8ECB-2418D488ECDD}.Release|Any CPU.ActiveCfg = Release|Any CPU {8060AFDA-F43C-4727-8ECB-2418D488ECDD}.Release|Any CPU.Build.0 = Release|Any CPU {8060AFDA-F43C-4727-8ECB-2418D488ECDD}.Release|Any CPU.Deploy.0 = Release|Any CPU - {B1007CC1-DC39-464F-B0C8-8B411D05C153}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B1007CC1-DC39-464F-B0C8-8B411D05C153}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B1007CC1-DC39-464F-B0C8-8B411D05C153}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B1007CC1-DC39-464F-B0C8-8B411D05C153}.Release|Any CPU.Build.0 = Release|Any CPU - {9D990D6C-1319-4E6A-B526-2D688044EAC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D990D6C-1319-4E6A-B526-2D688044EAC1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D990D6C-1319-4E6A-B526-2D688044EAC1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D990D6C-1319-4E6A-B526-2D688044EAC1}.Release|Any CPU.Build.0 = Release|Any CPU - {0BE2E05B-325D-481D-A7E2-8CBAC780678F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0BE2E05B-325D-481D-A7E2-8CBAC780678F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0BE2E05B-325D-481D-A7E2-8CBAC780678F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0BE2E05B-325D-481D-A7E2-8CBAC780678F}.Release|Any CPU.Build.0 = Release|Any CPU - {5D70CA12-7BDA-4A8D-82AB-FA383E7FEB1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5D70CA12-7BDA-4A8D-82AB-FA383E7FEB1B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5D70CA12-7BDA-4A8D-82AB-FA383E7FEB1B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5D70CA12-7BDA-4A8D-82AB-FA383E7FEB1B}.Release|Any CPU.Build.0 = Release|Any CPU {050A1E03-69EA-4977-B68F-3A0645919E3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {050A1E03-69EA-4977-B68F-3A0645919E3C}.Debug|Any CPU.Build.0 = Debug|Any CPU {050A1E03-69EA-4977-B68F-3A0645919E3C}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -141,13 +110,8 @@ Global GlobalSection(NestedProjects) = preSolution {E8920830-F404-4823-BB11-59620591A32D} = {A4871F8E-B9E1-4927-8B0E-C191FD2E8A25} {C67F810B-06EE-46A3-92D7-4BEAE10F4104} = {A4871F8E-B9E1-4927-8B0E-C191FD2E8A25} - {7EE02878-3B35-4070-B315-AF99B5740800} = {A4871F8E-B9E1-4927-8B0E-C191FD2E8A25} {1575B740-A1B7-4743-BE6B-5122DE5184B4} = {3F283EB3-43A5-4B64-801A-27D8D38D8D1A} {8060AFDA-F43C-4727-8ECB-2418D488ECDD} = {7873589A-4C80-4D59-86A7-E9080D9AE1C1} - {B1007CC1-DC39-464F-B0C8-8B411D05C153} = {A4871F8E-B9E1-4927-8B0E-C191FD2E8A25} - {9D990D6C-1319-4E6A-B526-2D688044EAC1} = {A4871F8E-B9E1-4927-8B0E-C191FD2E8A25} - {0BE2E05B-325D-481D-A7E2-8CBAC780678F} = {3F283EB3-43A5-4B64-801A-27D8D38D8D1A} - {5D70CA12-7BDA-4A8D-82AB-FA383E7FEB1B} = {3FA74E7C-AA3C-4BE7-A1D1-05C90EF0EF4E} {050A1E03-69EA-4977-B68F-3A0645919E3C} = {3FA74E7C-AA3C-4BE7-A1D1-05C90EF0EF4E} {9D516B83-48CC-4EDA-ACE0-BB7E75EBAD14} = {A4871F8E-B9E1-4927-8B0E-C191FD2E8A25} {3182E7A7-448E-40DE-BB22-6394E486CD26} = {3F283EB3-43A5-4B64-801A-27D8D38D8D1A} diff --git a/apps/CardHero.NetCoreApp.Mvc/.bowerrc b/apps/CardHero.NetCoreApp.Mvc/.bowerrc deleted file mode 100644 index 6406626ab..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "wwwroot/lib" -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Attributes/ChartJsAttribute.cs b/apps/CardHero.NetCoreApp.Mvc/Attributes/ChartJsAttribute.cs deleted file mode 100644 index 74de3608a..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Attributes/ChartJsAttribute.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace CardHero.NetCoreApp.Mvc.Models.ChartJs -{ - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class ChartJsAttribute : Attribute - { - public string Label { get; set; } - - public int Order { get; set; } - - public string Group { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/CardHero.NetCoreApp.Mvc.csproj b/apps/CardHero.NetCoreApp.Mvc/CardHero.NetCoreApp.Mvc.csproj deleted file mode 100644 index 2f2b85ab4..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/CardHero.NetCoreApp.Mvc.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - netcoreapp3.0 - true - $(PackageTargetFallback);portable-net45+win8+wp8+wpa81; - Kwok Kan - - Card Hero - Card Hero Net Core App Mvc. - Kwok Kan - ..\..\analyzers\stylecop.ruleset - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/CardHero.NetCoreApp.Mvc/Constants/CardHeroConstants.cs b/apps/CardHero.NetCoreApp.Mvc/Constants/CardHeroConstants.cs deleted file mode 100644 index c927fb7d0..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Constants/CardHeroConstants.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc -{ - public static class CardHeroConstants - { - public const string ApplicationName = "Card Hero"; - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/AccountController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/AccountController.cs deleted file mode 100644 index 792a972b9..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/AccountController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers -{ - public class AccountController : Controller - { - [Authorize] - public IActionResult Login() - { - if (User.Identity.IsAuthenticated) - { - return LocalRedirect("~/"); - } - - return Unauthorized(); - } - - public IActionResult Logout() - { - return new SignOutResult(new[] { "Cookies", "oidc" }); - } - } -} \ No newline at end of file diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/Api/CardsController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/Api/CardsController.cs deleted file mode 100644 index 0d968f32f..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/Api/CardsController.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.Core.Abstractions; -using CardHero.NetCoreApp.Mvc.Models; -using CardHero.NetCoreApp.Mvc.Models.ChartJs; - -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers.Api -{ - [Route("api/[controller]")] - public class CardsController : CardHeroController - { - private readonly ICardService _cardService; - - public CardsController(IUserService userService, ICardService cardService) - : base(userService) - { - _cardService = cardService; - } - - [Route("{id:int}")] - public async Task GetById(int id, string group = null, CancellationToken cancellationToken = default) - { - var filter = new CardSearchFilter - { - Ids = new[] { id }, - }; - var card = (await _cardService.GetCardsAsync(filter, cancellationToken: cancellationToken)).Results.FirstOrDefault(); - var cardModel = new CardViewModel().FromCard(card); - - var model = new ChartViewModel - { - Type = "radar", - Data = new DataViewModel - { - Labels = cardModel.GetLabels(group: group), - Datasets = new List - { - new DatasetViewModel - { - Label = "Stats", - BackgroundColor = "rgba(0, 0, 200, 0.3)", - BorderColor = "rgba(0, 0, 200, 0.5)", - PointBorderColor = "rgba(0, 0, 0, 0)", - PointHoverBackgroundColor = "rgba(0, 0, 200, 0.5)", - PointHoverBorderColor = "rgba(0, 0, 200, 0.5)", - Data = cardModel.GetData(group: group), - }, - }, - }, - Options = new OptionsViewModel - { - Scale = new ScaleViewModel - { - Ticks = new TicksViewModel - { - BeginAtZero = true, - Max = 10, - }, - }, - }, - }; - - return model; - } - - [HttpPost("favourite/{id:int}")] - [Authorize] - public async Task Favourite(int id, CancellationToken cancellationToken) - { - var user = await GetUserAsync(cancellationToken: cancellationToken); - - var result = await _cardService.ToggleFavouriteAsync(id, user.Id, cancellationToken: cancellationToken); - - return result; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/Api/DecksController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/Api/DecksController.cs deleted file mode 100644 index e00600586..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/Api/DecksController.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.Core.Abstractions; - -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers.Api -{ - [Route("api/[controller]")] - public class DecksController : CardHeroController - { - private readonly IDeckService _deckService; - - public DecksController(IUserService userService, IDeckService deckService) - : base(userService) - { - _deckService = deckService; - } - - [HttpPost("favourite/{id:int}")] - [Authorize] - public async Task FavouriteAsync(int id, CancellationToken cancellationToken) - { - var user = await GetUserAsync(cancellationToken: cancellationToken); - - var result = await _deckService.ToggleFavouriteAsync(id, user.Id, cancellationToken: cancellationToken); - - return result; - } - - [HttpPost("collection/{id:int}")] - [Authorize] - public async Task PostCollectionAsync(int id, IEnumerable cardCollectionIds, CancellationToken cancellationToken) - { - var user = await GetUserAsync(cancellationToken: cancellationToken); - - await _deckService.UpdateCollectionAsync(id, user.Id, cardCollectionIds, cancellationToken: cancellationToken); - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/Api/GameTripleTriadApiController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/Api/GameTripleTriadApiController.cs deleted file mode 100644 index 341210581..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/Api/GameTripleTriadApiController.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -using CardHero.Core.Abstractions; -using CardHero.Core.Models; -using CardHero.NetCoreApp.Mvc.Models; - -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers.Api -{ - [Route("api/games/tripletriad")] - [Authorize] - public class GameTripleTriadApiController : CardHeroController - { - private readonly IGamePlayService _gamePlayService; - - public GameTripleTriadApiController(IUserService userService, IGamePlayService gamePlayService) - : base(userService) - { - _gamePlayService = gamePlayService; - } - - [HttpPost("{id:int}/[action]")] - public async Task Move(int id, [FromBody]GameTripleTriadMoveViewModel model, CancellationToken cancellationToken) - { - var user = await GetUserAsync(cancellationToken: cancellationToken); - var move = new MoveModel - { - CardCollectionId = model.CardCollectionId.Value, - Column = model.Column.Value, - GameId = id, - Row = model.Row.Value, - UserId = user.Id, - }; - await _gamePlayService.MakeMoveAsync(move, cancellationToken: cancellationToken); - - return model; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/CardController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/CardController.cs deleted file mode 100644 index 9e31f8555..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/CardController.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.Core.Abstractions; -using CardHero.NetCoreApp.Mvc.Models; - -using KwokKan.Sortable; - -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers -{ - [Route("[controller]")] - public class CardController : CardHeroController - { - private readonly ICardService _cardService; - private readonly ISortableHelper _sortableHelper; - - public CardController(IUserService userService, ICardService cardService, ISortableHelper sortableHelper) - : base(userService) - { - _cardService = cardService; - _sortableHelper = sortableHelper; - } - - public async Task Index(CardSearchViewModel model, CancellationToken cancellationToken) - { - var filter = new CardSearchFilter - { - Page = model.Page, - PageSize = model.PageSize, - Name = model.Name, - UserId = (await GetUserAsync(cancellationToken: cancellationToken))?.Id, - }; - _sortableHelper.ApplySortable(filter, model.Sort, model.SortDir); - - var result = await _cardService.GetCardsAsync(filter, cancellationToken: cancellationToken); - - model.Cards = result.Results.Select(x => new CardViewModel().FromCard(x)); - model.Total = result.Count; - - return View(model); - } - - [Route("{id:int}")] - public async Task View(int id, CancellationToken cancellationToken) - { - var filter = new CardSearchFilter - { - Ids = new[] { id }, - UserId = (await GetUserAsync(cancellationToken: cancellationToken))?.Id, - }; - - var card = (await _cardService.GetCardsAsync(filter, cancellationToken: cancellationToken)).Results.FirstOrDefault(); - - var model = new CardViewModel().FromCard(card); - - return View(model); - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/CardHeroController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/CardHeroController.cs deleted file mode 100644 index 8a148a962..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/CardHeroController.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -using CardHero.Core.Abstractions; -using CardHero.Core.Models; - -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers -{ - public abstract class CardHeroController : Controller - { - private readonly IUserService _userService; - - public CardHeroController(IUserService userService) - { - _userService = userService; - } - - protected async Task GetUserAsync(CancellationToken cancellationToken) - { - if (User.Identity.IsAuthenticated) - { - var sub = User.FindFirst("sub")?.Value; - var idp = User.FindFirst("idp")?.Value; - - var user = await _userService.GetUserByIdentifierAsync(sub, idp, cancellationToken: cancellationToken); - - if (user == null) - { - var name = User.FindFirst("name")?.Value; - - user = await _userService.CreateUserAsync(sub, idp, name, cancellationToken: cancellationToken); - } - - return user; - } - - return null; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/DeckController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/DeckController.cs deleted file mode 100644 index d18d4c18e..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/DeckController.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.Core.Abstractions; -using CardHero.Core.Models; -using CardHero.NetCoreApp.Mvc.Extensions; -using CardHero.NetCoreApp.Mvc.Models; - -using KwokKan.Sortable; - -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers -{ - [Route("[controller]")] - [Authorize] - public class DeckController : CardHeroController - { - private readonly IDeckService _deckService; - private readonly ICardService _cardService; - private readonly ISortableHelper _sortableHelper; - - public DeckController(IUserService userService, IDeckService deckService, ICardService cardService, ISortableHelper sortableHelper) - : base(userService) - { - _deckService = deckService; - _cardService = cardService; - _sortableHelper = sortableHelper; - } - - public async Task Index(DeckSearchViewModel model, CancellationToken cancellationToken) - { - var filter = new DeckSearchFilter - { - Page = model.Page, - PageSize = model.PageSize, - Name = model.Name, - UserId = (await GetUserAsync(cancellationToken: cancellationToken))?.Id, - }; - _sortableHelper.ApplySortable(filter, model.Sort, model.SortDir); - - var result = await _deckService.GetDecksAsync(filter, cancellationToken: cancellationToken); - - model.Decks = result.Results.Select(x => new DeckViewModel().FromDeck(x)); - model.Total = result.Count; - - return View(model); - } - - [Route("{id:int}")] - public async Task View(int id, CancellationToken cancellationToken) - { - var user = await GetUserAsync(cancellationToken: cancellationToken); - var filter = new DeckSearchFilter - { - Ids = new[] { id }, - UserId = user?.Id, - }; - - var deck = (await _deckService.GetDecksAsync(filter, cancellationToken: cancellationToken)).Results.FirstOrDefault(); - var deckVm = new DeckViewModel().FromDeck(deck); - - var cardCollectionFilter = new CardCollectionSearchFilter - { - UserId = user?.Id, - }; - var cardCollection = await _cardService.GetCardCollectionAsync(cardCollectionFilter, cancellationToken: cancellationToken); - - var usedCards = deck.Cards.Select(x => new CardCollectionViewModel().FromDeckCard(x)); - var usedCardIds = usedCards.Select(x => x.CardCollectionId); - var ownedCards = cardCollection.Results.Where(x => !usedCardIds.Contains(x.Id)).Select(x => new CardCollectionViewModel().FromCardCollection(x)); - - var model = new DeckEditViewModel - { - Deck = deckVm, - OwnedCards = ownedCards, - UsedCards = usedCards, - }; - - return View(model); - } - - [Route("[action]")] - public IActionResult Create() - { - var model = new DeckCreateViewModel - { - }; - - if (Request.IsAjaxRequest()) - { - return PartialView(model); - } - - return View(model); - } - - [HttpPost("[action]")] - [ValidateAntiForgeryToken] - public async Task Create(DeckCreateViewModel model, CancellationToken cancellationToken) - { - if (ModelState.IsValid) - { - var deck = new DeckModel - { - Description = model.Description, - MaxCards = 5, - Name = model.Name, - }; - var userId = (await GetUserAsync(cancellationToken: cancellationToken)).Id; - var newDeck = await _deckService.CreateDeckAsync(deck, userId, cancellationToken: cancellationToken); - - var url = Url.Action("View", new { id = newDeck.Id }); - - return Json(new JsonViewModel - { - RedirectUrl = url, - }); - } - - return View(model); - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/GameController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/GameController.cs deleted file mode 100644 index 818fcd6ec..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/GameController.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.Core.Abstractions; -using CardHero.Core.Models; -using CardHero.NetCoreApp.Mvc.Extensions; -using CardHero.NetCoreApp.Mvc.Models; - -using KwokKan.Sortable; - -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers -{ - [Route("[controller]")] - public class GameController : CardHeroController - { - private readonly IDeckService _deckService; - private readonly IGameService _gameService; - private readonly IMoveService _moveService; - private readonly ISortableHelper _sortableHelper; - - public GameController(IUserService userService, IDeckService deckService, IGameService gameService, IMoveService moveService, ISortableHelper sortableHelper) - : base(userService) - { - _deckService = deckService; - _gameService = gameService; - _moveService = moveService; - _sortableHelper = sortableHelper; - } - - public async Task Index(GameSearchViewModel model, CancellationToken cancellationToken) - { - var filter = new GameSearchFilter - { - ActiveOnly = model.ActiveOnly, - Name = model.Name, - Page = model.Page, - PageSize = model.PageSize, - Type = model.Type, - UserId = (await GetUserAsync(cancellationToken: cancellationToken))?.Id, - }; - _sortableHelper.ApplySortable(filter, model.Sort, model.SortDir); - - var result = await _gameService.GetGamesAsync(filter, cancellationToken: cancellationToken); - - model.Games = result.Results.Select(x => new GameViewModel().FromGame(x)); - model.Total = result.Count; - - return View(model); - } - - [Route("{id:int}")] - public async Task View(int id, CancellationToken cancellationToken) - { - var filter = new GameSearchFilter - { - GameId = id, - }; - var game = (await _gameService.GetGamesAsync(filter, cancellationToken: cancellationToken)).Results.FirstOrDefault(); - var moves = await _moveService.GetMovesAsync(id, cancellationToken: cancellationToken); - - var model = new GameViewModel().FromGame(game); - var data = new GameTripleTriadViewModel - { - Columns = game.Columns, - Moves = moves.Select(x => new GameTripleTriadMoveViewModel - { - CardCollectionId = x.CardCollectionId, - Column = x.Column, - Row = x.Row, - }).ToList(), - Rows = game.Rows, - }; - model.Data = data; - - foreach (var card in model.Deck.Cards) - { - card.IsUsable = !data.Moves.Any(x => x.CardCollectionId == card.CardCollectionId); - } - - return View(model); - } - - private async Task PopulateGameCreateViewModel(GameCreateViewModel model, CancellationToken cancellationToken) - { - var filter = new DeckSearchFilter - { - }; - var decks = await _deckService.GetDecksAsync(filter, cancellationToken: cancellationToken); - - model.Decks = decks.Results.OrderBy(x => x.Name).Select(x => new DeckViewModel().FromDeck(x)).ToList(); - } - - [Route("[action]")] - public async Task Create(CancellationToken cancellationToken) - { - var model = new GameCreateViewModel - { - }; - await PopulateGameCreateViewModel(model, cancellationToken: cancellationToken); - - if (Request.IsAjaxRequest()) - { - return PartialView(model); - } - - return View(model); - } - - [HttpPost("[action]")] - [ValidateAntiForgeryToken] - public async Task Create(GameCreateViewModel model, CancellationToken cancellationToken) - { - if (ModelState.IsValid) - { - var user = await GetUserAsync(cancellationToken: cancellationToken); - var game = new GameCreateModel - { - DeckId = model.SelectedDeckId.Value, - Name = model.Name, - Type = model.Type, - Users = new UserModel[] { user }, - }; - var newGame = await _gameService.CreateGameAsync(game, cancellationToken: cancellationToken); - - var url = Url.Action("View", new { id = newGame.Id }); - - return Json(new JsonViewModel - { - RedirectUrl = url, - }); - } - - await PopulateGameCreateViewModel(model, cancellationToken: cancellationToken); - - return View(model); - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/HomeController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/HomeController.cs deleted file mode 100644 index 70ee9494f..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/HomeController.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult About() - { - ViewData["Message"] = "Your application description page."; - - return View(); - } - - public IActionResult Contact() - { - ViewData["Message"] = "Your contact page."; - - return View(); - } - - public IActionResult Error() - { - return View(); - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Controllers/ProfileController.cs b/apps/CardHero.NetCoreApp.Mvc/Controllers/ProfileController.cs deleted file mode 100644 index 2d2837c70..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Controllers/ProfileController.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -using CardHero.Core.Abstractions; - -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.Controllers -{ - [Authorize] - public class ProfileController : CardHeroController - { - public ProfileController(IUserService userService) - : base(userService) - { - } - - public async Task Index(CancellationToken cancellationToken) - { - var user = await GetUserAsync(cancellationToken: cancellationToken); - - return View(); - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Extensions/CardCollectionViewModelExtensions.cs b/apps/CardHero.NetCoreApp.Mvc/Extensions/CardCollectionViewModelExtensions.cs deleted file mode 100644 index 20b20343c..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Extensions/CardCollectionViewModelExtensions.cs +++ /dev/null @@ -1,35 +0,0 @@ -using CardHero.Core.Models; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public static class CardCollectionViewModelExtensions - { - public static CardCollectionViewModel FromCardCollection(this CardCollectionViewModel model, CardCollectionModel cardCollection) - { - if (model == null) - { - return null; - } - - model.Card = new CardViewModel().FromCard(cardCollection.Card); - - model.CardCollectionId = cardCollection.Id; - - return model; - } - - public static CardCollectionViewModel FromDeckCard(this CardCollectionViewModel model, DeckCardModel deckCard) - { - if (model == null) - { - return null; - } - - model.Card = new CardViewModel().FromCard(deckCard); - - model.CardCollectionId = deckCard.CardCollectionId; - - return model; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Extensions/CardViewModelExtensions.cs b/apps/CardHero.NetCoreApp.Mvc/Extensions/CardViewModelExtensions.cs deleted file mode 100644 index 0775c69b8..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Extensions/CardViewModelExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CardHero.Core.Models; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public static class CardViewModelExtensions - { - public static CardViewModel FromCard(this CardViewModel model, CardModel card) - { - if (model == null) - { - return null; - } - - model.Attack = card.Attack; - model.Defence = card.Defence; - model.Description = card.Description; - model.DownAttack = card.DownAttack; - model.Health = card.Health; - model.Id = card.Id; - model.LeftAttack = card.LeftAttack; - model.Name = card.Name; - model.RightAttack = card.RightAttack; - model.UpAttack = card.UpAttack; - model.TotalStats = card.TotalStats; - - model.IsFavourited = card.IsFavourited; - - return model; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Extensions/DeckViewModelExtensions.cs b/apps/CardHero.NetCoreApp.Mvc/Extensions/DeckViewModelExtensions.cs deleted file mode 100644 index 866996af0..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Extensions/DeckViewModelExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -using CardHero.Core.Models; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public static class DeckViewModelExtensions - { - public static DeckViewModel FromDeck(this DeckViewModel model, DeckModel deck) - { - if (model == null || deck == null) - { - return null; - } - - model.Cards = deck.Cards == null ? new List() : deck.Cards.Select(x => new CardCollectionViewModel().FromDeckCard(x)).ToList(); - model.Description = deck.Description; - model.Id = deck.Id; - model.MaxCards = deck.MaxCards; - model.Name = deck.Name; - - model.IsFavourited = deck.IsFavourited; - - return model; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Extensions/GameViewModelExtensions.cs b/apps/CardHero.NetCoreApp.Mvc/Extensions/GameViewModelExtensions.cs deleted file mode 100644 index d1bab4d60..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Extensions/GameViewModelExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -using CardHero.Core.Models; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public static class GameViewModelExtensions - { - public static GameViewModel FromGame(this GameViewModel model, GameModel game) - { - if (model == null) - { - return null; - } - - model.Deck = new DeckViewModel().FromDeck(game.Deck); - model.Id = game.Id; - model.Name = game.Name; - model.StartTime = game.StartTime; - model.Type = game.Type; - - return model; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Extensions/HttpRequestExtensions.cs b/apps/CardHero.NetCoreApp.Mvc/Extensions/HttpRequestExtensions.cs deleted file mode 100644 index eb94745f6..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Extensions/HttpRequestExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.AspNetCore.Http; - -namespace CardHero.NetCoreApp.Mvc.Extensions -{ - public static class HttpRequestExtensions - { - public static bool IsAjaxRequest(this HttpRequest request) - { - // messy 1 liner but it works - //return ((string)(request)?.Headers?["X-Requested-With"]) == "XMLHttpRequest"; - - if (request == null) - { - return false; - } - - if (request.Headers != null) - { - return request.Headers["X-Requested-With"] == "XMLHttpRequest"; - } - - return false; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Extensions/IChartJsExtensions.cs b/apps/CardHero.NetCoreApp.Mvc/Extensions/IChartJsExtensions.cs deleted file mode 100644 index 87edd708c..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Extensions/IChartJsExtensions.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Reflection; - -namespace CardHero.NetCoreApp.Mvc.Models.ChartJs -{ - public static class IChartJsExtensions - { - public static IEnumerable GetLabels(this IChartJs chart, string group = null) - { - if (chart == null) - { - return null; - } - - var labels = chart.GetType().GetProperties() - .Where(x => x.GetCustomAttributes().Any(a => string.IsNullOrWhiteSpace(group) || a.Group == group)) - .Select(x => - { - var ca = x.GetCustomAttribute(); - var da = x.GetCustomAttribute()?.Name; - - return new - { - Value = da ?? ca.Label ?? x.Name, - Order = ca.Order, - }; - }) - .OrderBy(x => x.Order) - .Select(x => x.Value) - .ToList(); - - return labels; - } - - public static IEnumerable GetData(this IChartJs chart, string group = null) - { - if (chart == null) - { - return null; - } - - var labels = chart.GetType().GetProperties() - .Where(x => x.GetCustomAttributes().Any(a => string.IsNullOrWhiteSpace(group) || a.Group == group)) - .Select(x => - { - var ca = x.GetCustomAttribute(); - - return new - { - Value = x.GetValue(chart, null), - Order = ca.Order, - }; - }) - .OrderBy(x => x.Order) - .Select(x => x.Value) - .ToList(); - - return labels; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Extensions/IServiceCollectionExtensions.cs b/apps/CardHero.NetCoreApp.Mvc/Extensions/IServiceCollectionExtensions.cs deleted file mode 100644 index ffecd2e7c..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Extensions/IServiceCollectionExtensions.cs +++ /dev/null @@ -1,16 +0,0 @@ -using KwokKan.Sortable; - -namespace Microsoft.Extensions.DependencyInjection -{ - public static class IServiceCollectionExtensions - { - public static IServiceCollection UseCardHeroServices(this IServiceCollection services) - { - services - .AddScoped() - ; - - return services; - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Card/CardCollectionViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Card/CardCollectionViewModel.cs deleted file mode 100644 index 988ebfe19..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Card/CardCollectionViewModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class CardCollectionViewModel - { - public int CardCollectionId { get; set; } - - public CardViewModel Card { get; set; } - - public bool IsUsable { get; set; } = true; - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Card/CardSearchViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Card/CardSearchViewModel.cs deleted file mode 100644 index e2dd6bc60..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Card/CardSearchViewModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class CardSearchViewModel : SortableViewModel - { - public string Name { get; set; } - - public IEnumerable Cards { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Card/CardViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Card/CardViewModel.cs deleted file mode 100644 index acda3cbb3..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Card/CardViewModel.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using CardHero.NetCoreApp.Mvc.Models.ChartJs; -using KwokKan.Sortable; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class CardViewModel : ISortable, IChartJs - { - private const string GroupMain = "main"; - private const string GroupSecondary = "secondary"; - - [Sortable("Default")] - public int Id { get; set; } - - [Sortable] - public string Name { get; set; } - - public string Description { get; set; } - - [Display(Name = "Up Attack")] - [ChartJs(Order = 3, Group = GroupSecondary)] - [Sortable] - public int UpAttack { get; set; } - - [Display(Name = "Right Attack")] - [ChartJs(Order = 4, Group = GroupSecondary)] - [Sortable] - public int RightAttack { get; set; } - - [Display(Name = "Down Attack")] - [ChartJs(Order = 5, Group = GroupSecondary)] - [Sortable] - public int DownAttack { get; set; } - - [Display(Name = "Left Attack")] - [ChartJs(Order = 6, Group = GroupSecondary)] - [Sortable] - public int LeftAttack { get; set; } - - [ChartJs(Order = 0, Group = GroupMain)] - [Sortable] - public int Health { get; set; } - - [ChartJs(Order = 1, Group = GroupMain)] - [Sortable] - public int Attack { get; set; } - - [ChartJs(Order = 2, Group = GroupMain)] - [Sortable] - public int Defence { get; set; } - - [Display(Name = "Total Stats")] - [Sortable] - public int TotalStats { get; set; } - - [Display(Name = "Is Favourited")] - public bool IsFavourited { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/ChartViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/ChartViewModel.cs deleted file mode 100644 index b9485ce53..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/ChartViewModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc.Models.ChartJs -{ - public class ChartViewModel - { - public string Type { get; set; } - - public DataViewModel Data { get; set; } - - public OptionsViewModel Options { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/DataViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/DataViewModel.cs deleted file mode 100644 index b083eb37f..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/DataViewModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace CardHero.NetCoreApp.Mvc.Models.ChartJs -{ - public class DataViewModel - { - public IEnumerable Labels { get; set; } - - public List Datasets { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/DatasetViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/DatasetViewModel.cs deleted file mode 100644 index 95d0835ad..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/DatasetViewModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; - -namespace CardHero.NetCoreApp.Mvc.Models.ChartJs -{ - public class DatasetViewModel - { - public string Label { get; set; } - - public string BackgroundColor { get; set; } - - public string BorderColor { get; set; } - - public string PointBorderColor { get; set; } - - public string PointHoverBackgroundColor { get; set; } - - public string PointHoverBorderColor { get; set; } - - public IEnumerable Data { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/IChartJs.cs b/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/IChartJs.cs deleted file mode 100644 index 7ae2f677b..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/IChartJs.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc.Models.ChartJs -{ - public interface IChartJs - { - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/OptionsViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/OptionsViewModel.cs deleted file mode 100644 index eba0a3dd9..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/OptionsViewModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc.Models.ChartJs -{ - public class OptionsViewModel - { - public ScaleViewModel Scale { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/ScaleViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/ScaleViewModel.cs deleted file mode 100644 index ff5ce3f6f..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/ScaleViewModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc.Models.ChartJs -{ - public class ScaleViewModel - { - public TicksViewModel Ticks { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/TicksViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/TicksViewModel.cs deleted file mode 100644 index e15f7a7c8..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/ChartJs/TicksViewModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc.Models.ChartJs -{ - public class TicksViewModel - { - public bool BeginAtZero { get; set; } - - public int Max { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckCreateViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckCreateViewModel.cs deleted file mode 100644 index 2da926b81..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckCreateViewModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class DeckCreateViewModel - { - public string Name { get; set; } - - public string Description { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckEditViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckEditViewModel.cs deleted file mode 100644 index 160ccf84c..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckEditViewModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class DeckEditViewModel - { - public DeckViewModel Deck { get; set; } - - public CardSearchViewModel OwnedCardSearch { get; set; } - - public IEnumerable OwnedCards { get; set; } - - public IEnumerable UsedCards { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckSearchViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckSearchViewModel.cs deleted file mode 100644 index 91f46616e..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckSearchViewModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class DeckSearchViewModel : SortableViewModel - { - public string Name { get; set; } - - public IEnumerable Decks { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckViewModel.cs deleted file mode 100644 index 960d9a54a..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Deck/DeckViewModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using KwokKan.Sortable; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class DeckViewModel : ISortable - { - [Sortable("Default")] - public int Id { get; set; } - - [Sortable] - public string Name { get; set; } - - public string Description { get; set; } - - [Display(Name = "Max Cards")] - public int MaxCards { get; set; } - - [Display(Name = "Is Favourited")] - public bool IsFavourited { get; set; } - - public IEnumerable Cards { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Game/GameCreateViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Game/GameCreateViewModel.cs deleted file mode 100644 index a27293331..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Game/GameCreateViewModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class GameCreateViewModel - { - public string Name { get; set; } - - public CardHero.Core.Models.GameType Type { get; set; } - - [Required] - public int? SelectedDeckId { get; set; } - - public IEnumerable Decks { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Game/GameSearchViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Game/GameSearchViewModel.cs deleted file mode 100644 index 4b18d5709..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Game/GameSearchViewModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class GameSearchViewModel : SortableViewModel - { - [Display(Name = "Created Date")] - public DateTime CreatedDate { get; set; } - - [Display(Name = "Active Only")] - public bool ActiveOnly { get; set; } - - public string Name { get; set; } - - public CardHero.Core.Models.GameType? Type { get; set; } - - public IEnumerable Games { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Game/GameViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Game/GameViewModel.cs deleted file mode 100644 index 954a02e09..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Game/GameViewModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using KwokKan.Sortable; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class GameViewModel : ISortable - { - [Sortable("Default")] - public int Id { get; set; } - - [Sortable] - public string Name { get; set; } - - [Display(Name = "Start Time")] - [Sortable] - public DateTime StartTime { get; set; } - - [Sortable] - public CardHero.Core.Models.GameType Type { get; set; } - - public DeckViewModel Deck { get; set; } - - public object Data { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Game/TripleTriad/GameTripleTriadMoveViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Game/TripleTriad/GameTripleTriadMoveViewModel.cs deleted file mode 100644 index d5672cd27..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Game/TripleTriad/GameTripleTriadMoveViewModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class GameTripleTriadMoveViewModel - { - public int? Row { get; set; } - - public int? Column { get; set; } - - public int? CardCollectionId { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/Game/TripleTriad/GameTripleTriadViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/Game/TripleTriad/GameTripleTriadViewModel.cs deleted file mode 100644 index baecdb522..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/Game/TripleTriad/GameTripleTriadViewModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class GameTripleTriadViewModel - { - public int Columns { get; set; } - - public int Rows { get; set; } - - public IEnumerable Moves { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/JsonViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/JsonViewModel.cs deleted file mode 100644 index 4a0733da1..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/JsonViewModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class JsonViewModel - { - public string Status { get; set; } - - public string RedirectUrl { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Models/SortableViewModel.cs b/apps/CardHero.NetCoreApp.Mvc/Models/SortableViewModel.cs deleted file mode 100644 index 95a26d0d3..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Models/SortableViewModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc.Rendering; - -namespace CardHero.NetCoreApp.Mvc.Models -{ - public class SortableViewModel - { - public int Page { get; set; } = 0; - - public int PageSize { get; set; } = 10; - - public IEnumerable PageSizes { get; set; } = new List - { - new SelectListItem { Text = "10" }, - new SelectListItem { Text = "25" }, - new SelectListItem { Text = "50" }, - new SelectListItem { Text = "100" }, - }; - - public int Total { get; set; } - - public string Sort { get; set; } - - public string SortDir { get; set; } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Program.cs b/apps/CardHero.NetCoreApp.Mvc/Program.cs deleted file mode 100644 index a09728767..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Program.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace CardHero.NetCoreApp.Mvc -{ - public class Program - { - //public static void Main(string[] args) - //{ - // var host = new WebHostBuilder() - // .UseUrls("http://*:51000") - // .UseKestrel(x => - // { - // x.AddServerHeader = false; - // x.Limits.KeepAliveTimeout = TimeSpan.FromSeconds(5); - // }) - // .UseContentRoot(Directory.GetCurrentDirectory()) - // .UseIISIntegration() - // .UseStartup() - // .UseApplicationInsights() - // .Build(); - - // host.Run(); - //} - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - webBuilder.UseApplicationInsights(); - }); - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Properties/launchSettings.json b/apps/CardHero.NetCoreApp.Mvc/Properties/launchSettings.json deleted file mode 100644 index 76b44e717..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Properties/launchSettings.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:51000/", - "sslPort": 44351 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "CardHero.Mvc": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:65116" - } - } -} \ No newline at end of file diff --git a/apps/CardHero.NetCoreApp.Mvc/Startup.cs b/apps/CardHero.NetCoreApp.Mvc/Startup.cs deleted file mode 100644 index de4bba61e..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Startup.cs +++ /dev/null @@ -1,188 +0,0 @@ -using System.IdentityModel.Tokens.Jwt; -using System.Text.Json; -using System.Threading.Tasks; - -using CardHero.Core.SqlServer.Web; - -using KwokKan.Options; - -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -using WebMarkupMin.AspNetCore3; - -namespace CardHero.NetCoreApp.Mvc -{ - public class Startup - { - private readonly KwokKanOptions _options; - - public Startup(IWebHostEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) - .AddEnvironmentVariables(); - Configuration = builder.Build(); - - _options = Configuration.GetSection("KwokKan").Get(); - } - - public IConfigurationRoot Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - var kkidOptions = _options.Identity; - - services.AddLogging(x => - { - x.AddConfiguration(Configuration.GetSection("Logging")); - x.AddConsole(); - x.AddDebug(); - }); - - services - .AddAuthentication(x => - { - x.DefaultScheme = "oidc"; - }) - .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme) - .AddOpenIdConnect("oidc", x => - { - x.Authority = kkidOptions.Authority; - x.ClientId = kkidOptions.ClientId; - x.ClientSecret = kkidOptions.ClientSecret; - x.Events = new Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectEvents - { - OnRedirectToIdentityProvider = (context) => - { - var absoluteBaseUri = string.Format( - "{0}://{1}{2}", - context.Request.Scheme, - context.Request.Host, - context.Request.PathBase.HasValue ? "/" + context.Request.PathBase : string.Empty - ); - var absoluteRedirectUri = $"{ absoluteBaseUri }/Account/Login"; - - if (context.Request.Path == "/Account/Login" && context.Properties.RedirectUri == absoluteRedirectUri) - { - var referer = (string)context.Request.Headers["Referer"]; - - if (referer != null && referer.StartsWith(absoluteBaseUri + "/")) - { - context.Properties.RedirectUri = referer; - } - } - - return Task.CompletedTask; - }, - }; - x.GetClaimsFromUserInfoEndpoint = true; - x.ResponseType = "code id_token token"; - x.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; - x.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters - { - NameClaimType = "name", - RoleClaimType = "role", - }; - - if (kkidOptions.Scopes != null) - { - foreach (var scope in kkidOptions.Scopes) - { - x.Scope.Add(scope); - } - } - }) - ; - - // Add framework services. - services - .AddControllersWithViews() - .AddJsonOptions(x => - { - x.JsonSerializerOptions.IgnoreNullValues = true; - x.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; - }) - ; - - services - .AddWebMarkupMin(x => - { - x.AllowCompressionInDevelopmentEnvironment = true; - x.AllowMinificationInDevelopmentEnvironment = true; - x.DisablePoweredByHttpHeaders = true; - }) - .AddHtmlMinification(x => - { - x.MinificationSettings.AttributeQuotesRemovalMode = WebMarkupMin.Core.HtmlAttributeQuotesRemovalMode.KeepQuotes; - x.MinificationSettings.EmptyTagRenderMode = WebMarkupMin.Core.HtmlEmptyTagRenderMode.Slash; - x.MinificationSettings.MinifyEmbeddedCssCode = true; - x.MinificationSettings.MinifyEmbeddedJsCode = true; - x.MinificationSettings.MinifyEmbeddedJsonData = true; - x.MinificationSettings.MinifyInlineCssCode = true; - x.MinificationSettings.MinifyInlineJsCode = true; - x.MinificationSettings.RemoveEmptyAttributes = true; - x.MinificationSettings.RemoveHtmlComments = true; - x.MinificationSettings.RemoveHtmlCommentsFromScriptsAndStyles = true; - x.MinificationSettings.RemoveOptionalEndTags = false; - x.MinificationSettings.WhitespaceMinificationMode = WebMarkupMin.Core.WhitespaceMinificationMode.Aggressive; - - x.SupportedHttpMethods.Add("POST"); - }) - ; - - services.AddCardHeroDataSqlServer(Configuration); - - services.AddCardHeroSqlServerDbContext(Configuration); - - services.ConfigureTagHelpers(Configuration); - - services.Configure(options => - { - options.BaseUrl = _options.Cdn.BaseUrl; - }); - - services.UseCardHeroServices(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - app.UseBrowserLink(); - } - else - { - app.UseExceptionHandler("/Home/Error"); - } - - app.UseStaticFiles(); - - app.UseRouting(); - - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); - - app - .UseAuthentication() - .UseAuthorization() - ; - - app.UseWebMarkupMin(); - - app.UseEndpoints(x => - { - x.MapDefaultControllerRoute(); - }); - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/ViewComponents/MenuViewComponent.cs b/apps/CardHero.NetCoreApp.Mvc/ViewComponents/MenuViewComponent.cs deleted file mode 100644 index 8e899e46e..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/ViewComponents/MenuViewComponent.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.NetCoreApp.Mvc.ViewComponents -{ - public class MenuViewComponent : ViewComponent - { - public Task InvokeAsync() - { - var model = new MenuViewComponentModel - { - }; - - return Task.FromResult(View(model)); - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/ViewComponents/MenuViewComponentModel.cs b/apps/CardHero.NetCoreApp.Mvc/ViewComponents/MenuViewComponentModel.cs deleted file mode 100644 index d1aabf9d2..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/ViewComponents/MenuViewComponentModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace CardHero.NetCoreApp.Mvc.ViewComponents -{ - public class MenuViewComponentModel - { - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Card/Index.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Card/Index.cshtml deleted file mode 100644 index 4a6d79cbf..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Card/Index.cshtml +++ /dev/null @@ -1,86 +0,0 @@ -@model CardSearchViewModel - -@{ - ViewData["Title"] = "Cards"; - - var isAuthenticated = User.Identity.IsAuthenticated; -} - -@section sideContent { -
-

- @ViewData["Title"] -

- -
-
-
- @Html.TextBoxFor(x => x.Name, new { @class = "form-control", placeholder = Html.DisplayNameFor(x => x.Name) }) -
- -
- @Html.SortableDropDownList(typeof(CardViewModel), htmlAttributes: new { @class = "form-control" }, selectedValue: Model.Sort) -
- -
- @Html.SortableDirectionDropDownList(htmlAttributes: new { @class = "form-control" }, selectedValue: Model.SortDir) -
- -
- @Html.DropDownList(nameof(Model.PageSize), Model.PageSizes, new { @class = "form-control", selected = Model.PageSize }) -
-
- - -
-
-} - -
- - - - - - - - - - - - - - - - @foreach (var card in Model.Cards) - { - - - - - - - - - - - - } - -
NameHealthAttackDefenceUp AttackDown AttackLeft AttackRight AttackTotal Stats
- @if (isAuthenticated) - { - - } - - @card.Name - @card.Health@card.Attack@card.Defence@card.UpAttack@card.DownAttack@card.LeftAttack@card.RightAttack@card.TotalStats
-
- -@section scripts { - -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Card/View.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Card/View.cshtml deleted file mode 100644 index b02493c71..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Card/View.cshtml +++ /dev/null @@ -1,86 +0,0 @@ -@model CardViewModel - -@{ - ViewData["Title"] = Model.Name; - - var isAuthenticated = User.Identity.IsAuthenticated; -} - -
-
-
-
-

- @Model.Name - - @if (isAuthenticated) - { - - } -

-

@Model.Description

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Stats
@Html.DisplayNameFor(x => x.Health)@Model.Health
@Html.DisplayNameFor(x => x.Attack)@Model.Attack
@Html.DisplayNameFor(x => x.Defence)@Model.Defence
@Html.DisplayNameFor(x => x.UpAttack)@Model.UpAttack
@Html.DisplayNameFor(x => x.RightAttack)@Model.RightAttack
@Html.DisplayNameFor(x => x.DownAttack)@Model.DownAttack
@Html.DisplayNameFor(x => x.LeftAttack)@Model.LeftAttack
@Html.DisplayNameFor(x => x.TotalStats)@Model.TotalStats
-
-
-
- -
- -
- -
- -
-
- -@section scripts { - - -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Deck/Create.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Deck/Create.cshtml deleted file mode 100644 index cb18cc103..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Deck/Create.cshtml +++ /dev/null @@ -1,21 +0,0 @@ -@model DeckCreateViewModel - -@{ - ViewData["Title"] = "Create"; -} - -
-
-
-
- @Html.LabelFor(x => x.Name) - @Html.TextBoxFor(x => x.Name, new { @class = "form-control", placeholder = Html.DisplayNameFor(x => x.Name) }) -
- -
- @Html.LabelFor(x => x.Description) - @Html.TextBoxFor(x => x.Description, new { @class = "form-control", placeholder = Html.DisplayNameFor(x => x.Description) }) -
-
-
-
diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Deck/Index.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Deck/Index.cshtml deleted file mode 100644 index 33c94cd02..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Deck/Index.cshtml +++ /dev/null @@ -1,67 +0,0 @@ -@model DeckSearchViewModel - -@{ - ViewData["Title"] = "Decks"; -} - -@section sideContent { -
-

- @ViewData["Title"] -

- -
-
-
- @Html.TextBoxFor(x => x.Name, new { @class = "form-control", placeholder = Html.DisplayNameFor(x => x.Name) }) -
- -
- @Html.SortableDropDownList(typeof(DeckViewModel), htmlAttributes: new { @class = "form-control" }, selectedValue: Model.Sort) -
- -
- @Html.SortableDirectionDropDownList(htmlAttributes: new { @class = "form-control" }, selectedValue: Model.SortDir) -
- -
- @Html.DropDownList(nameof(Model.PageSize), Model.PageSizes, new { @class = "form-control", selected = Model.PageSize }) -
- -
- - -
-
-} - -
- - - - - - - - @foreach (var deck in Model.Decks) - { - - - - } - -
Name
- - - @deck.Name -
-
- -@section scripts { - -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Deck/View.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Deck/View.cshtml deleted file mode 100644 index 0a66f3de2..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Deck/View.cshtml +++ /dev/null @@ -1,68 +0,0 @@ -@model DeckEditViewModel - -@{ - ViewData["Title"] = Model.Deck.Name; - - var deckVm = Model.Deck; -} - -
-
-
-
-

- @deckVm.Name - -

-

@deckVm.Description

-
- -
-
- -
-
-
-

- Owned Cards -

-

-

    - @foreach (var owned in Model.OwnedCards) - { -
  • @owned.Card.Name
  • - } -
-

-
-
-
- -
-
-
-

- Current Deck -

-

-

    - @foreach (var used in Model.UsedCards) - { -
  • @used.Card.Name
  • - } -
-

-
-
-
-
- -@section scripts { - - - - - -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Game/Create.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Game/Create.cshtml deleted file mode 100644 index c7c82e1e4..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Game/Create.cshtml +++ /dev/null @@ -1,26 +0,0 @@ -@model GameCreateViewModel - -@{ - ViewData["Title"] = "Create"; -} - -
-
-
-
- @Html.LabelFor(x => x.Name) - @Html.TextBoxFor(x => x.Name, new { @class = "form-control", placeholder = Html.DisplayNameFor(x => x.Name) }) -
- -
- @Html.LabelFor(x => x.Type) - @Html.DropDownListFor(x => x.Type, Html.GetEnumSelectList(), new { @class = "form-control" }) -
- -
- @Html.LabelFor(x => x.Decks) - @Html.DropDownListFor(x => x.SelectedDeckId, Model.Decks.Select(d => new SelectListItem { Text = d.Name, Value = d.Id.ToString() }), "N/A", new { @class = "form-control" }) -
-
-
-
diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Game/Index.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Game/Index.cshtml deleted file mode 100644 index 1b44db1b7..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Game/Index.cshtml +++ /dev/null @@ -1,90 +0,0 @@ -@model GameSearchViewModel - -@{ - ViewData["Title"] = "Games"; - - var isAuthenticated = User.Identity.IsAuthenticated; -} - -@section sideContent { -
-

- @ViewData["Title"] -

- -
-
-
- @Html.TextBoxFor(x => x.Name, new { @class = "form-control", placeholder = Html.DisplayNameFor(x => x.Name) }) -
- -
- @Html.DropDownListFor(x => x.Type, Html.GetEnumSelectList(), "N/A", new { @class = "form-control" }) -
- -
- -
- -
- @Html.SortableDropDownList(typeof(GameViewModel), htmlAttributes: new { @class = "form-control" }, selectedValue: Model.Sort) -
- -
- @Html.SortableDirectionDropDownList(htmlAttributes: new { @class = "form-control" }, selectedValue: Model.SortDir) -
- -
- @Html.DropDownList(nameof(Model.PageSize), Model.PageSizes, new { @class = "form-control", selected = Model.PageSize }) -
-
- - -
-
-} - -
- - - - - - - - - - @foreach (var game in Model.Games) - { - - - - - - } - -
GameStart TimeType
- - #@game.Id @game.Name - - - @game.StartTime - - @game.Type -
-
- diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Game/View.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Game/View.cshtml deleted file mode 100644 index 23b2afeb1..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Game/View.cshtml +++ /dev/null @@ -1,73 +0,0 @@ -@model GameViewModel - -@{ - ViewData["Title"] = $"#{ Model.Id } { Model.Name }"; - - var gameType = Model.Type.ToString().ToLower(); -} - -
-
-
-

- @ViewData["Title"] -

-
-
-
- @Html.DisplayNameFor(x => x.Type): - @Model.Type -
-
- @Html.DisplayNameFor(x => x.StartTime): - @Model.StartTime -
-
-
-
- -
-

- History -

-
-
-
-
    -
  • Game Started at @Model.StartTime
  • -
-
-
-
-
-
- -
-
- @await Html.PartialAsync("_View" + Model.Type.ToString()) -
-
- -
-
-

- You -

-
-
-
    - @foreach (var card in Model.Deck.Cards) - { -
  • @card.Card.Name
  • - } -
-
-
-
-
-
- -@section scripts { - - -} diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Game/_ViewTripleTriad.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Game/_ViewTripleTriad.cshtml deleted file mode 100644 index 987c70b35..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Game/_ViewTripleTriad.cshtml +++ /dev/null @@ -1,40 +0,0 @@ -@model GameViewModel - -@functions { - private GameTripleTriadViewModel data; - - bool IsSelected(int row, int column) - { - return data.Moves.Any(x => x.Row == row && x.Column == column); - } - - int? GetCardCollectionId(int row, int column) { - return data.Moves.FirstOrDefault(x => x.Row == row && x.Column == column)?.CardCollectionId; - } - - string GetCardCollectionName(int? cardCollectionId) - { - return Model.Deck.Cards.FirstOrDefault(x => x.CardCollectionId == cardCollectionId)?.Card.Name; - } -} - -@{ - data = Model.Data as GameTripleTriadViewModel; -} - -
-
- @for (int i = 0; i < data.Rows; i++) - { - @for (int j = 0; j < data.Columns; j++) - { - var cardCollectionId = GetCardCollectionId(i, j); -
-
- @GetCardCollectionName(cardCollectionId) -
-
- } - } -
-
diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Home/About.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Home/About.cshtml deleted file mode 100644 index 50476d1fb..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Home/About.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewData["Title"] = "About"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -

Use this area to provide additional information.

diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Home/Contact.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Home/Contact.cshtml deleted file mode 100644 index 15c12c6d1..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Home/Contact.cshtml +++ /dev/null @@ -1,17 +0,0 @@ -@{ - ViewData["Title"] = "Contact"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -
- One Microsoft Way
- Redmond, WA 98052-6399
- P: - 425.555.0100 -
- -
- Support: Support@example.com
- Marketing: Marketing@example.com -
diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Home/Index.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Home/Index.cshtml deleted file mode 100644 index de3531d45..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Home/Index.cshtml +++ /dev/null @@ -1,40 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -
-

@CardHeroConstants.ApplicationName

-

@CardHeroConstants.ApplicationName is a dynamic action game.

-
- -
-
-
-
-

Cards

-

Discover over 1000 cards.

- View Cards -
-
-
- -
-
-
-

Decks

-

Create you own decks.

- View Decks -
-
-
- -
-
-
-

Battle

-

Battle against other players.

- View Games -
-
-
-
diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Profile/Index.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Profile/Index.cshtml deleted file mode 100644 index 18b7d5a42..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Profile/Index.cshtml +++ /dev/null @@ -1,23 +0,0 @@ - -@{ - ViewData["Title"] = "Profile"; -} - -

Profile

- -@foreach (var identity in User.Identities) -{ -
-

@identity.Name

-

@identity.NameClaimType

-

@identity.RoleClaimType

- - @foreach (var claim in identity.Claims) - { -
- @claim.Type - @claim.Value -
- } -
-} diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Shared/Components/Menu/Default.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Shared/Components/Menu/Default.cshtml deleted file mode 100644 index c4027a483..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Shared/Components/Menu/Default.cshtml +++ /dev/null @@ -1,63 +0,0 @@ -@model MenuViewComponentModel - -@{ - var isAuthenticated = User.Identity.IsAuthenticated; -} - - diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Shared/Error.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Shared/Error.cshtml deleted file mode 100644 index e514139c4..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Shared/Error.cshtml +++ /dev/null @@ -1,14 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

Error.

-

An error occurred while processing your request.

- -

Development Mode

-

- Swapping to Development environment will display more detailed information about the error that occurred. -

-

- 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. -

diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Shared/_Layout.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Shared/_Layout.cshtml deleted file mode 100644 index 8e8b8c6ee..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,82 +0,0 @@ -@inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet - - - - - - - - - @ViewData["Title"] - @CardHeroConstants.ApplicationName - - - @*@Html.CdnStyle("~/nodelib/tether/1.3.7/css/tether.css", true) - @Html.CdnStyle("~/nodelib/tether/1.3.7/css/tether-theme-arrows.css", true) - @Html.CdnStyle("~/nodelib/bootstrap/4.0.0-alpha.6/css/bootstrap.css", true) - @Html.CdnStyle("~/lib/font-awesome/css/font-awesome.css", true) - @Html.CdnStyle("~/css/site.css", true)*@ - @**@ - @**@ - - - - - - - @Html.Raw(JavaScriptSnippet.FullScript) - - @await RenderSectionAsync("styles", false) - - - @*@{ await FlushAsync(); }*@ - @await Component.InvokeAsync(typeof(MenuViewComponent)) - -
- @{ - var hasSideContent = IsSectionDefined("sideContent"); - var mainCol = hasSideContent ? 10 : 12; - } - -
- @if (hasSideContent) - { -
- @RenderSection("sideContent") -
- } - -
- @RenderBody() -
-
-
- - -
-
- -
-

© 2017 - @CardHeroConstants.ApplicationName

-
-
-
- -
- - @*@Html.CdnScript("~/lib/jquery/dist/jquery.js", true) - @Html.CdnScript("~/nodelib/tether/1.3.7/js/tether.js", true) - @Html.CdnScript("~/nodelib/bootstrap/4.0.0-alpha.6/js/bootstrap.js", true) - @Html.CdnScript("~/lib/moment/moment.js", true)*@ - - - - - @**@ - - - - - @RenderSection("scripts", required: false) -
- - diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml deleted file mode 100644 index 27e0ea7ce..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/_ViewImports.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/_ViewImports.cshtml deleted file mode 100644 index 7dd525135..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/_ViewImports.cshtml +++ /dev/null @@ -1,9 +0,0 @@ -@using CardHero.NetCoreApp.Mvc -@using CardHero.NetCoreApp.Mvc.Extensions -@using CardHero.NetCoreApp.Mvc.Models -@using CardHero.NetCoreApp.Mvc.ViewComponents -@using KwokKan.AspNetCore.Mvc.Sortable - -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, KwokKan.Cdn.AspNetCore.Mvc.TagHelpers -@addTagHelper *, TripleTriad.Mvc.TagHelpers diff --git a/apps/CardHero.NetCoreApp.Mvc/Views/_ViewStart.cshtml b/apps/CardHero.NetCoreApp.Mvc/Views/_ViewStart.cshtml deleted file mode 100644 index a5f10045d..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/apps/CardHero.NetCoreApp.Mvc/appsettings.Development.json b/apps/CardHero.NetCoreApp.Mvc/appsettings.Development.json deleted file mode 100644 index fa8ce71a9..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/appsettings.Development.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/appsettings.json b/apps/CardHero.NetCoreApp.Mvc/appsettings.json deleted file mode 100644 index d72361655..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/appsettings.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Assets": { - "BaseUrl": "https://tt-assets.local.kkstatic.com/" - }, - "ConnectionStrings": { - "CardHeroSqlServerConnection": "Server=.\\SQLDEV2016;Database=CardHero;User Id=CardHeroUser;Password=password;MultipleActiveResultSets=true" - }, - "KwokKan": { - "Cdn": { - "BaseUrl": "https://cdn.local.kkstatic.com/" - }, - "Identity": { - "Authority": "https://identity.local.kwokkan.com/", - "ClientId": "cardhero-web", - "ClientSecret": "password", - "Scopes": [ - "openid", - "profile", - "offline_access" - ] - } - }, - "Defaults": { - "NewUser": { - "Coins": 10000 - } - }, - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Warning" - } - } -} diff --git a/apps/CardHero.NetCoreApp.Mvc/bower.json b/apps/CardHero.NetCoreApp.Mvc/bower.json deleted file mode 100644 index 07215a161..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/bower.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "asp.net", - "private": true, - "dependencies": {} -} diff --git a/apps/CardHero.NetCoreApp.Mvc/bundleconfig.json b/apps/CardHero.NetCoreApp.Mvc/bundleconfig.json deleted file mode 100644 index db22d9773..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/bundleconfig.json +++ /dev/null @@ -1,98 +0,0 @@ -// Configure bundling and minification for the project. -// More info at https://go.microsoft.com/fwlink/?LinkId=808241 -[ - { - "outputFileName": "wwwroot/modules/core/_.min.css", - // An array of relative input file paths. Globbing patterns supported - "inputFiles": [ - "wwwroot/css/site.css" - ] - }, - { - "outputFileName": "wwwroot/modules/core/_.min.js", - "inputFiles": [ - "wwwroot/js/_ns.js", - "wwwroot/js/site.js" - ], - // Optionally specify minification options - "minify": { - "enabled": true, - "renameLocals": true - }, - // Optionally generate .map file - "sourceMap": false - }, - { - "outputFileName": "wwwroot/modules/cards/_.min.js", - "inputFiles": [ - "wwwroot/js/cards/[!_]*.js", - "wwwroot/js/cards/_init.js" - ], - // Optionally specify minification options - "minify": { - "enabled": true, - "renameLocals": true - }, - // Optionally generate .map file - "sourceMap": false - }, - { - "outputFileName": "wwwroot/modules/charts/_.min.js", - "inputFiles": [ - "wwwroot/js/charts/[!_]*.js", - "wwwroot/js/charts/_init.js" - ], - // Optionally specify minification options - "minify": { - "enabled": true, - "renameLocals": true - }, - // Optionally generate .map file - "sourceMap": false - }, - { - "outputFileName": "wwwroot/modules/decks/_.min.js", - "inputFiles": [ - "wwwroot/js/decks/_ns.js", - "wwwroot/js/decks/[!_]*.js", - "wwwroot/js/decks/_init.js" - ], - // Optionally specify minification options - "minify": { - "enabled": true, - "renameLocals": true - }, - // Optionally generate .map file - "sourceMap": false - }, - { - "outputFileName": "wwwroot/modules/games/tripletriad/_.min.js", - "inputFiles": [ - "wwwroot/js/games/tripletriad/_ns.js", - "wwwroot/js/games/tripletriad/[!_]*.js", - "wwwroot/js/games/tripletriad/_init.js" - ], - // Optionally specify minification options - "minify": { - "enabled": true, - "renameLocals": true - }, - // Optionally generate .map file - "sourceMap": false - }, - { - "outputFileName": "wwwroot/modules/modals/_.min.js", - "inputFiles": [ - "wwwroot/js/modals/_ns.js", - "wwwroot/js/modals/[!_]*.js", - "wwwroot/js/modals/_init.js" - ], - // Optionally specify minification options - "minify": { - "enabled": true, - "renameLocals": true - }, - // Optionally generate .map file - "sourceMap": false - } -] diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/css/site.css b/apps/CardHero.NetCoreApp.Mvc/wwwroot/css/site.css deleted file mode 100644 index 41d7e12d6..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/wwwroot/css/site.css +++ /dev/null @@ -1,65 +0,0 @@ -body { - overflow-y: scroll; -} - -/* Wrapping element */ -/* Set some basic padding to keep content from hitting the edges */ -.body-content { - margin-top: 4.5rem; -} - -.card { - margin-bottom: 1em; -} - -.card-favourite, -.deck-favourite { - cursor: pointer; -} - - .card-favourite.enabled, - .deck-favourite.enabled { - color: yellow; - } - -.game-cards.playable .game-card:hover { - cursor: pointer; -} - -.game-cards.playable .game-card.selected:hover { - cursor: no-drop; -} - -.ch-cards { - min-height: 1em; -} - -.ch-card { - list-style: none; - border: 1px solid black; - padding: 5px; - margin-bottom: 5px; -} - -.ch-cards .ch-card .card-body:empty:after { - content: "\00a0"; -} - -.current-card { - cursor: pointer; -} - - .current-card.disabled { - cursor: not-allowed; - } - -.draggable { - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - user-select: none; - /* Required to make elements draggable in old WebKit */ - -khtml-user-drag: element; - -webkit-user-drag: element; - cursor: move; -} diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/favicon.ico b/apps/CardHero.NetCoreApp.Mvc/wwwroot/favicon.ico deleted file mode 100644 index a3a799985c43bc7309d701b2cad129023377dc71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32038 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 - -`; - - var bindShown = function () { - var buttonSelector = '.modal-footer .btn-primary'; - modalSelector.find(buttonSelector).off('click').on('click', function () { - var autoPostForm = modalSelector.find('form.auto-post'); - - if (autoPostForm.length > 0) { - $.ajax({ - url: autoPostForm.attr('action'), - method: autoPostForm.attr('method'), - data: autoPostForm.serialize() - }) - .done(function (data, textStatus, jqXHR) { - if (typeof (data) == 'object' && data.redirectUrl) { - window.location = data.redirectUrl; - } - - modalSelector.hide(); - }); - } - }); - }; - - var initModal = function () { - $('#' + modalId).remove(); - $('body').append(modalHtmlString); - modalSelector = $('#' + modalId); - - modalSelector.on('shown.bs.modal', bindShown); - }; - - var bindHidden = function () { - }; - - $modal.show = function (content, title) { - initModal(); - - modalSelector.find('.modal-body').append(content); - modalSelector.find('.modal-title').text(title); - modalSelector.modal(); - }; -})(window.cardhero.modal); diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/js/site.js b/apps/CardHero.NetCoreApp.Mvc/wwwroot/js/site.js deleted file mode 100644 index 82ecce7b4..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/wwwroot/js/site.js +++ /dev/null @@ -1 +0,0 @@ -// Write your Javascript code. diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/cards/_.min.js b/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/cards/_.min.js deleted file mode 100644 index 1edafca66..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/cards/_.min.js +++ /dev/null @@ -1 +0,0 @@ -$(document).on("click",".card-favourite",function(){var n=$(this);$.ajax({url:cardhero.baseUrl+"api/Cards/Favourite/"+n.attr("data-card-id"),method:"POST"}).done(function(t){t?n.addClass("enabled"):n.removeClass("enabled")})}); \ No newline at end of file diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/charts/_.min.js b/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/charts/_.min.js deleted file mode 100644 index 939823230..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/charts/_.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(n,t){var i={render:function(n){var t=n.getContext("2d"),i=$(n);t&&$.ajax(i.attr("data-chart-js-url"),{data:{group:i.attr("data-chart-js-group")},dataType:"json"}).done(function(n){var i=new Chart(t,n)})}};t.charts=i})(window,cardhero);$(function(){$(".chart-js").each(function(n,t){cardhero.charts.render(t)})}); \ No newline at end of file diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/core/_.min.css b/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/core/_.min.css deleted file mode 100644 index 0be8208dc..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/core/_.min.css +++ /dev/null @@ -1 +0,0 @@ -body{overflow-y:scroll}.body-content{margin-top:4.5rem}.card{margin-bottom:1em}.card-favourite,.deck-favourite{cursor:pointer}.card-favourite.enabled,.deck-favourite.enabled{color:#ff0}.game-cards.playable .game-card:hover{cursor:pointer}.game-cards.playable .game-card.selected:hover{cursor:no-drop}.ch-cards{min-height:1em}.ch-card{list-style:none;border:1px solid #000;padding:5px;margin-bottom:5px}.ch-cards .ch-card .card-body:empty:after{content:" "}.current-card{cursor:pointer}.current-card.disabled{cursor:not-allowed}.draggable{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;user-select:none;-khtml-user-drag:element;-webkit-user-drag:element;cursor:move} \ No newline at end of file diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/core/_.min.js b/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/core/_.min.js deleted file mode 100644 index b6bf6e5e9..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/core/_.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(n){var t={baseUrl:$("html").attr("data-base-url")};n.cardhero=t})(window); \ No newline at end of file diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/decks/_.min.js b/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/decks/_.min.js deleted file mode 100644 index d0d6bf989..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/decks/_.min.js +++ /dev/null @@ -1 +0,0 @@ -$(document).on("click",".deck-favourite",function(){var n=$(this);$.ajax({url:cardhero.baseUrl+"api/Decks/Favourite/"+n.attr("data-deck-id"),method:"POST"}).done(function(t){t?n.addClass("enabled"):n.removeClass("enabled")})}); \ No newline at end of file diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/games/tripletriad/_.min.js b/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/games/tripletriad/_.min.js deleted file mode 100644 index ba0e750b0..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/games/tripletriad/_.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(function(n){n.game=n.game||{};n.game.tripletriad={}})(window.cardhero),function(n){var t=function(t){t=t||{};var i={row:t.row,column:t.column,cardCollectionId:t.cardCollectionId};$.ajax({url:cardhero.baseUrl+"api/games/tripletriad/"+n.current.gameId+"/move",method:"POST",data:JSON.stringify(i),contentType:"application/json; charset=utf-8"}).done(function(n){typeof t.successCallback=="function"&&t.successCallback(n)}).fail(function(){})};n.move=t}(window.cardhero.game.tripletriad),function(n){n.current={gameId:$("#current-game").attr("data-game-id")}}(window.cardhero.game.tripletriad); \ No newline at end of file diff --git a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/modals/_.min.js b/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/modals/_.min.js deleted file mode 100644 index fd21d7c1e..000000000 --- a/apps/CardHero.NetCoreApp.Mvc/wwwroot/modules/modals/_.min.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict";(function(n){n.dialog={};n.modal={}})(window.cardhero),function(n){var i="cardhero-modal",t,r=` -`,u=function(){t.find(".modal-footer .btn-primary").off("click").on("click",function(){var n=t.find("form.auto-post");n.length>0&&$.ajax({url:n.attr("action"),method:n.attr("method"),data:n.serialize()}).done(function(n){typeof n=="object"&&n.redirectUrl&&(window.location=n.redirectUrl);t.hide()})})},f=function(){$("#"+i).remove();$("body").append(r);t=$("#"+i);t.on("shown.bs.modal",u)},e=function(){};n.show=function(n,i){f();t.find(".modal-body").append(n);t.find(".modal-title").text(i);t.modal()}}(window.cardhero.modal);$(document).on("click",".auto-modal",function(){var n=$(this),r=n.attr("data-modal-enabled")=="false",t,i;r||(t=n.attr("data-modal-url"),i=n.attr("data-modal-title"),t&&$.ajax({url:t}).done(function(n){cardhero.modal.show(n,i)}))}); \ No newline at end of file diff --git a/shared/KwokKan.AspNetCore.Mvc.Sortable/Extensions/HtmlHelperExtensions.cs b/shared/KwokKan.AspNetCore.Mvc.Sortable/Extensions/HtmlHelperExtensions.cs deleted file mode 100644 index 485555d6c..000000000 --- a/shared/KwokKan.AspNetCore.Mvc.Sortable/Extensions/HtmlHelperExtensions.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Reflection; -using KwokKan.Sortable; -using Microsoft.AspNetCore.Html; -using Microsoft.AspNetCore.Mvc.Rendering; - -namespace KwokKan.AspNetCore.Mvc.Sortable -{ - public static class HtmlHelperExtensions - { - /// - /// Creates a dropdown list from a model. - /// - /// The current viewmodel. - /// The HtmlHelper. - /// The model to use. - /// Name of the dropdown. - /// Text for the empty value. - /// Html attributes. - /// The currently selected value. - /// The dropdown list html. - public static IHtmlContent SortableDropDownList( - this IHtmlHelper htmlHelper, - Type model, - string name = Constants.SortName, - string optionLabel = "N/A", - object htmlAttributes = null, - string selectedValue = null - ) - { - if (model != null) - { - if (model.GetInterfaces().Contains(typeof(ISortable))) - { - var selectList = model.GetProperties() - .Where(x => x.GetCustomAttributes().Any()) - .Select(x => - { - var sa = x.GetCustomAttribute(); - var da = x.GetCustomAttribute()?.Name; - - return new - { - Name = da ?? sa.Name ?? x.Name, - Value = x.Name, - Order = sa.Order, - }; - }) - .OrderBy(x => x.Order) - .ThenBy(x => x.Name) - .Select(x => - { - return new SelectListItem - { - Text = x.Name, - Value = x.Value, - Selected = x.Value == selectedValue, - }; - }); - - return htmlHelper.DropDownList(name, selectList, optionLabel, htmlAttributes); - } - } - - return null; - } - - /// - /// Creates a dropdown list for sortable order. - /// - /// The current model. - /// The HtmlHelper. - /// Name of the dropdown. - /// Text for the empty value. - /// Html attributes. - /// The currently selected value. - /// The dropdown list html. - public static IHtmlContent SortableDirectionDropDownList( - this IHtmlHelper htmlHelper, - string name = Constants.SortDirectionName, - string optionLabel = "N/A", - object htmlAttributes = null, - string selectedValue = null - ) - { - var selectList = Enum.GetNames(typeof(SortDirection)) - .Select(x => new SelectListItem - { - Text = x, - Value = x, - Selected = x == selectedValue, - }); - - return htmlHelper.DropDownList(name, selectList, optionLabel, htmlAttributes); - } - } -} diff --git a/shared/KwokKan.AspNetCore.Mvc.Sortable/KwokKan.AspNetCore.Mvc.Sortable.csproj b/shared/KwokKan.AspNetCore.Mvc.Sortable/KwokKan.AspNetCore.Mvc.Sortable.csproj deleted file mode 100644 index dc7928941..000000000 --- a/shared/KwokKan.AspNetCore.Mvc.Sortable/KwokKan.AspNetCore.Mvc.Sortable.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - netcoreapp3.0 - Kwok Kan - Kwok Kan - Kwok Kan - true - ..\..\analyzers\stylecop.ruleset - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/CardHero.AspNetCore.Mvc.Common/CardHero.AspNetCore.Mvc.Common.csproj b/src/CardHero.AspNetCore.Mvc.Common/CardHero.AspNetCore.Mvc.Common.csproj deleted file mode 100644 index 70e2ff8dc..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/CardHero.AspNetCore.Mvc.Common.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - Card Hero ASP.NET Core MVC Common. - Kwok Kan - Card Hero ASP.NET Core MVC Common - netcoreapp3.0 - true - CardHero.AspNetCore.Mvc.Common - CardHero.AspNetCore.Mvc.Common - false - false - false - Kwok Kan - ..\..\analyzers\stylecop.ruleset - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/AccountController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/AccountController.cs deleted file mode 100644 index c6bc4f983..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/AccountController.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers -{ - [Authorize] - public class AccountController : Controller - { - public async Task LogoutAsync() - { - await Request.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); - - foreach (var cookie in HttpContext.Request.Cookies) - { - HttpContext.Response.Cookies.Delete(cookie.Key); - } - - return new SignOutResult("OpenIdConnect", new AuthenticationProperties - { - RedirectUri = Url.Action("Index", "Home"), - }); - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/CardApiController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/CardApiController.cs deleted file mode 100644 index af64880ca..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/CardApiController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.AspNetCore.Mvc.Common.Models; -using CardHero.Core.Abstractions; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers.Api -{ - public class CardApiController : BaseController - { - private readonly ICardService _cardService; - - public CardApiController(ICardService cardService) - { - _cardService = cardService; - } - - public virtual async Task> GetAsync(SearchCardViewModel model, CancellationToken cancellationToken) - { - var filter = new CardSearchFilter - { - Page = model.Page, - PageSize = model.PageSize, - Name = model.Name, - }; - ApplySortable(filter); - var cards = await _cardService.GetCardsAsync(filter, cancellationToken: cancellationToken); - var result = cards.Results.Select(x => new CardViewModel - { - Id = x.Id, - Name = x.Name, - }); - - return result; - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/DeckApiController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/DeckApiController.cs deleted file mode 100644 index e23259619..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/DeckApiController.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.AspNetCore.Mvc.Common.Models; -using CardHero.Core.Abstractions; -using CardHero.Core.Models; - -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers.Api -{ - [Route("api/decks")] - [Authorize] - public class DeckApiController : BaseController - { - private readonly IUserService _userService; - private readonly IDeckService _deckService; - - public DeckApiController(IUserService userService, IDeckService deckService) - { - _userService = userService; - _deckService = deckService; - } - - private async Task GetUserAsync(CancellationToken cancellationToken) - { - if (User.Identity.IsAuthenticated) - { - var sub = User.FindFirst("sub")?.Value; - var idp = User.FindFirst("idp")?.Value; - - var user = await _userService.GetUserByIdentifierAsync(sub, idp, cancellationToken: cancellationToken); - - if (user == null) - { - var name = User.FindFirst("name")?.Value; - - user = await _userService.CreateUserAsync(sub, idp, name, cancellationToken: cancellationToken); - } - - return user; - } - - return null; - } - - [HttpGet] - [Route("")] - public async Task> GetDecksAsync(CancellationToken cancellationToken) - { - var filter = new DeckSearchFilter(); - var decks = await _deckService.GetDecksAsync(filter, cancellationToken: cancellationToken); - var result = decks.Results.Select(x => new DeckViewModel - { - Id = x.Id, - Name = x.Name, - MaxCards = x.MaxCards, - Cards = x.Cards.Select(y => new DeckCardCollectionViewModel - { - Id = y.Id, - Name = y.Name, - DeckCardCollectionId = y.CardCollectionId, - }), - }); - - return result; - } - - [HttpPost] - [Route("")] - public async Task PostDeckAsync([FromBody]DeckViewModel model, CancellationToken cancellationToken) - { - var deck = new DeckModel - { - Name = model.Name, - MaxCards = model.MaxCards, - }; - var user = await GetUserAsync(cancellationToken: cancellationToken); - var result = await _deckService.CreateDeckAsync(deck, user.Id, cancellationToken: cancellationToken); - - return result; - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/GameApiController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/GameApiController.cs deleted file mode 100644 index a7b23aac8..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/GameApiController.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.AspNetCore.Mvc.Common.Models; -using CardHero.Core.Abstractions; - -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers.Api -{ - [Route("api/games")] - public class GameApiController : BaseController - { - private readonly IGameService _gameService; - - public GameApiController(IGameService gameService) - { - _gameService = gameService; - } - - [HttpGet] - [Route("")] - public virtual async Task IndexAsync(SearchGameViewModel model, CancellationToken cancellationToken) - { - var filter = new GameSearchFilter - { - Page = model.Page, - PageSize = model.PageSize, - StartTime = model.StartTime, - EndTime = model.EndTime, - ActiveOnly = model.ActiveOnly, - }; - ApplySortable(filter); - var games = await _gameService.GetGamesAsync(filter, cancellationToken: cancellationToken); - - model.Games = games.Results.Select(x => new GameViewModel - { - Id = x.Id, - StartTime = x.StartTime, - EndTime = x.EndTime, - IsActive = !x.EndTime.HasValue, - }); - - return model; - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/GamePlayApiController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/GamePlayApiController.cs deleted file mode 100644 index 1d68bc146..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/Api/GamePlayApiController.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -using CardHero.AspNetCore.Mvc.Common.Models; -using CardHero.Core.Abstractions; -using CardHero.Core.Models; - -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers.Api -{ - [Route("api/gameplay")] - public class GamePlayApiController : BaseController - { - private readonly IGamePlayService _gamePlayService; - - public GamePlayApiController(IGamePlayService gamePlayService) - { - _gamePlayService = gamePlayService; - } - - [HttpPost("move")] - public async Task MoveAsync([FromBody]MoveViewModel model, CancellationToken cancellationToken) - { - var move = new MoveModel - { - CardCollectionId = model.CardCollectionId, - Column = model.Column, - GameId = model.GameId, - Row = model.Row, - }; - - await _gamePlayService.MakeMoveAsync(move, cancellationToken: cancellationToken); - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/BaseController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/BaseController.cs deleted file mode 100644 index e0eed6e29..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/BaseController.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using CardHero.Core.Abstractions; -using CardHero.Core.Models; -using KwokKan.Sortable; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers -{ - public abstract class BaseController : Controller - { - protected void ApplySortable(SearchFilter filter, string sortName = Constants.SortName, string sortDirName = Constants.SortDirectionName) - where T : class, ICardHeroEntity - { - var sn = HttpContext.Request.Query[sortName].ToString(); - var property = typeof(T) - .GetProperties() - .Where(x => x.Name == sn) - .FirstOrDefault(); - - if (property != null) - { - var parameterExpression = Expression.Parameter(typeof(T)); - var propertyExpression = Expression.Property(parameterExpression, property); - - var convertedPropertyExpression = Expression.Convert(propertyExpression, typeof(object)); - var propertyFunction = Expression.Lambda>(convertedPropertyExpression, parameterExpression).Compile(); - - filter.Sort = propertyFunction; - } - - SortDirection sortDirection; - if (Enum.TryParse(HttpContext.Request.Query[sortDirName], out sortDirection)) - { - filter.SortDirection = sortDirection; - } - } - } -} \ No newline at end of file diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/CardController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/CardController.cs deleted file mode 100644 index bd1da4775..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/CardController.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.AspNetCore.Mvc.Common.Models; -using CardHero.Core.Abstractions; - -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers -{ - public class CardController : BaseController - { - private readonly ICardService _cardService; - - public CardController(ICardService cardService) - { - _cardService = cardService; - } - - public virtual async Task IndexAsync(SearchCardViewModel model, CancellationToken cancellationToken) - { - var filter = new CardSearchFilter - { - Page = model.Page, - PageSize = model.PageSize, - Name = model.Name, - }; - ApplySortable(filter); - var cards = await _cardService.GetCardsAsync(filter, cancellationToken: cancellationToken); - - model.Cards = cards.Results.Select(x => new CardViewModel - { - Id = x.Id, - Name = x.Name, - }); - - return View(model); - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/DeckController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/DeckController.cs deleted file mode 100644 index 460d0cab9..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/DeckController.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.AspNetCore.Mvc.Common.Models; -using CardHero.Core.Abstractions; - -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers -{ - [Authorize] - public class DeckController : BaseController - { - private readonly ICardService _cardService; - private readonly IDeckService _deckService; - - public DeckController(ICardService cardService, IDeckService deckService) - { - _cardService = cardService; - _deckService = deckService; - } - - public IActionResult Index() - { - return View(); - } - - public async Task DetailsAsync(int id, CancellationToken cancellationToken) - { - var deck = await _deckService.GetDeckByIdAsync(id, cancellationToken: cancellationToken); - var cardFilter = new CardCollectionSearchFilter - { - }; - var ownedCards = await _cardService.GetCardCollectionAsync(cardFilter, cancellationToken: cancellationToken); - - var model = new EditDeckViewModel - { - Cards = deck.Cards.Select(x => new DeckCardCollectionViewModel - { - DeckCardCollectionId = x.Id, - Id = x.CardCollectionId, - Name = x.Name, - }), - Id = deck.Id, - MaxCards = deck.MaxCards, - Name = deck.Name, - OwnedCards = ownedCards.Results.Select(x => new CardCollectionViewModel - { - Card = new CardViewModel - { - Id = x.CardId, - Name = x.Card.Name, - }, - Id = x.Id, - }), - }; - - return View(model); - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/GameController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/GameController.cs deleted file mode 100644 index 17f014b6a..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/GameController.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using CardHero.AspNetCore.Mvc.Common.Models; -using CardHero.Core.Abstractions; -using CardHero.Core.Models; - -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers -{ - public class GameController : BaseController - { - private readonly IGameService _gameService; - - public GameController(IGameService gameService) - { - _gameService = gameService; - } - - private void PopulateViewModel(CreateGameViewModel model) - { - } - - public IActionResult Index(SearchGameViewModel model) - { - var filter = new GameSearchFilter - { - }; - ApplySortable(filter); - - return View(model); - } - - [HttpGet] - public IActionResult Create() - { - var model = new CreateGameViewModel - { - }; - PopulateViewModel(model); - - return View(model); - } - - [HttpPost] - [ValidateAntiForgeryToken] - public async Task CreateAsync(CreateGameViewModel model, CancellationToken cancellationToken) - { - if (!ModelState.IsValid || model.PlayerIds == null) - { - ModelState.AddModelError(string.Empty, "You must select some players."); - PopulateViewModel(model); - return View(model); - } - - var users = model.PlayerIds.Select(x => new UserModel - { - Id = x, - }).ToArray(); - var game = new GameCreateModel - { - Users = users, - }; - var newGame = await _gameService.CreateGameAsync(game, cancellationToken: cancellationToken); - - return RedirectToAction("Details", new { id = newGame.Id }); - } - - public async Task DetailsAsync(int id, CancellationToken cancellationToken) - { - var filter = new GameSearchFilter - { - GameId = id, - }; - var games = await _gameService.GetGamesAsync(filter, cancellationToken: cancellationToken); - var game = games.Results.FirstOrDefault(); - - if (game == null) - { - return NotFound(); - } - - var model = new GameViewModel - { - Id = game.Id, - StartTime = game.StartTime, - EndTime = game.EndTime, - Rows = game.Rows, - Columns = game.Columns, - }; - - return View(model); - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Controllers/TokenController.cs b/src/CardHero.AspNetCore.Mvc.Common/Controllers/TokenController.cs deleted file mode 100644 index 0c37f98bf..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Controllers/TokenController.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Net.Http; -using System.Threading.Tasks; -using IdentityModel.Client; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Controllers -{ - public class TokenController : BaseController - { - public virtual async Task AuthorizeAsync() - { - var httpClient = new HttpClient(); - - var tokenRequest = new ClientCredentialsTokenRequest - { - Address = "http://localhost:4433/connect/token", - ClientId = "TripleTriadWebClient", - ClientSecret = "TripleTriadWebClientSecret", - Scope = "AccessTripleTriad", - }; - - var tokenResponse = await httpClient.RequestClientCredentialsTokenAsync(tokenRequest); - - return Json(tokenResponse); - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Account/LoginViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Account/LoginViewModel.cs deleted file mode 100644 index 64fb37b36..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Account/LoginViewModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class LoginViewModel - { - [Required] - public string Username { get; set; } - - [Required] - public string Password { get; set; } - - public string ReturnUrl { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Card/CardCollectionViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Card/CardCollectionViewModel.cs deleted file mode 100644 index a189d6533..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Card/CardCollectionViewModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class CardCollectionViewModel - { - public int Id { get; set; } - - public CardViewModel Card { get; set; } - - public int Count { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Card/CardViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Card/CardViewModel.cs deleted file mode 100644 index 85f30e7f9..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Card/CardViewModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using KwokKan.Sortable; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class CardViewModel : ISortable - { - [HiddenInput(DisplayValue = true)] - [Sortable("Default")] - public int Id { get; set; } - - [Sortable] - public string Name { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Card/SearchCardViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Card/SearchCardViewModel.cs deleted file mode 100644 index 87925eed7..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Card/SearchCardViewModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; - -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class SearchCardViewModel - { - public int Page { get; set; } - - public int PageSize { get; set; } - - public string Name { get; set; } - - public string Sort { get; set; } - - public string SortDir { get; set; } - - public IEnumerable Cards { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Components/MenuViewComponentModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Components/MenuViewComponentModel.cs deleted file mode 100644 index fd2e449a6..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Components/MenuViewComponentModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace CardHero.AspNetCore.Mvc.Common.Models.Components -{ - public class MenuViewComponentModel - { - public string FullName { get; set; } - - public int Wins { get; set; } - - public int Losses { get; set; } - - public int FriendCount { get; set; } - - public int CardCount { get; set; } - - public int NotificationCount { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Deck/DeckCardCollectionViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Deck/DeckCardCollectionViewModel.cs deleted file mode 100644 index e0c093ed0..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Deck/DeckCardCollectionViewModel.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class DeckCardCollectionViewModel : CardViewModel - { - public int DeckCardCollectionId { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Deck/DeckViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Deck/DeckViewModel.cs deleted file mode 100644 index 82ed208a4..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Deck/DeckViewModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; - -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class DeckViewModel - { - public int Id { get; set; } - - public string Name { get; set; } - - public int MaxCards { get; set; } - - public IEnumerable Cards { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Deck/EditDeckViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Deck/EditDeckViewModel.cs deleted file mode 100644 index e01e784ad..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Deck/EditDeckViewModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Generic; - -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class EditDeckViewModel : DeckViewModel - { - public IEnumerable OwnedCards { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Game/CreateGameViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Game/CreateGameViewModel.cs deleted file mode 100644 index 2b96fa4ad..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Game/CreateGameViewModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; - -using CardHero.Core.Models; - -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class CreateGameViewModel - { - public IEnumerable PlayerIds { get; set; } - - public IEnumerable Players { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Game/GameViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Game/GameViewModel.cs deleted file mode 100644 index e98a850f6..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Game/GameViewModel.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using KwokKan.Sortable; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class GameViewModel : ISortable - { - [HiddenInput(DisplayValue = true)] - [Sortable("Default", Order = -1)] - public int Id { get; set; } - - [Display(Name = "Start Time")] - [Sortable] - public DateTime StartTime { get; set; } - - [Display(Name = "End Time")] - [Sortable] - public DateTime? EndTime { get; set; } - - public bool IsActive { get; set; } - - public int Rows { get; set; } - - public int Columns { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/Game/SearchGameViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/Game/SearchGameViewModel.cs deleted file mode 100644 index c477f87af..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/Game/SearchGameViewModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class SearchGameViewModel - { - public int Page { get; set; } - - public int PageSize { get; set; } - - public string Sort { get; set; } - - public string SortDir { get; set; } - - [Display(Name = "Start Time")] - public DateTime? StartTime { get; set; } - - [Display(Name = "End Time")] - public DateTime? EndTime { get; set; } - - [Display(Name = "Active?")] - public bool ActiveOnly { get; set; } = true; - - public IEnumerable Games { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Models/GamePlay/MoveViewModel.cs b/src/CardHero.AspNetCore.Mvc.Common/Models/GamePlay/MoveViewModel.cs deleted file mode 100644 index b2f39490c..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Models/GamePlay/MoveViewModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace CardHero.AspNetCore.Mvc.Common.Models -{ - public class MoveViewModel - { - public int GameId { get; set; } - - public int CardCollectionId { get; set; } - - public int Row { get; set; } - - public int Column { get; set; } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Common/Properties/AssemblyInfo.cs b/src/CardHero.AspNetCore.Mvc.Common/Properties/AssemblyInfo.cs deleted file mode 100644 index 0fe4f8afd..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Card Hero")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b1007cc1-dc39-464f-b0c8-8b411d05c153")] diff --git a/src/CardHero.AspNetCore.Mvc.Common/ViewComponents/MenuViewComponent.cs b/src/CardHero.AspNetCore.Mvc.Common/ViewComponents/MenuViewComponent.cs deleted file mode 100644 index 35b27ccdd..000000000 --- a/src/CardHero.AspNetCore.Mvc.Common/ViewComponents/MenuViewComponent.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Threading.Tasks; -using CardHero.AspNetCore.Mvc.Common.Models.Components; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Common.ViewComponents -{ - public class MenuViewComponent : ViewComponent - { - public Task InvokeAsync() - { - var model = new MenuViewComponentModel - { - FullName = User.Identity.Name, - }; - - return Task.FromResult(View(model)); - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Helpers/CardHero.AspNetCore.Mvc.Helpers.csproj b/src/CardHero.AspNetCore.Mvc.Helpers/CardHero.AspNetCore.Mvc.Helpers.csproj deleted file mode 100644 index e81aa4e1d..000000000 --- a/src/CardHero.AspNetCore.Mvc.Helpers/CardHero.AspNetCore.Mvc.Helpers.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - Helper objects for Card Hero MVC. - Kwok Kan - Card Hero ASP.NET Core MVC Helpers - netcoreapp3.0 - true - CardHero.AspNetCore.Mvc.Helpers - CardHero.AspNetCore.Mvc.Helpers - false - false - false - Kwok Kan - ..\..\analyzers\stylecop.ruleset - - - - - - - - - - - - - - - - diff --git a/src/CardHero.AspNetCore.Mvc.Helpers/Extensions/HtmlHelperExtensions.cs b/src/CardHero.AspNetCore.Mvc.Helpers/Extensions/HtmlHelperExtensions.cs deleted file mode 100644 index 30e1f086c..000000000 --- a/src/CardHero.AspNetCore.Mvc.Helpers/Extensions/HtmlHelperExtensions.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Linq; -using Microsoft.AspNetCore.Html; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.Extensions.Primitives; - -namespace CardHero.AspNetCore.Mvc.Helpers -{ - public static class HtmlHelperExtensions - { - private static string PreloadLink(IHtmlHelper helper, string link, string type, bool preload) - { - var preloadLink = link; - - if (preloadLink.StartsWith("~/")) - { - preloadLink = "http://localhost:55670/" + preloadLink.Substring(2); - } - - if (preload) - { - var linkValue = $"<{ preloadLink }>; rel=preload; as={ type };"; - var responseHeaders = helper.ViewContext.HttpContext.Response.Headers; - var stringValues = default(StringValues); - - if (responseHeaders.TryGetValue("Link", out stringValues)) - { - responseHeaders.Remove("Link"); - } - - if (!stringValues.Any()) - { - stringValues = new StringValues(linkValue); - } - else - { - var sv = stringValues.Select(x => x).ToList(); - sv.Add(linkValue); - stringValues = new StringValues(sv.ToArray()); - } - - responseHeaders.Add("Link", stringValues); - } - - return preloadLink; - } - - public static IHtmlContent CdnScript(this IHtmlHelper helper, string src, bool preload = false) - { - var cdnSrc = PreloadLink(helper, src, "script", preload); - - var scriptTag = $""; - return helper.Raw(scriptTag); - } - - public static IHtmlContent CdnStyle(this IHtmlHelper helper, string href, bool preload = false) - { - var cdnHref = PreloadLink(helper, href, "script", preload); - - var scriptTag = $""; - return helper.Raw(scriptTag); - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Helpers/Extensions/UrlHelperExtensions.cs b/src/CardHero.AspNetCore.Mvc.Helpers/Extensions/UrlHelperExtensions.cs deleted file mode 100644 index 5cae9a0a9..000000000 --- a/src/CardHero.AspNetCore.Mvc.Helpers/Extensions/UrlHelperExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Microsoft.AspNetCore.Mvc; - -namespace CardHero.AspNetCore.Mvc.Helpers -{ - public static class UrlHelperExtensions - { - public static string CdnContent(this IUrlHelper urlHelper, string path) - { - if (path == null) - { - throw new ArgumentException(nameof(path)); - } - - if (path.StartsWith("~/")) - { - return $"http://localhost:55670/{path.Substring(2)}"; - } - - return path; - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.Helpers/Properties/AssemblyInfo.cs b/src/CardHero.AspNetCore.Mvc.Helpers/Properties/AssemblyInfo.cs deleted file mode 100644 index 97caa4e90..000000000 --- a/src/CardHero.AspNetCore.Mvc.Helpers/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Card Hero")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7ee02878-3b35-4070-b315-af99b5740800")] diff --git a/src/CardHero.AspNetCore.Mvc.TagHelpers/CardHero.AspNetCore.Mvc.TagHelpers.csproj b/src/CardHero.AspNetCore.Mvc.TagHelpers/CardHero.AspNetCore.Mvc.TagHelpers.csproj deleted file mode 100644 index e51004516..000000000 --- a/src/CardHero.AspNetCore.Mvc.TagHelpers/CardHero.AspNetCore.Mvc.TagHelpers.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - Card Hero ASP.NET Core MVC Tag Helpers. - Kwok Kan - Card Hero ASP.NET Core MVC Tag Helpers - netcoreapp3.0 - true - CardHero.AspNetCore.Mvc.TagHelpers - CardHero.AspNetCore.Mvc.TagHelpers - false - false - false - Kwok Kan - ..\..\analyzers\stylecop.ruleset - - - - - - - - - - - - - - - - diff --git a/src/CardHero.AspNetCore.Mvc.TagHelpers/Extensions/ServiceCollectionExtensions.cs b/src/CardHero.AspNetCore.Mvc.TagHelpers/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index 2b7746b30..000000000 --- a/src/CardHero.AspNetCore.Mvc.TagHelpers/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using CardHero.AspNetCore.Mvc.TagHelpers; -using Microsoft.Extensions.Configuration; - -namespace Microsoft.Extensions.DependencyInjection -{ - public static class ServiceCollectionExtensions - { - public static IServiceCollection ConfigureTagHelpers(this IServiceCollection services, IConfigurationRoot configuration) - { - services.Configure(options => - { - var config = configuration.GetSection("Assets"); - options.BaseUrl = config.GetSection("BaseUrl").Value; - }); - - return services; - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.TagHelpers/Options/AssetTagHelperOptions.cs b/src/CardHero.AspNetCore.Mvc.TagHelpers/Options/AssetTagHelperOptions.cs deleted file mode 100644 index 88a0796f6..000000000 --- a/src/CardHero.AspNetCore.Mvc.TagHelpers/Options/AssetTagHelperOptions.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace CardHero.AspNetCore.Mvc.TagHelpers -{ - public class AssetTagHelperOptions - { - public string BaseUrl { get; set; } = "~/"; - } -} diff --git a/src/CardHero.AspNetCore.Mvc.TagHelpers/Properties/AssemblyInfo.cs b/src/CardHero.AspNetCore.Mvc.TagHelpers/Properties/AssemblyInfo.cs deleted file mode 100644 index 011ad2082..000000000 --- a/src/CardHero.AspNetCore.Mvc.TagHelpers/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Card Hero")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9d990d6c-1319-4e6a-b526-2d688044eac1")] diff --git a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/AssetTagHelper.cs b/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/AssetTagHelper.cs deleted file mode 100644 index 3000d1130..000000000 --- a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/AssetTagHelper.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.AspNetCore.Razor.TagHelpers; -using Microsoft.Extensions.Options; - -namespace CardHero.AspNetCore.Mvc.TagHelpers -{ - [HtmlTargetElement("link", Attributes = UseAssetAttributeName + "," + HrefAttributeName)] - [HtmlTargetElement("img", Attributes = UseAssetAttributeName + "," + SrcAttributeName)] - [HtmlTargetElement("script", Attributes = UseAssetAttributeName + "," + SrcAttributeName)] - public class AssetTagHelper : TagHelper - { - private const string UseAssetAttributeName = "tt-use-asset"; - private const string SrcAttributeName = "src"; - private const string HrefAttributeName = "href"; - - private readonly AssetTagHelperOptions _options; - - [HtmlAttributeName(UseAssetAttributeName)] - public bool UseAsset { get; set; } - - [HtmlAttributeName(SrcAttributeName)] - public string Src { get; set; } - - [HtmlAttributeName(HrefAttributeName)] - public string Href { get; set; } - - public AssetTagHelper(IOptions options) - { - _options = options.Value; - } - - public override void Process(TagHelperContext context, TagHelperOutput output) - { - if (UseAsset) - { - if (!string.IsNullOrEmpty(Src)) - { - if (Src.StartsWith("~/")) - { - Src = _options.BaseUrl + Src.Substring(2); - } - - output.Attributes.SetAttribute(SrcAttributeName, Src); - } - else if (!string.IsNullOrEmpty(Href)) - { - if (Href.StartsWith("~/")) - { - Href = _options.BaseUrl + Href.Substring(2); - } - - output.Attributes.SetAttribute(HrefAttributeName, Href); - } - } - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/HideIfNullTagHelper.cs b/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/HideIfNullTagHelper.cs deleted file mode 100644 index 63d13ab63..000000000 --- a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/HideIfNullTagHelper.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace CardHero.AspNetCore.Mvc.TagHelpers -{ - [HtmlTargetElement(Attributes = "hide-if-null")] - public class HideIfNullTagHelper : TagHelper - { - [HtmlAttributeName("hide-if-null")] - public object HideIfNull { get; set; } - - public override void Process(TagHelperContext context, TagHelperOutput output) - { - if (HideIfNull == null) - { - output.SuppressOutput(); - } - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/HideIfTagHelper.cs b/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/HideIfTagHelper.cs deleted file mode 100644 index 342af64bd..000000000 --- a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/HideIfTagHelper.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace CardHero.AspNetCore.Mvc.TagHelpers -{ - [HtmlTargetElement(Attributes = "hide-if")] - public class HideIfTagHelper : TagHelper - { - [HtmlAttributeName("hide-if")] - public bool HideIf { get; set; } - - public override void Process(TagHelperContext context, TagHelperOutput output) - { - if (HideIf) - { - output.SuppressOutput(); - } - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/ShowIfTagHelper.cs b/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/ShowIfTagHelper.cs deleted file mode 100644 index 6e0cee129..000000000 --- a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/ShowIfTagHelper.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace CardHero.AspNetCore.Mvc.TagHelpers -{ - [HtmlTargetElement(Attributes = "show-if")] - public class ShowIfTagHelper : TagHelper - { - [HtmlAttributeName("show-if")] - public bool ShowIf { get; set; } - - public override void Process(TagHelperContext context, TagHelperOutput output) - { - if (ShowIf == false) - { - output.SuppressOutput(); - } - } - } -} diff --git a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/ShowifNullTagHelper.cs b/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/ShowifNullTagHelper.cs deleted file mode 100644 index 2675a8708..000000000 --- a/src/CardHero.AspNetCore.Mvc.TagHelpers/TagHelpers/ShowifNullTagHelper.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Razor.TagHelpers; - -namespace CardHero.AspNetCore.Mvc.TagHelpers -{ - [HtmlTargetElement(Attributes = "show-if-null")] - public class ShowifNullTagHelper : TagHelper - { - [HtmlAttributeName("show-if-null")] - public object ShowIfNull { get; set; } - - public override void Process(TagHelperContext context, TagHelperOutput output) - { - if (ShowIfNull != null) - { - output.SuppressOutput(); - } - } - } -}