Files
2026-10-11 22:19:34 +02:00

124 lines
7.5 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="cfs_tracker.Views.YearPage"
x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:loc="clr-namespace:cfs_tracker.Helpers"
xmlns:views="clr-namespace:cfs_tracker.Views"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:YearViewModel"
Title="{loc:Translate Tab_Year}"
BackgroundColor="{DynamicResource AppBackground}">
<Grid RowDefinitions="Auto,Auto,*"
Padding="16"
RowSpacing="12">
<Grid Grid.Row="0"
ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="12">
<Button Text="◀"
Command="{Binding PreviousYearCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
<Label Grid.Column="1"
Text="{Binding HeaderText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="22"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Grid.Column="2"
Text="▶"
Command="{Binding NextYearCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
</Grid>
<Grid Grid.Row="1"
ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="{loc:Translate Common_Today}"
Command="{Binding TodayCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
<Button Grid.Column="1"
Text="{loc:Translate Common_Export}"
Command="{Binding ExportPdfCommand}"
Style="{StaticResource PrimaryButtonStyle}" />
</Grid>
<ScrollView Grid.Row="2">
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Months}"
Spacing="14">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthSectionViewModel">
<Border Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 12"
Padding="10">
<VerticalStackLayout Spacing="8">
<Grid ColumnDefinitions="*,Auto"
ColumnSpacing="8">
<Label Text="{Binding Title}"
FontSize="18"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<ActivityIndicator Grid.Column="1"
IsVisible="{Binding IsLoading}"
IsRunning="{Binding IsLoading}"
VerticalOptions="Center"
Color="{DynamicResource TextMuted}" />
</Grid>
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="4">
<Label Text="{loc:Translate Common_Weekday_Mon}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="{loc:Translate Common_Weekday_Tue}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="{loc:Translate Common_Weekday_Wed}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="{loc:Translate Common_Weekday_Thu}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="{loc:Translate Common_Weekday_Fri}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="{loc:Translate Common_Weekday_Sat}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="{loc:Translate Common_Weekday_Sun}" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
</Grid>
<CollectionView ItemsSource="{Binding Cells}"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="7"
VerticalItemSpacing="4"
HorizontalItemSpacing="4" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Stroke="{Binding BorderColor}"
BackgroundColor="{Binding BackgroundColor}"
StrokeShape="RoundRectangle 8"
Padding="3"
MinimumHeightRequest="30">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.OpenDayCommand, x:DataType=views:YearPage}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<Label Text="{Binding DayNumberText}"
IsVisible="{Binding ShowDayNumber}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="11"
FontAttributes="Bold"
TextColor="{Binding TextColor}" />
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</ScrollView>
</Grid>
</ContentPage>