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.

view.tmpl 4.9 kB

3 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. {{template "base/head" .}}
  2. <div class="repository wiki view">
  3. {{template "repo/header" .}}
  4. {{ $title := .title}}
  5. <div class="ui container">
  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}}/wiki">{{.i18n.Tr "repo.wiki"}}</div>
  11. </div>
  12. </h2>
  13. <div class="ui divider"></div>
  14. <div class="ui stackable grid">
  15. <div class="ui ten wide column">
  16. <div class="choose page">
  17. <div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
  18. <div class="ui basic small button">
  19. <span class="text">
  20. {{.i18n.Tr "repo.wiki.page"}}:
  21. <strong>{{$title}}</strong>
  22. </span>
  23. <i class="dropdown icon"></i>
  24. </div>
  25. <div class="menu">
  26. <div class="ui icon search input">
  27. <i class="filter icon"></i>
  28. <input name="search" placeholder="{{.i18n.Tr "repo.wiki.filter_page"}}...">
  29. </div>
  30. <div class="scrolling menu">
  31. {{range .Pages}}
  32. <div class="item {{if eq $.Title .Name}}selected{{end}}" data-url="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</div>
  33. {{end}}
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="ui six wide column right aligned">
  40. <div class="ui action small input" id="clone-panel">
  41. {{if not $.DisableHTTP}}
  42. <button class="ui basic clone button" id="repo-clone-https" data-link="{{.WikiCloneLink.HTTPS}}">
  43. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  44. </button>
  45. {{end}}
  46. {{if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
  47. <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.WikiCloneLink.SSH}}">
  48. SSH
  49. </button>
  50. {{end}}
  51. {{if not $.DisableHTTP}}
  52. <input id="repo-clone-url" value="{{$.WikiCloneLink.HTTPS}}" readonly>
  53. {{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
  54. <input id="repo-clone-url" value="{{$.WikiCloneLink.SSH}}" readonly>
  55. {{end}}
  56. {{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}
  57. <button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
  58. {{svg "octicon-clippy" 16}}
  59. </button>
  60. {{end}}
  61. </div>
  62. </div>
  63. </div>
  64. <div class="ui dividing header">
  65. <div class="ui stackable grid">
  66. <div class="eight wide column">
  67. <a class="file-revisions-btn ui basic button" title="{{.i18n.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}/_revision" ><span>{{.CommitCount}}</span> <i class="fa fa-fw fa-history"></i></a>
  68. {{$title}}
  69. <div class="ui sub header">
  70. {{$timeSince := TimeSince .Author.When $.Lang}}
  71. {{.i18n.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}}
  72. </div>
  73. </div>
  74. <div class="eight wide right aligned column">
  75. {{if and .CanWriteWiki (not .Repository.IsMirror)}}
  76. <div class="ui right">
  77. <a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}/_edit">{{.i18n.Tr "repo.wiki.edit_page_button"}}</a>
  78. <a class="ui green small button" href="{{.RepoLink}}/wiki/_new">{{.i18n.Tr "repo.wiki.new_page_button"}}</a>
  79. <a class="ui red small button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}/delete" data-id="{{.PageURL}}">{{.i18n.Tr "repo.wiki.delete_page_button"}}</a>
  80. </div>
  81. {{end}}
  82. </div>
  83. </div>
  84. </div>
  85. {{if .FormatWarning}}
  86. <div class="ui negative message">
  87. <p>{{.FormatWarning}}</p>
  88. </div>
  89. {{end}}
  90. <div class="ui {{if .sidebarPresent}}grid equal width{{end}}" style="margin-top: 1rem;">
  91. <div class="ui {{if .sidebarPresent}}eleven wide column{{end}} segment markdown">
  92. {{.content | Str2html}}
  93. </div>
  94. {{if .sidebarPresent}}
  95. <div class="column" style="padding-top: 0;">
  96. <div class="ui segment">
  97. {{.sidebarContent | Str2html}}
  98. </div>
  99. </div>
  100. {{end}}
  101. </div>
  102. {{if .footerPresent}}
  103. <div class="ui segment">
  104. {{.footerContent | Str2html}}
  105. </div>
  106. {{end}}
  107. </div>
  108. </div>
  109. <div class="ui small basic delete modal">
  110. <div class="ui icon header">
  111. <i class="trash icon"></i>
  112. {{.i18n.Tr "repo.wiki.delete_page_button"}}
  113. </div>
  114. <div class="content">
  115. <p>{{.i18n.Tr "repo.wiki.delete_page_notice_1" ($title|Escape) | Safe}}</p>
  116. </div>
  117. {{template "base/delete_modal_actions" .}}
  118. </div>
  119. {{template "base/footer" .}}