diff options
author | zeripath <art27@cantab.net> | 2019-12-12 13:18:07 +0000 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-12-12 21:18:07 +0800 |
commit | dc2fe9801f1a83a5810a778b806dac1bc210f110 (patch) | |
tree | c8f45d4005f90cd5727dc9ec44fdd35641c88376 /templates | |
parent | 751cfb805ddddbb4242583db2a71d8d3ed00f9d7 (diff) | |
download | gitea-dc2fe9801f1a83a5810a778b806dac1bc210f110.tar.gz gitea-dc2fe9801f1a83a5810a778b806dac1bc210f110.zip |
Make repository management section handle lfs locks (#8726)
* Make repository maangement section handle lfs locks
* Add check attribute handling and handle locking paths better
* More cleanly check-attributes
* handle error
* Check if file exists in default branch before linking to it.
* fixup
* Properly cleanPath
* Use cleanPath
* Sigh
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/settings/lfs.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/settings/lfs_locks.tmpl | 61 |
2 files changed, 64 insertions, 2 deletions
diff --git a/templates/repo/settings/lfs.tmpl b/templates/repo/settings/lfs.tmpl index e4480a8b97..f43f9479a2 100644 --- a/templates/repo/settings/lfs.tmpl +++ b/templates/repo/settings/lfs.tmpl @@ -5,9 +5,10 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "repo.settings.lfs_filelist"}} + {{.i18n.Tr "repo.settings.lfs_filelist"}} ({{.i18n.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui blue tiny show-panel button" href="{{.Link}}/pointers">{{.i18n.Tr "repo.settings.lfs_findpointerfiles"}}</a> + <a class="ui black tiny show-panel button" href="{{.Link}}/locks"><i class="octicon octicon-lock octicon-tiny"></i>{{.i18n.Tr "repo.settings.lfs_locks"}}</a> + <a class="ui blue tiny show-panel button" href="{{.Link}}/pointers"><i class="octicon octicon-search octicon-tiny"></i> {{.i18n.Tr "repo.settings.lfs_findpointerfiles"}}</a> </div> </h4> <table id="lfs-files-table" class="ui attached segment single line table"> diff --git a/templates/repo/settings/lfs_locks.tmpl b/templates/repo/settings/lfs_locks.tmpl new file mode 100644 index 0000000000..8a5f6e1658 --- /dev/null +++ b/templates/repo/settings/lfs_locks.tmpl @@ -0,0 +1,61 @@ +{{template "base/head" .}} +<div class="repository settings lfs"> + {{template "repo/header" .}} + {{template "repo/settings/navbar" .}} + <div class="ui container repository file list"> + {{template "base/alert" .}} + <div class="tab-size-8 non-diff-file-content"> + <h4 class="ui top attached header"> + <a href="{{.LFSFilesLink}}">{{.i18n.Tr "repo.settings.lfs"}}</a> / {{.i18n.Tr "repo.settings.lfs_locks"}} ({{.i18n.Tr "admin.total" .Total}}) + </h4> + <div class="ui attached segment"> + <form class="ui form ignore-dirty" method="POST"> + {{$.CsrfTokenHtml}} + <div class="ui fluid action input"> + <input name="path" value="" placeholder="{{.i18n.Tr "repo.settings.lfs_lock_path"}}" autofocus> + <button class="ui blue button">{{.i18n.Tr "repo.settings.lfs_lock"}}</button> + </div> + </form> + </div> + <table id="lfs-files-locks-table" class="ui attached segment single line table"> + <tbody> + {{range $index, $lock := .LFSLocks}} + <tr> + <td> + {{if index $.Linkable $index}} + <span class="octicon octicon-file-text"></span> + <a href="{{EscapePound $.RepoLink}}/src/branch/{{EscapePound $lock.Repo.DefaultBranch}}/{{EscapePound $lock.Path}}" title="{{$lock.Path}}">{{$lock.Path}}</a> + {{else}} + <span class="octicon octicon-diff"></span> + <span class="poping up" title="{{$.i18n.Tr "repo.settings.lfs_lock_file_no_exist"}}">{{$lock.Path}}</span> + {{end}} + {{if not (index $.Lockables $index)}} + <i class="octicon octicon-alert poping up" title="{{$.i18n.Tr "repo.settings.lfs_noattribute"}}"></i> + {{end}} + </td> + <td> + <a href="{{$.AppSubUrl}}/{{$lock.Owner.Name}}"> + <img class="ui avatar image" src="{{$lock.Owner.RelAvatarLink}}"> + {{$lock.Owner.DisplayName}} + </a> + </td> + <td>{{TimeSince .Created $.Lang}}</td> + <td class="right aligned"> + <form action="{{$.LFSFilesLink}}/locks/{{$lock.ID}}/unlock" method="POST"> + {{$.CsrfTokenHtml}} + <button class="ui blue button"><i class="octicon octicon-lock btn-octicon"></i>{{$.i18n.Tr "repo.settings.lfs_force_unlock"}}</button> + </form> + </td> + </tr> + {{else}} + <tr> + <td colspan="4">{{.i18n.Tr "repo.settings.lfs_locks_no_locks"}}</td> + </tr> + {{end}} + </tbody> + </table> + {{template "base/paginate" .}} + </div> + </div> +</div> +{{template "base/footer" .}} |