modification page de création d'oeuvre
continuous-integration/drone/push Build is failing Details

pull/29/head
Vianney JOURDY 2 years ago
parent 8c5372325a
commit d9c8149aaf

@ -4,20 +4,19 @@ using static System.Runtime.InteropServices.JavaScript.JSType;
using System.Threading.Tasks;
using Microsoft.Maui.Storage;
namespace MangaMap.Views;
public partial class createOeuvre : ContentPage
{
public Manager my_manager => (App.Current as App).MyManager;
private string imagePath;
public createOeuvre()
{
InitializeComponent();
BindingContext = this;
}
private string imagePath;
async void SelectImageClicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
@ -33,7 +32,7 @@ public partial class createOeuvre : ContentPage
imagePath = result.FullPath;
// Affichez l'image sélectionnée dans l'interface utilisateur, si nécessaire
}
}

@ -12,11 +12,9 @@ public partial class ficheAnime : ContentPage, INotifyPropertyChanged
public ficheAnime()
{
InitializeComponent();
this.BindingContext = this;
BindingContext = this;
}
public ficheAnime(Oeuvre anime)
@ -25,11 +23,9 @@ public partial class ficheAnime : ContentPage, INotifyPropertyChanged
InitializeComponent();
this.BindingContext = this;
BindingContext = this;
}
public async void AjouterListe(object sender, EventArgs e)
{
if (my_manager.UtilisateurActuel.Email == null)
@ -40,7 +36,7 @@ public partial class ficheAnime : ContentPage, INotifyPropertyChanged
string selectedOption = await DisplayActionSheet("Ajouter à quelle liste ?", "Annuler", null, "En Visionnage", "Déjà Vu", "Pour Plus Tard", "Favoris");
if (selectedOption == "Annuler")
if (selectedOption == "Annuler" || selectedOption == null)
return;
Debug.WriteLine("Selected Option: " + selectedOption);
@ -75,7 +71,6 @@ public partial class ficheAnime : ContentPage, INotifyPropertyChanged
my_manager.sauvegarder();
await Navigation.PushAsync(new listPage());
//await Shell.Current.GoToAsync("//page/secondaire/listPage");
}

@ -3,15 +3,18 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MangaMap.Views.createOeuvre"
Background="{StaticResource Secondary}">
<VerticalStackLayout>
<Label Text="Création d'une nouvelle série" FontSize="Title" Margin="0,0,0,20" TextColor="#ffffff"/>
<Label Text="Création d'une nouvelle série" FontSize="Title" Margin="0,0,0,20" TextColor="#ffffff" HorizontalOptions="Center"/>
<Button Text="Sélectionner une image" Clicked="SelectImageClicked" Margin="0,0,0,10"/>
<Entry x:Name="nameEntry" Placeholder="Nom" Margin="0,0,0,10" Style="{StaticResource Champs}"/>
<Grid ColumnDefinitions="*,*" Margin="10" ColumnSpacing="10">
<Entry x:Name="nameEntry" Placeholder="Nom" Margin="0,0,0,10" Style="{StaticResource Champs}"/>
<Entry x:Name="typeEntry" Placeholder="Type" Margin="0,0,0,10" Style="{StaticResource Champs}"/>
<Entry Grid.Column="1" x:Name="typeEntry" Placeholder="Type" Margin="0,0,0,10" Style="{StaticResource Champs}"/>
</Grid>
<Entry x:Name="descriptionEntry" Placeholder="Description" Margin="0,0,0,10" Style="{StaticResource Champs}"/>

@ -12,7 +12,7 @@
<VerticalStackLayout Grid.Row="1">
<HorizontalStackLayout>
<ImageButton
Style="{StaticResource ImageAnime}"
BackgroundColor="Orange"
@ -21,20 +21,17 @@
/>
<Label Text="{Binding AnimeModel.Nom}" FontSize="Header" VerticalOptions="Center" TextColor="White"/>
</HorizontalStackLayout>
<Grid>
<Label Text="test"/>
<Label Text="test"/>
<Label Text="test" BackgroundColor="{StaticResource Primary}"/>
</Grid>
<Label Text="{Binding AnimeModel.Genre}" BackgroundColor="{StaticResource Primary}" TextColor="White" Margin="0,0,0,30"/>
<HorizontalStackLayout x:Name="star">
<Image Source="star_full.png" WidthRequest="50" HeightRequest="50" Margin="10"/>
<HorizontalStackLayout x:Name="star">
<Image Source="star_full.png" WidthRequest="50" HeightRequest="50" Margin="10"/>
<Image Source="star_full.png" WidthRequest="50" HeightRequest="50" Margin="10"/>
<Image Source="star_full.png" WidthRequest="50" HeightRequest="50" Margin="10"/>
<Image Source="star_full.png" WidthRequest="50" HeightRequest="50" Margin="10"/>
<Image Source="star_empty.png" WidthRequest="50" HeightRequest="50" Margin="10"/>
</HorizontalStackLayout>
<Button Text="Ajouter à la liste"
@ -44,9 +41,11 @@
BackgroundColor="{StaticResource Primary}"
Clicked="AjouterListe"/>
<Label Text="{Binding AnimeModel.Type}" FontSize="Large" TextColor="White"/>
<Label Text="{Binding AnimeModel.Description}"/>
</VerticalStackLayout>
</Grid>
</ContentPage>

@ -41,7 +41,6 @@
<Label Grid.Column="1" Text="{Binding Nom}" TextColor="White" FontSize="Medium" VerticalOptions="Center" Margin="15"/>
<Label Grid.Column="2" Text="4/5" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="Center"/>
<Label Grid.Column="3" Text="{Binding NbEpisodes}" TextColor="White" FontSize="Medium" VerticalOptions="Center" HorizontalOptions="End"/>
<ImageButton Grid.Column="4" Source="addepisodes.png" BackgroundColor="#333333" HorizontalOptions="End" MaximumHeightRequest="5" MaximumWidthRequest="5" Clicked="OnAddClicked"/>
</Grid>
</DataTemplate>

@ -21,16 +21,4 @@ public partial class listPage : ContentPage
await Navigation.PushAsync(new ficheAnime(selectedAnime));
}
}
private async void OnAddClicked(object sender, EventArgs e)
{
var button = (ImageButton)sender;
var oeuvre = (Oeuvre)button.BindingContext;
// Mettez à jour le nombre d'épisodes vus
oeuvre.AjouterEpisode(1);
// Sauvegardez les modifications
my_manager.sauvegarder();
}
}

@ -24,11 +24,11 @@ public partial class settingsPage : ContentPage
private async void AddClicked(object sender, EventArgs e)
{
if(my_manager.isAdmin)
if(!my_manager.isAdmin)
{
await Shell.Current.Navigation.PushAsync(new createOeuvre());
await DisplayAlert("Erreur", "Vous n'êtes pas connecté en tant qu'Administrateur.", "OK");
return;
}
await DisplayAlert("Erreur", "Vous n'êtes pas connecté en tant qu'Administrateur.", "OK");
return;
await Shell.Current.Navigation.PushAsync(new createOeuvre());
}
}
Loading…
Cancel
Save