Skip to content

Commit

Permalink
polish Profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
rrelyea committed Jun 23, 2023
1 parent f9974c2 commit 75d41de
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Pages/Portfolio-Review.razor
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Portfolio Review@(stepPath==null?"":": "+stepPath.Replace('-',' ')) - bogle.tool
familyData.UpdatePercentages();

<h4 style="max-width:450px">
Portfolio Review<br/>
Portfolio Review (@appData.CurrentProfileName)<br/>
<br/>
</h4>
<p> Bogleheads.org forum enables you to <a target=_blank href="https://www.bogleheads.org/forum/viewtopic.php?t=6212">Ask Portfolio Questions</a> ↗️. This tool makes it easy to collect your information and format it properly.</p>
Expand Down Expand Up @@ -338,7 +338,7 @@ Portfolio Review@(stepPath==null?"":": "+stepPath.Replace('-',' ')) - bogle.tool
string nextPage = folderName + nextStep?.step;

<h4 style="max-width:450px">
<NavLink href=/portfolio-review>Portfolio Review</NavLink> &gt; @step.title (@step.number)<br/>
<NavLink href=/portfolio-review>Portfolio Review (@appData.CurrentProfileName)</NavLink> &gt; @step.title (@step.number)<br/>
<a style='font-size:24pt' href="@nextPage"><span class="oi oi-arrow-right m-2 aria-hidden="true"></span></a>
<br/>
</h4>
Expand Down
3 changes: 2 additions & 1 deletion Pages/Profiles.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<h1>bogle.tools profiles</h1>

Click on profile name to make it the active profile, then navigate to which ever tool you'd like to use.<br/>
Click on profile name to make it the active profile. You'll be navigated back to your prior page.<br/>

<ul>

Expand All @@ -27,6 +27,7 @@ Click on profile name to make it the active profile, then navigate to which ever
{
appData.CurrentProfileName = profileName;
await ProfileUtilities.Load(appData);
Navigation.NavigateTo(appData.LastPageUri);
}

private async Task createProfile()
Expand Down
4 changes: 2 additions & 2 deletions Pages/Saving.razor
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Saving@(stepPath==null?": review":": "+stepPath.Replace('-',' ')) - bogle.tools
int itemTotal = 0;

<h4 style="max-width:450px">
Saving Plan <br/>
Saving Plan (@appData.CurrentProfileName)<br/>
<br/>
</h4>

Expand Down Expand Up @@ -411,7 +411,7 @@ Saving@(stepPath==null?": review":": "+stepPath.Replace('-',' ')) - bogle.tools
string nextPage = folderName + nextStep?.step;

<h4 style="max-width:450px">
<NavLink href=/saving>Saving Plan</NavLink> &gt; @step.title (@step.number)<br/>
<NavLink href=/saving>Saving Plan (@appData.CurrentProfileName)</NavLink> &gt; @step.title (@step.number)<br/>
<a style='font-size:24pt' href="@nextPage"><span class="oi oi-arrow-right m-2 aria-hidden="true"></span></a>
<br/>
</h4>
Expand Down
2 changes: 1 addition & 1 deletion Shared/Models/FamilyData/AppData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public AppData(FamilyData familyData) {
public FamilyData FamilyData { get; set; }
public List<string> ProfileNames {get; set;}
public string CurrentProfileName {get; set;}

public string LastPageUri {get; set;}
public string CurrentProfileKey
{
get {
Expand Down
2 changes: 2 additions & 0 deletions Shared/Models/FamilyData/IAppData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ public interface IAppData {
public List<string> ProfileNames {get; set;}
public string CurrentProfileName {get; set;}
public string CurrentProfileKey { get; }
public string LastPageUri {get; set;}


}
22 changes: 14 additions & 8 deletions Shared/TopLine.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@
@inject IRSData irsData
@inject IJSRuntime JS

<div style=position:absolute;left:0px;padding:10px>
<a href=/profiles>Switch Profile</a>
</div
<div style=position:absolute;right:0px;padding:10px>
Data is <a style=margin-left:0px href=/about>kept private</a>: <button @onclick=@Save>Save</button> or
<button @onclick=@Clear>Erase</button>
<div style=width:100%;vertical-align:middle>
<div style=float:left;padding:3px>
<a href=/profiles @onclick:preventDefault @onclick=navWithBackStack>Switch Profile</a>
</div
<div style=float:right>
<a style=margin-left:0px href=/about>Private data</a>: <button @onclick=@Save>Save</button> or
<button @onclick=@Clear>Erase</button>
</div>
</div>
@code{

@code{

private void navWithBackStack()
{
appData.LastPageUri = Navigation.Uri;
Navigation.NavigateTo("/profiles");
}
private async Task Save() {
await ProfileUtilities.Save(appData.CurrentProfileKey, appData.FamilyData);
}
Expand Down

0 comments on commit 75d41de

Please sign in to comment.