diff --git a/src/components/Icon.svelte b/src/components/Icon.svelte index 45fd60cf6..6dbb98346 100644 --- a/src/components/Icon.svelte +++ b/src/components/Icon.svelte @@ -4,6 +4,7 @@ import { unreachable } from "@app/lib/utils"; export let name: | "activity" + | "archive" | "arrow-box-up-right" | "arrow-reply" | "badge" @@ -86,6 +87,16 @@ fill-rule="evenodd" clip-rule="evenodd" d="M2.76032 2.0563C2.56506 1.86104 2.24848 1.86104 2.05322 2.0563C1.85795 2.25156 1.85795 2.56815 2.05322 2.76341L3.41389 4.12408C2.52941 5.16972 1.99551 6.52284 1.99551 8C1.99551 11.3162 4.68381 14.0045 8 14.0045C11.3162 14.0045 14.0045 11.3162 14.0045 8C14.0045 4.68381 11.3162 1.99551 8 1.99551C7.13343 1.99551 6.30847 2.1794 5.5631 2.51075C5.31076 2.62293 5.19714 2.91842 5.30932 3.17075C5.42149 3.42308 5.71698 3.5367 5.96931 3.42453C6.58928 3.14892 7.27606 2.99551 8 2.99551C10.7639 2.99551 13.0045 5.2361 13.0045 8C13.0045 10.7639 10.7639 13.0045 8 13.0045C5.2361 13.0045 2.99551 10.7639 2.99551 8C2.99551 6.79876 3.41827 5.69689 4.12393 4.83412L4.84861 5.5588C4.32565 6.23309 4.01382 7.08042 4.01382 8C4.01382 10.2015 5.7985 11.9862 8 11.9862C10.2015 11.9862 11.9862 10.2015 11.9862 8C11.9862 5.79849 10.2015 4.01382 8 4.01382C7.6541 4.01382 7.31777 4.058 6.99668 4.14128C6.72939 4.21061 6.5689 4.4835 6.63823 4.7508C6.70756 5.01809 6.98045 5.17858 7.24775 5.10925C7.48754 5.04705 7.73952 5.01382 8 5.01382C9.64923 5.01382 10.9862 6.35078 10.9862 8C10.9862 9.64922 9.64923 10.9862 8 10.9862C6.35078 10.9862 5.01382 9.64922 5.01382 8C5.01382 7.35653 5.21697 6.76101 5.56321 6.27341L6.29783 7.00802C6.12778 7.29932 6.03009 7.63844 6.03009 8C6.03009 9.08795 6.91205 9.96991 8 9.96991C9.08794 9.96991 9.9699 9.08795 9.9699 8C9.9699 7.27462 9.57756 6.64143 8.9959 6.30011C8.75773 6.16035 8.45137 6.24013 8.31161 6.47829C8.17185 6.71646 8.25163 7.02282 8.48979 7.16258C8.77813 7.33178 8.9699 7.64377 8.9699 8C8.9699 8.53567 8.53566 8.96991 8 8.96991C7.46433 8.96991 7.03009 8.53567 7.03009 8C7.03009 7.87888 7.05216 7.76309 7.09262 7.6563C7.24121 7.67561 7.39681 7.62819 7.51096 7.51404C7.70622 7.31878 7.70622 7.0022 7.51096 6.80694L2.76032 2.0563Z" /> + {:else if name === "archive"} + + + + + + + + + {:else if name === "arrow-box-up-right"} - + { - radicle = true; + activeTab = "radicle"; }}> Radicle @@ -62,24 +65,37 @@ { - radicle = false; + activeTab = "git"; }}> Git + {#if enabledArchiveDownload} + + { + activeTab = "archive"; + }}> + + Download + + {/if} - {#if radicle} + {#if activeTab === "radicle"} Use the Radicle CLI to clone this repository. - {:else} + {:else if activeTab === "git"} If you don't have Radicle installed, you can still clone the @@ -91,6 +107,18 @@ such as issues or patches. + {:else if activeTab === "archive"} + + + If you don't have Radicle installed, you can still download an archive + of the repository. + + + + Note that a compressed archive of the source code does not include any + of the social artifacts such as issues or patches nor the git history. + + {/if} diff --git a/src/views/repos/History.svelte b/src/views/repos/History.svelte index 6fa373fa7..b8c753400 100644 --- a/src/views/repos/History.svelte +++ b/src/views/repos/History.svelte @@ -11,7 +11,7 @@ import config from "@app/lib/config"; import { HttpdClient } from "@http-client"; - import { baseUrlToString } from "@app/lib/utils"; + import { baseUrlToString, formatQualifiedRefname } from "@app/lib/utils"; import { groupCommits } from "@app/lib/commit"; import Button from "@app/components/Button.svelte"; @@ -104,7 +104,14 @@ Commits - + {/if} - + { + enabledArchiveDownload = response.ok; + }); function render(content: string): string { return dompurify.sanitize( @@ -89,7 +101,12 @@ style:display="flex" style:gap="0.5rem" class="global-hide-on-mobile-down"> - +