| 741 | section class="listing" { | 741 | section class="listing" { |
| 742 | h2 { "General" } | 742 | h2 { "General" } |
| 743 | div class="card" { | 743 | div class="card" { |
| 744 | form method="post" action=(format!("/repo-settings/{id}/general")) { | 744 | form id="repo-general" method="post" action=(format!("/repo-settings/{id}/general")) { |
| 745 | input type="hidden" name="_csrf" value=(chrome.csrf); | 745 | input type="hidden" name="_csrf" value=(chrome.csrf); |
| 746 | label for="name" { "Repository name" } | 746 | label for="name" { "Repository name" } |
| 747 | input type="text" id="name" name="name" value=(ctx.repo.name) required; | 747 | input type="text" id="name" name="name" value=(ctx.repo.name) required; |
| 751 | (vis_option(Visibility::Internal, "Internal — any signed-in user")) | 751 | (vis_option(Visibility::Internal, "Internal — any signed-in user")) |
| 752 | (vis_option(Visibility::Private, "Private — only you and collaborators")) | 752 | (vis_option(Visibility::Private, "Private — only you and collaborators")) |
| 753 | } | 753 | } |
| 754 | button class="btn btn-primary" type="submit" { "Save changes" } | | |
| 755 | } | 754 | } |
| 756 | } | 755 | div class="settings-actions" { |
| 757 | } | 756 | button class="btn btn-primary" type="submit" form="repo-general" { "Save changes" } |
| 758 | (collaborators_section(id, &chrome.csrf, &collaborators)) | 757 | @let archived = ctx.repo.archived_at.is_some(); |
| 759 | section class="listing" { | | |
| 760 | h2 { "Archive" } | | |
| 761 | div class="card" { | | |
| 762 | @if ctx.repo.archived_at.is_some() { | | |
| 763 | p class="muted" { "This repository is archived (read-only). Unarchiving restores pushing." } | | |
| 764 | form method="post" action=(format!("/repo-settings/{id}/archive")) { | 758 | form method="post" action=(format!("/repo-settings/{id}/archive")) { |
| 765 | input type="hidden" name="_csrf" value=(chrome.csrf); | 759 | input type="hidden" name="_csrf" value=(chrome.csrf); |
| 766 | input type="hidden" name="archived" value="false"; | 760 | input type="hidden" name="archived" value=(if archived { "false" } else { "true" }); |
| 767 | button class="btn btn-primary" type="submit" { "Unarchive repository" } | 761 | button class="btn inline-btn" type="submit" { |
| 768 | } | 762 | (if archived { "Unarchive" } else { "Archive" }) |
| 769 | } @else { | 763 | } |
| 770 | p class="muted" { "Archiving makes the repository read-only; pushes are refused until it is unarchived." } | | |
| 771 | form method="post" action=(format!("/repo-settings/{id}/archive")) { | | |
| 772 | input type="hidden" name="_csrf" value=(chrome.csrf); | | |
| 773 | input type="hidden" name="archived" value="true"; | | |
| 774 | button class="btn" type="submit" { "Archive repository" } | | |
| 775 | } | 764 | } |
| 776 | } | 765 | } |
| 777 | } | 766 | } |
| 778 | } | 767 | } |
| | 768 | (collaborators_section(id, &chrome.csrf, &collaborators)) |
| 779 | section class="listing" { | 769 | section class="listing" { |
| 780 | h2 { "Danger zone" } | 770 | h2 { "Danger zone" } |
| 781 | div class="card danger-zone" { | 771 | div class="card danger-zone" { |