This commit is contained in:
Adrian Wozniak 2020-03-31 11:36:39 +02:00
parent 1f382d9ac6
commit 4ecba98a7a
4 changed files with 39 additions and 4 deletions

View File

@ -57,13 +57,20 @@
}
#projectPage > #projectBoardFilters > #avatars > .avatarIsActiveBorder:hover {
transform: translateY(-5px);
}
transform: translateY(-5px);
}
#projectPage > #projectBoardFilters > #avatars > .avatarIsActiveBorder > .styledAvatar {
box-shadow: 0 0 0 2px #fff;
}
#projectPage > #projectBoardFilters .styledButton {
margin-left: 6px;
}
#projectPage > #projectBoardLists {
}
@media (max-width: 1100px) {
#projectPage {
padding: 25px 20px 50px calc(var(--appNavBarLeftWidth) + var(--secondarySideBarWidth) + 20px);

View File

@ -26,6 +26,7 @@ pub enum Msg {
ProjectTextFilterChanged(String),
ProjectAvatarFilterChanged(UserId, AvatarFilterActive),
ProjectToggleOnlyMy,
ProjectToggleRecentlyUpdated,
}
fn update(msg: Msg, model: &mut model::Model, orders: &mut impl Orders<Msg>) {

View File

@ -53,6 +53,7 @@ pub struct ProjectPage {
pub text_filter: String,
pub active_avatar_filters: Vec<i32>,
pub only_my_filter: bool,
pub recenlty_updated_filter: bool,
}
#[derive(Serialize, Deserialize, Debug)]
@ -89,6 +90,7 @@ impl Default for Model {
text_filter: "".to_string(),
active_avatar_filters: vec![],
only_my_filter: false,
recenlty_updated_filter: false,
},
}
}

View File

@ -40,12 +40,21 @@ pub fn update(msg: Msg, model: &mut crate::model::Model, orders: &mut impl Order
Msg::ProjectToggleOnlyMy => {
model.project_page.only_my_filter = !model.project_page.only_my_filter;
}
Msg::ProjectToggleRecentlyUpdated => {
model.project_page.recenlty_updated_filter =
!model.project_page.recenlty_updated_filter;
}
_ => (),
}
}
pub fn view(model: &Model) -> Node<Msg> {
let project_section = vec![breadcrumbs(model), header(), project_board_filters(model)];
let project_section = vec![
breadcrumbs(model),
header(),
project_board_filters(model),
project_board_lists(model),
];
inner_layout(model, "projectPage", project_section)
}
@ -101,17 +110,29 @@ fn project_board_filters(model: &Model) -> Node<Msg> {
icon_only: false,
disabled: false,
active: model.project_page.only_my_filter,
text: Some("Only my".to_string()),
text: Some("Only My Issues".to_string()),
icon: None,
on_click: Some(mouse_ev(Ev::Click, |_| Msg::ProjectToggleOnlyMy)),
}
.into_node();
let recently_updated = StyledButton {
variant: Variant::Empty,
icon_only: false,
disabled: false,
active: model.project_page.only_my_filter,
text: Some("Recently Updated".to_string()),
icon: None,
on_click: Some(mouse_ev(Ev::Click, |_| Msg::ProjectToggleRecentlyUpdated)),
}
.into_node();
div![
id!["projectBoardFilters"],
search_input,
avatars_filters(model),
only_my,
recently_updated,
]
}
@ -146,3 +167,7 @@ fn avatars_filters(model: &Model) -> Node<Msg> {
div![id!["avatars"], avatars]
}
fn project_board_lists(model: &Model) -> Node<Msg> {
div![id!["projectBoardLists"]]
}