@@ -3,4 +3,6 @@
|
||||
@inject NavigationManager nav
|
||||
@inject AppState state
|
||||
|
||||
<PageTitle Title="Logging in..." />
|
||||
|
||||
<p>@Message</p>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
@inject HttpClient http
|
||||
@inject AppState state
|
||||
|
||||
<PageTitle Title="Dashboard" />
|
||||
|
||||
<h3>Welcome, @state.User!.Name!</h3>
|
||||
|
||||
@if (RetrievingData)
|
||||
@@ -17,17 +19,19 @@ else
|
||||
Your employment profile was last updated <FullDateTime TheDate=@Profile.LastUpdatedOn />. Your profile currently
|
||||
lists @Profile.Skills.Length skill@(Profile.Skills.Length != 1 ? "s" : "").
|
||||
</p>
|
||||
<p><a href="/profile/view/@state.User.Id">View Your Employment Profile</a></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>You do not have an employment profile established; click “Profile”* in the menu to get started!</p>
|
||||
}
|
||||
<hr>
|
||||
<p>
|
||||
There @(ProfileCount == 1 ? "is" : "are") @(ProfileCount == 0 ? "no" : ProfileCount) employment
|
||||
profile@(ProfileCount != 1 ? "s" : "") from citizens of Gitmo Nation.
|
||||
@if (ProfileCount > 0)
|
||||
{
|
||||
<text>Take a look around and see if you can help them find work!</text>
|
||||
<text>Take a look around and see if you can help them find work!</text> <em>(coming soon)</em>
|
||||
}
|
||||
</p>
|
||||
</ErrorList>
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
@page "/citizen/profile"
|
||||
@inject HttpClient http
|
||||
@inject AppState state
|
||||
@inject NavigationManager nav
|
||||
@inject IToastService toast
|
||||
|
||||
<PageTitle Title="Edit Profile" />
|
||||
|
||||
<h3>Employment Profile</h3>
|
||||
|
||||
@if (AllLoaded)
|
||||
{
|
||||
@if (ErrorMessages.Count > 0)
|
||||
{
|
||||
<p><strong>Error</strong></p>
|
||||
@foreach (var msg in ErrorMessages)
|
||||
{
|
||||
<p>@msg</p>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<ErrorList Errors=@ErrorMessages>
|
||||
<EditForm Model=@ProfileForm OnValidSubmit=@SaveProfile>
|
||||
<DataAnnotationsValidator />
|
||||
<div class="form-row">
|
||||
@@ -111,7 +105,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
||||
}
|
||||
@if (!IsNew)
|
||||
{
|
||||
<p>
|
||||
<br><a href="/profile/view/@state.User!.Id"><span class="oi oi-file"></span> View Your User Profile</a>
|
||||
</p>
|
||||
}
|
||||
</ErrorList>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -33,6 +33,11 @@ namespace JobsJobsJobs.Client.Pages.Citizen
|
||||
/// </summary>
|
||||
private IEnumerable<Continent> Continents { get; set; } = Enumerable.Empty<Continent>();
|
||||
|
||||
/// <summary>
|
||||
/// Whether this is a new profile or not
|
||||
/// </summary>
|
||||
private bool IsNew { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Error messages from API access
|
||||
/// </summary>
|
||||
@@ -57,9 +62,15 @@ namespace JobsJobsJobs.Client.Pages.Citizen
|
||||
|
||||
if (profileTask.Result.IsOk)
|
||||
{
|
||||
ProfileForm = (profileTask.Result.Ok == null)
|
||||
? new ProfileForm()
|
||||
: ProfileForm.FromProfile(profileTask.Result.Ok);
|
||||
if (profileTask.Result.Ok == null)
|
||||
{
|
||||
ProfileForm = new ProfileForm();
|
||||
IsNew = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ProfileForm = ProfileForm.FromProfile(profileTask.Result.Ok);
|
||||
}
|
||||
if (ProfileForm.Skills.Count == 0) AddNewSkill();
|
||||
}
|
||||
else
|
||||
@@ -98,6 +109,7 @@ namespace JobsJobsJobs.Client.Pages.Citizen
|
||||
if (res.IsSuccessStatusCode)
|
||||
{
|
||||
toast.ShowSuccess("Profile Saved Successfully");
|
||||
nav.NavigateTo($"/profile/view/{state.User!.Id}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
@page "/"
|
||||
@inject IJSRuntime js
|
||||
|
||||
<PageTitle Title="Welcome!" />
|
||||
|
||||
<p>
|
||||
Future home of No Agenda Jobs, where citizens of Gitmo Nation can assist one another in finding or enhancing their
|
||||
employment. This will enable them to continue providing value for value to Adam and John, as they continue their work
|
||||
@@ -10,12 +12,12 @@
|
||||
Do you not understand the terms in the paragraph above? No worries; just head over to
|
||||
<a href="https://noagendashow.net">
|
||||
The Best Podcast in the Universe
|
||||
</a> <em><a class="audio" @onclick=@PlayTrue>(it’s true!)</a></em> and find out what you’re missing.
|
||||
</a> <em><a class="audio" @onclick=@PlayTrue>(that’s true!)</a></em> and find out what you’re missing.
|
||||
</p>
|
||||
<audio id="itstrue">
|
||||
<audio id="thatstrue">
|
||||
<source src="/audio/thats-true.mp3">
|
||||
</audio>
|
||||
|
||||
@code {
|
||||
async void PlayTrue() => await js.InvokeVoidAsync("Audio.play", "itstrue");
|
||||
async void PlayTrue() => await js.InvokeVoidAsync("Audio.play", "thatstrue");
|
||||
}
|
||||
@@ -8,8 +8,45 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<PageTitle Title=@($"Employment Profile for {Citizen.DisplayName}") />
|
||||
<ErrorList Errors=@ErrorMessages>
|
||||
<h3>View Profile</h3>
|
||||
<h2><a href="@Citizen.ProfileUrl" target="_blank">@Citizen.DisplayName</a></h2>
|
||||
<h4>@Profile.Continent!.Name, @Profile.Region</h4>
|
||||
<p>@WorkTypes</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<div>
|
||||
@(new MarkupString(Profile.Biography.ToHtml()))
|
||||
</div>
|
||||
|
||||
|
||||
@if (Profile.Skills.Length > 0)
|
||||
{
|
||||
<hr>
|
||||
<h4>Skills</h4>
|
||||
<ul>
|
||||
@foreach (var skill in Profile.Skills)
|
||||
{
|
||||
var notes = skill.Notes == null ? "" : $" ({skill.Notes})";
|
||||
<li>@skill.Description@notes</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
|
||||
@if (Profile.Experience != null)
|
||||
{
|
||||
<hr>
|
||||
<h4>Experience / Employment History</h4>
|
||||
<div>
|
||||
@(new MarkupString(Profile.Experience.ToHtml()))
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (Id == state.User!.Id.ToString())
|
||||
{
|
||||
<hr>
|
||||
<p><a href="/citizen/profile"><span class="oi oi-pencil"></span> Edit Your Profile</a></p>
|
||||
}
|
||||
</ErrorList>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -9,22 +8,62 @@ namespace JobsJobsJobs.Client.Pages.Profile
|
||||
{
|
||||
public partial class View : ComponentBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether data for this component is loading
|
||||
/// </summary>
|
||||
private bool IsLoading { get; set; } = true;
|
||||
|
||||
private Domain.Citizen? Citizen { get; set; }
|
||||
/// <summary>
|
||||
/// The citizen whose profile is being displayed
|
||||
/// </summary>
|
||||
private Domain.Citizen Citizen { get; set; } = default!;
|
||||
|
||||
private Domain.Profile? Profile { get; set; }
|
||||
/// <summary>
|
||||
/// The profile to display
|
||||
/// </summary>
|
||||
private Domain.Profile Profile { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The work types for the top of the page
|
||||
/// </summary>
|
||||
private MarkupString WorkTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
IEnumerable<string> parts()
|
||||
{
|
||||
if (Profile.SeekingEmployment)
|
||||
{
|
||||
yield return "<strong><em>CURRENTLY SEEKING EMPLOYMENT</em></strong>";
|
||||
}
|
||||
else
|
||||
{
|
||||
yield return "Not actively seeking employment";
|
||||
}
|
||||
yield return $"{(Profile.FullTime ? "I" : "Not i")}nterested in full-time employment";
|
||||
yield return $"{(Profile.RemoteWork ? "I" : "Not i")}nterested in remote opportunities";
|
||||
}
|
||||
|
||||
return new MarkupString(string.Join(" • ", parts()));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Error messages from data retrieval
|
||||
/// </summary>
|
||||
private IList<string> ErrorMessages { get; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// The ID of the citizen whose profile should be displayed
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string Id { get; set; } = default!;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ServerApi.SetJwt(http, state);
|
||||
var citizenTask = ServerApi.RetrieveOne<Domain.Citizen>(http, $"/api/citizen/{Id}");
|
||||
var profileTask = ServerApi.RetrieveOne<Domain.Profile>(http, $"/api/profile/get/{Id}");
|
||||
var citizenTask = ServerApi.RetrieveOne<Domain.Citizen>(http, $"citizen/get/{Id}");
|
||||
var profileTask = ServerApi.RetrieveOne<Domain.Profile>(http, $"profile/get/{Id}");
|
||||
|
||||
await Task.WhenAll(citizenTask, profileTask);
|
||||
|
||||
@@ -53,6 +92,8 @@ namespace JobsJobsJobs.Client.Pages.Profile
|
||||
{
|
||||
ErrorMessages.Add(profileTask.Result.Error);
|
||||
}
|
||||
|
||||
IsLoading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user