first push
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
@using MudBlazor
|
||||
@inherits LayoutComponentBase
|
||||
@* Required *@
|
||||
<MudThemeProvider />
|
||||
<MudPopoverProvider />
|
||||
|
||||
@* Needed for dialogs *@
|
||||
<MudDialogProvider />
|
||||
|
||||
@* Needed for snackbars *@
|
||||
<MudSnackbarProvider />
|
||||
<MudLayout>
|
||||
|
||||
|
||||
<!-- Ton menu -->
|
||||
<NavMenu />
|
||||
|
||||
<MudMainContent>
|
||||
<MudBreakpointProvider>
|
||||
@Body
|
||||
</MudBreakpointProvider>
|
||||
</MudMainContent>
|
||||
|
||||
</MudLayout>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
Une erreur dans le traitement est survenue.
|
||||
<a href="" class="reload">Recharger</a>
|
||||
</div>
|
||||
@@ -0,0 +1,112 @@
|
||||
.page {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.main-wrapper {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
}
|
||||
.navbar {
|
||||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
|
||||
}
|
||||
|
||||
.top-row {
|
||||
background-color: #f7f7f7;
|
||||
border-bottom: 1px solid #d6d5d5;
|
||||
justify-content: flex-end;
|
||||
height: 3.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
white-space: nowrap;
|
||||
margin-left: 1.5rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.top-row ::deep a:first-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
@media (max-width: 640.98px) {
|
||||
.top-row {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1px) {
|
||||
.page {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.top-row.auth ::deep a:first-child {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.top-row, article {
|
||||
padding-left: 2rem !important;
|
||||
padding-right: 1.5rem !important;
|
||||
|
||||
}
|
||||
}
|
||||
.content-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
#blazor-error-ui {
|
||||
background: lightyellow;
|
||||
bottom: 0;
|
||||
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
|
||||
display: none;
|
||||
left: 0;
|
||||
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using ModelsLib
|
||||
@using MudBlazor
|
||||
@inject NavigationManager Navigation
|
||||
@rendermode InteractiveServer
|
||||
@inject IWebHostEnvironment Env
|
||||
@inject PhotoService ShootingDb
|
||||
@inject IDialogService DialogService
|
||||
<MudHidden Breakpoint="Breakpoint.MdAndDown">
|
||||
|
||||
<MudAppBar Color="Color.Dark" Elevation="4">
|
||||
|
||||
<!-- Logo -->
|
||||
<MudText Typo="Typo.h6" Class="ml-2">
|
||||
<MudNavLink Href="/" Class="nav-link">
|
||||
Photo Sharing Helrira
|
||||
</MudNavLink>
|
||||
</MudText>
|
||||
|
||||
<MudSpacer />
|
||||
|
||||
<!-- Menu desktop -->
|
||||
<MudNavMenu Class="d-flex">
|
||||
<MudNavLink Href="/shootingdesire" Class="nav-link">
|
||||
Projets
|
||||
</MudNavLink>
|
||||
<MudNavLink Href="/Contact" Class="nav-link">
|
||||
Contact
|
||||
</MudNavLink>
|
||||
</MudNavMenu>
|
||||
|
||||
<!-- Recherche desktop -->
|
||||
<MudStack Row="true" Spacing="2" Class="ml-4">
|
||||
<MudTextField @bind-Value="Id"
|
||||
Label="Recherche"
|
||||
Variant="Variant.Outlined"
|
||||
Style="color: white;"
|
||||
InputStyle="color: white;" />
|
||||
|
||||
<MudButton OnClick="SendSelection"
|
||||
Variant="Variant.Outlined"
|
||||
Color="Color.Inherit">
|
||||
Rechercher
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
|
||||
</MudAppBar>
|
||||
|
||||
</MudHidden>
|
||||
<MudHidden Breakpoint="Breakpoint.LgAndUp">
|
||||
<!-- Drawer mobile -->
|
||||
<!-- AppBar mobile -->
|
||||
<MudAppBar Color="Color.Dark" Elevation="4">
|
||||
<!-- Bouton burger -->
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu"
|
||||
Color="Color.Default"
|
||||
OnClick="@(() => _drawerOpen = true)" />
|
||||
|
||||
<MudText Typo="Typo.h6" Class="ml-2">
|
||||
<MudNavLink Href="/" Class="nav-link">
|
||||
Photo Sharing Helrira
|
||||
</MudNavLink>
|
||||
</MudText>
|
||||
|
||||
<MudSpacer />
|
||||
|
||||
<!-- Bouton recherche -->
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Search"
|
||||
Color="Color.Default"
|
||||
OnClick="OpenSearchDialogAsync" />
|
||||
</MudAppBar>
|
||||
|
||||
<!-- Drawer mobile -->
|
||||
<MudDrawer @bind-Open="_drawerOpen"
|
||||
Anchor="Anchor.Left"
|
||||
Variant="DrawerVariant.Temporary"
|
||||
Color="Color.Dark"
|
||||
Class="custom-drawer drawer-fixed-width">
|
||||
|
||||
<MudStack Spacing="2" Class="pa-3" Style="display:flex; flex-direction:column; height:100%;">
|
||||
<MudNavMenu Class="flex-grow-1">
|
||||
<MudNavLink Href="/shootingdesire">Projets</MudNavLink>
|
||||
<MudNavLink Href="/Contact">Contact</MudNavLink>
|
||||
</MudNavMenu>
|
||||
</MudStack>
|
||||
|
||||
</MudDrawer>
|
||||
</MudHidden>
|
||||
@code {
|
||||
private string Id { get; set; } = "";
|
||||
|
||||
private bool _drawerOpen = false;
|
||||
|
||||
private async Task OpenSearchDialogAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
var parameters = new DialogParameters();
|
||||
parameters.Add("OnSearch", EventCallback.Factory.Create<string>(this, SendSelectionMobil));
|
||||
var options = new DialogOptions
|
||||
{
|
||||
MaxWidth = MaxWidth.Small,
|
||||
FullWidth = true
|
||||
};
|
||||
var dialogRef = await DialogService.ShowAsync<SearchDialog>("", parameters, options);
|
||||
var result = await dialogRef.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
Console.WriteLine("Résultat : " + result.Data);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("ERREUR DIALOG : " + ex.Message);
|
||||
Console.WriteLine(ex.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
void ToggleDrawer() => _drawerOpen = !_drawerOpen;
|
||||
/// <summary>
|
||||
/// a la validation de la saisie
|
||||
/// </summary>
|
||||
private async void SendSelectionMobil(string value)
|
||||
{
|
||||
Id = value;
|
||||
//si une saisie est faite dans le champs
|
||||
SendSelection();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// a la validation de la saisie
|
||||
/// </summary>
|
||||
private async void SendSelection()
|
||||
{
|
||||
//si une saisie est faite dans le champs
|
||||
if (!string.IsNullOrWhiteSpace(Id))
|
||||
{
|
||||
string idSaisie = Id.ToLower().Trim();//passage en full minuscule + suppression espace
|
||||
var path = Path.Combine(Env.WebRootPath, "Photos", idSaisie);
|
||||
|
||||
bool dossierExiste = Directory.Exists(path);//verification de présence du dossier
|
||||
|
||||
if (dossierExiste)
|
||||
{
|
||||
ShootingData datas = ShootingDb.GetInfosShooting(idSaisie);
|
||||
if (datas == null)
|
||||
{
|
||||
await ShootingDb.AddShootingInfoPerDefault(idSaisie);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (datas.IsPhotosSelected)
|
||||
{
|
||||
Navigation.NavigateTo($"/Share?Id={idSaisie}");//redirection vers le shooting post retouche
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/PhotoSelect?Id={idSaisie}");//redirection vers le shooting à selectionné
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.NavigateTo($"/PhotoSelectError");//redirection vers page d'erreur
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
.navbar-toggler {
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
width: 3.5rem;
|
||||
height: 2.5rem;
|
||||
color: white;
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
right: 1rem;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.navbar-toggler:checked {
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.top-row {
|
||||
height: 3.5rem;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
.drawer-fixed-width {
|
||||
width: 250px; /* largeur fixe */
|
||||
min-width: 250px; /* ne peut pas rétrécir */
|
||||
max-width: 250px; /* ne peut pas grandir */
|
||||
}
|
||||
|
||||
.drawer-fixed-width .mud-drawer-content {
|
||||
overflow-x: hidden; /* empêche le scroll horizontal */
|
||||
}
|
||||
|
||||
.custom-drawer.mud-shrink {
|
||||
height: 100vh !important; /* prend toute la hauteur de l’écran */
|
||||
min-height: 100vh !important;
|
||||
max-height: 100vh !important;
|
||||
overflow-y: auto; /* scroll uniquement si contenu > hauteur */
|
||||
}
|
||||
.bi {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
margin-right: 0.75rem;
|
||||
top: -1px;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
font-size: 1.1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.nav-item:first-of-type {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.nav-item:last-of-type {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.nav-item ::deep .nav-link {
|
||||
color: #d7d7d7;
|
||||
background: auto;
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
height: 3rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 3rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav-item ::deep .nav-link:hover {
|
||||
background-color: rgba(255,255,255,0.5);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-scrollable {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navbar-toggler:checked ~ .nav-scrollable {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.navbar-toggler {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-scrollable {
|
||||
/* Never collapse the sidebar for wide screens */
|
||||
display: block;
|
||||
/* Allow sidebar to scroll for tall menus */
|
||||
height: calc(100vh - 3.5rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
@using MudBlazor
|
||||
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudTextField @bind-Value="SearchTerm"
|
||||
Label="Recherche"
|
||||
Variant="Variant.Outlined"
|
||||
FullWidth="true" />
|
||||
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Primary"
|
||||
Class="mt-2"
|
||||
OnClick="Submit">
|
||||
Rechercher
|
||||
</MudButton>
|
||||
</DialogContent>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
private string SearchTerm { get; set; } = "";
|
||||
|
||||
[Parameter] public EventCallback<string> OnSearch { get; set; }
|
||||
|
||||
[CascadingParameter] IMudDialogInstance Dialog { get; set; }
|
||||
|
||||
private async Task Submit()
|
||||
{
|
||||
if (OnSearch.HasDelegate)
|
||||
await OnSearch.InvokeAsync(SearchTerm);
|
||||
|
||||
Dialog?.Close(DialogResult.Ok(SearchTerm)); // IMPORTANT
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
.drawer-fixed-width {
|
||||
width: 250px;
|
||||
min-width: 250px;
|
||||
max-width: 250px;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.custom-drawer .mud-drawer-content {
|
||||
overflow-y: auto;
|
||||
}
|
||||
Reference in New Issue
Block a user