141 lines
8.7 KiB
XML
141 lines
8.7 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
xmlns:mmodels="clr-namespace:Jugenddienst_Stunden.Models"
|
|
xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels"
|
|
xmlns:conv="clr-namespace:Jugenddienst_Stunden.Converter"
|
|
x:Class="Jugenddienst_Stunden.Views.StundenPage"
|
|
Title="{Binding Title}">
|
|
|
|
<ContentPage.BindingContext>
|
|
<models:StundenViewModel />
|
|
</ContentPage.BindingContext>
|
|
|
|
<ContentPage.Resources>
|
|
<ResourceDictionary>
|
|
<conv:SecondsTimeConverter x:Key="secToTime" />
|
|
<FontImageSource x:Key="ToolbarIcon"
|
|
Glyph="+"
|
|
Size="22"
|
|
Color="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"/>
|
|
</ResourceDictionary>
|
|
</ContentPage.Resources>
|
|
|
|
|
|
<ContentPage.ToolbarItems>
|
|
<!--<ToolbarItem Text="Lade Liste" Command="{Binding RefreshListCommand}"/>-->
|
|
<ToolbarItem Text="Neuer Eintrag" IconImageSource="{StaticResource ToolbarIcon}" Command="{Binding NewEntryCommand}" />
|
|
|
|
</ContentPage.ToolbarItems>
|
|
|
|
<RefreshView x:Name="MyRefreshView" Command="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}" Margin="10" Padding="10">
|
|
<Grid RowDefinitions="50,*,Auto,80">
|
|
<!--<VerticalStackLayout Spacing="10" Margin="10">-->
|
|
|
|
<Grid RowDefinitions="Auto" ColumnDefinitions="Auto,*" HeightRequest="50" Grid.Row="0">
|
|
<DatePicker Grid.Column="0" MinimumDate="{Binding MinimumDate}"
|
|
MaximumDate="{Binding MaximumDate}"
|
|
Date="{Binding DateToday}" Format="dddd, d. MMMM yyyy" />
|
|
<Border Grid.Column="1" Margin="15,0,0,0" Padding="15,0,0,0" ToolTipProperties.Text="Tagessumme">
|
|
<HorizontalStackLayout>
|
|
<Label Text="{Binding DayTotal,StringFormat='{}{0:HH:mm}'}" VerticalOptions="Center"></Label>
|
|
<Label Text="/" VerticalOptions="Center" Margin="3,0"/>
|
|
<Label Text="{Binding Sollstunden,StringFormat='{}{0:HH:mm}'}" VerticalOptions="Center"></Label>
|
|
</HorizontalStackLayout>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<CollectionView
|
|
ItemsSource="{Binding DayTimes}"
|
|
x:Name="stundeItems" Margin="0,0,0,20"
|
|
|
|
SelectionMode="Single"
|
|
SelectionChangedCommand="{Binding SelectEntryCommand}"
|
|
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}"
|
|
VerticalOptions="Start"
|
|
Grid.Row="1">
|
|
|
|
<CollectionView.ItemsLayout>
|
|
<LinearItemsLayout Orientation="Vertical" ItemSpacing="0" />
|
|
</CollectionView.ItemsLayout>
|
|
|
|
<CollectionView.ItemTemplate>
|
|
<DataTemplate>
|
|
<VerticalStackLayout Padding="5,10,5,0">
|
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup Name="CommonStates">
|
|
<VisualState Name="Normal">
|
|
<VisualState.Setters>
|
|
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource TransparentColor}}" />
|
|
</VisualState.Setters>
|
|
</VisualState>
|
|
<VisualState Name="Selected">
|
|
<VisualState.Setters>
|
|
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}" />
|
|
</VisualState.Setters>
|
|
</VisualState>
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
|
|
|
|
<HorizontalStackLayout>
|
|
<HorizontalStackLayout.Triggers>
|
|
<DataTrigger TargetType="HorizontalStackLayout" Binding="{Binding Approved}" Value="True">
|
|
<Setter Property="BackgroundColor" Value="LightCoral" />
|
|
<Setter Property="Padding" Value="4"/>
|
|
</DataTrigger>
|
|
</HorizontalStackLayout.Triggers>
|
|
<Label Text="{Binding Day, StringFormat='{0:dddd, dd. MMMM}'}"/>
|
|
<Label Text="von" Padding="5,0,5,0" />
|
|
<Label Text="{Binding Begin}" />
|
|
<Label Text="bis" Padding="5,0,5,0" />
|
|
<Label Text="{Binding End}" />
|
|
</HorizontalStackLayout>
|
|
|
|
<HorizontalStackLayout HorizontalOptions="FillAndExpand">
|
|
<HorizontalStackLayout.Triggers>
|
|
<DataTrigger TargetType="HorizontalStackLayout" Binding="{Binding Approved}" Value="True">
|
|
<Setter Property="BackgroundColor" Value="LightCoral" />
|
|
<Setter Property="Padding" Value="4"/>
|
|
</DataTrigger>
|
|
</HorizontalStackLayout.Triggers>
|
|
<Label Text="{Binding GemeindeAktiv.Name}" Margin="0,0,10,0" IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.GemeindeAktivSet}" />
|
|
<Label Text="{Binding ProjektAktiv.Name}" Margin="0,0,10,0" IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.ProjektAktivSet}" />
|
|
<Label Text="{Binding FreistellungAktiv.Name}" IsVisible="{Binding Approved}" />
|
|
</HorizontalStackLayout>
|
|
|
|
<Label Text="{Binding Description}" Padding="0,0,0,15"/>
|
|
</VerticalStackLayout>
|
|
</DataTemplate>
|
|
</CollectionView.ItemTemplate>
|
|
|
|
</CollectionView>
|
|
|
|
<!--<BoxView HeightRequest="1" Grid.Row="2" Margin="0,5,0,15" />-->
|
|
<Button Text="{Binding LoadOverview}" Command="{Binding LoadDataCommand}" Grid.Row="2" />
|
|
<Border Padding="2" Grid.Row="3" Margin="0,10,0,0">
|
|
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,Auto,*,Auto" Margin="10,2">
|
|
<Label Grid.Row="0" Text="Soll:" />
|
|
<Label Grid.Row="1" Text="Summe:" />
|
|
<Label Grid.Row="2" Text="Differenz:" Margin="0,0,15,0" />
|
|
<!--<BoxView Grid.Row="3" Grid.ColumnSpan="4" HeightRequest="1" Color="LightGrey" Margin="0,5"/>-->
|
|
<Label Grid.Row="0" Grid.Column="2" Text="Restüberstunden:" Margin="15,0,0,0" />
|
|
<Label Grid.Row="1" Grid.Column="2" Text="Zeitausgleich:" Margin="15,0,0,0" />
|
|
<Label Grid.Row="2" Grid.Column="2" Text="Resturlaub:" Margin="15,0,0,0" />
|
|
|
|
<Label Grid.Row="0" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Nominal, Converter={StaticResource secToTime}}" ToolTipProperties.Text="Sollstunden" />
|
|
<Label Grid.Row="1" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding ZeitCalculated, Converter={StaticResource secToTime}}" ToolTipProperties.Text="Geleistete Stunden" />
|
|
<Label Grid.Row="2" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding OvertimeMonth, Converter={StaticResource secToTime}}" />
|
|
<Label Grid.Row="0" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Overtime, Converter={StaticResource secToTime}}" />
|
|
<Label Grid.Row="1" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Zeitausgleich, Converter={StaticResource secToTime}}" />
|
|
<Label Grid.Row="2" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Holiday, Converter={StaticResource secToTime}}" />
|
|
</Grid>
|
|
</Border>
|
|
|
|
</Grid>
|
|
<!--</VerticalStackLayout>-->
|
|
|
|
</RefreshView>
|
|
</ContentPage> |