Signed by hanna SSH key fingerprint: SHA256:4g9cWhkAAw8gwqhJUcVbSnGEvdGwklW+1Aa/fMUu59k
assets/base.css +12 −8 crates/web/src/issues.rs +25 −13 crates/web/src/pulls.rs +4 −2 assets/base.css +12 −8 Expand 705 hidden lines 706 706 flex-wrap : wrap ; 707 707 gap : 0.35rem ; 708 708 } 709 - . label-picker { 710 - flex-direction : column ; 711 - align-items : stretch ; 709 + 710 + 711 + 712 + . side-form . label-dropdown { 713 + flex : 1 ; 714 + margin-bottom : 0 ; 712 715 } 713 - . label-picker . checkbox { 714 - display : flex ; 715 - align-items : center ; 716 - gap : 0.35rem ; 717 - margin : 0.15rem 0 ; 716 + . side-form . label-dropdown > summary { 717 + width : 100% ; 718 + justify-content : space-between ; 719 + } 720 + . label-apply { 721 + margin-top : 0.5rem ; 718 722 } 719 723 . label-swatch { 720 724 width : 0.8rem ;
crates/web/src/issues.rs +25 −13 Expand 284 hidden lines 285 285 } 286 286 section { 287 287 h3 { "Labels" } 288 - @if issue_labels. is_empty ( ) { p class="muted" { "None" } } 289 - @else { div class="label-set" { @for l in & issue_labels { ( label_chip ( l) ) } } } 290 288 @if can_write && !repo_labels. is_empty ( ) { 291 289 ( label_form ( & issue, & repo_labels, & issue_labels, & csrf) ) 290 + } @else if issue_labels. is_empty ( ) { 291 + p class="muted" { "None" } 292 + } @else { 293 + div class="label-set" { @for l in & issue_labels { ( label_chip ( l) ) } } 292 294 } 293 295 } 294 296 ( deps_section ( & issue, & ctx, & deps, & dependents, & csrf, can_write) ) Expand 183 hidden lines 478 480 } 479 481 } 480 482 481 - 483 + 484 + 485 + 486 + 482 487 pub ( crate ) fn label_form ( 483 488 issue : & Issue , 484 489 repo_labels : & [ Label ] , Expand 2 hidden lines 487 492 ) -> Markup { 488 493 let is_on = |id : & str | applied. iter ( ) . any ( |l| l. id == id) ; 489 494 html ! { 490 - 491 - 492 - form method="post" action=( format ! ( "/issue/{}/labels" , issue. id) ) class="side-form label-picker" { 495 + form method="post" action=( format ! ( "/issue/{}/labels" , issue. id) ) class="side-form" { 493 496 input type ="hidden" name="_csrf" value=( csrf) ; 494 - @for l in repo_labels { 495 - label class="checkbox" { 496 - input type ="checkbox" name="label" value=( l. id) checked[ is_on ( & l. id) ] 497 - data-autosubmit; 498 - " " span class="label-swatch" style=( format ! ( "--label-color: {}" , css_color ( & l. color) ) ) { } 499 - " " ( l. name) 497 + details class="menu label-dropdown" data-menu data-label-dropdown { 498 + summary class="btn" { 499 + span class="label-dropdown-label" data-label-summary { "Select labels" } 500 + ( icon ( Icon :: ChevronDown ) ) 501 + } 502 + div class="menu-popover label-menu" { 503 + @for l in repo_labels { 504 + label class="checkbox" { 505 + input type ="checkbox" name="label" value=( l. id) checked[ is_on ( & l. id) ] 506 + data-label-name=( l. name) 507 + data-label-color=( css_color ( & l. color) ) ; 508 + " " span class="label-swatch" style=( format ! ( "--label-color: {}" , css_color ( & l. color) ) ) { } 509 + " " ( l. name) 510 + } 511 + } 512 + button class="btn btn-primary inline-btn label-apply" type ="submit" { "Apply" } 500 513 } 501 514 } 502 - noscript { button class="btn inline-btn" type ="submit" { "Apply labels" } } 503 515 } 504 516 } 505 517 }
crates/web/src/pulls.rs +4 −2 Expand 182 hidden lines 183 183 } 184 184 section { 185 185 h3 { "Labels" } 186 - @if issue_labels. is_empty ( ) { p class="muted" { "None" } } 187 - @else { div class="label-set" { @for l in & issue_labels { ( label_chip ( l) ) } } } 188 186 @if can_write && !repo_labels. is_empty ( ) { 189 187 ( label_form ( & issue, & repo_labels, & issue_labels, & csrf) ) 188 + } @else if issue_labels. is_empty ( ) { 189 + p class="muted" { "None" } 190 + } @else { 191 + div class="label-set" { @for l in & issue_labels { ( label_chip ( l) ) } } 190 192 } 191 193 } 192 194 ( deps_section ( & issue, & ctx, & deps, & dependents, & csrf, can_write) )