iz-web: create assignee picker uses the edit pop-row
Browse files at this commit6c2d53c232dc6cbe3ace1322fb7f0d42f9c95822Parent: d3483eb2 changed files +18 -12
- crates/iz-web/src/detail.rs +16 -12
- style/main.scss +2 -0
crates/iz-web/src/detail.rsmodified+16 -12
| @@ -140,7 +140,11 @@ pub enum Direction { | |||
| 140 | /// Which task is `blocked` and which is `blocking`, from the task the modal | 140 | /// Which task is `blocked` and which is `blocking`, from the task the modal |
| 141 | /// is open on, the other task it names, and which way the form said the link | 141 | /// is open on, the other task it names, and which way the form said the link |
| 142 | /// runs. | 142 | /// runs. |
| 143 | -pub(crate) fn resolve_direction(task_id: &str, other_id: &str, direction: Direction) -> (String, String) { | 143 | +pub(crate) fn resolve_direction( |
| 144 | + task_id: &str, | ||
| 145 | + other_id: &str, | ||
| 146 | + direction: Direction, | ||
| 147 | +) -> (String, String) { | ||
| 144 | match direction { | 148 | match direction { |
| 145 | Direction::BlockedBy => (task_id.to_string(), other_id.to_string()), | 149 | Direction::BlockedBy => (task_id.to_string(), other_id.to_string()), |
| 146 | Direction::Blocks => (other_id.to_string(), task_id.to_string()), | 150 | Direction::Blocks => (other_id.to_string(), task_id.to_string()), |
| @@ -378,7 +382,9 @@ async fn load_snapshot( | |||
| 378 | None => { | 382 | None => { |
| 379 | let rule = store.mail_rule(&decision.rule_id).await?; | 383 | let rule = store.mail_rule(&decision.rule_id).await?; |
| 380 | rules_cache.insert(decision.rule_id.clone(), rule); | 384 | rules_cache.insert(decision.rule_id.clone(), rule); |
| 381 | - rules_cache.get(decision.rule_id.as_str()).expect("just inserted") | 385 | + rules_cache |
| 386 | + .get(decision.rule_id.as_str()) | ||
| 387 | + .expect("just inserted") | ||
| 382 | } | 388 | } |
| 383 | }; | 389 | }; |
| 384 | let rule_name = may_administer.then(|| { | 390 | let rule_name = may_administer.then(|| { |
| @@ -1819,14 +1825,12 @@ async fn dep_row<'a>( | |||
| 1819 | let cleared = edge.is_cleared(); | 1825 | let cleared = edge.is_cleared(); |
| 1820 | let note = match direction { | 1826 | let note = match direction { |
| 1821 | Direction::BlockedBy => match (edge.cleared_at, edge.done_at) { | 1827 | Direction::BlockedBy => match (edge.cleared_at, edge.done_at) { |
| 1822 | - (Some(at), _) => crate::i18n::cleared_dep_label( | 1828 | + (Some(at), _) => { |
| 1823 | - lang, | 1829 | + crate::i18n::cleared_dep_label(lang, &iz_core::board::day_label(at.date())) |
| 1824 | - &iz_core::board::day_label(at.date()), | 1830 | + } |
| 1825 | - ), | 1831 | + (None, Some(at)) => { |
| 1826 | - (None, Some(at)) => crate::i18n::done_dep_label( | 1832 | + crate::i18n::done_dep_label(lang, &iz_core::board::day_label(at.date())) |
| 1827 | - lang, | 1833 | + } |
| 1828 | - &iz_core::board::day_label(at.date()), | ||
| 1829 | - ), | ||
| 1830 | (None, None) => t(lang, Key::BlocksThisTask).to_string(), | 1834 | (None, None) => t(lang, Key::BlocksThisTask).to_string(), |
| 1831 | }, | 1835 | }, |
| 1832 | Direction::Blocks if cleared => t(lang, Key::NoLongerWaiting).to_string(), | 1836 | Direction::Blocks if cleared => t(lang, Key::NoLongerWaiting).to_string(), |
| @@ -2962,8 +2966,8 @@ pub async fn new_task_modal<'a>( | |||
| 2962 | <div class="edit-form pop-panel"> | 2966 | <div class="edit-form pop-panel"> |
| 2963 | <div class="pop-list pop-list-scroll"> | 2967 | <div class="pop-list pop-list-scroll"> |
| 2964 | for person in people { | 2968 | for person in people { |
| 2965 | - <label class="pick-row"> | 2969 | + <label class="pop-row"> |
| 2966 | - <input type="checkbox" name="assignee_id" value=(person.id.clone())> | 2970 | + <input class="visually-hidden" type="checkbox" name="assignee_id" value=(person.id.clone())> |
| 2967 | (topcoat::view::Child::new(crate::layout::avatar(cx, &person.id, &person.display_name, person.photo_version, "avatar-sm").await?)) | 2971 | (topcoat::view::Child::new(crate::layout::avatar(cx, &person.id, &person.display_name, person.photo_version, "avatar-sm").await?)) |
| 2968 | <span class="pop-row-name">(person.display_name.clone())</span> | 2972 | <span class="pop-row-name">(person.display_name.clone())</span> |
| 2969 | </label> | 2973 | </label> |
style/main.scssmodified+2 -0
| @@ -1799,6 +1799,7 @@ img.avatar { | |||
| 1799 | .pop-row-form { display: block; } | 1799 | .pop-row-form { display: block; } |
| 1800 | 1800 | ||
| 1801 | .pop-row { | 1801 | .pop-row { |
| 1802 | + position: relative; | ||
| 1802 | display: flex; | 1803 | display: flex; |
| 1803 | align-items: center; | 1804 | align-items: center; |
| 1804 | gap: 8px; | 1805 | gap: 8px; |
| @@ -1816,6 +1817,7 @@ img.avatar { | |||
| 1816 | transition: background-color var(--dur-fast) var(--ease); | 1817 | transition: background-color var(--dur-fast) var(--ease); |
| 1817 | 1818 | ||
| 1818 | &:hover { background: var(--row-hover); } | 1819 | &:hover { background: var(--row-hover); } |
| 1820 | + &:has(:checked) { background: var(--row-hover); } | ||
| 1819 | } | 1821 | } |
| 1820 | 1822 | ||
| 1821 | .pop-row-name { font-size: 12px; } | 1823 | .pop-row-name { font-size: 12px; } |