Skip to content

Commit 0a5efbe

Browse files
committed
Codeberg banners
hardcoding limits for now, to be made configurable
1 parent 93d6182 commit 0a5efbe

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!-- Pages Warning that content is accessible even on private repos -->
2+
{{if and (eq .Repository.LowerName "pages") (.Repository.IsPrivate)}}
3+
<div class="ui warning message">
4+
This content is published publicly using <a href="https://docs.codeberg.org/codeberg-pages/">Codeberg Pages</a>
5+
</div>
6+
{{end}}
7+
8+
<!-- Warning if private repo exceeds a certain size (hardcoded to 100MB + 250MB different warning-->
9+
{{if and (.Repository.IsPrivate) (ge .Repository.Size 100000000)}}
10+
<div class="ui error message">
11+
Your private repo uses up a{{if ge .Repository.Size 250000000}}n insanely{{end}} large amount of disk storage, while
12+
all content should ideally be public and licensed under an OSI/FSF-approved Free Software licence.<br/>
13+
<strong>Please refer to our ToS and the FAQ about <a href="https://docs.codeberg.org/getting-started/faq/#is-it-allowed-to-host-non-free-software%3F">software licenses</a> and <a href="https://docs.codeberg.org/getting-started/faq/#can-i-host-private-repositories%3F">private repositories</a></strong><br/>
14+
Thank you for considering to release this repo to the public or reducing your required disk space for this repo.
15+
</div>
16+
{{end}}

templates/repo/home.tmpl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@
5050
<span id="count_prompt">{{.i18n.Tr "repo.topic.count_prompt"}}</span>
5151
<span id="format_prompt">{{.i18n.Tr "repo.topic.format_prompt"}}</span>
5252
</div>
53-
{{if and (eq .Repository.LowerName "pages") (.Repository.IsPrivate)}}
54-
<div class="ui warning message">
55-
This content is published publicly using <a href="https://docs.codeberg.org/codeberg-pages/">Codeberg Pages</a>
56-
</div>
57-
{{end}}
53+
54+
{{template "repo/codeberg_banners" .}}
55+
5856
{{if .Repository.IsArchived}}
5957
<div class="ui warning message">
6058
{{.i18n.Tr "repo.archive.title"}}

0 commit comments

Comments
 (0)