+13
-5
appview/state/repo.go
+13
-5
appview/state/repo.go
···
312
user := s.auth.GetUser(r)
313
314
var breadcrumbs [][]string
315
-
breadcrumbs = append(breadcrumbs, []string{f.RepoName, fmt.Sprintf("/%s/%s/tree/%s", f.OwnerDid(), f.RepoName, ref)})
316
if treePath != "" {
317
for idx, elem := range strings.Split(treePath, "/") {
318
breadcrumbs = append(breadcrumbs, []string{elem, fmt.Sprintf("%s/%s", breadcrumbs[idx][1], elem)})
319
}
320
}
321
322
-
baseTreeLink := path.Join(f.OwnerDid(), f.RepoName, "tree", ref, treePath)
323
-
baseBlobLink := path.Join(f.OwnerDid(), f.RepoName, "blob", ref, treePath)
324
325
s.pages.RepoTree(w, pages.RepoTreeParams{
326
LoggedInUser: user,
···
447
}
448
449
var breadcrumbs [][]string
450
-
breadcrumbs = append(breadcrumbs, []string{f.RepoName, fmt.Sprintf("/%s/%s/tree/%s", f.OwnerDid(), f.RepoName, ref)})
451
if filePath != "" {
452
for idx, elem := range strings.Split(filePath, "/") {
453
breadcrumbs = append(breadcrumbs, []string{elem, fmt.Sprintf("%s/%s", breadcrumbs[idx][1], elem)})
···
854
}
855
856
func (f *FullyResolvedRepo) OwnerSlashRepo() string {
857
-
p, _ := securejoin.SecureJoin(f.OwnerDid(), f.RepoName)
858
return p
859
}
860
···
312
user := s.auth.GetUser(r)
313
314
var breadcrumbs [][]string
315
+
breadcrumbs = append(breadcrumbs, []string{f.RepoName, fmt.Sprintf("/%s/tree/%s", f.OwnerSlashRepo(), ref)})
316
if treePath != "" {
317
for idx, elem := range strings.Split(treePath, "/") {
318
breadcrumbs = append(breadcrumbs, []string{elem, fmt.Sprintf("%s/%s", breadcrumbs[idx][1], elem)})
319
}
320
}
321
322
+
baseTreeLink := path.Join(f.OwnerSlashRepo(), "tree", ref, treePath)
323
+
baseBlobLink := path.Join(f.OwnerSlashRepo(), "blob", ref, treePath)
324
325
s.pages.RepoTree(w, pages.RepoTreeParams{
326
LoggedInUser: user,
···
447
}
448
449
var breadcrumbs [][]string
450
+
breadcrumbs = append(breadcrumbs, []string{f.RepoName, fmt.Sprintf("/%s/tree/%s", f.OwnerSlashRepo(), ref)})
451
if filePath != "" {
452
for idx, elem := range strings.Split(filePath, "/") {
453
breadcrumbs = append(breadcrumbs, []string{elem, fmt.Sprintf("%s/%s", breadcrumbs[idx][1], elem)})
···
854
}
855
856
func (f *FullyResolvedRepo) OwnerSlashRepo() string {
857
+
handle := f.OwnerId.Handle
858
+
859
+
var p string
860
+
if handle != "" && !handle.IsInvalidHandle() {
861
+
p, _ = securejoin.SecureJoin(fmt.Sprintf("@%s", handle), f.RepoName)
862
+
} else {
863
+
p, _ = securejoin.SecureJoin(f.OwnerDid(), f.RepoName)
864
+
}
865
+
866
return p
867
}
868