diff options
author | Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> | 2020-06-15 20:39:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 14:39:39 -0400 |
commit | c8780984f8c211342acf6b133bd08b940cb9cba2 (patch) | |
tree | cc5cb7b4e09eb493cd6d51e9d755e1e77653baa8 /templates/repo/blame.tmpl | |
parent | a7f7d1399f2f0c4ee9d13d595607c4fe2fd437e8 (diff) | |
download | gitea-c8780984f8c211342acf6b133bd08b940cb9cba2.tar.gz gitea-c8780984f8c211342acf6b133bd08b940cb9cba2.zip |
Rework blame template and styling (#11885)
* Rework blame template and styling
* cleanup template and add missing NumLines
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/repo/blame.tmpl')
-rw-r--r-- | templates/repo/blame.tmpl | 74 |
1 files changed, 30 insertions, 44 deletions
diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl index c2410e8c1d..84e3e8c53e 100644 --- a/templates/repo/blame.tmpl +++ b/templates/repo/blame.tmpl @@ -1,51 +1,37 @@ -<div class="tab-size-8 non-diff-file-content"> - - <h4 class="ui top attached header" id="repo-read-file"> - <div class="ui stackable grid"> - <div class="eight wide column"> - <i class="file text outline icon ui left"></i> - <strong>{{.FileName}}</strong> <span class="text grey normal">{{FileSize .FileSize}}{{if .IsLFSFile}} ({{.i18n.Tr "repo.stored_lfs"}}){{end}}</span> +<div class="{{TabSizeClass .Editorconfig .FileName}} non-diff-file-content"> + <h4 class="file-header ui top attached header"> + <div class="file-header-left"> + <div class="file-info text grey normal mono"> + <div class="file-info-entry"> + {{.NumLines}} {{.i18n.Tr (TrN .i18n.Lang .NumLines "repo.line" "repo.lines") }} + </div> + <div class="file-info-entry">{{FileSize .FileSize}}</div> </div> - <div class="eight wide right aligned column"> - <div class="ui right file-actions"> - <div class="ui buttons"> - <a class="ui button" href="{{EscapePound $.RawFileLink}}">{{.i18n.Tr "repo.file_raw"}}</a> - {{if not .IsViewCommit}} - <a class="ui button" href="{{.RepoLink}}/src/commit/{{.CommitID}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_permalink"}}</a> - {{end}} - <a class="ui button" href="{{.RepoLink}}/src/{{EscapePound .BranchNameSubURL}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.normal_view"}}</a> - <a class="ui button" href="{{.RepoLink}}/commits/{{EscapePound .BranchNameSubURL}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_history"}}</a> - </div> - {{if .Repository.CanEnableEditor}} - {{if .CanEditFile}} - <a href="{{.RepoLink}}/_edit/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}"><span class="btn-octicon poping up" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted">{{svg "octicon-pencil" 16}}</span></a> - {{else}} - <span class="btn-octicon poping up disabled" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted">{{svg "octicon-pencil" 16}}</span> - {{end}} - {{if .CanDeleteFile}} - <a href="{{.RepoLink}}/_delete/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}"><span class="btn-octicon btn-octicon-danger poping up" data-content="{{.DeleteFileTooltip}}" data-position="bottom center" data-variation="tiny inverted">{{svg "octicon-trashcan" 16}}</span></a> - {{else}} - <span class="btn-octicon poping up disabled" data-content="{{.DeleteFileTooltip}}" data-position="bottom center" data-variation="tiny inverted">{{svg "octicon-trashcan" 16}}</span> - {{end}} - {{end}} - </div> + </div> + <div class="file-header-right"> + <div class="ui right file-actions"> + <div class="ui buttons"> + <a class="ui button" href="{{EscapePound $.RawFileLink}}">{{.i18n.Tr "repo.file_raw"}}</a> + {{if not .IsViewCommit}} + <a class="ui button" href="{{.RepoLink}}/src/commit/{{.CommitID}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_permalink"}}</a> + {{end}} + <a class="ui button" href="{{.RepoLink}}/src/{{EscapePound .BranchNameSubURL}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.normal_view"}}</a> + <a class="ui button" href="{{.RepoLink}}/commits/{{EscapePound .BranchNameSubURL}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_history"}}</a> + </div> </div> </div> </h4> - <div class="ui attached table unstackable segment"> - <div class="file-view code-view"> - <table> - <tbody> - <tr> - <td class="lines-commit">{{.BlameCommitInfo}}</td> - <td class="lines-num">{{.BlameLineNums}}</td> - <td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol class="linenums">{{.BlameContent}}</ol></code></pre></td> - </tr> - </tbody> - </table> - </div> + <div class="file-view code-view"> + <table> + <tbody> + <tr> + <td class="lines-commit">{{.BlameCommitInfo}}</td> + <td class="lines-num">{{.BlameLineNums}}</td> + <td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol class="linenums">{{.BlameContent}}</ol></code></pre></td> + </tr> + </tbody> + </table> + </div> </div> - - </div> |