272 lines
14 KiB
XML
272 lines
14 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:models="clr-namespace:CORP_MAUI.Models"
|
||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||
x:Class="CORP_MAUI.Pages.DepartmentDetailsPage"
|
||
Title="Информация об отделе"
|
||
BackgroundColor="White">
|
||
|
||
<Shell.BackButtonBehavior>
|
||
<BackButtonBehavior IsVisible="True" TextOverride="Назад" />
|
||
</Shell.BackButtonBehavior>
|
||
|
||
<Grid RowDefinitions="Auto,*">
|
||
|
||
<!-- Шапка -->
|
||
<Grid
|
||
Grid.Row="0"
|
||
ColumnDefinitions="50,*,50"
|
||
Padding="15,10"
|
||
BackgroundColor="#E5E5E5">
|
||
|
||
<!-- Кнопка назад -->
|
||
<Border
|
||
Grid.Column="0"
|
||
WidthRequest="40"
|
||
HeightRequest="40"
|
||
StrokeShape="RoundRectangle 20"
|
||
BackgroundColor="Transparent"
|
||
Stroke="Transparent"
|
||
HorizontalOptions="Start">
|
||
<Border.GestureRecognizers>
|
||
<TapGestureRecognizer Tapped="OnBackTapped"/>
|
||
</Border.GestureRecognizers>
|
||
<Image
|
||
Source="arrow_back.png"
|
||
WidthRequest="24"
|
||
HeightRequest="24"
|
||
HorizontalOptions="Center"
|
||
VerticalOptions="Center">
|
||
<Image.Behaviors>
|
||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||
</Image.Behaviors>
|
||
</Image>
|
||
</Border>
|
||
|
||
<!-- Заголовок -->
|
||
<Label
|
||
Grid.Column="1"
|
||
Text="Информация об отделе"
|
||
FontSize="18"
|
||
FontAttributes="Bold"
|
||
TextColor="{StaticResource Gray900}"
|
||
HorizontalOptions="Center"
|
||
VerticalOptions="Center"/>
|
||
|
||
<!-- Пустое место справа -->
|
||
<BoxView Grid.Column="2" Color="Transparent"/>
|
||
</Grid>
|
||
|
||
<!-- Контент -->
|
||
<ScrollView Grid.Row="1">
|
||
<VerticalStackLayout Padding="15" Spacing="15">
|
||
|
||
<!-- Информация об отделе -->
|
||
<Border Style="{StaticResource CardBorderLarge}">
|
||
<VerticalStackLayout Spacing="10">
|
||
|
||
<!-- Название отдела -->
|
||
<Label
|
||
x:Name="DepartmentNameLabel"
|
||
Style="{StaticResource PageTitle}"/>
|
||
|
||
<!-- Описание -->
|
||
<Label
|
||
x:Name="DepartmentDescriptionLabel"
|
||
Style="{StaticResource CardText}"
|
||
FontSize="16"
|
||
HorizontalOptions="Center"
|
||
HorizontalTextAlignment="Center"
|
||
Margin="0,0,0,10"/>
|
||
|
||
<!-- Количество сотрудников -->
|
||
<HorizontalStackLayout
|
||
HorizontalOptions="Center"
|
||
Spacing="5">
|
||
<Image Source="employees.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center">
|
||
<Image.Behaviors>
|
||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||
</Image.Behaviors>
|
||
</Image>
|
||
<Label
|
||
x:Name="EmployeesCountLabel"
|
||
Style="{StaticResource CardMeta}"
|
||
FontSize="16"/>
|
||
</HorizontalStackLayout>
|
||
|
||
</VerticalStackLayout>
|
||
</Border>
|
||
|
||
<!-- Руководитель отдела -->
|
||
<VerticalStackLayout
|
||
x:Name="HeadSection"
|
||
Spacing="10"
|
||
IsVisible="False">
|
||
|
||
<Label Text="Руководитель" Style="{StaticResource SectionTitle}" Margin="5,0,0,0"/>
|
||
|
||
<Border Style="{StaticResource CardBorderLarge}">
|
||
|
||
<Grid ColumnDefinitions="60,*">
|
||
|
||
<!-- Аватар руководителя -->
|
||
<Border Grid.Column="0" Style="{StaticResource AvatarMedium}">
|
||
<Image x:Name="HeadAvatarImage" Aspect="AspectFill"/>
|
||
</Border>
|
||
|
||
<!-- Информация о руководителе -->
|
||
<VerticalStackLayout
|
||
Grid.Column="1"
|
||
VerticalOptions="Center"
|
||
Spacing="3"
|
||
Margin="10,0">
|
||
|
||
<Label
|
||
x:Name="HeadNameLabel"
|
||
Style="{StaticResource CardSubtitle}"/>
|
||
|
||
<Label
|
||
x:Name="HeadPositionLabel"
|
||
Style="{StaticResource CardText}"
|
||
FontSize="13"/>
|
||
|
||
</VerticalStackLayout>
|
||
|
||
</Grid>
|
||
</Border>
|
||
</VerticalStackLayout>
|
||
|
||
<!-- Команда отдела -->
|
||
<VerticalStackLayout Spacing="10">
|
||
|
||
<Label Text="Команда отдела" Style="{StaticResource SectionTitle}" Margin="5,0,0,0"/>
|
||
|
||
<CollectionView
|
||
x:Name="TeamCollectionView"
|
||
SelectionMode="None"
|
||
BackgroundColor="Transparent">
|
||
|
||
<CollectionView.EmptyView>
|
||
<VerticalStackLayout Style="{StaticResource EmptyStateContainer}">
|
||
<Label Text="👥" Style="{StaticResource EmptyStateIcon}"/>
|
||
<Label
|
||
Text="Нет сотрудников в отделе"
|
||
Style="{StaticResource EmptyStateTitle}"
|
||
Margin="0,10,0,0"/>
|
||
</VerticalStackLayout>
|
||
</CollectionView.EmptyView>
|
||
|
||
<CollectionView.ItemTemplate>
|
||
<DataTemplate x:DataType="models:User">
|
||
<Border
|
||
Style="{StaticResource CardBorder}"
|
||
Margin="0,5">
|
||
|
||
<Border.GestureRecognizers>
|
||
<TapGestureRecognizer Tapped="OnTeamMemberCardTapped" CommandParameter="{Binding .}"/>
|
||
</Border.GestureRecognizers>
|
||
|
||
<Grid ColumnDefinitions="60,*,50">
|
||
|
||
<!-- Аватар -->
|
||
<Border Grid.Column="0" Style="{StaticResource AvatarMedium}">
|
||
<Grid>
|
||
<Image
|
||
Source="{Binding DisplayAvatarSource}"
|
||
Aspect="AspectFill"/>
|
||
<!-- Индикатор онлайн статуса -->
|
||
<Border
|
||
Style="{StaticResource OnlineIndicatorMedium}"
|
||
IsVisible="{Binding IsOnline}"/>
|
||
</Grid>
|
||
</Border>
|
||
|
||
<!-- Информация о сотруднике -->
|
||
<VerticalStackLayout
|
||
Grid.Column="1"
|
||
VerticalOptions="Center"
|
||
Spacing="5"
|
||
Margin="10,0">
|
||
|
||
<Label
|
||
Text="{Binding FullName}"
|
||
Style="{StaticResource CardSubtitle}"/>
|
||
|
||
<Label
|
||
Text="{Binding PositionName}"
|
||
Style="{StaticResource CardText}"
|
||
FontSize="13"/>
|
||
|
||
<!-- Навыки -->
|
||
<FlexLayout
|
||
BindableLayout.ItemsSource="{Binding Skills}"
|
||
Wrap="Wrap"
|
||
JustifyContent="Start"
|
||
AlignItems="Start"
|
||
Margin="0,3,0,0">
|
||
<BindableLayout.ItemTemplate>
|
||
<DataTemplate x:DataType="models:Skill">
|
||
<Border
|
||
Padding="6,3"
|
||
Margin="2"
|
||
StrokeShape="RoundRectangle 10"
|
||
BackgroundColor="{StaticResource Gray200}"
|
||
Stroke="Transparent">
|
||
<Label
|
||
Text="{Binding Name}"
|
||
FontSize="11"
|
||
TextColor="{StaticResource Gray700}"/>
|
||
</Border>
|
||
</DataTemplate>
|
||
</BindableLayout.ItemTemplate>
|
||
</FlexLayout>
|
||
|
||
</VerticalStackLayout>
|
||
|
||
<!-- Кнопка чата -->
|
||
<Border
|
||
Grid.Column="2"
|
||
Style="{StaticResource IconButton}"
|
||
VerticalOptions="Center">
|
||
<Border.GestureRecognizers>
|
||
<TapGestureRecognizer Tapped="OnChatIconTapped" CommandParameter="{Binding .}"/>
|
||
</Border.GestureRecognizers>
|
||
<Image
|
||
Source="chats.png"
|
||
WidthRequest="22"
|
||
HeightRequest="22"
|
||
HorizontalOptions="Center"
|
||
VerticalOptions="Center">
|
||
<Image.Behaviors>
|
||
<toolkit:IconTintColorBehavior TintColor="White"/>
|
||
</Image.Behaviors>
|
||
</Image>
|
||
</Border>
|
||
|
||
</Grid>
|
||
</Border>
|
||
|
||
</DataTemplate>
|
||
</CollectionView.ItemTemplate>
|
||
</CollectionView>
|
||
|
||
</VerticalStackLayout>
|
||
|
||
<!-- Индикатор загрузки -->
|
||
<ActivityIndicator
|
||
x:Name="LoadingIndicator"
|
||
IsRunning="False"
|
||
IsVisible="False"
|
||
Color="{StaticResource Primary}"
|
||
VerticalOptions="Center"
|
||
HorizontalOptions="Center"
|
||
Margin="0,50,0,0"/>
|
||
|
||
</VerticalStackLayout>
|
||
</ScrollView>
|
||
</Grid>
|
||
|
||
</ContentPage>
|
||
|