199 lines
10 KiB
XML
199 lines
10 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<ContentPage
|
|
x:Class="cfs_tracker.Views.QuickEntryPage"
|
|
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:QuickEntryViewModel"
|
|
Title="{loc:Translate QuickEntry_Title}"
|
|
BackgroundColor="{DynamicResource AppBackground}">
|
|
|
|
<ScrollView>
|
|
<VerticalStackLayout Padding="16" Spacing="16">
|
|
|
|
<Label Text="{Binding SelectedDateText}"
|
|
FontSize="20"
|
|
FontAttributes="Bold"
|
|
HorizontalTextAlignment="Center"
|
|
TextColor="{DynamicResource TextPrimary}" />
|
|
|
|
<Label Text="{Binding ModeText}"
|
|
IsVisible="{Binding IsFutureDate}"
|
|
HorizontalTextAlignment="Center"
|
|
TextColor="IndianRed" />
|
|
|
|
<Border Padding="12"
|
|
Stroke="{DynamicResource Border}"
|
|
BackgroundColor="{DynamicResource SurfaceBackground}"
|
|
StrokeShape="RoundRectangle 14"
|
|
IsVisible="{Binding IsPastDate}">
|
|
<VerticalStackLayout Spacing="8">
|
|
<Label Text="{loc:Translate QuickEntry_BackfillTitle}"
|
|
FontAttributes="Bold"
|
|
TextColor="{DynamicResource TextPrimary}" />
|
|
<Picker Title="{loc:Translate QuickEntry_DayPartPicker}"
|
|
ItemsSource="{Binding Parts}"
|
|
ItemDisplayBinding="{Binding Name, x:DataType=viewModels:DayPartOptionItemViewModel}"
|
|
SelectedItem="{Binding SelectedPart}" />
|
|
</VerticalStackLayout>
|
|
</Border>
|
|
|
|
<Border Padding="12"
|
|
Stroke="{DynamicResource Border}"
|
|
BackgroundColor="{DynamicResource SurfaceBackground}"
|
|
StrokeShape="RoundRectangle 14">
|
|
<VerticalStackLayout Spacing="8">
|
|
<Label Text="{loc:Translate QuickEntry_ActivityLabel}"
|
|
FontAttributes="Bold"
|
|
TextColor="{DynamicResource TextPrimary}" />
|
|
<Picker Title="{loc:Translate QuickEntry_ActivityPicker}"
|
|
ItemsSource="{Binding Activities}"
|
|
ItemDisplayBinding="{Binding Name, x:DataType=viewModels:ActivityPickerItemViewModel}"
|
|
SelectedItem="{Binding SelectedActivity}" />
|
|
|
|
<Label Text="{loc:Translate QuickEntry_DurationLabel}"
|
|
FontAttributes="Bold"
|
|
TextColor="{DynamicResource TextPrimary}" />
|
|
<TimePicker Time="{Binding ActivityDuration}"
|
|
Format="HH:mm" />
|
|
</VerticalStackLayout>
|
|
</Border>
|
|
|
|
<Border Padding="12"
|
|
Stroke="{DynamicResource Border}"
|
|
BackgroundColor="{DynamicResource SurfaceBackground}"
|
|
StrokeShape="RoundRectangle 14">
|
|
<VerticalStackLayout Spacing="8">
|
|
<Label Text="{loc:Translate QuickEntry_SymptomsLabel}"
|
|
FontAttributes="Bold"
|
|
TextColor="{DynamicResource TextPrimary}" />
|
|
|
|
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Symptoms}"
|
|
Spacing="8">
|
|
<BindableLayout.ItemTemplate>
|
|
<DataTemplate x:DataType="viewModels:SelectableSymptomItemViewModel">
|
|
<Border Padding="12,10"
|
|
StrokeThickness="1"
|
|
Stroke="{DynamicResource Border}"
|
|
StrokeShape="RoundRectangle 12"
|
|
BackgroundColor="{DynamicResource ButtonPrimaryBackground}">
|
|
<Border.GestureRecognizers>
|
|
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleSymptomCommand, x:DataType=views:QuickEntryPage}"
|
|
CommandParameter="{Binding .}" />
|
|
</Border.GestureRecognizers>
|
|
|
|
<Border.Triggers>
|
|
<DataTrigger TargetType="Border"
|
|
Binding="{Binding IsSelected}"
|
|
Value="True">
|
|
<Setter Property="BackgroundColor"
|
|
Value="{DynamicResource ButtonSecondaryBackground}" />
|
|
</DataTrigger>
|
|
</Border.Triggers>
|
|
|
|
<Grid ColumnDefinitions="Auto,*"
|
|
ColumnSpacing="12">
|
|
<CheckBox IsChecked="{Binding IsSelected}"
|
|
InputTransparent="True"
|
|
Color="White"
|
|
VerticalOptions="Center" />
|
|
|
|
<Label Grid.Column="1"
|
|
Text="{Binding Name}"
|
|
VerticalOptions="Center"
|
|
TextColor="{DynamicResource ButtonPrimaryText}">
|
|
<Label.Triggers>
|
|
<DataTrigger TargetType="Label"
|
|
Binding="{Binding IsSelected}"
|
|
Value="True">
|
|
<Setter Property="TextColor"
|
|
Value="{DynamicResource ButtonSecondaryText}" />
|
|
</DataTrigger>
|
|
</Label.Triggers>
|
|
</Label>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</BindableLayout.ItemTemplate>
|
|
</VerticalStackLayout>
|
|
</VerticalStackLayout>
|
|
</Border>
|
|
|
|
<Grid ColumnDefinitions="*,*"
|
|
RowDefinitions="Auto,Auto"
|
|
ColumnSpacing="12"
|
|
RowSpacing="12">
|
|
<Button Grid.Row="0"
|
|
Grid.Column="0"
|
|
Text="{Binding GreenStatusText}"
|
|
FontSize="22"
|
|
FontAttributes="Bold"
|
|
HeightRequest="110"
|
|
BackgroundColor="{Binding GreenStateColor}"
|
|
TextColor="White"
|
|
Command="{Binding SaveGreenCommand}"
|
|
IsEnabled="{Binding CanSave}" />
|
|
|
|
<Button Grid.Row="0"
|
|
Grid.Column="1"
|
|
Text="{Binding YellowStatusText}"
|
|
FontSize="22"
|
|
FontAttributes="Bold"
|
|
HeightRequest="110"
|
|
BackgroundColor="{Binding YellowStateColor}"
|
|
TextColor="Black"
|
|
Command="{Binding SaveYellowCommand}"
|
|
IsEnabled="{Binding CanSave}" />
|
|
|
|
<Button Grid.Row="1"
|
|
Grid.Column="0"
|
|
Text="{Binding RedStatusText}"
|
|
FontSize="22"
|
|
FontAttributes="Bold"
|
|
HeightRequest="110"
|
|
BackgroundColor="{Binding RedStateColor}"
|
|
TextColor="White"
|
|
Command="{Binding SaveRedCommand}"
|
|
IsEnabled="{Binding CanSave}" />
|
|
|
|
<Button Grid.Row="1"
|
|
Grid.Column="1"
|
|
Text="{Binding GrayStatusText}"
|
|
FontSize="22"
|
|
FontAttributes="Bold"
|
|
HeightRequest="110"
|
|
BackgroundColor="{Binding GrayStateColor}"
|
|
TextColor="White"
|
|
Command="{Binding SaveGrayCommand}"
|
|
IsEnabled="{Binding CanSave}" />
|
|
</Grid>
|
|
|
|
<Border Padding="12"
|
|
IsVisible="{Binding ShowSaveButton}"
|
|
Stroke="{DynamicResource Border}"
|
|
BackgroundColor="{DynamicResource SurfaceBackground}"
|
|
StrokeShape="RoundRectangle 14">
|
|
<VerticalStackLayout Spacing="10">
|
|
<Label Text="{Binding SelectedStateSummaryText}"
|
|
HorizontalTextAlignment="Center"
|
|
TextColor="{DynamicResource TextPrimary}" />
|
|
|
|
<Button Text="{loc:Translate QuickEntry_SaveButton}"
|
|
Command="{Binding SaveCommand}"
|
|
IsEnabled="{Binding CanExplicitSave}"
|
|
Style="{StaticResource PrimaryButtonStyle}"
|
|
HorizontalOptions="Fill" />
|
|
</VerticalStackLayout>
|
|
</Border>
|
|
|
|
<Button Text="{loc:Translate Common_Cancel}"
|
|
Command="{Binding CancelCommand}"
|
|
Style="{StaticResource SecondaryButtonStyle}"
|
|
HorizontalOptions="Fill" />
|
|
</VerticalStackLayout>
|
|
</ScrollView>
|
|
</ContentPage>
|