diff --git a/Kemkas.Web/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml b/Kemkas.Web/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml index fefa57f..d73358a 100644 --- a/Kemkas.Web/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml +++ b/Kemkas.Web/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml @@ -22,7 +22,7 @@
  • Scan the QR Code or enter this key @Model.SharedKey into your two factor authenticator app. Spaces and casing do not matter.

    -
    Learn how to enable QR code generation.
    + @*
    Learn how to enable QR code generation.
    *@
  • @@ -50,4 +50,7 @@ @section Scripts { + + + } diff --git a/Kemkas.Web/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs b/Kemkas.Web/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs index dd9f0f7..919bb97 100644 --- a/Kemkas.Web/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs +++ b/Kemkas.Web/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs @@ -181,7 +181,7 @@ namespace Kemkas.Web.Areas.Identity.Pages.Account.Manage return string.Format( CultureInfo.InvariantCulture, AuthenticatorUriFormat, - _urlEncoder.Encode("Microsoft.AspNetCore.Identity.UI"), + _urlEncoder.Encode("Kemkas"), _urlEncoder.Encode(email), unformattedKey); } diff --git a/Kemkas.Web/Areas/Identity/Pages/Account/RegisterConfirmation.cshtml b/Kemkas.Web/Areas/Identity/Pages/Account/RegisterConfirmation.cshtml index b15d7c0..04321a5 100644 --- a/Kemkas.Web/Areas/Identity/Pages/Account/RegisterConfirmation.cshtml +++ b/Kemkas.Web/Areas/Identity/Pages/Account/RegisterConfirmation.cshtml @@ -8,5 +8,4 @@

    Please check your email to confirm your account.

    -} diff --git a/Kemkas.Web/Controllers/CharacterController.cs b/Kemkas.Web/Controllers/CharacterController.cs index 40e0c70..14136ec 100644 --- a/Kemkas.Web/Controllers/CharacterController.cs +++ b/Kemkas.Web/Controllers/CharacterController.cs @@ -2,6 +2,7 @@ using System.ComponentModel.DataAnnotations; using Kemkas.Web.Db.Models; using Kemkas.Web.Services.Character; using Kemkas.Web.ViewModels; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace Kemkas.Web.Controllers; @@ -16,7 +17,7 @@ public class CharacterController( : ControllerBase { [HttpPost] - public async Task> StoreNewCharacter([FromBody] CharacterDto dto) + public async Task> StoreNewCharacter([FromBody] CharacterDto dto, bool isPublic = true) { if (!ModelState.IsValid) { @@ -52,4 +53,11 @@ public class CharacterController( return dbModelToDtoService.Convert(entity); } + + [HttpGet] + [Authorize] + public async Task> GetAllCharacters() + { + return await persistenceService.GetAllCharactersOfUser(); + } } \ No newline at end of file diff --git a/Kemkas.Web/Pages/Shared/_Layout.cshtml b/Kemkas.Web/Pages/Shared/_Layout.cshtml index de6b25f..eb882dc 100644 --- a/Kemkas.Web/Pages/Shared/_Layout.cshtml +++ b/Kemkas.Web/Pages/Shared/_Layout.cshtml @@ -3,11 +3,11 @@ @inject IWebHostEnvironment Environment @inject ICompositeViewEngine Engine - + - @ViewData["Title"] - Kemkas.Web + @ViewData["Title"] - Kemkas @@ -25,7 +25,7 @@
    +
    +
    + +
    +
    +
    + A Kard és Mágiát Lux Gábor alkotta. A szerzői jogok őt illetik. Ez az oldal egy "rajongói + hozzájárulás", célja a Kard és Mágia népszerűsítése. Ha többet akarsz tudni a Kard és Mágiáról + látogass el a hivatalos honlapjára. A Kard és Mágia az Open + Gaming Licence 1.0a alatt lett kiadva, melynek szövege itt található +
    +
    + ); } diff --git a/Kemkas.Web/frontend/src/first-edition/components/CharacterListItem.tsx b/Kemkas.Web/frontend/src/first-edition/components/CharacterListItem.tsx new file mode 100644 index 0000000..d74cee9 --- /dev/null +++ b/Kemkas.Web/frontend/src/first-edition/components/CharacterListItem.tsx @@ -0,0 +1,25 @@ +import * as React from "react"; +import {Osztaly, OsztalyLabel} from "../domain-models/osztaly"; +import {Faj, FajLabel} from "../domain-models/faj"; + +export interface CharacterListItemDto { + id: string, + name: string, + szint: number, + faj: Faj, + osztaly: Osztaly, +} + +function CharacterListItem(props: { + character: CharacterListItemDto, +}) { + const {character:c} = props + return <> + {c.name} + {c.szint}. szintű + {FajLabel(c.faj)} + {OsztalyLabel(c.osztaly)} + +} + +export default CharacterListItem; \ No newline at end of file diff --git a/Kemkas.Web/frontend/src/first-edition/pages/CharacterList.tsx b/Kemkas.Web/frontend/src/first-edition/pages/CharacterList.tsx new file mode 100644 index 0000000..139797d --- /dev/null +++ b/Kemkas.Web/frontend/src/first-edition/pages/CharacterList.tsx @@ -0,0 +1,37 @@ +import * as React from "react"; +import {useLoaderData} from "react-router-dom"; +import CharacterListItem, {CharacterListItemDto} from "../components/CharacterListItem"; +import {Faro} from "@grafana/faro-web-sdk"; + +function CharacterList(props: {faro?: Faro}) { + const {faro} = props + const characters = useLoaderData() as CharacterListItemDto[]; + + return
    +
    +

    Karakterek

    +
    + + + + + + + + + + + + {characters.map(c => ( + + + + ))} + +
    NévSzintFajOsztály
    +
    +} + +export default CharacterList; \ No newline at end of file diff --git a/Kemkas.Web/frontend/src/first-edition/pages/CreateCharacter.tsx b/Kemkas.Web/frontend/src/first-edition/pages/CreateCharacter.tsx index 7755886..e8e7b54 100644 --- a/Kemkas.Web/frontend/src/first-edition/pages/CreateCharacter.tsx +++ b/Kemkas.Web/frontend/src/first-edition/pages/CreateCharacter.tsx @@ -59,7 +59,7 @@ function CreateCharacterPage(props: { return (
    -

    Karakter létrehozása

    +

    Karakter {initialKarakterInputs ? "szerkesztése*" : "létrehozása"}

    event.preventDefault()}> @@ -179,7 +179,8 @@ function CreateCharacterPage(props: {