feat(postit): show a live published badge beside blog post titles
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
3f73d7a909
commit
e7721bc3ab
3 changed files with 40 additions and 3 deletions
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
### Added
|
||||
|
||||
* [PostIt] Badge « Publié » à côté du titre des billets publiés dans la
|
||||
liste, mis à jour lors de la publication ou du retour en brouillon.
|
||||
* [PostIt] Gestion native du compte inspirée de `/Manage` : modification
|
||||
du nom d'utilisateur, du nom complet et de l'adresse, téléversement
|
||||
d'avatar, confirmation e-mail, préférence de courriel mensuel,
|
||||
|
|
|
|||
|
|
@ -126,7 +126,27 @@
|
|||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:BlogPostDto">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock FontWeight="SemiBold" Text="{Binding Title}" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="SemiBold"
|
||||
Text="{Binding Title}" />
|
||||
<Border
|
||||
x:Name="PublishedBadge"
|
||||
VerticalAlignment="Center"
|
||||
Padding="6,2"
|
||||
Background="#F2F7F2"
|
||||
BorderBrush="#2F6D2F"
|
||||
BorderThickness="1"
|
||||
CornerRadius="6"
|
||||
IsVisible="{Binding IsPublished}">
|
||||
<TextBlock
|
||||
FontSize="10"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#2F6D2F"
|
||||
Text="Publié" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
FontSize="10"
|
||||
Foreground="Gray"
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
#nullable enable annotations
|
||||
|
||||
using Yavsc.Abstract.Identity.Security;
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Yavsc.Blogspot;
|
||||
|
||||
public class BlogPostDto : IBlogPost
|
||||
public class BlogPostDto : IBlogPost, INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
private bool _isPublished;
|
||||
|
||||
public string AuthorId { get; set; }
|
||||
|
||||
public BlogPostAuthorDto? Author { get; set; }
|
||||
|
|
@ -30,7 +34,18 @@ public class BlogPostDto : IBlogPost
|
|||
/// follow-up request. Toggled via
|
||||
/// <c>PUT /api/BlogApi/{id}/publish</c>.
|
||||
/// </summary>
|
||||
public bool IsPublished { get; set; }
|
||||
public bool IsPublished
|
||||
{
|
||||
get => _isPublished;
|
||||
set
|
||||
{
|
||||
if (_isPublished == value)
|
||||
return;
|
||||
|
||||
_isPublished = value;
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsPublished)));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool AuthorizeCircle(long circleId)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue