Skip to content

Commit

Permalink
Display username and repourl on changepw page. (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tusmester authored Oct 10, 2023
1 parent 907e02e commit 5dce333
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,8 @@ public async Task<IActionResult> PasswordChange(string token, string returnUrl)
return View(new PasswordChangeViewModel
{
ReturnUrl = returnUrl,
FullName = user.FullName ?? user.Username
FullName = user.FullName ?? user.Username,
Username = user.Username
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@model PasswordChangeViewModel
@using SenseNet.Client
@model PasswordChangeViewModel
@{
ViewData["Title"] = "PasswordChange";
}
Expand All @@ -15,28 +16,30 @@
</a>
</figure>
</div>
<div class="card-repoinfo card-repoinfo-lean">
<h2>Welcome @Model.Username</h2>
<h3>@Model.SnRepositoryUrl.TrimSchema()</h3>
</div>

<form asp-route="PasswordChange">
<div class="card-body">
<h1 class="card-title">Please change your password before proceeding.</h1>


<h2 class="card-title">Please change your password before proceeding.</h2>

<div class="form-error">
<partial name="_ValidationSummary" />
<partial name="_ValidationSummary"/>
</div>

<input type="hidden" asp-for="ReturnUrl" />
<input type="hidden" asp-for="ReturnUrl"/>

<fieldset class="form-fieldset">
<div class="form-group @(@ViewData.ModelState["Password"] != null && @ViewData.ModelState["Password"].Errors.Count > 0 ? "field-validation-error": "")">
<div class="form-group @(@ViewData.ModelState["Password"] != null && @ViewData.ModelState["Password"].Errors.Count > 0 ? "field-validation-error" : "")">
<label class="form-label" asp-for="Password">Password</label>
<div class="input-group">
<input type="password" class="form-control" asp-for="Password" autocomplete="off">
</div>
</div>

<div class="form-group @(@ViewData.ModelState["Password2"] != null && @ViewData.ModelState["Password2"].Errors.Count > 0 ? "field-validation-error": "")">
<div class="form-group @(@ViewData.ModelState["Password2"] != null && @ViewData.ModelState["Password2"].Errors.Count > 0 ? "field-validation-error" : "")">
<label class="form-label" asp-for="Password2">Password again</label>
<div class="input-group">
<input type="password" class="form-control" asp-for="Password2" autocomplete="off">
Expand All @@ -45,6 +48,10 @@
</fieldset>
</div>

<div class="card-body">
After providing the new password, you will be able to <br> log in using the
login name <strong>@Model.Username</strong>
</div>

<button class="btn btn-primary btn-block card-button " name="button" value="changepassword">
<span class="btn-animation">Change password</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ $border-radius: 0.5rem;
padding: 0 0 0.8rem 0;
}

&-repoinfo-lean {
padding: 0 0 0 0;
margin-bottom: 0px;
}

&-repoinfo-lean > h3 {
margin-block-end: 0px;
}

&-body {
padding: 1rem;
}
Expand Down

0 comments on commit 5dce333

Please sign in to comment.