Skip to content

Commit

Permalink
Fixes USFM download
Browse files Browse the repository at this point in the history
  • Loading branch information
richmahn committed Jul 17, 2024
1 parent edfbe81 commit a9f0209
Show file tree
Hide file tree
Showing 6 changed files with 9,511 additions and 59 deletions.
9,524 changes: 9,474 additions & 50 deletions public/assets/js-dcs/usfm-alignment-remover.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions templates/repo/branch/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{{template "base/head" .}}
<!-- DCS Customizaitons --->
{{if and .RepoDM (eq .RepoDM.Subject "Aligned Bible")}}
<script src="{{AssetUrlPrefix}}/js-dcs/usfm-alignment-remover.js"></script>
{{end}}
<!-- END DCS Customizaitons -->
<div role="main" aria-label="{{.Title}}" class="page-content ui repository branches">
{{template "repo/header" .}}
<div class="ui container">
Expand Down Expand Up @@ -172,6 +177,9 @@
<div class="menu">
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a>
{{if and $.Repository.RepoDM (eq $.Repository.RepoDM.Subject "Aligned Bible")}}
<a class="item " href="#" onclick="window.downloadUnalignedUSFM('{{PathEscapeSegments $.Repository.OwnerName}}', '{{PathEscapeSegments $.Repository.Name}}', '{{PathEscapeSegments .DBBranch.Name}}'); return false;" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;USFM (ZIP)</a>
{{end}}
</div>
</div>
{{end}}
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/dcs_metadata.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
Validation Errors (JSON)
</a>
{{end}}
<a class="item" href="{{$.RepoLink}}/preview/{{.RefType | PathEscapeSegments}}/{{.Ref | PathEscapeSegments}}">
Preview
<a class="item" href="{{Door43PreviewURL}}/u/{{.Repository.Owner.Name}}/{{.Repository.Name}}/{{PathEscapeSegments .Ref}}">
Preview / PDF
</a>
{{if or $.Permission.IsAdmin $.IsOrganizationOwner $.PageIsAdmin $.PageIsUserSettings}}
<div class="right menu">
Expand Down
14 changes: 12 additions & 2 deletions templates/repo/home.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@

{{template "base/head" .}}
<!-- DCS Customizaitons -->
{{if and .RepoDM (eq .RepoDM.Subject "Aligned Bible")}}
<script src="{{AssetUrlPrefix}}/js-dcs/usfm-alignment-remover.js"></script>
{{end}}
<!-- END DCS Customizaitons -->
<div role="main" aria-label="{{.Title}}" class="page-content repository file list {{if .IsBlame}}blame{{end}}">
{{template "repo/header" .}}
<div class="ui container {{if .IsBlame}}fluid padded{{end}}">
Expand Down Expand Up @@ -85,7 +90,7 @@
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
{{$cmpBranch := ""}}
{{if ne .Repository.ID .BaseRepo.ID}}
{{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
{{$cmpBranch = printf "%s/%s:" (.Repository.Owner.Name|PathEscape) (.Repository.Name|PathEscape)}}
{{end}}
{{$cmpBranch = print $cmpBranch (.BranchName|PathEscapeSegments)}}
{{$compareLink := printf "%s/compare/%s...%s" .BaseRepo.Link (.BaseRepo.DefaultBranch|PathEscapeSegments) $cmpBranch}}
Expand Down Expand Up @@ -158,7 +163,12 @@
{{if not $.DisableDownloadSourceArchives}}
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_zip"}}</a>
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_tar"}}</a>
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_bundle"}}</a>
<!-- DCS Customizaitons -->
{{if and .RepoDM (eq .RepoDM.Subject "Aligned Bible")}}
<a class="item archive-link" href="#" onclick="window.downloadUnalignedUSFM('{{PathEscapeSegments .Owner.Name}}', '{{PathEscapeSegments .Repository.Name}}', '{{PathEscapeSegments $.RefName}}'); return false;" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}USFM (ZIP)</a>
{{end}}
<!-- END DCS Customizaitons -->
<a class="item" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_bundle"}}</a>
{{if .CitiationExist}}
<a class="item" id="cite-repo-button">{{svg "octicon-cross-reference" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.cite_this_repo"}}</a>
{{end}}
Expand Down
10 changes: 5 additions & 5 deletions templates/repo/release/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{template "base/head" .}}
<!-- DCS Customizaitons --->
{{if and .RepoDM (eq .RepoDM.Subject "Aligned Bible")}}
<script src="{{AssetUrlPrefix}}/js-dcs/usfm-alignment-remover.js"></script>
{{end}}
<!-- END DCS Customizaitons --->
<div role="main" aria-label="{{.Title}}" class="page-content repository releases">
{{template "repo/header" .}}
<!-- DCS Customizaitons --->
{{if and .RepoDM (eq .RepoDM.Subject "Aligned Bible")}}
<script src="{{AssetUrlPrefix}}/js-dcs/usfm-alignment-remover.js"></script>
{{end}}
<!-- END DCS Customizaitons --->
<div class="ui container">
{{template "base/alert" .}}
{{template "repo/release_tag_header" .}}
Expand Down
10 changes: 10 additions & 0 deletions templates/repo/tag/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{{template "base/head" .}}
<!-- DCS Customizaitons --->
{{if and .RepoDM (eq .RepoDM.Subject "Aligned Bible")}}
<script src="{{AssetUrlPrefix}}/js-dcs/usfm-alignment-remover.js"></script>
{{end}}
<!-- END DCS Customizaitons --->
<div role="main" aria-label="{{.Title}}" class="page-content repository tags">
{{template "repo/header" .}}
<div class="ui container">
Expand Down Expand Up @@ -34,6 +39,11 @@
{{if not $.DisableDownloadSourceArchives}}
<a class="archive-link gt-mr-3 muted" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-2"}}ZIP</a>
<a class="archive-link gt-mr-3 muted" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-2"}}TAR.GZ</a>
<!-- DCS Customizaitons --->
{{if and .Repo.RepoDM (eq .Repo.RepoDM.Subject "Aligned Bible")}}
<a class="gt-mr-3 muted" href="#" onclick="window.downloadUnalignedUSFM('{{PathEscapeSegments .Repo.Owner.Name}}', '{{PathEscapeSegments .Repo.Name}}', '{{PathEscapeSegments .TagName}}'); return false;" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-2"}}USFM (ZIP)</a>
{{end}}
<!-- END DCS Customizaitons --->
{{end}}

<!-- DCS Customizations -->
Expand Down

0 comments on commit a9f0209

Please sign in to comment.