Compact Gitea Layout
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.

168 lines
8.6KB

  1. <div class="header-wrapper">
  2. {{with .Repository}}
  3. <div class="ui container">
  4. <div class="repo-header">
  5. <div class="ui huge breadcrumb repo-title">
  6. {{if .RelAvatarLink}}
  7. <img class="ui avatar image" src="{{.RelAvatarLink}}">
  8. {{else}}
  9. <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
  10. {{end}}
  11. <a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
  12. <div class="divider"> / </div>
  13. <a href="{{$.RepoLink}}">{{.Name}}</a>
  14. {{if and .RelAvatarLink .IsPrivate}}<i class="mega-octicon octicon-lock"></i>{{end}}
  15. {{if .IsTemplate}}<i class="icon fa-copy"></i>{{end}}
  16. {{if .IsArchived}}<i class="archive icon archived-icon"></i>{{end}}
  17. {{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{if .SanitizedOriginalURL}}{{.SanitizedOriginalURL}}{{else}}{{MirrorAddress $.Mirror}}{{end}}">{{if .SanitizedOriginalURL}}{{.SanitizedOriginalURL}}{{else}}{{MirrorAddress $.Mirror}}{{end}}</a></div>{{end}}
  18. {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
  19. {{if .IsGenerated}}<div class="fork-flag">{{$.i18n.Tr "repo.generated_from"}} <a href="{{.TemplateRepo.Link}}">{{SubStr .TemplateRepo.RelLink 1 -1}}</a></div>{{end}}
  20. <small>{{SizeFmt .Size}}</small>
  21. </div>
  22. {{if not .IsBeingCreated}}
  23. <div class="repo-buttons">
  24. <form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
  25. {{$.CsrfTokenHtml}}
  26. <div class="ui labeled button" tabindex="0">
  27. <button type="submit" class="ui compact basic button">
  28. <i class="icon fa-eye{{if not $.IsWatchingRepo}}-slash{{end}}"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  29. </button>
  30. <a class="ui basic label" href="{{.Link}}/watchers">
  31. {{.NumWatches}}
  32. </a>
  33. </div>
  34. </form>
  35. <form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
  36. {{$.CsrfTokenHtml}}
  37. <div class="ui labeled button" tabindex="0">
  38. <button type="submit" class="ui compact basic button">
  39. <i class="icon star{{if not $.IsStaringRepo}} outline{{end}}"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
  40. </button>
  41. <a class="ui basic label" href="{{.Link}}/stars">
  42. {{.NumStars}}
  43. </a>
  44. </div>
  45. </form>
  46. {{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
  47. <div class="ui labeled button {{if and ($.IsSigned) (not $.CanSignedUserFork)}}disabled-repo-button{{end}}" tabindex="0">
  48. <a class="ui compact basic button {{if or (not $.IsSigned) (not $.CanSignedUserFork)}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else if $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" {{ else }} data-content="{{$.i18n.Tr "repo.fork_guest_user" }}" rel="nofollow" href="{{AppSubUrl}}/user/login?redirect_to={{AppSubUrl}}/repo/fork/{{.ID}}" {{end}} data-position="top center" data-variation="tiny">
  49. <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  50. </a>
  51. <a class="ui basic label" href="{{.Link}}/forks">
  52. {{.NumForks}}
  53. </a>
  54. </div>
  55. {{end}}
  56. </div>
  57. {{end}}
  58. </div><!-- end grid -->
  59. <div class="ui repo-description repo-description-custom">
  60. <div id="repo-desc">
  61. {{if .DescriptionHTML}}<span class="description has-emoji">{{.DescriptionHTML}}</span>{{else if $.IsRepositoryAdmin}}<span class="no-description text-italic">{{$.i18n.Tr "repo.no_desc"}}</span>{{end}}
  62. <a class="link" href="{{.Website}}">{{.Website}}</a>
  63. </div>
  64. </div>
  65. <div class="ui repo-topics-custom" id="repo-topics">
  66. {{range $.Topics}}<a class="ui repo-topic small label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
  67. {{if and $.Permission.IsAdmin (not .IsArchived)}}<a id="manage_topic">{{$.i18n.Tr "repo.topic.manage_topics"}}</a>{{end}}
  68. </div>
  69. {{if and $.Permission.IsAdmin (not .IsArchived)}}
  70. <div class="ui repo-topic-edit grid form segment error" id="topic_edit" style="display:none">
  71. <div class="fourteen wide column">
  72. <div class="field">
  73. <div class="ui fluid multiple search selection dropdown">
  74. <input type="hidden" name="topics" value="{{range $i, $v := $.Topics}}{{.Name}}{{if lt (Add $i 1) (len $.Topics)}},{{end}}{{end}}">
  75. {{range $.Topics}}
  76. <div class="ui small label topic transition visible" data-value="{{.Name}}" style="display: inline-block !important; cursor: default;">{{.Name}}<i class="delete icon"></i></div>
  77. {{end}}
  78. <div class="text"></div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="two wide column">
  83. <a class="ui button primary" href="javascript:;" id="save_topic"
  84. data-link="{{$.RepoLink}}/topics">{{$.i18n.Tr "repo.topic.done"}}</a>
  85. </div>
  86. </div>
  87. {{end}}
  88. </div><!-- end container -->
  89. {{end}}
  90. <div class="ui tabs container">
  91. {{if not .Repository.IsBeingCreated}}
  92. <div class="ui tabular stackable menu navbar">
  93. {{if .Permission.CanRead $.UnitTypeCode}}
  94. <a class="{{if (and .PageIsViewCode (not (or .PageIsCommits .PageIsBranches)))}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL | EscapePound}}{{end}}">
  95. <i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
  96. </a>
  97. <a class="{{if .PageIsCommits}}active{{end}} item"
  98. href="{{.RepoLink}}/commits{{if .IsViewBranch}}/branch{{else if .IsViewTag}}/tag{{else if .IsViewCommit}}/commit{{end}}/{{EscapePound .BranchName}}">
  99. <i class="octicon octicon-clock"></i>
  100. {{.i18n.Tr "repo.commits"}}
  101. <span class="ui small label">{{or .CommitsCount "0"}}</span>
  102. </a>
  103. <a class="{{if .PageIsBranches}}active{{end}} item"
  104. href="{{.RepoLink}}/branches/">
  105. <i class="octicon octicon-git-branch"></i>
  106. {{.i18n.Tr "repo.branches"}}
  107. <span class="ui small label">{{or .BranchesCount "0"}}</span>
  108. </a>
  109. {{end}}
  110. {{if .Permission.CanRead $.UnitTypeIssues}}
  111. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  112. <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} <span class="ui {{if not .Repository.NumOpenIssues}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenIssues}}</span>
  113. </a>
  114. {{end}}
  115. {{if .Permission.CanRead $.UnitTypeExternalTracker}}
  116. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer">
  117. <i class="octicon octicon-link-external"></i> {{.i18n.Tr "repo.issues"}} </span>
  118. </a>
  119. {{end}}
  120. {{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}}
  121. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  122. <i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls"}} <span class="ui {{if not .Repository.NumOpenPulls}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenPulls}}</span>
  123. </a>
  124. {{end}}
  125. {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo) }}
  126. <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
  127. <i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .NumReleases}}gray{{else}}blue{{end}} small label">{{.NumReleases}}</span>
  128. </a>
  129. {{end}}
  130. {{if or (.Permission.CanRead $.UnitTypeWiki) (.Permission.CanRead $.UnitTypeExternalWiki)}}
  131. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki" {{if (.Permission.CanRead $.UnitTypeExternalWiki)}} target="_blank" rel="noopener noreferrer" {{end}}>
  132. <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
  133. </a>
  134. {{end}}
  135. {{if and (.Permission.CanReadAny $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsEmptyRepo)}}
  136. <a class="{{if .PageIsActivity}}active{{end}} item" href="{{.RepoLink}}/activity">
  137. <i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}}
  138. </a>
  139. {{end}}
  140. {{template "custom/extra_tabs" .}}
  141. {{if .Permission.IsAdmin}}
  142. <div class="right menu">
  143. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  144. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  145. </a>
  146. </div>
  147. {{end}}
  148. </div>
  149. {{end}}
  150. </div>
  151. <div class="ui tabs divider"></div>
  152. </div>