Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions templates/repo/branch/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{if .DefaultBranchBranch}}
<h4 class="ui top attached header">
{{ctx.Locale.Tr "repo.default_branch"}}
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
{{if and $.IsWriter $.Repository.CanContentChange (not .IsDeleted)}}
<a role="button" class="right" href="{{.RepoLink}}/settings/branches" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.branches.switch_default_branch"}}">
{{svg "octicon-arrow-switch"}}
</a>
Expand All @@ -31,7 +31,7 @@
</td>
{{/* FIXME: here and below, the tw-overflow-visible is not quite right but it is still needed the moment: to show the important buttons when the width is narrow */}}
<td class="tw-text-right tw-overflow-visible">
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
{{if and $.IsWriter $.Repository.CanContentChange (not .IsDeleted)}}
<button class="btn interact-bg show-create-branch-modal tw-p-2"
data-modal="#create-branch-modal"
data-branch-from="{{$.DefaultBranchBranch.DBBranch.Name}}"
Expand All @@ -53,7 +53,7 @@
</div>
</div>
{{end}}
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted) (not $.IsMirror)}}
{{if and $.IsWriter $.Repository.CanContentChange (not .IsDeleted)}}
<button class="btn interact-bg tw-p-2 show-modal show-rename-branch-modal"
data-is-default-branch="true"
data-modal="#rename-branch-modal"
Expand Down Expand Up @@ -157,7 +157,7 @@
</td>
{{/* FIXME: here and above, the tw-overflow-visible is not quite right */}}
<td class="three wide tw-text-right tw-overflow-visible">
{{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted)}}
{{if and $.IsWriter $.Repository.CanContentChange (not .DBBranch.IsDeleted)}}
<button class="btn interact-bg tw-p-2 show-modal show-create-branch-modal"
data-branch-from="{{.DBBranch.Name}}"
data-branch-from-urlcomponent="{{PathEscapeSegments .DBBranch.Name}}"
Expand All @@ -179,7 +179,7 @@
</div>
</div>
{{end}}
{{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted) (not $.IsMirror)}}
{{if and $.IsWriter $.Repository.CanContentChange (not .DBBranch.IsDeleted)}}
<button class="btn interact-bg tw-p-2 show-modal show-rename-branch-modal"
data-is-default-branch="false"
data-old-branch-name="{{.DBBranch.Name}}"
Expand All @@ -189,7 +189,7 @@
{{svg "octicon-pencil"}}
</button>
{{end}}
{{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}}
{{if and $.IsWriter $.Repository.CanContentChange (not .IsProtected)}}
{{if .DBBranch.IsDeleted}}
<button class="btn interact-bg tw-p-2 link-action restore-branch-button" data-url="{{$.Link}}/restore?branch_id={{.DBBranch.ID}}&name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.restore" (.DBBranch.Name)}}">
<span class="tw-text-blue">
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/tag/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<a class="flex-text-inline" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag"}}{{ctx.Locale.Tr "repo.release.new_release"}}</a>
{{end}}

{{if (and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) $release.IsTag)}}
{{if (and $.Repository.CanContentChange ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) $release.IsTag)}}
<a class="flex-text-inline link-action" data-url="{{$.RepoLink}}/tags/delete?id={{.ID}}" data-modal-confirm="#confirm-delete-tag-modal">
{{svg "octicon-trash"}}{{ctx.Locale.Tr "repo.release.delete_tag"}}
</a>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/view_content.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.zip?path={{PathEscapeSegments .TreePath}}" rel="nofollow">{{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "ZIP"}}</a>
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.tar.gz?path={{PathEscapeSegments .TreePath}}" rel="nofollow">{{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "TAR.GZ"}}</a>
{{end}}
{{if and (.Repository.CanContentChange) (not $isTreePathRoot)}}
{{if and .Repository.CanContentChange (not $isTreePathRoot)}}
<div class="divider"></div>
<a class="item tw-text-danger" href="{{.RepoLink}}/_delete/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
{{svg "octicon-trash" 16}}{{ctx.Locale.Tr "repo.editor.delete_this_directory"}}
Expand Down