aboutsummaryrefslogtreecommitdiff
path: root/templates/repo/view_file.tmpl
diff options
context:
space:
mode:
authorJustin Nuß <nuss.justin@gmail.com>2014-07-26 11:23:58 +0200
committerJustin Nuß <nuss.justin@gmail.com>2014-07-26 11:23:58 +0200
commit91480f3791f266369c343c539f8eeec245fa969a (patch)
treea03ad6062fe4b546367cdb6f9921399458d97441 /templates/repo/view_file.tmpl
parent835e85b5ce9921ffd4d50b90b706e02685167331 (diff)
parent35c75f06a0a4f321021984830d760e67ca0ef8e5 (diff)
Merge branch 'dev' of https://github.com/gogits/Gogs into issue/281
Conflicts: modules/base/tool.go
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r--templates/repo/view_file.tmpl29
1 files changed, 29 insertions, 0 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
new file mode 100644
index 00000000..be544194
--- /dev/null
+++ b/templates/repo/view_file.tmpl
@@ -0,0 +1,29 @@
+<div class="panel panel-radius" id="repo-readme">
+ <p class="panel-header">
+ {{if .ReadmeExist}}
+ <i class="icon fa fa-book fa-lg"></i>
+ {{if .ReadmeInHome}}
+ <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}}
+ </p>
+ <div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view">
+ {{if .ReadmeExist}}
+ {{.FileContent | Str2html}}
+ {{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>
+ </table>
+ {{end}}
+ </div>
+</div> \ No newline at end of file