diff options
author | Cherrg <michael@gnehr.de> | 2019-07-08 10:20:22 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-07-08 11:20:22 +0300 |
commit | e5b247ea8e77689bb14e5f304ada36f9326f0904 (patch) | |
tree | 90426d29833e24eaa5c04ff2b09bd06f5175049f /templates | |
parent | d7211c5b5d90a3e6bc9c1550e2c0bf7d0d9ad66f (diff) | |
download | gitea-e5b247ea8e77689bb14e5f304ada36f9326f0904.tar.gz gitea-e5b247ea8e77689bb14e5f304ada36f9326f0904.zip |
wiki - page revisions list (#7369)
fix #7
* add wiki page revision list
* mobile improvements
* css improvements for long usernames
* split renderWikiPage into 3 functions
Signed-off-by: Michael Gnehr <michael@gnehr.de>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/wiki/revision.tmpl | 104 | ||||
-rw-r--r-- | templates/repo/wiki/view.tmpl | 1 |
2 files changed, 105 insertions, 0 deletions
diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl new file mode 100644 index 0000000000..a64c386edc --- /dev/null +++ b/templates/repo/wiki/revision.tmpl @@ -0,0 +1,104 @@ +{{template "base/head" .}} +<div class="repository wiki revisions"> + {{template "repo/header" .}} + {{ $title := .title}} + <div class="ui container"> + <div class="ui stackable grid"> + <div class="ui eight wide column text right"> + <div class="ui action small input" id="clone-panel"> + {{if not $.DisableHTTP}} + <button class="ui basic clone button" id="repo-clone-https" data-link="{{.WikiCloneLink.HTTPS}}"> + {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}} + </button> + {{end}} + {{if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}} + <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.WikiCloneLink.SSH}}"> + SSH + </button> + {{end}} + {{if not $.DisableHTTP}} + <input id="repo-clone-url" value="{{$.WikiCloneLink.HTTPS}}" readonly> + {{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}} + <input id="repo-clone-url" value="{{$.WikiCloneLink.SSH}}" readonly> + {{end}} + {{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}} + <button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url"> + <i class="octicon octicon-clippy"></i> + </button> + {{end}} + </div> + </div> + <div class="ui header eight wide column"> + <a class="file-revisions-btn ui basic button" title="{{.i18n.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}" ><span>{{.revision}}</span> <i class="fa fa-fw fa-file-text-o"></i></a> + {{$title}} + <div class="ui sub header"> + {{$timeSince := TimeSince .Author.When $.Lang}} + {{.i18n.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}} + </div> + </div> + </div> + <h2 class="ui top header">{{.i18n.Tr "repo.wiki.wiki_page_revisions"}}</h2> + <div class="ui" style="margin-top: 1rem;"> + <h4 class="ui top attached header"> + <div class="ui stackable grid"> + <div class="sixteen wide column"> + {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} + </div> + </div> + </h4> + + {{if and .Commits (gt .CommitCount 0)}} + <div class="ui attached table segment"> + <table class="ui very basic striped fixed table single line" id="commits-table"> + <thead> + <tr> + <th class="eight wide">{{.i18n.Tr "repo.commits.author"}}</th> + <th class="four wide sha">SHA1</th> + <th class="four wide">{{.i18n.Tr "repo.commits.date"}}</th> + </tr> + </thead> + <tbody class="commit-list"> + {{ $r:= List .Commits}} + {{range $r}} + <tr> + <td class="author"> + {{if .User}} + {{if .User.FullName}} + <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/> <a href="{{AppSubUrl}}/{{.User.Name}}">{{.User.FullName}}</a> + {{else}} + <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/> <a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a> + {{end}} + {{else}} + <img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/> {{.Author.Name}} + {{end}} + </td> + <td class="sha"> + <label rel="nofollow" class="ui sha label {{if .Signature}} isSigned {{if .Verification.Verified }} isVerified {{end}}{{end}}"> + {{ShortSha .ID.String}} + {{if .Signature}} + <div class="ui detail icon button"> + {{if .Verification.Verified}} + <i title="{{.Verification.Reason}}" class="lock green icon"></i> + {{else}} + <i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i> + {{end}} + </div> + {{end}} + </label> + </td> + <td class="grey text">{{TimeSince .Author.When $.Lang}}</td> + </tr> + {{end}} + </tbody> + </table> + </div> + {{end}} + + {{template "base/paginate" .}} + + </div> + </div> +</div> + + +{{template "base/footer" .}} diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index dd2de2a041..f775ac9429 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -56,6 +56,7 @@ <div class="ui dividing header"> <div class="ui stackable grid"> <div class="eight wide column"> + <a class="file-revisions-btn ui basic button" title="{{.i18n.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}/_revision" ><span>{{.CommitCount}}</span> <i class="fa fa-fw fa-history"></i></a> {{$title}} <div class="ui sub header"> {{$timeSince := TimeSince .Author.When $.Lang}} |