From 5a12e7570bc48e7ca903ddb8dbcf928171670cdb Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 14 Nov 2021 21:25:32 +0100 Subject: [PATCH] Add download button for file viewer - Resolves #17286 - Use the `download` attribute such that the browser will natively initate a download dialog for the given URL. --- options/locale/locale_en-US.ini | 1 + templates/repo/view_file.tmpl | 1 + 2 files changed, 2 insertions(+) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 7d6c878ad6c2..2069b2053014 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -989,6 +989,7 @@ commit_graph.hide_pr_refs = Hide Pull Requests commit_graph.monochrome = Mono commit_graph.color = Color blame = Blame +download_file = Download file normal_view = Normal View line = line lines = lines diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 0c8990a4f5c8..2c678beb9073 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -48,6 +48,7 @@ {{end}} {{.i18n.Tr "repo.file_history"}} + {{svg "octicon-download"}} {{if .Repository.CanEnableEditor}} {{if .CanEditFile}} {{svg "octicon-pencil"}}