feat: agregar SyncService y mejorar gestión de asistencia con nuevas funcionalidades
This commit is contained in:
1 parent
fb275508ee
commit
d953afd3b4
15 files changed
+339
-359
No files matched your search
@@ -4,130 +4,109 @@
|
||||
x:Class="Asistencia.Views.AsistenciaView"
|
||||
x:DataType="vm:AsistenciaViewModel">
|
||||
|
||||
<Design.DataContext>
|
||||
<vm:AsistenciaViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="0" Margin="32,24">
|
||||
<StackPanel Spacing="0" Margin="32,24" MaxWidth="500">
|
||||
|
||||
<Button Content="Volver" Classes="secondary"
|
||||
HorizontalAlignment="Left"
|
||||
Command="{Binding VolverCommand}"
|
||||
Margin="0,0,0,16" />
|
||||
|
||||
<TextBlock Text="{Binding NombreCurso}" Classes="page-header" />
|
||||
<TextBlock Text="Tomar Asistencia" Classes="page-header" />
|
||||
|
||||
<Border Classes="card" Margin="0,0,0,20">
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Text="{Binding InfoCurso}"
|
||||
FontSize="14" Foreground="{DynamicResource TextSecondary}" />
|
||||
|
||||
<TextBlock Text="{Binding MensajeEstado}"
|
||||
FontSize="13" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource PrimaryNavy}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" Margin="0,8,0,0">
|
||||
<Button Content="Iniciar Sesion"
|
||||
Classes="success"
|
||||
<Border Classes="card" Margin="0,0,0,16">
|
||||
<StackPanel Spacing="12">
|
||||
<TextBlock Text="ID Curso Abierto" FontSize="13" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextPrimary}" />
|
||||
<TextBox PlaceholderText="Ej: 16451"
|
||||
Text="{Binding InputCursoAbierto}"
|
||||
FontSize="14" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<Button Content="Iniciar Sesion" Classes="success"
|
||||
Command="{Binding IniciarSesionCommand}"
|
||||
IsVisible="{Binding !EnSesion}" />
|
||||
<Button Content="Finalizar Sesion"
|
||||
Classes="danger"
|
||||
<Button Content="Finalizar Sesion" Classes="danger"
|
||||
Command="{Binding FinalizarSesionCommand}"
|
||||
IsVisible="{Binding EnSesion}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Grid ColumnDefinitions="*,Auto" Margin="0,0,0,16">
|
||||
<TextBlock Grid.Column="0"
|
||||
Classes="section-title"
|
||||
Text="Alumnos"
|
||||
VerticalAlignment="Center" />
|
||||
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="16">
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<Border Background="{DynamicResource SuccessColor}"
|
||||
CornerRadius="4" Width="12" Height="12" />
|
||||
<TextBlock Text="{Binding Presentes}" FontSize="13"
|
||||
Foreground="{DynamicResource TextSecondary}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<Border Background="{DynamicResource WarningColor}"
|
||||
CornerRadius="4" Width="12" Height="12" />
|
||||
<TextBlock Text="{Binding Tardanzas}" FontSize="13"
|
||||
Foreground="{DynamicResource TextSecondary}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<Border Background="{DynamicResource DangerColor}"
|
||||
CornerRadius="4" Width="12" Height="12" />
|
||||
<TextBlock Text="{Binding Ausentes}" FontSize="13"
|
||||
Foreground="{DynamicResource TextSecondary}" />
|
||||
</StackPanel>
|
||||
<Border Classes="card" Margin="0,0,0,16"
|
||||
IsVisible="{Binding EnSesion}">
|
||||
<StackPanel Spacing="12">
|
||||
<TextBlock Text="RUT Alumno" FontSize="13" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextPrimary}" />
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBox Grid.Column="0"
|
||||
PlaceholderText="Ej: 11111111-1"
|
||||
Text="{Binding InputRutAlumno}"
|
||||
FontSize="14"
|
||||
KeyDown="OnRutAlumnoKeyDown" />
|
||||
<Button Grid.Column="1"
|
||||
Content="+"
|
||||
Classes="primary"
|
||||
Command="{Binding AgregarAlumnoCommand}"
|
||||
Margin="8,0,0,0"
|
||||
Width="40" Height="40"
|
||||
FontSize="18" FontWeight="Bold" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Classes="card" Padding="0">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<TextBlock Text="{Binding MensajeEstado}"
|
||||
FontSize="13" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource PrimaryNavy}"
|
||||
Margin="0,0,0,12"
|
||||
IsVisible="{Binding !HasError}" />
|
||||
|
||||
<Border Grid.Row="0" Background="{DynamicResource BackgroundSecondary}"
|
||||
<TextBlock Text="{Binding MensajeError}"
|
||||
FontSize="13"
|
||||
Foreground="{DynamicResource DangerColor}"
|
||||
Margin="0,0,0,12"
|
||||
IsVisible="{Binding HasError}" />
|
||||
|
||||
<Border Classes="card" Padding="0"
|
||||
IsVisible="{Binding EnSesion}">
|
||||
<StackPanel>
|
||||
<Border Background="{DynamicResource BackgroundSecondary}"
|
||||
CornerRadius="12,12,0,0" Padding="16,12">
|
||||
<Grid ColumnDefinitions="*,120">
|
||||
<TextBlock Grid.Column="0" Text="Alumno"
|
||||
FontSize="13" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextSecondary}" />
|
||||
<TextBlock Grid.Column="1" Text="Estado"
|
||||
FontSize="13" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextSecondary}"
|
||||
HorizontalAlignment="Center" />
|
||||
</Grid>
|
||||
<TextBlock Text="Alumnos Presentes"
|
||||
FontSize="13" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextSecondary}" />
|
||||
</Border>
|
||||
|
||||
<ListBox Grid.Row="1"
|
||||
ItemsSource="{Binding Alumnos}"
|
||||
<ListBox ItemsSource="{Binding AlumnosPresentes}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Padding="0">
|
||||
Padding="0"
|
||||
MaxHeight="300">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:AlumnoAsistenciaViewModel">
|
||||
<Border Padding="16,12"
|
||||
<DataTemplate x:DataType="vm:AlumnoPresenteViewModel">
|
||||
<Border Padding="16,10"
|
||||
BorderBrush="{DynamicResource BorderColor}"
|
||||
BorderThickness="0,0,0,1">
|
||||
<Grid ColumnDefinitions="*,120">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding NombreCompleto}"
|
||||
FontSize="14"
|
||||
VerticalAlignment="Center" />
|
||||
|
||||
<Button Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
Command="{Binding $parent[ListBox].((vm:AsistenciaViewModel)DataContext).MarcarAlumnoCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
Background="{Binding TipoAsistenciaColor}"
|
||||
CornerRadius="20"
|
||||
Padding="16,6"
|
||||
FontSize="13"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="White"
|
||||
BorderThickness="0"
|
||||
MinWidth="100">
|
||||
<TextBlock Text="{Binding TipoAsistenciaTexto}"
|
||||
Foreground="White" />
|
||||
</Button>
|
||||
<Grid ColumnDefinitions="Auto,*">
|
||||
<Border Grid.Column="0"
|
||||
Background="{DynamicResource SuccessColor}"
|
||||
CornerRadius="12" Padding="10,4"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Text="P" Foreground="White"
|
||||
FontSize="12" FontWeight="Bold" />
|
||||
</Border>
|
||||
<StackPanel Grid.Column="1" Margin="12,0,0,0"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Text="{Binding NombreCompleto}"
|
||||
FontSize="14" FontWeight="SemiBold" />
|
||||
<TextBlock Text="{Binding IdAlumno}"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource TextSecondary}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Classes="card" Margin="0,16,0,0"
|
||||
IsVisible="{Binding !Alumnos.Count}"
|
||||
Background="#FFF3CD">
|
||||
<TextBlock Text="No hay alumnos en este curso."
|
||||
FontSize="14" Foreground="#856404" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
Reference in new issue
Block a user