Skip to content

Commit

Permalink
design improvements, fix register page
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Mar 14, 2024
1 parent 124e6cd commit 9de69ec
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion KratosSelfService/ViewComponents/KratosUiNodeComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ public Task<ViewViewComponentResult> InvokeAsync(KratosUiNodeArgs args)
case KratosUiNode.TypeEnum.Input:
switch (args.node.Attributes.GetKratosUiNodeInputAttributes().Type)
{
case KratosUiNodeInputAttributes.TypeEnum.Hidden:
return Task.FromResult(View("InputFieldHidden", args));
case KratosUiNodeInputAttributes.TypeEnum.Text:
case KratosUiNodeInputAttributes.TypeEnum.Password:
case KratosUiNodeInputAttributes.TypeEnum.Number:
case KratosUiNodeInputAttributes.TypeEnum.Hidden:
case KratosUiNodeInputAttributes.TypeEnum.Email:
case KratosUiNodeInputAttributes.TypeEnum.Tel:
case KratosUiNodeInputAttributes.TypeEnum.DatetimeLocal:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<label class="checkbox">
<input type="checkbox" class="checkbox"
@(attributes.Required ? "required" : "")
@(attributes.Value.ToString() == "True" ? "checked" : "")
@(attributes.Value?.ToString() == "True" ? "checked" : "")
@(attributes.Disabled ? "disabled" : "")
name="@attributes.Name"
value="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="field">
<label class="label">
@OryTranslator.ForUiText(uiText)
@OryTranslator.ForUiText(uiText) @(attributes.Required ? "*" : "")
<div class="control">
<input type="@attributes.Type.ToString().ToLower()" class="input"
required="@attributes.Required"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@model KratosUiNodeArgs

@{
var attributes = Model.node.Attributes.GetKratosUiNodeInputAttributes();
}

<input type="@attributes.Type.ToString().ToLower()" class="input"
required="@attributes.Required"
value="@attributes.Value" autocomplete="@attributes.Autocomplete.ToString()?.ToLower()"
disabled="@attributes.Disabled" name="@attributes.Name"
onclick="@attributes.Onclick" pattern="@attributes.Pattern"/>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name="@attributes.Name"
onclick="@attributes.Onclick">
<span class="icon">
<i class="fab fa-@attributes.Value.ToString()?.ToLowerInvariant()"></i>
<i class="fab fa-@(attributes.Value?.ToString()?.ToLowerInvariant() ?? "building")"></i>
</span>
@* Not using @OryTranslator.ForUiText(uiText), label too long *@
<span>@attributes.Value</span>
Expand Down

0 comments on commit 9de69ec

Please sign in to comment.