mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-25 01:10:37 +00:00
add up url in file list
This commit is contained in:
parent
a22c4ba71d
commit
c6e12d2568
2 changed files with 16 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
package repo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/codegangsta/martini"
|
||||
|
@ -87,6 +88,11 @@ func Single(ctx *middleware.Context, params martini.Params) {
|
|||
for i, _ := range treenames {
|
||||
Paths = append(Paths, strings.Join(treenames[0:i+1], "/"))
|
||||
}
|
||||
|
||||
ctx.Data["HasParentPath"] = true
|
||||
if len(Paths)-2 >= 0 {
|
||||
ctx.Data["ParentPath"] = "/" + Paths[len(Paths)-2]
|
||||
}
|
||||
}
|
||||
|
||||
// Get latest commit according username and repo name
|
||||
|
@ -126,6 +132,8 @@ func Single(ctx *middleware.Context, params martini.Params) {
|
|||
}
|
||||
}
|
||||
|
||||
fmt.Println(Paths)
|
||||
|
||||
ctx.Data["Paths"] = Paths
|
||||
ctx.Data["Treenames"] = treenames
|
||||
ctx.Data["IsRepoToolbarSource"] = true
|
||||
|
|
|
@ -57,6 +57,14 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if .HasParentPath}}
|
||||
<tr class="has-parent">
|
||||
<td class="icon"><a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}{{.ParentPath}}"><i class="fa fa-reply"></i></a></td>
|
||||
<td class="name"><a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}{{.ParentPath}}">..</a></td>
|
||||
<td class="text"></td>
|
||||
<td class="date"></td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{range .Files}}
|
||||
<tr
|
||||
{{if .IsDir}}class="is-dir"{{end}}>
|
||||
|
|
Loading…
Reference in a new issue