Skip to content

Commit

Permalink
use light mode
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Mar 22, 2024
1 parent fd7daf4 commit 4d2cd51
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 40 deletions.
14 changes: 7 additions & 7 deletions KratosSelfService/Views/Sessions/Sessions.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
}

<div class="columns">
<div class="column is-3 is-hidden-mobile">
<div class="column is-3 is-hidden-touch">
<div class="section">
<aside>
<aside class="menu">
<p class="menu-label">@CustomTranslator.Get("sessions.title-navigation")</p>
<ul class="menu-list">
<li>
Expand Down Expand Up @@ -53,7 +53,7 @@
</aside>
</div>
</div>
<div class="column is-9">
<div class="column is-12 is-9-desktop">
<div class="section">
<div class="box" id="overview">
<h1 class="title">@CustomTranslator.Get("sessions.title")</h1>
Expand All @@ -66,7 +66,7 @@
<tr>
<td>@CustomTranslator.Get("sessions.devices")</td>
<td>@CustomTranslator.Get("sessions.authenticatedAt")</td>
<td>@CustomTranslator.Get("sessions.expiresAt")</td>
<td class="is-hidden-mobile">@CustomTranslator.Get("sessions.expiresAt")</td>
</tr>
</thead>
<tbody>
Expand All @@ -85,7 +85,7 @@
@Model.CurrentSession.AuthenticatedAt.ToShortDateString()
@Model.CurrentSession.AuthenticatedAt.ToShortTimeString()
</td>
<td>
<td class="is-hidden-mobile">
@Model.CurrentSession.ExpiresAt.ToShortDateString()
@Model.CurrentSession.ExpiresAt.ToShortTimeString()
</td>
Expand Down Expand Up @@ -114,7 +114,7 @@
<tr>
<td>@CustomTranslator.Get("sessions.devices")</td>
<td>@CustomTranslator.Get("sessions.authenticatedAt")</td>
<td>@CustomTranslator.Get("sessions.expiresAt")</td>
<td class="is-hidden-mobile">@CustomTranslator.Get("sessions.expiresAt")</td>
</tr>
</thead>
<tbody>
Expand All @@ -132,7 +132,7 @@
}
</td>
<td>@session.AuthenticatedAt</td>
<td>@session.ExpiresAt</td>
<td class="is-hidden-mobile">@session.ExpiresAt</td>
</tr>
}
</tbody>
Expand Down
21 changes: 15 additions & 6 deletions KratosSelfService/Views/Settings/Settings.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
}

