[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,87 +1,104 @@
<ContentPage xmlns="https://github.com/avaloniaui" <ContentPage
x:Class="PostIt.Views.Blogs.BlogsPage"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:AvaloniaEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:PostIt.ViewModels"
xmlns:postitControls="using:PostIt.Controls"
xmlns:AvaloniaEdit="clr-namespace:AvaloniaEdit;assembly=AvaloniaEdit"
xmlns:models="using:Yavsc.Blogspot"
xmlns:views="using:PostIt.Views.Blogs"
xmlns:md="using:MarkdownViewer.Core.Controls" xmlns:md="using:MarkdownViewer.Core.Controls"
mc:Ignorable="d" xmlns:models="using:Yavsc.Blogspot"
x:Class="PostIt.Views.Blogs.BlogsPage" xmlns:postitControls="using:PostIt.Controls"
x:DataType="vm:BlogsViewModel" xmlns:views="using:PostIt.Views.Blogs"
xmlns:vm="using:PostIt.ViewModels"
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"
HorizontalScrollBarVisibility="Disabled"
Padding="5"
Margin="5" Margin="5"
> Padding="5"
HorizontalScrollBarVisibility="Disabled"
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">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="Blog Posts" />
<TextBox
HorizontalAlignment="Right"
PlaceholderText="Filter by title or author..."
Text="{Binding SearchText, Mode=TwoWay}" />
</StackPanel> </StackPanel>
<CommandBar IsDynamicOverflowEnabled="True" <CommandBar HorizontalAlignment="Right" IsDynamicOverflowEnabled="True">
HorizontalAlignment="Right" >
<CommandBar.PrimaryCommands> <CommandBar.PrimaryCommands>
<CommandBarButton Label="Refresh" Command="{Binding RefreshAsync}"> <CommandBarButton Command="{Binding RefreshAsync}" Label="Refresh">
<CommandBarButton.Icon> <CommandBarButton.Icon>
<PathIcon Data="{StaticResource RefreshIcon}" /> <PathIcon Data="{StaticResource RefreshIcon}" />
</CommandBarButton.Icon> </CommandBarButton.Icon>
</CommandBarButton> </CommandBarButton>
<CommandBarButton x:Name="SaveButton" Label="Save" Command="{Binding SaveAsync}"> <CommandBarButton
x:Name="SaveButton"
Command="{Binding SaveAsync}"
Label="Save">
<CommandBarButton.Icon> <CommandBarButton.Icon>
<PathIcon Data="{StaticResource SaveIcon}" /> <PathIcon Data="{StaticResource SaveIcon}" />
</CommandBarButton.Icon> </CommandBarButton.Icon>
</CommandBarButton> </CommandBarButton>
<CommandBarButton Label="Delete" Command="{Binding DeleteAsync}"> <CommandBarButton Command="{Binding DeleteAsync}" Label="Delete">
<CommandBarButton.Icon> <CommandBarButton.Icon>
<PathIcon Data="{StaticResource DeleteIcon}" /> <PathIcon Data="{StaticResource DeleteIcon}" />
</CommandBarButton.Icon> </CommandBarButton.Icon>
</CommandBarButton> </CommandBarButton>
<CommandBarButton Label="Ajouter fichiers" Click="AddAttachment_Click" <CommandBarButton
x:Name="AddAttachmentButton"> x:Name="AddAttachmentButton"
Click="AddAttachment_Click"
Label="Ajouter fichiers">
<CommandBarButton.Icon> <CommandBarButton.Icon>
<PathIcon Data="{StaticResource AddIcon}" /> <PathIcon Data="{StaticResource AddIcon}" />
</CommandBarButton.Icon> </CommandBarButton.Icon>
</CommandBarButton> </CommandBarButton>
<CommandBarButton x:Name="ManageAclButton" <CommandBarButton
Label="ACL" x:Name="ManageAclButton"
Command="{Binding ManageAclAsync}"> Command="{Binding ManageAclAsync}"
Label="ACL">
<CommandBarButton.Icon> <CommandBarButton.Icon>
<PathIcon Data="{StaticResource AclIcon}" /> <PathIcon Data="{StaticResource AclIcon}" />
</CommandBarButton.Icon> </CommandBarButton.Icon>
</CommandBarButton> </CommandBarButton>
<CommandBarButton x:Name="OpenCirclesButton" <CommandBarButton
Label="Mes cercles" Command="{Binding OpenCirclesAsync}"> x:Name="OpenCirclesButton"
Command="{Binding OpenCirclesAsync}"
Label="Mes cercles">
<CommandBarButton.Icon> <CommandBarButton.Icon>
<PathIcon Data="{StaticResource CircleIcon}" /> <PathIcon Data="{StaticResource CircleIcon}" />
</CommandBarButton.Icon> </CommandBarButton.Icon>
</CommandBarButton> </CommandBarButton>
<CommandBarToggleButton Label="Publié" <CommandBarToggleButton
Command="{Binding TogglePublishCommand}" Command="{Binding TogglePublishCommand}"
IsChecked="{Binding DraftIsPublished, Mode=TwoWay}"> IsChecked="{Binding DraftIsPublished, Mode=TwoWay}"
Label="Publié">
<CommandBarToggleButton.Icon> <CommandBarToggleButton.Icon>
<PathIcon Data="{StaticResource PublishedIcon}" /> <PathIcon Data="{StaticResource PublishedIcon}" />
</CommandBarToggleButton.Icon> </CommandBarToggleButton.Icon>
</CommandBarToggleButton> </CommandBarToggleButton>
<CommandBarToggleButton Label="Markdown Viewer" <CommandBarToggleButton IsChecked="{Binding IsMarkdownViewerVisible, Mode=TwoWay}" Label="Markdown Viewer">
IsChecked="{Binding IsMarkdownViewerVisible, Mode=TwoWay}">
<CommandBarToggleButton.Icon> <CommandBarToggleButton.Icon>
<PathIcon Data="{StaticResource MarkdownIcon}" /> <PathIcon Data="{StaticResource MarkdownIcon}" />
</CommandBarToggleButton.Icon> </CommandBarToggleButton.Icon>
</CommandBarToggleButton> </CommandBarToggleButton>
<CommandBarButton x:Name="OpenSignatureDevButton" <CommandBarButton
Label="[DEV] Signature" Command="{Binding OpenSignatureDevAsync}"> x:Name="OpenSignatureDevButton"
Command="{Binding OpenSignatureDevAsync}"
Label="[DEV] Signature">
<CommandBarButton.Icon> <CommandBarButton.Icon>
<PathIcon Data="{StaticResource SignIcon}" /> <PathIcon Data="{StaticResource SignIcon}" />
</CommandBarButton.Icon> </CommandBarButton.Icon>
@ -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
Grid.Row="2"
Padding="8"
BorderBrush="Gray"
BorderThickness="1"
IsVisible="{Binding !IsMarkdownViewerVisible}"> IsVisible="{Binding !IsMarkdownViewerVisible}">
<Grid RowSpacing="10" <Grid
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="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}" Document="{Binding DraftArticleDocument, Mode=TwoWay}"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
ShowLineNumbers="True" ShowLineNumbers="True"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"/> WordWrap="True"
BorderThickness="1"
BorderBrush="LightGray"
CornerRadius="5"
Padding="5,5,5,15"
/>
<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,8 +207,7 @@
</StackPanel> </StackPanel>
</Border> </Border>
<postitControls:StatusBar Grid.Row="4" <postitControls:StatusBar Grid.Row="4" DataContext="{Binding ActionStatus}" />
DataContext="{Binding ActionStatus}" />
</Grid> </Grid>
</Border> </Border>