summaryrefslogtreecommitdiffstats
path: root/templates/repo/view_file.tmpl
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-14 04:34:01 -0500
committerUnknwon <u@gogs.io>2015-11-14 04:34:01 -0500
commit7b1c10ea7eadf83706ca7e27094104749636d26a (patch)
treecbb1d0e32d4ac81f76576b5bf88eb777fa6fb9c6 /templates/repo/view_file.tmpl
parent679af4ddeaca0748632959841867b2a56de26643 (diff)
downloadgitea-7b1c10ea7eadf83706ca7e27094104749636d26a.tar.gz
gitea-7b1c10ea7eadf83706ca7e27094104749636d26a.zip
new repo ui
- copy link button: #1396, #1168, #1668, - synxtax highlight: #1712, #1549, #1315, #670 - z-index: #1942
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r--templates/repo/view_file.tmpl86
1 files changed, 43 insertions, 43 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index a0d6781cbc..827e51931d 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -1,50 +1,50 @@
-<div class="panel panel-radius" id="{{if .ReadmeExist}}repo-readme{{else}}repo-read-file{{end}}">
- <p class="panel-header">
- {{if .ReadmeExist}}
- <i class="icon fa fa-book fa-lg"></i>
- {{if .ReadmeInList}}
- <strong class="file-name">{{.FileName}}</strong>
- {{else}}
- <strong>{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
- {{end}}
- {{else}}
- <i class="icon fa fa-file-text-o"></i>
- <strong class="file-name">{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
- {{end}}
- {{if not .ReadmeInList}}
- {{if not .IsCommit}}
- <a class="right" href="{{.RepoLink}}/src/{{.CommitID}}/{{EscapePound .TreeName}}">
- <button class="btn btn-medium btn-gray btn-right-radius btn-comb">{{.i18n.Tr "repo.file_permalink"}}</button>
- </a>
- {{end}}
- <a class="right" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}/{{EscapePound .TreeName}}">
- <button class="btn btn-medium btn-gray btn-right-radius btn-comb">{{.i18n.Tr "repo.file_history"}}</button>
- </a>
- <a class="right" href="{{EscapePound .FileLink}}">
- <button class="btn btn-medium btn-gray btn-left-radius btn-comb">{{.i18n.Tr "repo.file_raw"}}</button>
- </a>
+<div id="file-content">
+ <h4 class="ui top attached header" id="{{if .ReadmeExist}}repo-readme{{else}}repo-read-file{{end}}">
+ {{if .ReadmeExist}}
+ <i class="book icon ui left"></i>
+ {{if .ReadmeInList}}
+ <strong>{{.FileName}}</strong>
+ {{else}}
+ <strong>{{.FileName}}</strong> <span class="text grey normal">{{FileSize .FileSize}}</span>
+ {{end}}
+ {{else}}
+ <i class="file text outline icon ui left"></i>
+ <strong>{{.FileName}}</strong> <span class="text grey normal">{{FileSize .FileSize}}</span>
+ {{end}}
+ {{if not .ReadmeInList}}
+ <div class="ui right">
+ <div class="ui small grey basic buttons">
+ {{if not .IsCommit}}
+ <a class="ui button" href="{{.RepoLink}}/src/{{.CommitID}}/{{EscapePound .TreeName}}">{{.i18n.Tr "repo.file_permalink"}}</a>
{{end}}
- </p>
- <div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view" id="repo-code-view">
- {{if .ReadmeExist}}
- {{if .FileContent}}{{.FileContent | Str2html}}{{end}}
+ <a class="ui button" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}/{{EscapePound .TreeName}}">{{.i18n.Tr "repo.file_history"}}</a>
+ <a class="ui button" href="{{EscapePound .FileLink}}">{{.i18n.Tr "repo.file_raw"}}</a>
+ </div>
+ </div>
+ {{end}}
+ </h4>
+ <div class="ui attached table segment">
+ <div class="{{if .ReadmeExist}}markdown{{else if .IsFileText}}code-view{{end}}">
+ {{if .ReadmeExist}}
+ {{if .FileContent}}{{.FileContent | Str2html}}{{end}}
{{else if not .IsFileText}}
<div class="view-raw">
- {{if .IsImageFile}}
- <img src="{{EscapePound .FileLink}}">
- {{else}}
- <a href="{{EscapePound .FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
- {{end}}
+ {{if .IsImageFile}}
+ <img src="{{EscapePound .FileLink}}">
+ {{else}}
+ <a href="{{EscapePound .FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
+ {{end}}
</div>
- {{else if .FileSize}}
+ {{else if .FileSize}}
<table>
- <tbody>
- <tr>
- <td class="lines-num"></td>
- <td class="lines-code"><pre class="prettyprint linenums {{if .FileExt}}lang-{{.FileExt}}{{end}}"><code>{{.FileContent}}</code></pre></td>
- </tr>
- </tbody>
+ <tbody>
+ <tr>
+ <td class="lines-num"></td>
+ <td class="lines-code"><pre class="{{if .FileExt}}lang-{{.FileExt}}{{end}}"><code><ol class="linenums">{{.FileContent}}</ol></code></pre></td>
+ </tr>
+ </tbody>
</table>
- {{end}}
+ {{end}}
</div>
-</div>
+ </div>
+</div> \ No newline at end of file