diff options
author | Adam Strzelecki <ono@java.pl> | 2015-12-07 23:30:52 +0100 |
---|---|---|
committer | Adam Strzelecki <ono@java.pl> | 2015-12-08 00:57:46 +0100 |
commit | da2585c11e11023ffa7a8c69d21c6fecac520a8e (patch) | |
tree | 1c2a575dfc00e0e78f47c497a6d9347b3edeca9a /templates/repo/view_file.tmpl | |
parent | dd8a06a397e26c46639eba1313102560dfa49c95 (diff) | |
download | gitea-da2585c11e11023ffa7a8c69d21c6fecac520a8e.tar.gz gitea-da2585c11e11023ffa7a8c69d21c6fecac520a8e.zip |
Indent all templates with tabs
This commit improves templates readability, since all of them use consistent
indent with all template command blocks indented too.
1. Indents both HTML containers such as <div>, <p> and Go HTML template blocks
such as {{if}} {{with}}
2. Cleans all trailing white-space
3. Adds trailing last line-break to each file
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r-- | templates/repo/view_file.tmpl | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 5751d2e3dd..cf6198195a 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -1,50 +1,50 @@ <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}} - <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="file-view {{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}} - </div> - {{else if .FileSize}} - <table> - <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}} - </div> - </div> -</div>
\ No newline at end of file + <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}} + <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="file-view {{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}} + </div> + {{else if .FileSize}} + <table> + <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}} + </div> + </div> +</div> |