code.gitea.io/gitea@v1.22.3/templates/repo/view_list.tmpl (about)

     1  <table id="repo-files-table" class="ui single line table tw-mt-0" {{if .HasFilesWithoutLatestCommit}}hx-indicator="tr.notready td.message span" hx-trigger="load" hx-swap="morph" hx-post="{{.LastCommitLoaderURL}}"{{end}}>
     2  	<thead>
     3  		<tr class="commit-list">
     4  			<th class="tw-overflow-hidden" colspan="2">
     5  				<div class="tw-flex">
     6  					<div class="latest-commit">
     7  						{{template "repo/latest_commit" .}}
     8  					</div>
     9  				</div>
    10  			</th>
    11  			<th class="text grey right age">{{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When ctx.Locale}}{{end}}{{end}}</th>
    12  		</tr>
    13  	</thead>
    14  	<tbody>
    15  		{{if .HasParentPath}}
    16  			<tr class="has-parent">
    17  				<td colspan="3">{{svg "octicon-reply"}}<a class="muted" href="{{.BranchLink}}{{if .ParentPath}}{{PathEscapeSegments .ParentPath}}{{end}}">..</a></td>
    18  			</tr>
    19  		{{end}}
    20  		{{range $item := .Files}}
    21  			{{$entry := $item.Entry}}
    22  			{{$commit := $item.Commit}}
    23  			{{$subModuleFile := $item.SubModuleFile}}
    24  			<tr data-entryname="{{$entry.Name}}" data-ready="{{if $commit}}true{{else}}false{{end}}" class="{{if not $commit}}not{{end}}ready entry">
    25  				<td class="name four wide">
    26  					<span class="truncate">
    27  						{{if $entry.IsSubModule}}
    28  							{{svg "octicon-file-submodule"}}
    29  							{{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} {{/* FIXME: the usage of AppUrl seems incorrect, it would be fixed in the future, use AppSubUrl instead */}}
    30  							{{if $refURL}}
    31  								<a class="muted" href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a href="{{$refURL}}/commit/{{PathEscape $subModuleFile.RefID}}">{{ShortSha $subModuleFile.RefID}}</a>
    32  							{{else}}
    33  								{{$entry.Name}}<span class="at">@</span>{{ShortSha $subModuleFile.RefID}}
    34  							{{end}}
    35  						{{else}}
    36  							{{if $entry.IsDir}}
    37  								{{$subJumpablePathName := $entry.GetSubJumpablePathName}}
    38  								{{svg "octicon-file-directory-fill"}}
    39  								<a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}">
    40  									{{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}}
    41  									{{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}}
    42  									{{if eq $subJumpablePathFieldLast 0}}
    43  										{{$subJumpablePathName}}
    44  									{{else}}
    45  										{{$subJumpablePathPrefixes := slice $subJumpablePathFields 0 $subJumpablePathFieldLast}}
    46  										<span class="text light-2">{{StringUtils.Join $subJumpablePathPrefixes "/"}}</span>/{{index $subJumpablePathFields $subJumpablePathFieldLast}}
    47  									{{end}}
    48  								</a>
    49  							{{else}}
    50  								{{svg (printf "octicon-%s" (EntryIcon $entry))}}
    51  								<a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
    52  							{{end}}
    53  						{{end}}
    54  					</span>
    55  				</td>
    56  				<td class="message nine wide">
    57  					<span class="truncate">
    58  						{{if $commit}}
    59  							{{$commitLink := printf "%s/commit/%s" $.RepoLink (PathEscape $commit.ID.String)}}
    60  							{{RenderCommitMessageLinkSubject $.Context $commit.Message $commitLink ($.Repository.ComposeMetas ctx)}}
    61  						{{else}}
    62  							<div class="ui active tiny slow centered inline"></div>
    63  						{{end}}
    64  					</span>
    65  				</td>
    66  				<td class="text right age three wide">{{if $commit}}{{TimeSince $commit.Committer.When ctx.Locale}}{{end}}</td>
    67  			</tr>
    68  		{{end}}
    69  	</tbody>
    70  </table>
    71  {{if and .ReadmeExist (or .IsMarkup .IsPlainText)}}
    72  	{{template "repo/view_file" .}}
    73  {{end}}