Skip to content

Commit

Permalink
hide delete/restore button on archived repos [backport] (#7660)
Browse files Browse the repository at this point in the history
* hide delete/restore button on archived repos
close issue #7653
 * backport vor v1.9

* hide column also

* move protected icon to first colum
backport parts of #7461

* backport comit divergenze fix
#7625
  • Loading branch information
6543 authored and lafriks committed Jul 29, 2019
1 parent d4044b9 commit 0a9794a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions templates/repo/branch/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
<table class="ui very basic striped fixed table single line">
<tbody>
<tr>
<td>{{.DefaultBranch}}</td>
<td>
{{if .IsProtected}}
<i class="octicon octicon-shield"></i>
{{end}}
{{.DefaultBranch}}
</td>
</tr>
</tbody>
</table>
Expand All @@ -27,9 +32,9 @@
<thead>
<tr>
<th class="six wide">{{.i18n.Tr "repo.branch.name"}}</th>
<th class="three wide"></th>
<th class="two wide"></th>
<th class="two wide"></th>
{{if and $.IsWriter (not $.IsMirror)}}
{{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived)}}
<th class="one wide right aligned">{{.i18n.Tr "repo.branch.delete_head"}}</th>
{{end}}
</tr>
Expand All @@ -43,6 +48,9 @@
<s><a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a></s>
<p class="time">{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}} {{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}</p>
{{else}}
{{if .IsProtected}}
<i class="octicon octicon-shield"></i>
{{end}}
<a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a>
<p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
{{end}}
Expand Down Expand Up @@ -79,13 +87,11 @@
{{end}}
{{end}}
</td>
{{if and $.IsWriter (not $.IsMirror)}}
{{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived)}}
<td class="right aligned">
{{if .IsProtected}}
<i class="octicon octicon-shield"></i>
{{else if .IsDeleted}}
{{if and .IsDeleted (not .IsProtected)}}
<a class="undo-button" href data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID | urlquery}}&name={{.DeletedBranch.Name | urlquery}}"><i class="octicon octicon-reply"></i></a>
{{else}}
{{else if (not .IsProtected)}}
<a class="delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name | urlquery}}" data-name="{{.Name}}"><i class="trash icon text red"></i></a>
{{end}}
</td>
Expand Down

0 comments on commit 0a9794a

Please sign in to comment.