71 lines
4.5 KiB
XML
71 lines
4.5 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="using:Flawless.Client.ViewModels"
|
|
xmlns:u="https://irihi.tech/ursa"
|
|
x:DataType="vm:RepositoryViewModel"
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
x:Class="Flawless.Client.Views.RepositoryPage.RepoIssuePageView">
|
|
|
|
<DockPanel>
|
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Spacing="8" Margin="0 0 0 12">
|
|
<u:IconButton Icon="{StaticResource SemiIconRefresh}" Content="刷新"
|
|
Command="{Binding RefreshRepositoryIssuesAsyncCommand}"/>
|
|
<u:IconButton Icon="{StaticResource SemiIconPlus}" Content="新建 Issue"
|
|
Command="{Binding CreateIssueCommand}"/>
|
|
<!-- <ComboBox ItemsSource="{Binding IssueFilters}" SelectedIndex="0" -->
|
|
<!-- Width="120" PlaceholderText="筛选状态"/> -->
|
|
<!-- <ComboBox ItemsSource="{Binding IssueTags}" SelectedIndex="0" -->
|
|
<!-- Width="160" PlaceholderText="筛选标签"/> -->
|
|
</StackPanel>
|
|
|
|
<ListBox ItemsSource="{Binding Repository.Issues}" SelectionMode="Single">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid ColumnDefinitions="auto,*,auto" RowDefinitions="auto,auto,auto"
|
|
Margin="0 4" Classes="CardBorder">
|
|
<PathIcon Grid.Column="0" Grid.RowSpan="3" Width="24" Height="24" Margin="0 0 12 0"
|
|
Data="{StaticResource SemiIconCheckCircle}"
|
|
IsVisible="{Binding !Closed}"/>
|
|
<PathIcon Grid.Column="0" Grid.RowSpan="3" Width="24" Height="24" Margin="0 0 12 0"
|
|
Data="{StaticResource SemiIconCloseCircle}"
|
|
IsVisible="{Binding Closed}"/>
|
|
|
|
<TextBlock Grid.Column="1" Grid.Row="0"
|
|
FontSize="16" FontWeight="SemiBold"
|
|
Text="{Binding Title}"/>
|
|
|
|
<StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal" Spacing="8">
|
|
<TextBlock Text="{Binding Author}"
|
|
Foreground="{DynamicResource SemiSecondaryTextColor}"/>
|
|
<TextBlock Text="{Binding CreatedAt, StringFormat='创建于 {0:yyyy-MM-dd}'}"
|
|
Foreground="{DynamicResource SemiSecondaryTextColor}"/>
|
|
</StackPanel>
|
|
|
|
<WrapPanel Grid.Column="1" Grid.Row="2">
|
|
<Border CornerRadius="4" Padding="4 2" Background="{DynamicResource SemiInfoBgColor}">
|
|
<TextBlock Text="{Binding Id, StringFormat='#{}'}"
|
|
Foreground="{DynamicResource SemiInfoColor}"/>
|
|
</Border>
|
|
<!-- <Border CornerRadius="4" Padding="4 2" Background="{DynamicResource SemiSuccessBgColor}" -->
|
|
<!-- IsVisible="{Binding !!Tag}"> -->
|
|
<!-- </Border> -->
|
|
</WrapPanel>
|
|
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="8">
|
|
<u:IconButton Icon="{StaticResource SemiIconEdit}"
|
|
Command="{Binding $parent[ItemsControl].((vm:RepositoryViewModel)DataContext).OpenIssueCommand}"
|
|
CommandParameter="{Binding}"/>
|
|
<u:IconButton Icon="{StaticResource SemiIconClose}"
|
|
Command="{Binding $parent[ItemsControl].((vm:RepositoryViewModel)DataContext).CloseIssueCommand}"
|
|
CommandParameter="{Binding}"
|
|
IsVisible="{Binding !Closed}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</DockPanel>
|
|
</UserControl>
|