-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/initial-feed-view
- Loading branch information
Showing
13 changed files
with
352 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<UserControl x:Class="AdoptionAgency.Frontend.View.Post.AddAnimal" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
mc:Ignorable="d" | ||
d:DesignHeight="690" d:DesignWidth="800"> | ||
<Grid Background="#FFF8FDFA"> | ||
|
||
<Label Content="Please enter information about the animal" HorizontalAlignment="Center" Height="35" Margin="0,33,0,0" VerticalAlignment="Top" Width="644" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" FontStyle="Italic" FontSize="16" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/> | ||
|
||
<!-- first group box--> | ||
<GroupBox Header="Animal spieces" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,92,0,0" Width="700" Height="192"> | ||
<Grid Margin="0,0,0,0" Background="#FFEDEDED" > | ||
|
||
<Expander HorizontalAlignment="Left" Height="88" Margin="61,36,0,0" VerticalAlignment="Top" Width="164"> | ||
<TextBlock TextWrapping="Wrap"> Before adding an animal, it is necessary to add the species.</TextBlock> | ||
</Expander> | ||
|
||
<!--animal species--> | ||
<Label Content="Animal species" HorizontalAlignment="Left" Height="25" Margin="432,48,0,0" VerticalAlignment="Top" Width="224" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" InputScope="Srgs" Padding="6,5,5,5"/> | ||
<TextBox HorizontalAlignment="Left" Height="23" Margin="432,25,0,0" TextWrapping="Wrap" | ||
BorderThickness="2" VerticalAlignment="Top" Width="224" VerticalContentAlignment="Center" Background="#FFEFFCF3" BorderBrush="#FF7B996F" FontFamily="Bahnschrift Light" SelectionTextBrush="#FFF3B0B0" SelectionBrush="#FFFFEBEB" | ||
Padding="1,0,0,0"></TextBox> | ||
|
||
<!--animal breed--> | ||
<Label Content="Animal breed" HorizontalAlignment="Left" Height="24" Margin="432,100,0,0" VerticalAlignment="Top" Width="224" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" InputScope="Srgs" Padding="6,5,5,5"/> | ||
<TextBox HorizontalAlignment="Left" Height="22" Margin="432,78,0,0" TextWrapping="Wrap" | ||
BorderThickness="2" VerticalAlignment="Top" Width="224" VerticalContentAlignment="Center" Background="#FFEFFCF3" BorderBrush="#FF7B996F" FontFamily="Bahnschrift Light" SelectionTextBrush="#FFF3B0B0" SelectionBrush="#FFFFEBEB" | ||
Padding="1,0,0,0"></TextBox> | ||
|
||
<!-- add spieces button--> | ||
<Button Content="Add animal spieces" HorizontalAlignment="Left" Height="28" Margin="432,129,0,0" VerticalAlignment="Top" Width="224" BorderBrush="White" Background="#FFDADADA" Foreground="#FF577B47" FontFamily="Elephant"/> | ||
|
||
</Grid> | ||
</GroupBox> | ||
|
||
<!--second text box--> | ||
<GroupBox Header="Animal" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,299,0,0" Width="700" Height="300"> | ||
<Grid Background="#FFEDEDED" Margin="0,0,0,0"> | ||
|
||
<!--animal behaviour--> | ||
<Label Content="Animal behaviour" HorizontalAlignment="Left" Height="25" Margin="34,33,0,0" VerticalAlignment="Top" Width="264" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" InputScope="Srgs" Padding="6,5,5,5"/> | ||
<TextBox HorizontalAlignment="Left" Height="22" Margin="34,58,0,0" TextWrapping="Wrap" | ||
BorderThickness="2" VerticalAlignment="Top" Width="264" VerticalContentAlignment="Center" Background="#FFEFFCF3" BorderBrush="#FF7B996F" FontFamily="Bahnschrift Light" SelectionTextBrush="#FFF3B0B0" SelectionBrush="#FFFFEBEB" | ||
Padding="1,0,0,0" IsEnabled="False"></TextBox> | ||
|
||
<!--found location--> | ||
<Label Content="Found location" HorizontalAlignment="Left" Height="24" Margin="34,90,0,0" VerticalAlignment="Top" Width="264" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" InputScope="Srgs" Padding="6,5,5,5"/> | ||
<TextBox HorizontalAlignment="Left" Height="22" Margin="34,174,0,0" TextWrapping="Wrap" | ||
BorderThickness="2" VerticalAlignment="Top" Width="264" VerticalContentAlignment="Center" Background="#FFEFFCF3" BorderBrush="#FF7B996F" FontFamily="Bahnschrift Light" SelectionTextBrush="#FFF3B0B0" SelectionBrush="#FFFFEBEB" | ||
Padding="1,0,0,0" IsEnabled="False"></TextBox> | ||
|
||
<!--health condition--> | ||
<Label Content="Health condition" HorizontalAlignment="Left" Height="24" Margin="34,150,0,0" VerticalAlignment="Top" Width="264" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" InputScope="Srgs" Padding="6,5,5,5"/> | ||
<TextBox HorizontalAlignment="Left" Height="22" Margin="394,58,0,0" TextWrapping="Wrap" | ||
BorderThickness="2" VerticalAlignment="Top" Width="118" VerticalContentAlignment="Center" Background="#FFEFFCF3" BorderBrush="#FF7B996F" FontFamily="Bahnschrift Light" SelectionTextBrush="#FFF3B0B0" SelectionBrush="#FFFFEBEB" | ||
Padding="1,0,0,0" IsEnabled="False"></TextBox> | ||
|
||
<!--weight--> | ||
<Label Content="Weight" HorizontalAlignment="Left" Height="24" Margin="394,34,0,0" VerticalAlignment="Top" Width="132" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" InputScope="Srgs" Padding="6,5,5,5"/> | ||
<TextBox HorizontalAlignment="Left" Height="22" Margin="34,114,0,0" TextWrapping="Wrap" | ||
BorderThickness="2" VerticalAlignment="Top" Width="264" VerticalContentAlignment="Center" Background="#FFEFFCF3" BorderBrush="#FF7B996F" FontFamily="Bahnschrift Light" SelectionTextBrush="#FFF3B0B0" SelectionBrush="#FFFFEBEB" | ||
Padding="1,0,0,0" IsEnabled="False"></TextBox> | ||
|
||
<!--size--> | ||
<Label Content="Size" HorizontalAlignment="Left" Height="24" Margin="526,33,0,0" VerticalAlignment="Top" Width="132" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" InputScope="Srgs" Padding="6,5,5,5"/> | ||
<TextBox HorizontalAlignment="Left" Height="22" Margin="531,58,0,0" TextWrapping="Wrap" | ||
BorderThickness="2" VerticalAlignment="Top" Width="127" VerticalContentAlignment="Center" Background="#FFEFFCF3" BorderBrush="#FF7B996F" FontFamily="Bahnschrift Light" SelectionTextBrush="#FFF3B0B0" SelectionBrush="#FFFFEBEB" | ||
Padding="1,0,0,0" IsEnabled="False"></TextBox> | ||
|
||
<!--gender--> | ||
<Label Content="Gender" HorizontalAlignment="Left" Height="24" Margin="394,90,0,0" VerticalAlignment="Top" Width="264" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" InputScope="Srgs" Padding="6,5,5,5"/> | ||
<ComboBox HorizontalAlignment="Left" Height="22" Width="264" Margin="394,114,0,141" BorderBrush="#FFE8E8E8" IsEnabled="False"/> | ||
|
||
<!--birthdate--> | ||
<Label Content="BirthDate" HorizontalAlignment="Left" Height="24" Margin="394,150,0,0" VerticalAlignment="Top" Width="264" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" InputScope="Srgs" Padding="6,5,5,5"/> | ||
|
||
<DatePicker HorizontalAlignment="Left" Height="24" Width="264" Background="#FFEDEDED" Margin="394,172,0,81" IsEnabled="False"> | ||
<DatePicker.BorderBrush> | ||
<LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1"> | ||
<GradientStop Color="#FFEDEDED"/> | ||
</LinearGradientBrush> | ||
</DatePicker.BorderBrush> | ||
</DatePicker> | ||
|
||
<Button Content="Add animal" HorizontalAlignment="Left" Height="28" Margin="166,239,0,0" VerticalAlignment="Top" Width="346" BorderBrush="White" Background="#FFDADADA" Foreground="#FF577B47" FontFamily="Elephant" IsEnabled="False"/> | ||
</Grid> | ||
</GroupBox> | ||
|
||
<Button Margin="657,604,50,10" Click="NextPage_Click"> | ||
<Image Source="/Frontend/Assets/Icons/continue.png" Stretch="Fill" Width="73"/> | ||
</Button> | ||
</Grid> | ||
|
||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
|
||
namespace AdoptionAgency.Frontend.View.Post | ||
{ | ||
public partial class AddAnimal : UserControl | ||
{ | ||
private readonly Post _parentWindow; | ||
public AddAnimal(Post parentWindow) | ||
{ | ||
InitializeComponent(); | ||
_parentWindow = parentWindow; | ||
} | ||
|
||
private void NextPage_Click(object sender, RoutedEventArgs e) | ||
{ | ||
_parentWindow.contentGrid.Children.Clear(); | ||
_parentWindow.contentGrid.Children.Add(new AddPost()); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<UserControl x:Class="AdoptionAgency.Frontend.View.Post.AddPost" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
mc:Ignorable="d" | ||
d:DesignHeight="690" d:DesignWidth="800"> | ||
<Grid Background="#FFF8FDFA"> | ||
|
||
<TextBox HorizontalAlignment="Center" Height="94" Margin="0,52,0,0" TextWrapping="Wrap" | ||
BorderThickness="2" VerticalAlignment="Top" Width="378" VerticalContentAlignment="Center" Background="#FFEFFCF3" BorderBrush="#FF7B996F" FontFamily="Bahnschrift Light" SelectionTextBrush="#FFF3B0B0" SelectionBrush="#FFFFEBEB" | ||
Padding="1,0,0,0"></TextBox> | ||
|
||
<Label Content="Please enter post description" HorizontalAlignment="Center" Height="37" Margin="0,10,0,0" VerticalAlignment="Top" Width="378" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" FontSize="16" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/> | ||
<Grid x:Name="pictureGrid" Background="AliceBlue" HorizontalAlignment="Center" Height="322" Margin="0,168,0,0" VerticalAlignment="Top" Width="478"/> | ||
<Button Content="Attach pictures" HorizontalAlignment="Center" Height="50" Margin="0,526,0,0" VerticalAlignment="Top" Width="378" BorderBrush="White" Background="#FFDADADA" Foreground="#FF577B47" FontFamily="Elephant" IsEnabled="False"/> | ||
<Button Content="Publish Post" HorizontalAlignment="Center" Height="50" Margin="0,601,0,0" VerticalAlignment="Top" Width="378" BorderBrush="White" Background="#FFDADADA" Foreground="#FF577B47" FontFamily="Elephant" IsEnabled="False"/> | ||
|
||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using AdoptionAgency.Backend.Domain.Model.Post; | ||
using AdoptionAgency.Frontend.View.Common; | ||
using System.Windows.Controls; | ||
|
||
namespace AdoptionAgency.Frontend.View.Post | ||
{ | ||
public partial class AddPost : UserControl | ||
{ | ||
public AddPost() | ||
{ | ||
InitializeComponent(); | ||
pictureGrid.Children.Add(new ImageDisplay(new List<Picture>())); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Window x:Class="AdoptionAgency.Frontend.View.Post.Post" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:AdoptionAgency.Frontend.View.Post" | ||
mc:Ignorable="d" | ||
Title="Post" Height="770" Width="800" | ||
WindowStartupLocation="CenterScreen" | ||
ResizeMode="NoResize"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="*"/> | ||
</Grid.RowDefinitions> | ||
|
||
<Label Content="Create post" HorizontalAlignment="Center" Height="62" VerticalAlignment="Center" Width="175" Foreground="#FF577B47" FontFamily="Elephant" FontStretch="Expanded" FontStyle="Italic" FontSize="24" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/> | ||
<Image Source="/Frontend/Assets/Logos/logo.png" Width="58" Height="53" Margin="260,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"/> | ||
<Grid Grid.Row="1" x:Name="contentGrid"></Grid> | ||
|
||
</Grid> | ||
</Window> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Windows; | ||
|
||
namespace AdoptionAgency.Frontend.View.Post | ||
{ | ||
public partial class Post : Window | ||
{ | ||
public Post() | ||
{ | ||
InitializeComponent(); | ||
contentGrid.Children.Add(new AddAnimal(this)); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
AdoptionAgency/Frontend/View/VolunteerView/VolunteerRequestsView.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<Window x:Class="AdoptionAgency.Frontend.View.VolunteerView.VolunteerRequestsView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:AdoptionAgency.Frontend.View.VolunteerView" | ||
mc:Ignorable="d" | ||
Title="VolunteerRequestsView" Height="450" Width="800"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="1*"/> | ||
<ColumnDefinition Width="8*"/> | ||
<ColumnDefinition Width="1*"/> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="3*"/> | ||
<RowDefinition Height="5*"/> | ||
<RowDefinition Height="2.5*"/> | ||
<RowDefinition Height=".5*"/> | ||
</Grid.RowDefinitions> | ||
<ListView Grid.Row="1" Grid.Column="1" Margin="0,20" ItemsSource="{Binding MembersView}" HorizontalAlignment="Center" SelectedItem="{Binding SelectedMember}"> | ||
<ListView.View> | ||
<GridView> | ||
<GridViewColumn DisplayMemberBinding="{Binding Username}" Header="Username"/> | ||
<GridViewColumn DisplayMemberBinding="{Binding Name}" Header="Name"/> | ||
<GridViewColumn DisplayMemberBinding="{Binding LastName}" Header="Last name"/> | ||
<GridViewColumn DisplayMemberBinding="{Binding Email}" Header="Email"/> | ||
<GridViewColumn DisplayMemberBinding="{Binding PhoneNumber}" Header="Phone number"/> | ||
</GridView> | ||
</ListView.View> | ||
</ListView> | ||
<StackPanel VerticalAlignment="Center" Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center"> | ||
<Button Click="AcceptReqBtn" Margin="20,0" MaxHeight="96" MaxWidth="96"> | ||
Accept request | ||
</Button> | ||
<Button Click="RejectReqBtn" Margin="20,0" MaxHeight="96" MaxWidth="96"> | ||
Reject request | ||
</Button> | ||
</StackPanel> | ||
</Grid> | ||
</Window> |
51 changes: 51 additions & 0 deletions
51
AdoptionAgency/Frontend/View/VolunteerView/VolunteerRequestsView.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using AdoptionAgency.Backend.Domain.Model.Person; | ||
using AdoptionAgency.Backend.Domain.Model.Person.Member; | ||
using AdoptionAgency.Backend.Services; | ||
using AdoptionAgency.Frontend.ViewModel.VolunteerViewModel; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace AdoptionAgency.Frontend.View.VolunteerView | ||
{ | ||
/// <summary> | ||
/// Interaction logic for VolunteerRequestsView.xaml | ||
/// </summary> | ||
public partial class VolunteerRequestsView : Window | ||
{ | ||
public VolunteerRequestsViewModel ViewModel { get; set; } | ||
public VolunteerRequestsView() | ||
{ | ||
InitializeComponent(); | ||
ViewModel = new VolunteerRequestsViewModel(); | ||
DataContext = ViewModel; | ||
} | ||
private void AcceptReqBtn(object sender, RoutedEventArgs e) | ||
{ | ||
var member = ViewModel.SelectedMember; | ||
var personService = new PersonService(); | ||
//TODO Check if there is need for new User object | ||
personService.Add(new Volunteer(member.Id, member.User, member.Name, | ||
member.LastName, member.Email, member.PhoneNumber)); | ||
personService.Delete(member.Id); | ||
var members = ViewModel.Members; | ||
members.Remove(member); | ||
} | ||
private void RejectReqBtn(object sender, RoutedEventArgs e) | ||
{ | ||
var member = ViewModel.SelectedMember; | ||
var members = ViewModel.Members; | ||
members.Remove(member); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.