<div class="columns">
<div class="column is-3 is-hidden-mobile">
<div class="column is-3 is-hidden-touch">
<div class="section">
<aside>
<aside class="menu">
<p class="menu-label">@OryTranslator.Get("settings.title-navigation")</p>
<ul class="menu-list">
@foreach (var group in groups)
Expand Down Expand Up @@ -96,7 +96,7 @@
</aside>
</div>
</div>
<div class="column is-9">
<div class="column is-12 is-9-desktop">
<div class="section">
<div class="box pt-5">
<h1 class="title">@OryTranslator.Get("settings.title")</h1>
Expand Down Expand Up @@ -130,7 +130,8 @@
</form>
</div>
}
@if (Model.exportUserDataEnabled) {
@if (Model.exportUserDataEnabled)
{
<div class="box p-5" id="export-data">
<h3 class="subtitle">
@CustomTranslator.Get("settings.exportData")
Expand All @@ -139,7 +140,11 @@
<div class="field">
<div class="control">
<a href="settings/[email protected]&[email protected]"
class="button is-info">
class="button is-info is-fullwidth is-hidden-tablet">
@CustomTranslator.Get("settings.exportDataButtonLabel")
</a>
<a href="settings/[email protected]&[email protected]"
class="button is-info is-hidden-mobile">
@CustomTranslator.Get("settings.exportDataButtonLabel")
</a>
</div>
Expand All @@ -155,7 +160,11 @@
<div class="field">
<div class="control">
<a href="settings/[email protected]&[email protected]"
class="button is-danger">
class="button is-danger is-hidden-mobile">
@CustomTranslator.Get("settings.deleteAccountButtonLabel")
</a>
<a href="settings/[email protected]&[email protected]"
class="button is-danger is-fullwidth is-hidden-tablet">
@CustomTranslator.Get("settings.deleteAccountButtonLabel")
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,37 @@
@{
var attributes = Model.node.Attributes.GetKratosUiNodeInputAttributes();
var uiText = attributes.Label ?? Model.node.Meta.Label;
var fullwidth = Model.FlowType != FlowType.Settings;
}

<div class="field">
<div class="control">
<button type="button" class="button is-info @(fullwidth ? "is-fullwidth" : "")"
required="@attributes.Required"
value="@attributes.Value" autocomplete="@attributes.Autocomplete"
disabled="@attributes.Disabled" name="@attributes.Name"
onclick="@attributes.Onclick" pattern="@attributes.Pattern">
@OryTranslator.ForUiText(uiText)
</button>
@if (Model.FlowType == FlowType.Settings)
{
<button type="button" class="button is-info is-hidden-mobile"
required="@attributes.Required"
value="@attributes.Value" autocomplete="@attributes.Autocomplete"
disabled="@attributes.Disabled" name="@attributes.Name"
onclick="@attributes.Onclick" pattern="@attributes.Pattern">
@OryTranslator.ForUiText(uiText)
</button>
<button type="button" class="button is-info is-fullwidth is-hidden-tablet"
required="@attributes.Required"
value="@attributes.Value" autocomplete="@attributes.Autocomplete"
disabled="@attributes.Disabled" name="@attributes.Name"
onclick="@attributes.Onclick" pattern="@attributes.Pattern">
@OryTranslator.ForUiText(uiText)
</button>
}
else
{
<button type="button" class="button is-info is-fullwidth"
required="@attributes.Required"
value="@attributes.Value" autocomplete="@attributes.Autocomplete"
disabled="@attributes.Disabled" name="@attributes.Name"
onclick="@attributes.Onclick" pattern="@attributes.Pattern">
@OryTranslator.ForUiText(uiText)
</button>
}
</div>

@await Component.InvokeAsync("KratosUiTextMessages", Model.node.Messages)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,51 @@
@{
var attributes = Model.node.Attributes.GetKratosUiNodeInputAttributes();
var uiText = attributes.Label ?? Model.node.Meta.Label;
var isFullWidth = Model.FlowType != FlowType.Settings;
var buttonType = attributes.Name switch
{
"lookup_secret_disable" or "webauthn_remove" or "totp_unlink" or "unlink" or "lookup_secret_confirm" => "is-warning",
_ => "is-info"
};
var label = Model.node.Group == KratosUiNode.GroupEnum.Webauthn && Model.node.Meta?.Label.Id == 1010001
? CustomTranslator.Get($"1010001-webauthn")
: OryTranslator.ForUiText(uiText);
}

<div class="field">
<div class="control">
<button type="submit"
class="button @buttonType @(isFullWidth ? "is-fullwidth" : "")"
required="@attributes.Required"
disabled="@attributes.Disabled"
value="@attributes.Value"
name="@attributes.Name"
onclick="@attributes.Onclick">
@if (Model.node.Group == KratosUiNode.GroupEnum.Webauthn && Model.node.Meta?.Label.Id == 1010001)
{
<span>@CustomTranslator.Get($"{Model.node.Meta.Label.Id}-webauthn")</span>
}
else
{
<span>@OryTranslator.ForUiText(uiText)</span>
}
</button>
@if (Model.FlowType == FlowType.Settings)
{
<button type="submit"
class="button @buttonType is-fullwidth is-hidden-tablet"
required="@attributes.Required"
disabled="@attributes.Disabled"
value="@attributes.Value"
name="@attributes.Name"
onclick="@attributes.Onclick">
<span>@label</span>
</button>
<button type="submit"
class="button @buttonType is-hidden-mobile"
required="@attributes.Required"
disabled="@attributes.Disabled"
value="@attributes.Value"
name="@attributes.Name"
onclick="@attributes.Onclick">
<span>@label</span>
</button>
}
else
{
<button type="submit"
class="button @buttonType is-fullwidth"
required="@attributes.Required"
disabled="@attributes.Disabled"
value="@attributes.Value"
name="@attributes.Name"
onclick="@attributes.Onclick">
<span>@label</span>
</button>
}
</div>
@await Component.InvokeAsync("KratosUiTextMessages", Model.node.Messages)
</div>
2 changes: 1 addition & 1 deletion KratosSelfService/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
@* scroll-padding-top is used that the anchor titles are not hidden behind the fixed nav bar *@
<html lang="@CustomTranslator.Get("en")" style="scroll-padding-top: 60px">
<html lang="@CustomTranslator.Get("en")" style="scroll-padding-top: 60px" data-theme="light">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
Expand Down
1 change: 1 addition & 0 deletions KratosSelfService/Views/Shared/_NavbarLayout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>

Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Layout/SideMenu.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inject EnvService env

<aside class="is-narrow-mobile is-fullheight">
<aside class="menu is-narrow-mobile is-fullheight">
<p class="menu-label">Home</p>
<ul class="menu-list">
<li>
Expand Down

0 comments on commit 4d2cd51

Please sign in to comment.