QAFormPicker.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <timesheets:BasePage
  3. xmlns:timesheets="clr-namespace:comal.timesheets"
  4. xmlns="http://xamarin.com/schemas/2014/forms"
  5. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  6. xmlns:customcontrols="clr-namespace:comal.timesheets.CustomControls"
  7. x:Class="comal.timesheets.QAForms.QAFormPicker">
  8. <NavigationPage.TitleView>
  9. <Grid Margin="0" Padding="0">
  10. <Grid.ColumnDefinitions>
  11. <ColumnDefinition Width="*"/>
  12. <ColumnDefinition Width="*"/>
  13. <ColumnDefinition Width="*"/>
  14. </Grid.ColumnDefinitions>
  15. <Button Grid.Column="0" HorizontalOptions="Start" VerticalOptions="Center" TextColor="White" BackgroundColor="Transparent" Margin="0" Padding="0"
  16. Text="Exit" Clicked="ExitBtn_Clicked"/>
  17. <Label Grid.Column="1" Text="Digital Forms" VerticalOptions="Center" x:Name="titleLbl"
  18. HorizontalOptions="Center" HorizontalTextAlignment="Center" TextColor="White" FontSize="Medium" FontAttributes="Bold"/>
  19. </Grid>
  20. </NavigationPage.TitleView>
  21. <timesheets:BasePage.PageContent>
  22. <Grid RowSpacing="0" ColumnSpacing="0">
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="40"/>
  25. <RowDefinition Height="*"/>
  26. </Grid.RowDefinitions>
  27. <Grid x:Name="buttonsGrid" Grid.Row="0" RowSpacing="0" ColumnSpacing="0">
  28. <Grid.ColumnDefinitions>
  29. <ColumnDefinition Width="*"/>
  30. <ColumnDefinition Width="*"/>
  31. </Grid.ColumnDefinitions>
  32. <Button Grid.Column="0" x:Name="newButton" BackgroundColor="#15C7C1"
  33. TextColor="Black" FontAttributes="Bold" Padding="0" CornerRadius="5" BorderColor="Black" BorderWidth="1" Margin="5"
  34. Text="New" HorizontalOptions="FillAndExpand" VerticalOptions="Center"
  35. Clicked="NewButton_Clicked"/>
  36. <Grid Grid.Column="1" RowSpacing="0" ColumnSpacing="0">
  37. <Grid.ColumnDefinitions>
  38. <ColumnDefinition Width="*"/>
  39. <ColumnDefinition Width="0" x:Name="notificationColumn"/>
  40. </Grid.ColumnDefinitions>
  41. <Button Grid.Column="0" x:Name="myFormsButton"
  42. TextColor="Black" FontAttributes="Bold" Padding="0" CornerRadius="5" BorderColor="Black" BorderWidth="1" Margin="5"
  43. Text="My Forms" HorizontalOptions="FillAndExpand" VerticalOptions="Center"
  44. Clicked="MyFormsButton_Clicked"/>
  45. <Frame x:Name="notificationFrame" Grid.Column="1" HorizontalOptions="Center" VerticalOptions="Center"
  46. HeightRequest="30" WidthRequest="30" CornerRadius="15" IsVisible="false" HasShadow="False"
  47. BackgroundColor="Yellow" Padding="1">
  48. <Frame.GestureRecognizers>
  49. <TapGestureRecognizer Tapped="MyFormsButton_Clicked"/>
  50. </Frame.GestureRecognizers>
  51. <Label FontAttributes="Bold" TextColor="Red" FontSize="Medium" HorizontalOptions="Center" VerticalOptions="Center" Margin="1"
  52. x:Name="numberOfIncompleteFormsLbl" />
  53. </Frame>
  54. </Grid>
  55. </Grid>
  56. <Grid Grid.Row="1" RowSpacing="0" ColumnSpacing="0">
  57. <Grid.ColumnDefinitions>
  58. <ColumnDefinition Width="*" x:Name="templatesColumn"/>
  59. <ColumnDefinition Width="0" x:Name="formsColumn"/>
  60. </Grid.ColumnDefinitions>
  61. <!-- Page for templates / digital form picker -->
  62. <Grid Grid.Column="0" x:Name="templatesGrid">
  63. <Grid.RowDefinitions>
  64. <RowDefinition Height="auto"/>
  65. <RowDefinition Height="*"/>
  66. </Grid.RowDefinitions>
  67. <timesheets:FilterOptionsControl Grid.Row="0" x:Name="filterOptionsControl"/>
  68. <ListView Grid.Row="1"
  69. x:Name="layoutsList" HasUnevenRows="True" BackgroundColor="Transparent" Margin="0,0,0,0">
  70. <ListView.ItemTemplate>
  71. <DataTemplate>
  72. <ViewCell Tapped="LayoutsList_Tapped">
  73. <Frame Padding="6" BorderColor="#15C7C1" Margin="5, 2, 5, 2" CornerRadius="10" HasShadow="False">
  74. <Grid>
  75. <Grid.RowDefinitions>
  76. <RowDefinition Height="auto"/>
  77. <RowDefinition Height="{Binding AverageTimeRow}"/>
  78. </Grid.RowDefinitions>
  79. <Grid.ColumnDefinitions>
  80. <ColumnDefinition Width="auto"/>
  81. <ColumnDefinition Width="*"/>
  82. </Grid.ColumnDefinitions>
  83. <Image Grid.Row="0" Grid.RowSpan="{Binding ImageRowSpan}" Grid.Column="0" Margin="5"
  84. Source="forms.png" HeightRequest="50" WidthRequest="50" VerticalOptions="Center" HorizontalOptions="Center"/>
  85. <Label Grid.Row="0" Grid.Column="1"
  86. Text="{Binding Description}" FontAttributes="Bold" FontSize="Medium" VerticalOptions="Center"
  87. HorizontalOptions="Start" HorizontalTextAlignment="Start" LineBreakMode="WordWrap" Margin="0"/>
  88. <Label Grid.Row="1" Grid.Column="1" TextColor="#873260" LineBreakMode="WordWrap"
  89. Text="{Binding AverageTime}" VerticalOptions="Center" HorizontalOptions="Start"/>
  90. </Grid>
  91. </Frame>
  92. </ViewCell>
  93. </DataTemplate>
  94. </ListView.ItemTemplate>
  95. </ListView>
  96. </Grid>
  97. <!-- Page for complete and incomplete forms -->
  98. <Grid Grid.Column="1" x:Name="existingFormsGrid">
  99. <Grid.RowDefinitions>
  100. <RowDefinition Height="auto"/>
  101. <RowDefinition Height="40"/>
  102. <RowDefinition Height="*"/>
  103. </Grid.RowDefinitions>
  104. <Entry Grid.Row="0" VerticalOptions="Center" HorizontalOptions="FillAndExpand" x:Name="searchEnt" Margin="5, 0, 5, 0"
  105. Placeholder="Search" TextChanged="SearchEnt_Changed"/>
  106. <Grid Grid.Row="1" ColumnSpacing="0" RowSpacing="0">
  107. <Grid.ColumnDefinitions>
  108. <ColumnDefinition Width="*"/>
  109. <ColumnDefinition Width="*"/>
  110. </Grid.ColumnDefinitions>
  111. <Button Grid.Column="0" Text="Incomplete" x:Name="incompleteBtn" BackgroundColor="#15C7C1"
  112. HorizontalOptions="FillAndExpand" VerticalOptions="Center" TextColor="Black" FontAttributes="Bold"
  113. Clicked="Incomplete_Tapped"
  114. Padding="0" CornerRadius="5" BorderColor="Black" BorderWidth="1" Margin="5"
  115. />
  116. <Button Grid.Column="1" Text="Complete" x:Name="completeBtn" TextColor="Black" FontAttributes="Bold"
  117. HorizontalOptions="FillAndExpand" VerticalOptions="Center"
  118. Clicked="Complete_Tapped"
  119. Padding="0" CornerRadius="5" BorderColor="Black" BorderWidth="1" Margin="5"
  120. />
  121. </Grid>
  122. <Grid Grid.Row="2" ColumnSpacing="0" RowSpacing="0">
  123. <Grid.ColumnDefinitions>
  124. <ColumnDefinition Width="*" x:Name="incompleteFormsColumn"/>
  125. <ColumnDefinition Width="0" x:Name="completeFormsColumn"/>
  126. </Grid.ColumnDefinitions>
  127. <ListView Grid.Column="0"
  128. x:Name="incompleteFormsList" HasUnevenRows="True" BackgroundColor="Transparent" Margin="0,0,0,0">
  129. <ListView.ItemTemplate>
  130. <DataTemplate>
  131. <ViewCell Tapped="IncompleteFormsList_Tapped">
  132. <Frame Padding="3" BorderColor="#15C7C1" Margin="3" CornerRadius="10" HasShadow="False">
  133. <Grid>
  134. <Grid.RowDefinitions>
  135. <RowDefinition Height="auto"/>
  136. <RowDefinition Height="auto"/>
  137. </Grid.RowDefinitions>
  138. <Label Grid.Row="0" Text="{Binding Description}" FontAttributes="Bold"/>
  139. <Label Grid.Row="1" Text="{Binding Started}"/>
  140. </Grid>
  141. </Frame>
  142. </ViewCell>
  143. </DataTemplate>
  144. </ListView.ItemTemplate>
  145. </ListView>
  146. <ListView Grid.Column="1" IsVisible="false"
  147. x:Name="completeFormsList" HasUnevenRows="True" BackgroundColor="Transparent" Margin="0,0,0,0">
  148. <ListView.ItemTemplate>
  149. <DataTemplate>
  150. <ViewCell Tapped="CompleteFormsList_Tapped">
  151. <Frame Padding="3" BorderColor="#15C7C1" Margin="3" CornerRadius="10" HasShadow="False">
  152. <Grid>
  153. <Grid.RowDefinitions>
  154. <RowDefinition Height="auto"/>
  155. <RowDefinition Height="auto"/>
  156. <RowDefinition Height="auto"/>
  157. </Grid.RowDefinitions>
  158. <Label Grid.Row="0" Text="{Binding Description}" FontAttributes="Bold"/>
  159. <Label Grid.Row="1" Text="{Binding Started}"/>
  160. <Label Grid.Row="2" Text="{Binding Completed}"/>
  161. </Grid>
  162. </Frame>
  163. </ViewCell>
  164. </DataTemplate>
  165. </ListView.ItemTemplate>
  166. </ListView>
  167. </Grid>
  168. </Grid>
  169. </Grid>
  170. </Grid>
  171. </timesheets:BasePage.PageContent>
  172. </timesheets:BasePage>