Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit ef54b54

Browse files
committed
show "empty" if trait is not set
1 parent cee0efa commit ef54b54

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

KratosSelfService/Resources/CustomTranslator.de.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,7 @@
133133
<data name="login.signInWithProvider" xml:space="preserve">
134134
<value>Oder anmelden mit</value>
135135
</data>
136+
<data name="profile.empty" xml:space="preserve">
137+
<value>leer</value>
138+
</data>
136139
</root>

KratosSelfService/Resources/CustomTranslator.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,7 @@
8484
<data name="login.signInWithProvider" xml:space="preserve">
8585
<value>Or sign in with</value>
8686
</data>
87+
<data name="profile.empty" xml:space="preserve">
88+
<value>empty</value>
89+
</data>
8790
</root>

KratosSelfService/Views/Home/Profile.cshtml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,21 @@
2020
<tbody>
2121
@foreach (var (schemaPathSections, schema) in Model.traitSchemas)
2222
{
23+
var value = traits.GetTraitValueFromPath(schemaPathSections);
2324
<tr>
2425
<td>@schema.Title</td>
25-
<td>@traits.GetTraitValueFromPath(schemaPathSections)</td>
26+
@if (string.IsNullOrWhiteSpace(value))
27+
{
28+
<td>
29+
<p class="is-italic has-text-grey">
30+
@CustomTranslator.Get("profile.empty")
31+
</p>
32+
</td>
33+
}
34+
else
35+
{
36+
<td>@value</td>
37+
}
2638
</tr>
2739
}
2840
</tbody>

0 commit comments

Comments
 (0)