Skip to content

Commit

Permalink
#218 - UI preparation for managing actions at client.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed Feb 20, 2019
1 parent 0527afe commit 420b83e
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Money.UI.Backend/wwwroot/css/site.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/Money.UI.Backend/wwwroot/css/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ h4 {

/* ------ PAGING ------------------------------------------------------------------------------- */


.pager {
margin: 20px 0 40px 0;

Expand All @@ -464,3 +465,9 @@ h4 {
margin: 0 16px;
}
}

/* ------ USER --------------------------------------------------------------------------------- */

.user {
margin: 20px 15px;
}
28 changes: 28 additions & 0 deletions src/Money.UI.Blazor/Pages/User/ChangePassword.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@page "/user/changepassword"

<UserHead />

<div class="user">
<div class="row">
<div class="col-md-6">
<form method="post">
<div class="form-group">
<label for="OldPassword">Current password</label>
<input class="form-control" autofocus="" type="password" data-val="true" data-val-required="The Current password field is required." id="OldPassword" name="OldPassword">
<span class="text-danger field-validation-valid" data-valmsg-for="OldPassword" data-valmsg-replace="true"></span>
</div>
<div class="form-group">
<label for="NewPassword">New password</label>
<input class="form-control" type="password" data-val="true" data-val-length="The New password must be at least 4 and at max 100 characters long." data-val-length-max="100" data-val-length-min="4" data-val-required="The New password field is required." id="NewPassword" name="NewPassword">
<span class="text-danger field-validation-valid" data-valmsg-for="NewPassword" data-valmsg-replace="true"></span>
</div>
<div class="form-group">
<label for="ConfirmPassword">Confirm new password</label>
<input class="form-control" type="password" data-val="true" data-val-equalto="The new password and confirmation password do not match." data-val-equalto-other="*.NewPassword" id="ConfirmPassword" name="ConfirmPassword">
<span class="text-danger field-validation-valid" data-valmsg-for="ConfirmPassword" data-valmsg-replace="true"></span>
</div>
<button type="submit" class="btn btn-default">Update password</button>
</form>
</div>
</div>
</div>
25 changes: 25 additions & 0 deletions src/Money.UI.Blazor/Pages/User/Profile.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@page "/user"

<UserHead />

<div class="user">
<div class="row">
<div class="col-md-6">
<form method="post">
<div class="form-group">
<label for="UserName">UserName</label>
<input class="form-control" disabled="" type="text" id="UserName" name="UserName" value="maraf">
</div>
<div class="form-group">
<label for="Email">Email</label>
<div class="input-group">
<input class="form-control" autofocus="" type="email" data-val="true" data-val-email="The Email field is not a valid e-mail address." data-val-required="The Email field is required." id="Email" name="Email" value="">
<span class="input-group-addon" aria-hidden="true"><span class="glyphicon glyphicon-ok text-success"></span></span>
</div>
<span class="text-danger field-validation-valid" data-valmsg-for="Email" data-valmsg-replace="true"></span>
</div>
<button type="submit" class="btn btn-default">Save</button>
</form>
</div>
</div>
</div>
23 changes: 23 additions & 0 deletions src/Money.UI.Blazor/Pages/User/UserHead.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@inject Navigator Navigator
@inject Microsoft.AspNetCore.Blazor.Services.IUriHelper UriHelper

<Title Icon="user" Main="User Account" Sub="Change your account settings" />

<TabSet>
<Tab Url="@Navigator.UrlUserManage()" CssClass="@GetActiveCssClass(Navigator.UrlUserManage())">
Profile
</Tab>
<Tab Url="@Navigator.UrlUserPassword()" CssClass="@GetActiveCssClass(Navigator.UrlUserPassword())">
Password
</Tab>
</TabSet>

@functions
{
string GetActiveCssClass(string url)
{
string absolute = UriHelper.GetAbsoluteUri();
string relative = "/" + UriHelper.ToBaseRelativePath(UriHelper.GetBaseUri(), absolute);
return relative == url ? "active" : null;
}
}
2 changes: 1 addition & 1 deletion src/Money.UI.Blazor/Services/Navigator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public void OpenAbout()
=> uri.NavigateTo(UrlAbout());

public void OpenUserManage()
=> OpenExternal(UrlUserManage());
=> uri.NavigateTo(UrlUserManage());
}
}
5 changes: 4 additions & 1 deletion src/Money.UI.Blazor/Services/NavigatorUrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ public string UrlAbout()
=> "/about";

public string UrlUserManage()
=> "/manage";
=> "/user";

public string UrlUserPassword()
=> "/user/changepassword";

#region External

Expand Down

0 comments on commit 420b83e

Please sign in to comment.