diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo_index.tmpl | 108 |
1 files changed, 57 insertions, 51 deletions
diff --git a/templates/repo_index.tmpl b/templates/repo_index.tmpl index 617b8ad..da67df4 100644 --- a/templates/repo_index.tmpl +++ b/templates/repo_index.tmpl @@ -41,61 +41,67 @@ <a href="contrib/" class="btn-normal">Merge requests</a> </p> </div> - <div class="padding-wrapper scroll"> - <table id="recent-commits" class="wide"> - <thead> - <tr class="title-row"> - <th colspan="3">Recent commits (<a href="log/{{ if .ref_type }}?{{ .ref_type }}={{ .ref_name }}{{ end }}">see all</a>)</th> - </tr> - <tr> - <th scope="col">Title</th> - <th scope="col">Author</th> - <th scope="col">Author Date</th> - </tr> - </thead> - <tbody> - {{- range .commits }} + {{ if .commits }} + <div class="padding-wrapper scroll"> + <table id="recent-commits" class="wide"> + <thead> + <tr class="title-row"> + <th colspan="3">Recent commits (<a href="log/{{ if .ref_type }}?{{ .ref_type }}={{ .ref_name }}{{ end }}">see all</a>)</th> + </tr> <tr> - <td class="commit-title"><a href="commit/{{ .ID }}">{{ .Message | first_line }}</a></td> - <td class="commit-author"> - <a class="email-name" href="mailto:{{ .Author.Email }}">{{ .Author.Name }}</a> - </td> - <td class="commit-time"> - {{ .Author.When.Format "2006-01-02 15:04:05 -0700" }} - </td> + <th scope="col">Title</th> + <th scope="col">Author</th> + <th scope="col">Author Date</th> + </tr> + </thead> + <tbody> + {{- range .commits }} + <tr> + <td class="commit-title"><a href="commit/{{ .ID }}">{{ .Message | first_line }}</a></td> + <td class="commit-author"> + <a class="email-name" href="mailto:{{ .Author.Email }}">{{ .Author.Name }}</a> + </td> + <td class="commit-time"> + {{ .Author.When.Format "2006-01-02 15:04:05 -0700" }} + </td> + </tr> + {{- end }} + </tbody> + </table> + </div> + {{ end }} + {{ if .files }} + <div class="padding-wrapper scroll"> + <table id="file-tree" class="wide"> + <thead> + <tr class="title-row"> + <th colspan="3">/{{ if .ref_name }} on {{ .ref_name }}{{ end }}</th> </tr> - {{- end }} - </tbody> - </table> - </div> - <div class="padding-wrapper scroll"> - <table id="file-tree" class="wide"> - <thead> - <tr class="title-row"> - <th colspan="3">/{{ if .ref_name }} on {{ .ref_name }}{{ end }}</th> - </tr> - <tr> - <th scope="col">Mode</th> - <th scope="col">Filename</th> - <th scope="col">Size</th> - </tr> - </thead> - <tbody> - {{- $ref_type := .ref_type }} - {{- $ref := .ref_name }} - {{- range .files }} <tr> - <td class="file-mode">{{ .Mode }}</td> - <td class="file-name"><a href="tree/{{ .Name }}{{ if not .Is_file }}/{{ end }}{{ if $ref_type }}?{{ $ref_type }}={{ $ref }}{{ end }}">{{ .Name }}</a>{{ if not .Is_file }}/{{ end }}</td> - <td class="file-size">{{ .Size }}</td> + <th scope="col">Mode</th> + <th scope="col">Filename</th> + <th scope="col">Size</th> </tr> - {{- end }} - </tbody> - </table> - </div> - <div class="padding-wrapper" id="readme"> - {{ .readme }} - </div> + </thead> + <tbody> + {{- $ref_type := .ref_type }} + {{- $ref := .ref_name }} + {{- range .files }} + <tr> + <td class="file-mode">{{ .Mode }}</td> + <td class="file-name"><a href="tree/{{ .Name }}{{ if not .Is_file }}/{{ end }}{{ if $ref_type }}?{{ $ref_type }}={{ $ref }}{{ end }}">{{ .Name }}</a>{{ if not .Is_file }}/{{ end }}</td> + <td class="file-size">{{ .Size }}</td> + </tr> + {{- end }} + </tbody> + </table> + </div> + {{ end }} + {{ if .readme }} + <div class="padding-wrapper" id="readme"> + {{ .readme }} + </div> + {{ end }} <footer> {{ template "footer" . }} </footer> |