-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
259 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,91 @@ | ||
@page "/" | ||
|
||
<h1>Hello, world!</h1> | ||
|
||
Welcome to your new app. | ||
|
||
<SurveyPrompt Title="How is Blazor working for you?" /> | ||
<div class="bg-gray-100 p-8"> | ||
<div> | ||
<h2 class="text-2xl">Today</h2> | ||
<div class="whitespace-nowrap overflow-x-auto"> | ||
<Ticket | ||
Name="Create Something Something" | ||
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tinciduLorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tincidunt sed...." | ||
Priority="1" | ||
Assignee="Isala Piyarisi" | ||
Status="todo" | ||
DueDate=@DateTime.Parse("03/11/2021") | ||
EstimatedTime=@TimeSpan.Parse("02:00:00") /> | ||
<Ticket | ||
Name="Create Something Something" | ||
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tinciduLorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tincidunt sed...." | ||
Priority="2" | ||
Assignee="Isala Piyarisi" | ||
Status="inprogress" | ||
DueDate=@DateTime.Parse("03/11/2021") | ||
EstimatedTime=@TimeSpan.Parse("02:00:00") /> | ||
<Ticket | ||
Name="Create Something Something" | ||
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tinciduLorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tincidunt sed...." | ||
Priority="3" | ||
Assignee="Isala Piyarisi" | ||
Status="done" | ||
DueDate=@DateTime.Parse("03/11/2021") | ||
EstimatedTime=@TimeSpan.Parse("02:00:00") /> | ||
<Ticket | ||
Name="Create Something Something" | ||
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tinciduLorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tincidunt sed...." | ||
Priority="2" | ||
Assignee="Isala Piyarisi" | ||
Status="done" | ||
DueDate=@DateTime.Parse("03/11/2021") | ||
EstimatedTime=@TimeSpan.Parse("02:00:00") /> | ||
</div> | ||
</div> | ||
<div> | ||
<h2 class="text-2xl">Overdue</h2> | ||
<div class="whitespace-nowrap overflow-x-auto"> | ||
<Ticket | ||
Name="Create Something Something" | ||
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tinciduLorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tincidunt sed...." | ||
Priority="3" | ||
Assignee="Isala Piyarisi" | ||
Status="todo" | ||
DueDate=@DateTime.Parse("03/11/2021") | ||
EstimatedTime=@TimeSpan.Parse("02:00:00") /> | ||
<Ticket | ||
Name="Create Something Something" | ||
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tinciduLorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tincidunt sed...." | ||
Priority="1" | ||
Assignee="Isala Piyarisi" | ||
Status="inprogress" | ||
DueDate=@DateTime.Parse("03/11/2021") | ||
EstimatedTime=@TimeSpan.Parse("02:00:00") /> | ||
</div> | ||
</div> | ||
<div> | ||
<h2 class="text-2xl">Next</h2> | ||
<div class="whitespace-nowrap overflow-x-auto"> | ||
<Ticket | ||
Name="Create Something Something" | ||
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tinciduLorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tincidunt sed...." | ||
Priority="2" | ||
Assignee="Isala Piyarisi" | ||
Status="todo" | ||
DueDate=@DateTime.Parse("03/11/2021") | ||
EstimatedTime=@TimeSpan.Parse("02:00:00") /> | ||
<Ticket | ||
Name="Create Something Something" | ||
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tinciduLorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tincidunt sed...." | ||
Priority="1" | ||
Assignee="Isala Piyarisi" | ||
Status="inprogress" | ||
DueDate=@DateTime.Parse("03/11/2021") | ||
EstimatedTime=@TimeSpan.Parse("02:00:00") /> | ||
<Ticket | ||
Name="Create Something Something" | ||
Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tinciduLorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce et sapien pulvinar ante pellentesque lacinia. Etiam tincidunt sed...." | ||
Priority="3" | ||
Assignee="Isala Piyarisi" | ||
Status="done" | ||
DueDate=@DateTime.Parse("03/11/2021") | ||
EstimatedTime=@TimeSpan.Parse("02:00:00") /> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,43 @@ | ||
@inherits LayoutComponentBase | ||
@inject NavigationManager _navigationManager | ||
@inject ProtectedLocalStorage _protectedLocalStore | ||
|
||
<header> | ||
<NavMenu /> | ||
<NavMenu CurrentCompany="@_currentCompany" /> | ||
</header> | ||
<div class="container mx-auto"> | ||
<Breadcrumbs CurrentCompany="@_currentCompany" /> | ||
@Body | ||
</div> | ||
</div> | ||
|
||
|
||
@code | ||
{ | ||
public static Navigation.Navigation NavCtrl; | ||
|
||
private string _currentCompany; | ||
|
||
protected override void OnInitialized() | ||
{ | ||
NavCtrl = new Navigation.Navigation(_navigationManager, _protectedLocalStore); | ||
_currentCompany = NavCtrl.GetCurrentCompany(); | ||
} | ||
|
||
protected override async Task OnAfterRenderAsync(bool firstRender) | ||
{ | ||
if (firstRender) | ||
{ | ||
var currentPath = _navigationManager.ToBaseRelativePath(_navigationManager.Uri).Split("/"); | ||
|
||
_currentCompany = await NavCtrl.RestoreLastCompany(); | ||
|
||
if (currentPath.First() != "" && currentPath.First() != _currentCompany) | ||
{ | ||
NavCtrl.SetCurrentCompany(currentPath.First()); | ||
_currentCompany = currentPath.First(); | ||
} | ||
|
||
StateHasChanged(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@inject NavigationManager _navigationManager | ||
|
||
<div class="my-5"> | ||
<ol class="list-reset flex text-grey-dark"> | ||
@foreach (var url in _urLs) | ||
{ | ||
<li> | ||
<a href="@url.Url" class="font-bold">@url.Name</a> | ||
</li> | ||
<li> | ||
<span class="mx-2">></span> | ||
</li> | ||
} | ||
|
||
</ol> | ||
</div> | ||
|
||
@code { | ||
[Parameter] | ||
public string CurrentCompany { get; set; } | ||
|
||
private List<Breadcrumb> _urLs; | ||
|
||
protected override void OnParametersSet() | ||
{ | ||
var currentPath = _navigationManager.ToBaseRelativePath(_navigationManager.Uri).Split("/"); | ||
var subPaths = currentPath.Skip(1); | ||
|
||
_urLs = new List<Breadcrumb> {new Breadcrumb {Name = Navigation.TitleCase(CurrentCompany), Url = "/"}}; | ||
|
||
var url = "/" + CurrentCompany; | ||
foreach (var path in subPaths) | ||
{ | ||
if (path == "") | ||
continue; | ||
url += "/" + path; | ||
_urLs.Add(new Breadcrumb {Name = Navigation.TitleCase(path), Url = url}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
<select value="@CurrentCompany" @onchange="SetCompany" class="block w-52 text-gray-700 py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 mx-auto" name="company"> | ||
@foreach (var company in NavMenu.NavCtrl.CompanyLinks) | ||
<select value="@CurrentCompany" @onchange="SetCompany" class="block w-52 text-gray-700 py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 mx-auto" name="company"> | ||
@foreach (var company in MainLayout.NavCtrl.CompanyLinks) | ||
{ | ||
<option value=@company.Uri>@company.Name</option> | ||
} | ||
</select> | ||
|
||
@code { | ||
|
||
[Parameter] | ||
public string CurrentCompany { get; set; } | ||
|
||
private void SetCompany(ChangeEventArgs e) | ||
{ | ||
if (e.Value != null) CurrentCompany = e.Value.ToString(); | ||
|
||
NavMenu.NavCtrl.SetCurrentCompany(CurrentCompany); | ||
MainLayout.NavCtrl.SetCurrentCompany(CurrentCompany); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.