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

list.tmpl 5.1 kB

9 years ago
3 years ago
Add Octicon SVG spritemap (#10107) * Add octicon SVG sprite Signed-off-by: jolheiser <john.olheiser@gmail.com> * Static prefix Signed-off-by: jolheiser <john.olheiser@gmail.com> * SVG for all repo icons Signed-off-by: jolheiser <john.olheiser@gmail.com> * make vendor Signed-off-by: jolheiser <john.olheiser@gmail.com> * Swap out octicons Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move octicons to top of less imports Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix JS Signed-off-by: jolheiser <john.olheiser@gmail.com> * Definitely not a search/replace Signed-off-by: jolheiser <john.olheiser@gmail.com> * Missed regex Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move to more generic calls and webpack Signed-off-by: jolheiser <john.olheiser@gmail.com> * make svg -> make webpack Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove svg-sprite Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Missed a test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove svg from makefile Signed-off-by: jolheiser <john.olheiser@gmail.com> * Suggestions Signed-off-by: jolheiser <john.olheiser@gmail.com> * Attempt to fix test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Revert timetracking test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Swap .octicon for .svg in less Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add aria-hidden Signed-off-by: jolheiser <john.olheiser@gmail.com> * Replace mega-octicon Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix webpack globbing on Windows Signed-off-by: jolheiser <john.olheiser@gmail.com> * Revert Co-Authored-By: silverwind <me@silverwind.io> * Fix octions from upstream Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix Vue and missed JS function Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add JS helper and PWA Signed-off-by: jolheiser <john.olheiser@gmail.com> * Preload SVG Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <matti@mdranta.net>
5 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {{template "base/head" .}}
  2. <div class="repository release">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <h2 class="ui header">
  7. <div class="ui breadcrumb">
  8. <a class="section" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL | EscapePound}}{{end}}">{{.i18n.Tr "repo.code"}}</a>
  9. <div class="divider"> / </div>
  10. <div class="active section" href="{{.RepoLink}}/releases">{{.i18n.Tr "repo.releases"}}</div>
  11. </div>
  12. {{if .CanCreateRelease}}
  13. <div class="ui right">
  14. <a class="ui small green button" href="{{$.RepoLink}}/releases/new">
  15. {{.i18n.Tr "repo.release.new_release"}}
  16. </a>
  17. </div>
  18. {{end}}
  19. </h2>
  20. <ul id="release-list">
  21. {{range $idx, $release := .Releases}}
  22. <li class="ui grid">
  23. <div class="ui four wide column meta">
  24. {{if .IsTag}}
  25. {{if .CreatedUnix}}<span class="time">{{TimeSinceUnix .CreatedUnix $.Lang}}</span>{{end}}
  26. {{else}}
  27. {{if .IsDraft}}
  28. <span class="ui yellow label">{{$.i18n.Tr "repo.release.draft"}}</span>
  29. {{else if .IsPrerelease}}
  30. <span class="ui orange label">{{$.i18n.Tr "repo.release.prerelease"}}</span>
  31. {{else}}
  32. <span class="ui green label">{{$.i18n.Tr "repo.release.stable"}}</span>
  33. {{end}}
  34. <span class="tag text blue">
  35. <a href="{{$.RepoLink}}/src/tag/{{.TagName | EscapePound}}" rel="nofollow"><i class="tag icon"></i> {{.TagName}}</a>
  36. </span>
  37. <span class="commit">
  38. <a href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow"><i class="code icon"></i> {{ShortSha .Sha1}}</a>
  39. </span>
  40. {{end}}
  41. </div>
  42. <div class="ui twelve wide column detail">
  43. {{if .IsTag}}
  44. <h4>
  45. <a href="{{$.RepoLink}}/src/tag/{{.TagName | EscapePound}}" rel="nofollow"><i class="tag icon"></i> {{.TagName}}</a>
  46. </h4>
  47. <div class="download">
  48. {{if $.Permission.CanRead $.UnitTypeCode}}
  49. <a href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow"><i class="code icon"></i> {{ShortSha .Sha1}}</a>
  50. <a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16}}&nbsp;ZIP</a>
  51. <a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.tar.gz">{{svg "octicon-file-zip" 16}}&nbsp;TAR.GZ</a>
  52. {{end}}
  53. </div>
  54. {{else}}
  55. <h3>
  56. <a href="{{$.RepoLink}}/releases/tag/{{.TagName | EscapePound}}">{{.Title}}</a>
  57. {{if $.CanCreateRelease}}<small>(<a href="{{$.RepoLink}}/releases/edit/{{.TagName | EscapePound}}" rel="nofollow">{{$.i18n.Tr "repo.release.edit"}}</a>)</small>{{end}}
  58. </h3>
  59. <p class="text grey">
  60. <span class="author">
  61. {{if .OriginalAuthor}}
  62. <i class="fa fa-github" aria-hidden="true"></i>
  63. {{.OriginalAuthor}}
  64. {{else if .Publisher}}
  65. <img class="img-10" src="{{.Publisher.RelAvatarLink}}">
  66. <a href="{{AppSubUrl}}/{{.Publisher.Name}}">{{.Publisher.Name}}</a>
  67. {{else}}
  68. Ghost
  69. {{end}}
  70. </span>
  71. {{if .CreatedUnix}}<span class="time">{{TimeSinceUnix .CreatedUnix $.Lang}}</span>{{end}}
  72. <span class="ahead">{{$.i18n.Tr "repo.release.ahead" .NumCommitsBehind .Target | Str2html}}</span>
  73. </p>
  74. <div class="markdown desc">
  75. {{Str2html .Note}}
  76. </div>
  77. <div class="download">
  78. <div class="ui accordion">
  79. <h2 class="title {{if eq $idx 0}}active{{end}}">
  80. <i class="dropdown icon"></i>
  81. {{$.i18n.Tr "repo.release.downloads"}}
  82. </h2>
  83. <div class="content {{if eq $idx 0}}active{{end}}">
  84. <ul class="list">
  85. {{if $.Permission.CanRead $.UnitTypeCode}}
  86. <li>
  87. <a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (ZIP)</strong></a>
  88. </li>
  89. <li>
  90. <a href="{{$.RepoLink}}/archive/{{.TagName | EscapePound}}.tar.gz"><strong>{{svg "octicon-file-zip" 16}} {{$.i18n.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a>
  91. </li>
  92. {{end}}
  93. {{if .Attachments}}
  94. {{range .Attachments}}
  95. <li>
  96. <span class="ui text right" data-tooltip="{{$.i18n.Tr "repo.release.download_count" (.DownloadCount | PrettyNumber)}}" data-position="bottom right">{{svg "octicon-info" 16}}</span>
  97. <a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
  98. <strong><span class="ui image" title='{{.Name}}'>{{svg "octicon-package" 16}}</span> {{.Name}}</strong>
  99. <span class="ui text grey right">{{.Size | FileSize}}</span>
  100. </a>
  101. </li>
  102. {{end}}
  103. {{end}}
  104. </ul>
  105. </div>
  106. </div>
  107. </div>
  108. {{end}}
  109. <span class="dot">&nbsp;</span>
  110. </div>
  111. </li>
  112. {{end}}
  113. </ul>
  114. {{template "base/paginate" .}}
  115. </div>
  116. </div>
  117. {{template "base/footer" .}}