list.tmpl 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. {{template "base/head_old" .}}
  2. {{template "base/navbar" .}}
  3. {{template "repo/nav" .}}
  4. {{template "repo/toolbar" .}}
  5. <div id="body" class="container">
  6. <div id="issue">
  7. <div class="col-md-3 filters">
  8. <div class="filter-list">
  9. <ul class="list-unstyled">
  10. <li><a href="{{.RepoLink}}/issues?state={{.State}}"{{if eq .ViewType "all"}} class="active"{{end}}>All Issues <strong class="pull-right">{{.IssueStats.AllCount}}</strong></a></li>
  11. <li><a href="{{.RepoLink}}/issues?type=assigned&state={{.State}}"{{if eq .ViewType "assigned"}} class="active"{{end}}>Assigned to you <strong class="pull-right">{{.IssueStats.AssignCount}}</strong></a></li>
  12. <li><a href="{{.RepoLink}}/issues?type=created_by&state={{.State}}"{{if eq .ViewType "created_by"}} class="active"{{end}}>Created by you <strong class="pull-right">{{.IssueStats.CreateCount}}</strong></a></li>
  13. <li><a href="{{.RepoLink}}/issues?type=mentioned&state={{.State}}"{{if eq .ViewType "mentioned"}} class="active"{{end}}>Mentioning you <strong class="pull-right">{{.IssueStats.MentionCount}}</strong></a></li>
  14. </ul>
  15. </div>
  16. <div class="label-filter">
  17. <h4>Label</h4>
  18. <ul class="list-unstyled" id="label-list" data-ajax="{{$.RepoLink}}/issues/labels/delete">
  19. {{range .Labels}}
  20. <li class="label-item{{if eq $.SelectLabels .Id}} label-selected{{end}}" id="label-{{.Id}}" data-id="{{.Id}}">
  21. <a href="?type={{$.ViewType}}&state={{$.State}}{{if not (eq $.SelectLabels .Id)}}&labels={{.Id}}{{end}}">
  22. <span class="pull-right count">{{if $.IsShowClosed}}{{.NumClosedIssues}}{{else}}{{.NumOpenIssues}}{{end}}</span>
  23. <span class="color" style="background-color: {{.Color}}" data-color="{{.Color}}"></span>
  24. <span class="name">{{.Name}}</span>
  25. </a>
  26. <a class="del pull-right" href="#" data-id="{{.Id}}"><i class="fa fa-times-circle-o"></i></a>
  27. </li>
  28. {{end}}
  29. {{if or .IsRepositoryOwner .IsAdmin}}
  30. <li class="label-change-li" style="display: none">
  31. <form id="label-change-form" action="{{$.RepoLink}}/issues/labels/edit" method="post">
  32. {{.CsrfTokenHtml}}
  33. <div class="input-group label-change-color-picker form-group" style="margin-bottom: 2px">
  34. <input type="text" class="form-control" name="title" required="required" id="label-name-change-ipt"/>
  35. <input type="hidden" name="color" id="label-color-change-ipt" value="#444444"/>
  36. <span class="input-group-addon"><i></i></span>
  37. <input type="hidden" name="id" id="label-change-id-ipt" value="0"/>
  38. </div>
  39. <div class="form-group text-right">
  40. <input class="form-control input-sm" type="text" id="label-color-change-ipt2" value="#444444"/>
  41. <button class="btn btn-default btn-sm">Save</button>
  42. </div>
  43. </form>
  44. </li>
  45. {{end}}
  46. </ul>
  47. {{if or .IsRepositoryOwner .IsAdmin}}
  48. <button class="btn btn-default btn-block label-button" id="label-manage-btn">Manage Labels</button>
  49. <hr/>
  50. <form id="label-add-form" action="{{$.RepoLink}}/issues/labels/new" method="post">
  51. {{.CsrfTokenHtml}}
  52. <h5><strong>New Label</strong></h5>
  53. <div class="input-group label-color-picker form-group">
  54. <input type="text" class="form-control" name="title" required="required" id="label-name-ipt"/>
  55. <input type="hidden" name="color" id="label-color-ipt" value="#444444"/>
  56. <span class="input-group-addon"><i></i></span>
  57. </div>
  58. <div class="form-group text-right">
  59. <input class="form-control input-sm" type="text" id="label-color-ipt2" value="#444444"/>
  60. <button class="btn btn-default btn-sm">Create</button>
  61. </div>
  62. </form>
  63. {{end}}
  64. </div>
  65. </div>
  66. <div class="col-md-9">
  67. {{template "base/alert" .}}
  68. <div class="filter-option">
  69. <div class="btn-group">
  70. <a class="btn btn-default issue-open{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/issues?type={{.ViewType}}">{{.IssueStats.OpenCount}} Open</a>
  71. <a class="btn btn-default issue-close{{if .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/issues?type={{.ViewType}}&state=closed">{{.IssueStats.ClosedCount}} Closed</a>
  72. </div>
  73. </div>
  74. <div class="issues list-group">
  75. {{range .Issues}}{{if .Poster}}
  76. <div class="list-group-item issue-item{{if not .IsRead}} unread{{end}}" id="issue-{{.Id}}">
  77. <span class="number pull-right">#{{.Index}}</span>
  78. <h5 class="title">
  79. <a href="{{$.RepoLink}}/issues/{{.Index}}">{{.Name}}</a>
  80. <span class="labels">
  81. {{range .Labels}}
  82. <span class="label" style="background-color: {{.Color}}">{{.Name}}</span>
  83. {{end}}
  84. </span>
  85. </h5>
  86. <p class="info">
  87. <span class="author"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" width="20"/>
  88. <a href="{{AppSubUrl}}/{{.Poster.Name}}">{{.Poster.Name}}</a></span>
  89. <span class="time">{{TimeSince .Created $.Lang}}</span>
  90. <span class="comment"><i class="fa fa-comments"></i> {{.NumComments}}</span>
  91. </p>
  92. </div>
  93. {{end}}{{end}}
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <script src="/js/bootstrap-colorpicker.min.js"></script>
  100. <script>
  101. $(function(){
  102. $('.label-color-picker').colorpicker({
  103. input: $('#label-color-ipt')
  104. }).on('changeColor', function (ev) {
  105. var $ipt = $('#label-color-ipt2');
  106. if ($ipt.val().length != 4) {
  107. $ipt.val(ev.color.toHex());
  108. }
  109. });
  110. $('.label-change-color-picker').colorpicker({
  111. input:$('#label-color-change-ipt')
  112. }).on('changeColor', function (ev) {
  113. var $ipt = $('#label-color-change-ipt2');
  114. if ($ipt.val().length != 4) {
  115. $ipt.val(ev.color.toHex());
  116. }
  117. });
  118. });
  119. </script>
  120. {{template "base/footer_old" .}}