From a31fedd2c2def13e29a962c751c449491d5a1588 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel <brecht@blender.org> Date: Tue, 24 Jan 2023 20:01:39 +0100 Subject: [PATCH] Add templates to customize text when creating and migrating repositories These can be used to explain which types of repositories a Gitea instance is willing to host, or other rules for creating repositories. --- templates/repo/create.tmpl | 5 +---- templates/repo/create_helper.tmpl | 3 +++ templates/repo/migrate/helper.tmpl | 0 templates/repo/migrate/migrate.tmpl | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 templates/repo/create_helper.tmpl create mode 100644 templates/repo/migrate/helper.tmpl diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 6272b19bc6..455bbf757e 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -9,10 +9,7 @@ </h3> <div class="ui attached segment"> {{template "base/alert" .}} - - {{if not $.DisableMigrations}} - <p class="ui center">{{.locale.Tr "repo.new_repo_helper" ((printf "%s%s" AppSubUrl "/repo/migrate")|Escape) | Safe}}</p> - {{end}} + {{template "repo/create_helper" .}} {{if not .CanCreateRepo}} <div class="ui negative message"> diff --git a/templates/repo/create_helper.tmpl b/templates/repo/create_helper.tmpl new file mode 100644 index 0000000000..ec253e961d --- /dev/null +++ b/templates/repo/create_helper.tmpl @@ -0,0 +1,3 @@ +{{if not $.DisableMigrations}} + <p class="ui center">{{.locale.Tr "repo.new_repo_helper" ((printf "%s%s" AppSubUrl "/repo/migrate")|Escape) | Safe}}</p> +{{end}} diff --git a/templates/repo/migrate/helper.tmpl b/templates/repo/migrate/helper.tmpl new file mode 100644 index 0000000000..e69de29bb2 diff --git a/templates/repo/migrate/migrate.tmpl b/templates/repo/migrate/migrate.tmpl index a38302a663..ff96e6793b 100644 --- a/templates/repo/migrate/migrate.tmpl +++ b/templates/repo/migrate/migrate.tmpl @@ -2,6 +2,7 @@ <div class="page-content repository new migrate"> <div class="ui middle very relaxed page grid"> <div class="column"> + {{template "repo/migrate/helper" .}} <div class="ui three stackable cards"> {{range .Services}} <a class="ui card df ac" href="{{AppSubUrl}}/repo/migrate?service_type={{.}}&org={{$.Org}}&mirror={{$.Mirror}}">