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.

label_list.tmpl 4.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <h4 class="ui top attached header">
  2. {{.locale.Tr "repo.issues.label_count" .NumLabels}}
  3. <div class="ui right">
  4. <div class="ui right floated secondary filter menu">
  5. <!-- Sort -->
  6. <div class="ui dropdown type jump item">
  7. <span class="text">
  8. {{.locale.Tr "repo.issues.filter_sort"}}
  9. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  10. </span>
  11. <div class="menu">
  12. <a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&state={{$.State}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
  13. <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&state={{$.State}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
  14. <a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}">{{.locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
  15. <a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}">{{.locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
  16. </div>
  17. </div>
  18. </div>
  19. </div> <!-- filter menu -->
  20. </h4>
  21. <div class="ui attached segment">
  22. {{if and (not $.PageIsOrgSettingsLabels) (or $.CanWriteIssues $.CanWritePulls) (eq .NumLabels 0) (not $.Repository.IsArchived)}}
  23. {{template "repo/issue/labels/label_load_template" .}}
  24. <div class="divider"></div>
  25. {{else if and ($.PageIsOrgSettingsLabels) (eq .NumLabels 0)}}
  26. {{template "repo/issue/labels/label_load_template" .}}
  27. <div class="divider"></div>
  28. {{end}}
  29. <ul class="issue-label-list">
  30. {{range .Labels}}
  31. <li class="item">
  32. <div class="label-title">
  33. {{RenderLabel $.Context .}}
  34. {{if not .ArchivedUnix.IsZero}}
  35. <span class="gt-ml-3 gt-cursor-default gt-italic" data-tooltip-content="{{$.locale.Tr "repo.issues.label_archive_tooltip"}}">
  36. {{$.locale.Tr "home.archived"}}
  37. </span>
  38. {{end}}
  39. {{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}
  40. </div>
  41. <div class="label-issues">
  42. {{if $.PageIsOrgSettingsLabels}}
  43. <a class="open-issues" href="{{AppSubUrl}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
  44. {{else}}
  45. <a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
  46. {{end}}
  47. </div>
  48. <div class="label-operation">
  49. {{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}}
  50. <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
  51. <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
  52. {{else if $.PageIsOrgSettingsLabels}}
  53. <a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
  54. <a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
  55. {{end}}
  56. </div>
  57. </li>
  58. {{end}}
  59. {{if and (not .PageIsOrgSettingsLabels) (.OrgLabels)}}
  60. <li class="item">
  61. <div class="ui grid middle aligned">
  62. <div class="ten wide column">
  63. {{$.locale.Tr "repo.org_labels_desc" | Str2html}}
  64. {{if .IsOrganizationOwner}}
  65. <a href="{{.OrganizationLink}}/settings/labels">({{$.locale.Tr "repo.org_labels_desc_manage"}})</a>:
  66. {{end}}
  67. </div>
  68. </div>
  69. </li>
  70. {{range .OrgLabels}}
  71. <li class="item org-label">
  72. <div class="label-title">
  73. {{RenderLabel $.Context .}}
  74. {{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}
  75. </div>
  76. <div class="label-issues">
  77. <a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a>
  78. </div>
  79. <div class="label-operation"></div>
  80. </li>
  81. {{end}}
  82. {{end}}
  83. </ul>
  84. </div>