aboutsummaryrefslogblamecommitdiff
path: root/templates/repo_tree_dir.tmpl
blob: 12d1636cb72083d977e1e555b0c92c3f2c54f62c (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                                                            
                              
                
              
                                                                                                                                                                                                     
                                    
                                           
                                                           
                                       
                                                              
                                                                
                                                                                                                                                           
                                                     



                                                                                     
                                             
                                        


                                                                        
                                                    

                                                                                                                                                                                                                                                                
                                                     
                                                   





                                             
                                  
                                                         
                                       
                      
                           
                        
                                                   
                         
               
           
{{/*
	SPDX-License-Identifier: AGPL-3.0-only
	SPDX-FileContributor: Runxi Yu <https://runxiyu.org>
*/}}
{{- define "repo_tree_dir" -}}
<!DOCTYPE html>
<html lang="en">
	<head>
		{{- template "head_common" . -}}
		<title>/{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }} &ndash; {{ .repo_name }} &ndash; {{ template "group_path_plain" .group_path }} &ndash; {{ .global.forge_title -}}</title>
	</head>
	<body class="repo-tree-dir">
		{{- template "header" . -}}
		<div class="padding-wrapper scroll">
			<table id="file-tree" class="wide">
				<thead>
					<tr class="title-row">
						<th colspan="3">
							/{{ .path_spec }}{{ if ne .path_spec "" }}/{{ end }}{{ if .ref_name }} on {{ .ref_name }}{{ end -}}
						</th>
						<tr>
							<th scope="col">Mode</th>
							<th scope="col">Filename</th>
							<th scope="col">Size</th>
						</tr>
					</tr>
				</thead>
				<tbody>
					{{- $path_spec := .path_spec -}}
					{{- $ref := .ref_name -}}
					{{- $ref_type := .ref_type -}}
					{{- range .files -}}
						<tr>
							<td class="file-mode">{{- .Mode -}}</td>
							<td class="file-name"><a href="{{- .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>
		<div class="padding-wrapper">
			<div id="refs">
			</div>
		</div>
		{{- if .readme -}}
		<div class="padding-wrapper" id="readme">
			{{- .readme -}}
		</div>
		{{- end -}}
		<footer>
			{{- template "footer" . -}}
		</footer>
	</body>
</html>
{{- end -}}