Expand 1645 hidden lines 1646 1646 form method="post" action=( format ! ( "/repo-fork/{}" , source. id) ) { 1647 1647 input type ="hidden" name="_csrf" value=( chrome. csrf) ; 1648 1648 label for ="fk-name" { "Repository name" } 1649 - input type ="text" id="fk-name" name="name" value=( source. name) required; 1650 - button class="btn btn-primary inline-btn" type ="submit" { "Fork repository" } 1649 + div class="admin-form-row admin-form-row-last" { 1650 + input type ="text" id="fk-name" name="name" value=( source. name) required; 1651 + button class="btn btn-primary inline-btn" type ="submit" { "Fork repository" } 1652 + } 1651 1653 } 1652 1654 } 1653 1655 } Expand 185 hidden lines 1839 1841 . store 1840 1842 . rename_repo ( & repo. id, new_name, & new_path) 1841 1843 . await ?; 1842 - if let Some ( vis) = Visibility :: from_token ( & form. visibility) { 1844 + if let Some ( mut vis) = Visibility :: from_token ( & form. visibility) { 1845 + 1846 + 1847 + if let Some ( parent_id) = & repo. fork_parent_id 1848 + && let Some ( parent) = state. store. repo_by_id ( parent_id) . await ? 1849 + && vis. rank ( ) > parent. visibility. rank ( ) 1850 + { 1851 + vis = parent. visibility; 1852 + } 1843 1853 state. store. set_visibility ( & repo. id, vis) . await ?; 1844 1854 } 1845 1855 state Expand 728 hidden lines 2574 2584 pub ( crate ) archived: bool , 2575 2585 2576 2586 pub ( crate ) is_mirror: bool , 2587 + 2588 + pub ( crate ) is_fork: bool , 2577 2589 2578 2590 pub ( crate ) description: Option < String > , 2579 2591 } Expand 9 hidden lines 2589 2601 updated: repo. pushed_at. unwrap_or ( repo. updated_at) , 2590 2602 archived: repo. archived_at. is_some ( ) , 2591 2603 is_mirror: repo. is_mirror, 2604 + is_fork: repo. fork_parent_id. is_some ( ) , 2592 2605 description: repo. description. clone ( ) , 2593 2606 } 2594 2607 } Expand 9 hidden lines 2604 2617 updated: repo. pushed_at. unwrap_or ( repo. updated_at) , 2605 2618 archived: repo. archived_at. is_some ( ) , 2606 2619 is_mirror: repo. is_mirror, 2620 + is_fork: repo. fork_parent_id. is_some ( ) , 2607 2621 description: repo. description. clone ( ) , 2608 2622 } 2609 2623 } Expand 33 hidden lines 2643 2657 li { 2644 2658 a class="repo-row" href=( e. href) { 2645 2659 span class="repo-row-name" { 2646 - ( icon ( if e. is_mirror { Icon :: Mirror } else { Icon :: Box } ) ) 2660 + ( icon ( if e. is_mirror { Icon :: Mirror } else if e. is_fork { Icon :: GitFork } else { Icon :: Box } ) ) 2647 2661 span { ( e. label) } 2648 2662 ( visibility_badge ( e. visibility) ) 2649 2663 ( archived_badge ( e. archived) ) Expand 170 hidden lines 2820 2834 } 2821 2835 @if let Some ( ( powner, ppath) ) = & ctx. fork_parent { 2822 2836 p class="muted fork-note" { 2823 - ( icon ( Icon :: Mirror ) ) " forked from " 2837 + ( icon ( Icon :: GitFork ) ) " forked from " 2824 2838 a href=( format ! ( "/{powner}/{ppath}" ) ) { ( powner) "/" ( ppath) } 2825 2839 } 2826 2840 } Expand 17 hidden lines 2844 2858 div class="repo-actions" { 2845 2859 @if ctx. viewer_id. is_some ( ) { 2846 2860 a class="btn" href=( format ! ( "/repo-fork/{}" , ctx. repo. id) ) { 2847 - ( icon ( Icon :: GitBranch ) ) span { "Fork" } 2861 + ( icon ( Icon :: GitFork ) ) span { "Fork" } 2848 2862 } 2849 2863 } 2850 2864 ( branch_menu ( & base, rev, branches) )