summaryrefslogtreecommitdiffstats
path: root/templates/repo/settings
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2019-01-23 19:58:38 +0100
committertechknowlogick <matti@mdranta.net>2019-01-23 13:58:38 -0500
commit0b510725c97452bac57ff0080df10f6177aa2a6e (patch)
treeb9405cf290057698b32cf0acacc0d627f223ed6d /templates/repo/settings
parent6ad834e236756e7ba3de27e59681080a7ec4fcf1 (diff)
downloadgitea-0b510725c97452bac57ff0080df10f6177aa2a6e.tar.gz
gitea-0b510725c97452bac57ff0080df10f6177aa2a6e.zip
Feature: Archive repos (#5009)
Diffstat (limited to 'templates/repo/settings')
-rw-r--r--templates/repo/settings/branches.tmpl126
-rw-r--r--templates/repo/settings/options.tmpl55
2 files changed, 121 insertions, 60 deletions
diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl
index 369f73fcc7..c7f2c9ccad 100644
--- a/templates/repo/settings/branches.tmpl
+++ b/templates/repo/settings/branches.tmpl
@@ -4,74 +4,80 @@
{{template "repo/settings/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
- <h4 class="ui top attached header">
- {{.i18n.Tr "repo.default_branch"}}
- </h4>
- <div class="ui attached segment">
- <p>
- {{.i18n.Tr "repo.settings.default_branch_desc"}}
- </p>
- <form class="ui form" action="{{.Link}}" method="post">
- {{.CsrfTokenHtml}}
- <input type="hidden" name="action" value="default_branch">
- {{if not .Repository.IsEmpty}}
- <div class="required inline field">
- <div class="ui dropdown selection" tabindex="0">
- <select name="branch">
- <option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>
- {{range .Branches}}
- <option value="{{.}}">{{.}}</option>
- {{end}}
- </select><i class="dropdown icon"></i>
- <div class="default text">{{.Repository.DefaultBranch}}</div>
- <div class="menu transition hidden" tabindex="-1" style="display: block !important;">
- {{range .Branches}}
- <div class="item" data-value="{{.}}">{{.}}</div>
- {{end}}
- </div>
- </div>
- <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
- </div>
- {{end}}
- </form>
- </div>
+ {{if .Repository.IsArchived}}
+ <div class="ui warning message">
+ {{.i18n.Tr "repo.settings.archive.branchsettings_unavailable"}}
+ </div>
+ {{else}}
+ <h4 class="ui top attached header">
+ {{.i18n.Tr "repo.default_branch"}}
+ </h4>
+ <div class="ui attached segment">
+ <p>
+ {{.i18n.Tr "repo.settings.default_branch_desc"}}
+ </p>
+ <form class="ui form" action="{{.Link}}" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="default_branch">
+ {{if not .Repository.IsEmpty}}
+ <div class="required inline field">
+ <div class="ui dropdown selection" tabindex="0">
+ <select name="branch">
+ <option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>
+ {{range .Branches}}
+ <option value="{{.}}">{{.}}</option>
+ {{end}}
+ </select><i class="dropdown icon"></i>
+ <div class="default text">{{.Repository.DefaultBranch}}</div>
+ <div class="menu transition hidden" tabindex="-1" style="display: block !important;">
+ {{range .Branches}}
+ <div class="item" data-value="{{.}}">{{.}}</div>
+ {{end}}
+ </div>
+ </div>
+ <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
+ </div>
+ {{end}}
+ </form>
+ </div>
- <h4 class="ui top attached header">
- {{.i18n.Tr "repo.settings.protected_branch"}}
- </h4>
+ <h4 class="ui top attached header">
+ {{.i18n.Tr "repo.settings.protected_branch"}}
+ </h4>
- <div class="ui attached table segment">
- <div class="ui grid padded">
- <div class="eight wide column">
- <div class="ui fluid dropdown selection" tabindex="0">
- <i class="dropdown icon"></i>
- <div class="default text">{{.i18n.Tr "repo.settings.choose_branch"}}</div>
- <div class="menu transition hidden" tabindex="-1" style="display: block !important;">
- {{range .LeftBranches}}
- <a class="item" href="{{$.Repository.Link}}/settings/branches/{{. | EscapePound}}">{{.}}</a>
- {{end}}
+ <div class="ui attached table segment">
+ <div class="ui grid padded">
+ <div class="eight wide column">
+ <div class="ui fluid dropdown selection" tabindex="0">
+ <i class="dropdown icon"></i>
+ <div class="default text">{{.i18n.Tr "repo.settings.choose_branch"}}</div>
+ <div class="menu transition hidden" tabindex="-1" style="display: block !important;">
+ {{range .LeftBranches}}
+ <a class="item" href="{{$.Repository.Link}}/settings/branches/{{. | EscapePound}}">{{.}}</a>
+ {{end}}
+ </div>
</div>
</div>
</div>
- </div>
- <div class="ui grid padded">
- <div class="sixteen wide column">
- <table class="ui single line table padded">
- <tbody>
- {{range .ProtectedBranches}}
- <tr>
- <td><div class="ui basic label blue">{{.BranchName}}</div></td>
- <td class="right aligned"><a class="rm ui button" href="{{$.Repository.Link}}/settings/branches/{{.BranchName | EscapePound}}">{{$.i18n.Tr "repo.settings.edit_protected_branch"}}</a></td>
- </tr>
- {{else}}
- <tr class="center aligned"><td>{{.i18n.Tr "repo.settings.no_protected_branch"}}</td></tr>
- {{end}}
- </tbody>
- </table>
+ <div class="ui grid padded">
+ <div class="sixteen wide column">
+ <table class="ui single line table padded">
+ <tbody>
+ {{range .ProtectedBranches}}
+ <tr>
+ <td><div class="ui basic label blue">{{.BranchName}}</div></td>
+ <td class="right aligned"><a class="rm ui button" href="{{$.Repository.Link}}/settings/branches/{{.BranchName | EscapePound}}">{{$.i18n.Tr "repo.settings.edit_protected_branch"}}</a></td>
+ </tr>
+ {{else}}
+ <tr class="center aligned"><td>{{.i18n.Tr "repo.settings.no_protected_branch"}}</td></tr>
+ {{end}}
+ </tbody>
+ </table>
+ </div>
</div>
</div>
- </div>
+ {{end}}
</div>
</div>
{{template "base/footer" .}}
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 738cae4971..e5a3ce0752 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -325,6 +325,31 @@
<p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
</div>
</div>
+
+ {{if not .Repository.IsMirror}}
+ <div class="ui divider"></div>
+
+ <div class="item">
+ <div class="ui right">
+ <button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
+ {{if .Repository.IsArchived}}
+ {{.i18n.Tr "repo.settings.unarchive.button"}}
+ {{else}}
+ {{.i18n.Tr "repo.settings.archive.button"}}
+ {{end}}
+ </button>
+ </div>
+ <div>
+ {{if .Repository.IsArchived}}
+ <h5>{{.i18n.Tr "repo.settings.unarchive.header"}}</h5>
+ <p>{{.i18n.Tr "repo.settings.unarchive.text"}}</p>
+ {{else}}
+ <h5>{{.i18n.Tr "repo.settings.archive.header"}}</h5>
+ <p>{{.i18n.Tr "repo.settings.archive.text"}}</p>
+ {{end}}
+ </div>
+ </div>
+ {{end}}
</div>
{{end}}
</div>
@@ -464,6 +489,36 @@
</div>
</div>
{{end}}
+
+ {{if not .Repository.IsMirror}}
+ <div class="ui basic modal" id="archive-repo-modal">
+ <div class="ui icon header">
+ {{if .Repository.IsArchived}}
+ {{.i18n.Tr "repo.settings.unarchive.header"}}
+ {{else}}
+ {{.i18n.Tr "repo.settings.archive.header"}}
+ {{end}}
+ </div>
+ <div class="content center">
+ <p>
+ {{if .Repository.IsArchived}}
+ {{.i18n.Tr "repo.settings.unarchive.text"}}
+ {{else}}
+ {{.i18n.Tr "repo.settings.archive.text"}}
+ {{end}}
+ </p>
+ </div>
+ <form action="{{.Link}}" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="{{if .Repository.IsArchived}}unarchive{{else}}archive{{end}}">
+ <input type="hidden" name="repo_id" value="{{.Repository.ID}}">
+ <div class="center actions">
+ <div class="ui basic cancel inverted button">{{.i18n.Tr "settings.cancel"}}</div>
+ <button class="ui basic inverted yellow button">{{.i18n.Tr "modal.yes"}}</button>
+ </div>
+ </form>
+ </div>
+ {{end}}
{{end}}
{{template "base/footer" .}}