[PostIt][Blogs] Margins and wrap mode #55
Some checks failed
Dotnet build and test / build (pull_request) Failing after 16m51s

This commit is contained in:
Paul Schneider 2026-09-26 11:42:28 +01:00
commit 94a9239cd5
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12

View file

@ -1,93 +1,110 @@
<ContentPage xmlns="https://github.com/avaloniaui" <ContentPage
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="PostIt.Views.Blogs.BlogsPage"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns="https://github.com/avaloniaui"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:PostIt.ViewModels" xmlns:AvaloniaEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:postitControls="using:PostIt.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:AvaloniaEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="using:Yavsc.Blogspot" xmlns:md="using:MarkdownViewer.Core.Controls"
xmlns:views="using:PostIt.Views.Blogs" xmlns:models="using:Yavsc.Blogspot"
xmlns:md="using:MarkdownViewer.Core.Controls" xmlns:postitControls="using:PostIt.Controls"
mc:Ignorable="d" xmlns:views="using:PostIt.Views.Blogs"
x:Class="PostIt.Views.Blogs.BlogsPage" xmlns:vm="using:PostIt.ViewModels"
x:DataType="vm:BlogsViewModel" HorizontalAlignment="Stretch"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
VerticalAlignment="Stretch"> x:DataType="vm:BlogsViewModel"
mc:Ignorable="d">
<Design.DataContext> <Design.DataContext>
<vm:BlogsViewModel /> <vm:BlogsViewModel />
</Design.DataContext> </Design.DataContext>
<ScrollViewer <ScrollViewer
VerticalScrollBarVisibility="Visible" Margin="5"
HorizontalScrollBarVisibility="Disabled" Padding="5"
Padding="5" HorizontalScrollBarVisibility="Disabled"
Margin="5" VerticalScrollBarVisibility="Visible">
>
<StackPanel HorizontalAlignment="Stretch"> <StackPanel HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" Spacing="10" Margin="5"> <StackPanel
<TextBlock Text="Blog Posts" FontSize="20" FontWeight="SemiBold" /> Margin="5"
<TextBox HorizontalAlignment="Right" Orientation="Horizontal"
Text="{Binding SearchText, Mode=TwoWay}" PlaceholderText="Filter by title or author..." /> Spacing="10">
</StackPanel> <TextBlock
<CommandBar IsDynamicOverflowEnabled="True" FontSize="20"
HorizontalAlignment="Right" > FontWeight="SemiBold"
<CommandBar.PrimaryCommands> Text="Blog Posts" />
<CommandBarButton Label="Refresh" Command="{Binding RefreshAsync}"> <TextBox
<CommandBarButton.Icon> HorizontalAlignment="Right"
<PathIcon Data="{StaticResource RefreshIcon}" /> PlaceholderText="Filter by title or author..."
</CommandBarButton.Icon> Text="{Binding SearchText, Mode=TwoWay}" />
</CommandBarButton> </StackPanel>
<CommandBarButton x:Name="SaveButton" Label="Save" Command="{Binding SaveAsync}"> <CommandBar HorizontalAlignment="Right" IsDynamicOverflowEnabled="True">
<CommandBarButton.Icon> <CommandBar.PrimaryCommands>
<PathIcon Data="{StaticResource SaveIcon}" /> <CommandBarButton Command="{Binding RefreshAsync}" Label="Refresh">
</CommandBarButton.Icon> <CommandBarButton.Icon>
</CommandBarButton> <PathIcon Data="{StaticResource RefreshIcon}" />
<CommandBarButton Label="Delete" Command="{Binding DeleteAsync}"> </CommandBarButton.Icon>
<CommandBarButton.Icon> </CommandBarButton>
<PathIcon Data="{StaticResource DeleteIcon}" /> <CommandBarButton
</CommandBarButton.Icon> x:Name="SaveButton"
</CommandBarButton> Command="{Binding SaveAsync}"
<CommandBarButton Label="Ajouter fichiers" Click="AddAttachment_Click" Label="Save">
x:Name="AddAttachmentButton"> <CommandBarButton.Icon>
<CommandBarButton.Icon> <PathIcon Data="{StaticResource SaveIcon}" />
<PathIcon Data="{StaticResource AddIcon}" /> </CommandBarButton.Icon>
</CommandBarButton.Icon> </CommandBarButton>
</CommandBarButton> <CommandBarButton Command="{Binding DeleteAsync}" Label="Delete">
<CommandBarButton x:Name="ManageAclButton" <CommandBarButton.Icon>
Label="ACL" <PathIcon Data="{StaticResource DeleteIcon}" />
Command="{Binding ManageAclAsync}"> </CommandBarButton.Icon>
<CommandBarButton.Icon> </CommandBarButton>
<PathIcon Data="{StaticResource AclIcon}" /> <CommandBarButton
</CommandBarButton.Icon> x:Name="AddAttachmentButton"
</CommandBarButton> Click="AddAttachment_Click"
<CommandBarButton x:Name="OpenCirclesButton" Label="Ajouter fichiers">
Label="Mes cercles" Command="{Binding OpenCirclesAsync}"> <CommandBarButton.Icon>
<CommandBarButton.Icon> <PathIcon Data="{StaticResource AddIcon}" />
<PathIcon Data="{StaticResource CircleIcon}" /> </CommandBarButton.Icon>
</CommandBarButton.Icon> </CommandBarButton>
</CommandBarButton> <CommandBarButton
<CommandBarToggleButton Label="Publié" x:Name="ManageAclButton"
Command="{Binding TogglePublishCommand}" Command="{Binding ManageAclAsync}"
IsChecked="{Binding DraftIsPublished, Mode=TwoWay}"> Label="ACL">
<CommandBarToggleButton.Icon> <CommandBarButton.Icon>
<PathIcon Data="{StaticResource PublishedIcon}" /> <PathIcon Data="{StaticResource AclIcon}" />
</CommandBarToggleButton.Icon> </CommandBarButton.Icon>
</CommandBarToggleButton> </CommandBarButton>
<CommandBarToggleButton Label="Markdown Viewer" <CommandBarButton
IsChecked="{Binding IsMarkdownViewerVisible, Mode=TwoWay}"> x:Name="OpenCirclesButton"
<CommandBarToggleButton.Icon> Command="{Binding OpenCirclesAsync}"
<PathIcon Data="{StaticResource MarkdownIcon}" /> Label="Mes cercles">
</CommandBarToggleButton.Icon> <CommandBarButton.Icon>
</CommandBarToggleButton> <PathIcon Data="{StaticResource CircleIcon}" />
<CommandBarButton x:Name="OpenSignatureDevButton" </CommandBarButton.Icon>
Label="[DEV] Signature" Command="{Binding OpenSignatureDevAsync}"> </CommandBarButton>
<CommandBarButton.Icon> <CommandBarToggleButton
<PathIcon Data="{StaticResource SignIcon}" /> Command="{Binding TogglePublishCommand}"
</CommandBarButton.Icon> IsChecked="{Binding DraftIsPublished, Mode=TwoWay}"
</CommandBarButton> Label="Publié">
</CommandBar.PrimaryCommands> <CommandBarToggleButton.Icon>
</CommandBar> <PathIcon Data="{StaticResource PublishedIcon}" />
</CommandBarToggleButton.Icon>
</CommandBarToggleButton>
<CommandBarToggleButton IsChecked="{Binding IsMarkdownViewerVisible, Mode=TwoWay}" Label="Markdown Viewer">
<CommandBarToggleButton.Icon>
<PathIcon Data="{StaticResource MarkdownIcon}" />
</CommandBarToggleButton.Icon>
</CommandBarToggleButton>
<CommandBarButton
x:Name="OpenSignatureDevButton"
Command="{Binding OpenSignatureDevAsync}"
Label="[DEV] Signature">
<CommandBarButton.Icon>
<PathIcon Data="{StaticResource SignIcon}" />
</CommandBarButton.Icon>
</CommandBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
<Grid Margin="12" RowSpacing="12"> <Grid Margin="12" RowSpacing="12">
<Grid.RowDefinitions> <Grid.RowDefinitions>
@ -95,30 +112,49 @@
<RowDefinition Height="*" /> <RowDefinition Height="*" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="1" Padding="8"> <Border
<ListBox ItemsSource="{Binding FilteredPosts}" Grid.Row="1"
SelectedItem="{Binding SelectedPost, Mode=TwoWay}"> Padding="8"
BorderBrush="Gray"
BorderThickness="1">
<ListBox ItemsSource="{Binding FilteredPosts}" SelectedItem="{Binding SelectedPost, Mode=TwoWay}">
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate x:DataType="models:BlogPostDto"> <DataTemplate x:DataType="models:BlogPostDto">
<StackPanel Spacing="4" > <StackPanel Spacing="4">
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" /> <TextBlock FontWeight="SemiBold" Text="{Binding Title}" />
<TextBlock Text="{Binding DateModified, StringFormat='Updated: {0:yyyy-MM-dd HH:mm}'}" FontSize="10" Foreground="Gray" /> <TextBlock
<TextBlock Text="{Binding AuthorId}" FontSize="10" Foreground="DarkSlateGray" /> FontSize="10"
Foreground="Gray"
Text="{Binding DateModified, StringFormat='Updated: {0:yyyy-MM-dd HH:mm}'}" />
<TextBlock
FontSize="10"
Foreground="DarkSlateGray"
Text="{Binding AuthorId}" />
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
</ListBox> </ListBox>
</Border> </Border>
<md:MarkdownViewer Grid.Row="2" Name="MarkdownViewer" <Border
IsVisible="{Binding IsMarkdownViewerVisible}" Grid.Row="2"
MarkdownText="{Binding DraftArticle}" /> Padding="8"
BorderBrush="Gray"
BorderThickness="1"
IsVisible="{Binding IsMarkdownViewerVisible}">
<md:MarkdownViewer Name="MarkdownViewer" MarkdownText="{Binding DraftArticle}" />
</Border>
<Border Grid.Row="2" BorderBrush="Gray" BorderThickness="1" Padding="8" <Border
IsVisible="{Binding !IsMarkdownViewerVisible}"> Grid.Row="2"
<Grid RowSpacing="10" Padding="8"
HorizontalAlignment="Stretch" BorderBrush="Gray"
VerticalAlignment="Stretch"> BorderThickness="1"
IsVisible="{Binding !IsMarkdownViewerVisible}">
<Grid
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
RowSpacing="10">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -129,21 +165,38 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Text="Post detail" FontWeight="SemiBold" /> <TextBlock
<TextBox x:Name="DraftTitleTextBox" Grid.Row="0"
Grid.Row="1" Text="{Binding DraftTitle, Mode=TwoWay}" PlaceholderText="Title" /> FontWeight="SemiBold"
Text="Post detail" />
<TextBox
x:Name="DraftTitleTextBox"
Grid.Row="1"
PlaceholderText="Title"
Text="{Binding DraftTitle, Mode=TwoWay}" />
<AvaloniaEdit:TextEditor <AvaloniaEdit:TextEditor
Grid.Row="2" VerticalAlignment="Stretch" Grid.Row="2"
VerticalAlignment="Stretch"
Document="{Binding DraftArticleDocument, Mode=TwoWay}"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
ShowLineNumbers="True"
WordWrap="True"
BorderThickness="1"
BorderBrush="LightGray"
CornerRadius="5"
Padding="5,5,5,15"
Document="{Binding DraftArticleDocument, Mode=TwoWay}" />
ShowLineNumbers="True"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"/>
<Border Grid.Row="3" BorderBrush="LightGray" BorderThickness="1" Padding="8"> <Border
Grid.Row="3"
Padding="8"
BorderBrush="LightGray"
BorderThickness="1">
<StackPanel Spacing="4"> <StackPanel Spacing="4">
<TextBlock Text="Pièces jointes" FontWeight="SemiBold" /> <TextBlock FontWeight="SemiBold" Text="Pièces jointes" />
<ItemsControl ItemsSource="{Binding DraftAttachments}"> <ItemsControl ItemsSource="{Binding DraftAttachments}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
@ -154,12 +207,11 @@
</StackPanel> </StackPanel>
</Border> </Border>
<postitControls:StatusBar Grid.Row="4" <postitControls:StatusBar Grid.Row="4" DataContext="{Binding ActionStatus}" />
DataContext="{Binding ActionStatus}" />
</Grid> </Grid>
</Border> </Border>
</Grid> </Grid>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</ContentPage> </ContentPage>