You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sub_menu.tmpl 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {{if and (not .HideRepoInfo) (not .IsBlame)}}
  2. <div class="ui segments repository-summary{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}} repository-summary-language-stats{{end}} gt-mt-2 gt-mb-0">
  3. <div class="ui segment sub-menu repository-menu">
  4. <div class="ui two horizontal center list">
  5. {{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo)}}
  6. <div class="item{{if .PageIsCommits}} active{{end}}">
  7. <a class="flex-text-inline" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}">{{svg "octicon-history"}} <b>{{.locale.PrettyNumber .CommitsCount}}</b> {{.locale.TrN .CommitsCount "repo.commit" "repo.commits"}}</a>
  8. </div>
  9. <div class="item{{if .PageIsBranches}} active{{end}}">
  10. <a class="flex-text-inline" href="{{.RepoLink}}/branches">{{svg "octicon-git-branch"}} <b>{{.locale.PrettyNumber .BranchesCount}}</b> {{.locale.TrN .BranchesCount "repo.branch" "repo.branches"}}</a>
  11. </div>
  12. {{if $.Permission.CanRead $.UnitTypeCode}}
  13. <div class="item{{if .PageIsTagList}} active{{end}}">
  14. <a class="flex-text-inline" href="{{.RepoLink}}/tags">{{svg "octicon-tag"}} <b>{{.locale.PrettyNumber .NumTags}}</b> {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
  15. </div>
  16. {{end}}
  17. <div class="item" {{if not (eq .Repository.Size 0)}}data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>
  18. {{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}}
  19. {{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}}
  20. <span class="flex-text-inline">{{svg "octicon-database"}} <b>{{.locale.PrettyNumber (index $fileSizeFields 0)}}</b> {{index $fileSizeFields 1}}</span>
  21. </div>
  22. {{end}}
  23. </div>
  24. </div>
  25. {{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}}
  26. <div class="ui segment sub-menu language-stats-details gt-hidden">
  27. <div class="ui horizontal center list">
  28. {{range .LanguageStats}}
  29. <div class="item gt-df gt-ac gt-jc">
  30. <i class="color-icon gt-mr-3" style="background-color: {{.Color}}"></i>
  31. <span class="gt-font-semibold gt-mr-3">
  32. {{if eq .Language "other"}}
  33. {{$.locale.Tr "repo.language_other"}}
  34. {{else}}
  35. {{.Language}}
  36. {{end}}
  37. </span>
  38. {{.Percentage}}%
  39. </div>
  40. {{end}}
  41. </div>
  42. </div>
  43. <a class="ui segment language-stats">
  44. {{range .LanguageStats}}
  45. <div class="bar" style="width: {{.Percentage}}%; background-color: {{.Color}}" data-tooltip-placement="top" data-tooltip-content={{.Language}}>&nbsp;</div>
  46. {{end}}
  47. </a>
  48. {{end}}
  49. </div>
  50. {{end}}