new_form.tmpl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <form class="ui comment form grid" action="{{.Link}}" method="post">
  2. {{.CsrfTokenHtml}}
  3. {{if .Flash}}
  4. <div class="sixteen wide column">
  5. {{template "base/alert" .}}
  6. </div>
  7. {{end}}
  8. <div class="twelve wide column">
  9. <div class="ui comments">
  10. <div class="comment">
  11. <a class="avatar" href="{{.SignedUser.HomeLink}}">
  12. <img src="{{.SignedUser.AvatarLink}}">
  13. </a>
  14. <div class="ui segment content">
  15. <div class="field">
  16. <input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required>
  17. </div>
  18. {{template "repo/issue/comment_tab" .}}
  19. <div class="text right">
  20. <button class="ui green button">
  21. {{.i18n.Tr "repo.issues.create"}}
  22. </button>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="four wide column">
  29. <div class="ui segment metas">
  30. <input id="label_ids" name="label_ids" type="hidden" value="{{.label_ids}}">
  31. <div class="ui {{if not .Labels}}disabled{{end}} jump select-label dropdown">
  32. <span class="text">
  33. <strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
  34. <span class="octicon octicon-gear"></span>
  35. </span>
  36. <div class="filter menu" data-id="#label_ids">
  37. <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div>
  38. {{range .Labels}}
  39. <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
  40. {{end}}
  41. </div>
  42. </div>
  43. <div class="ui labels list">
  44. <span class="no-select item {{if .HasSelectedLabel}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_label"}}</span>
  45. {{range .Labels}}
  46. <a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name}}</span></a>
  47. {{end}}
  48. </div>
  49. <div class="ui divider"></div>
  50. <input id="milestone_id" name="milestone_id" type="hidden" value="{{.milestone_id}}">
  51. <div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} jump select-milestone dropdown">
  52. <span class="text">
  53. <strong>{{.i18n.Tr "repo.issues.new.milestone"}}</strong>
  54. <span class="octicon octicon-gear"></span>
  55. </span>
  56. <div class="menu">
  57. <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_milestone"}}</div>
  58. {{if .OpenMilestones}}
  59. <div class="divider"></div>
  60. <div class="header">
  61. <i class="octicon octicon-milestone"></i>
  62. {{.i18n.Tr "repo.issues.new.open_milestone"}}
  63. </div>
  64. {{range .OpenMilestones}}
  65. <div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</div>
  66. {{end}}
  67. {{end}}
  68. {{if .ClosedMilestones}}
  69. <div class="divider"></div>
  70. <div class="header">
  71. <i class="octicon octicon-milestone"></i>
  72. {{.i18n.Tr "repo.issues.new.closed_milestone"}}
  73. </div>
  74. {{range .ClosedMilestones}}
  75. <a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</a>
  76. {{end}}
  77. {{end}}
  78. </div>
  79. </div>
  80. <div class="ui select-milestone list">
  81. <span class="no-select item {{if .Milestone}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_milestone"}}</span>
  82. <div class="selected">
  83. {{if .Milestone}}
  84. <a class="item" href="{{.RepoLink}}/issues?milestone={{.Milestone.ID}}"> {{.Milestone.Name}}</a>
  85. {{end}}
  86. </div>
  87. </div>
  88. <div class="ui divider"></div>
  89. <input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}">
  90. <div class="ui {{if not .Assignees}}disabled{{end}} jump select-assignee dropdown">
  91. <span class="text">
  92. <strong>{{.i18n.Tr "repo.issues.new.assignee"}}</strong>
  93. <span class="octicon octicon-gear"></span>
  94. </span>
  95. <div class="menu">
  96. <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</div>
  97. {{range .Assignees}}
  98. <div class="item" data-id="{{.Id}}" data-href="{{$.RepoLink}}/issues?assignee={{.Id}}" data-avatar="{{.AvatarLink}}"><img src="{{.AvatarLink}}"> {{.Name}}</div>
  99. {{end}}
  100. </div>
  101. </div>
  102. <div class="ui select-assignee list">
  103. <span class="no-select item {{if .Assignee}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignee"}}</span>
  104. <div class="selected">
  105. {{if .Assignee}}
  106. <a class="item" href="{{.RepoLink}}/issues?assignee={{.Assignee.Id}}"><img class="ui avatar image" src="{{.Assignee.AvatarLink}}"> {{.Assignee.Name}}</a>
  107. {{end}}
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </form>