create.tmpl 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. <form class="form" action="{{.RepoLink}}/issues/new" method="post" id="issue-create-form" enctype="multipart/form-data">
  8. {{.CsrfTokenHtml}}
  9. {{template "base/alert" .}}
  10. <div class="col-md-1">
  11. <img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/>
  12. </div>
  13. <div class="col-md-8 panel panel-default">
  14. <div class="form-group panel-body">
  15. <input class="form-control input-lg" type="text" name="title" required="required" placeholder="Title" value="{{.title}}" />
  16. </div>
  17. <div class="form-group panel-body">
  18. {{if .IsRepositoryOwner}}
  19. <span><strong id="assigned" data-no-assigned="No one">No one</strong> will be assigned</span>
  20. <input type="hidden" name="assigneeid" value="0" id="assignee"/>&nbsp;&nbsp;
  21. <div style="display: inline-block;position: relative">
  22. <button type="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
  23. <i class="fa fa-group"></i>
  24. <span class="caret"></span>
  25. </button>
  26. <div class="dropdown-menu assignee">
  27. <ul class="list-unstyled">
  28. <li data-uid="0" class="clear-assignee hidden"><i class="fa fa-times-circle-o"></i> Clear assignee</li>
  29. {{range .Collaborators}}
  30. <li data-uid="{{.Id}}"><img src="{{.AvatarLink}}"><strong>{{.Name}}</strong> {{.FullName}}</li>
  31. {{end}}
  32. </ul>
  33. </div>
  34. </div>
  35. <span><strong id="milestone" data-no-milestone="No milestone">No milestone</strong></span>
  36. <input type="hidden" name="milestoneid" value="0" id="milestone-id"/>
  37. <div style="display: inline-block;position: relative">
  38. <button type="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
  39. <i class="fa fa-check-square-o"></i>
  40. <span class="caret"></span>
  41. </button>
  42. <div class="dropdown-menu milestone">
  43. <ul class="list-unstyled">
  44. <li data-id="0" class="clear-milestone milestone-item hidden"><i class="fa fa-times-circle-o"></i> Clear milestone </li>
  45. <li class="milestone-list">
  46. <ul class="nav nav-tabs" data-init="tabs">
  47. <li class="active"><a href="#milestone-open" data-toggle="tab">Open</a></li>
  48. <li><a href="#milestone-close" data-toggle="tab">Closed</a></li>
  49. </ul>
  50. <div class="tab-content">
  51. <div class="tab-pane active" id="milestone-open">
  52. {{if not .OpenMilestones}}
  53. <p class="milestone-item">Nothing to show</p>
  54. {{else}}
  55. <ul class="list-unstyled">
  56. {{range .OpenMilestones}}
  57. <li class="milestone-item" data-id="{{.Id}}">
  58. <p><strong>{{.Name}}</strong></p>
  59. <!-- <p>due to 3 days later</p> -->
  60. </li>
  61. {{end}}
  62. </ul>
  63. {{end}}
  64. </div>
  65. <div class="tab-pane" id="milestone-close">
  66. {{if not .ClosedMilestones}}
  67. <p class="milestone-item">Nothing to show</p>
  68. {{else}}
  69. <ul class="list-unstyled">
  70. {{range .ClosedMilestones}}
  71. <li class="milestone-item" data-id="{{.Id}}">
  72. <p><strong>{{.Name}}</strong></p>
  73. <p>Closed {{TimeSince .ClosedDate $.Lang}}</p>
  74. </li>
  75. {{end}}
  76. </ul>
  77. {{end}}
  78. </div>
  79. </div>
  80. </li>
  81. </ul>
  82. </div>
  83. </div>
  84. </div>
  85. {{end}}
  86. <div class="form-group panel-body">
  87. <div class="md-help pull-right"><!-- todo help link -->
  88. Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
  89. </div>
  90. <ul class="nav nav-tabs" data-init="tabs">
  91. <li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li>
  92. <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown" data-ajax-name="issue-preview" data-ajax-context="{{.RepoLink}}" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
  93. </ul>
  94. <div class="tab-content">
  95. <div class="tab-pane" id="issue-textarea">
  96. <div class="form-group">
  97. <div id="submit-error" class="text-danger"></div>
  98. <textarea class="form-control" name="content" id="issue-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="text">{{.content}}</textarea>
  99. </div>
  100. </div>
  101. <div class="tab-pane issue-preview-content" id="issue-preview">loading...</div>
  102. </div>
  103. </div>
  104. {{if .AttachmentsEnabled}}
  105. <div id="attached">
  106. <div id="attached-list">
  107. <b>Attachments:</b>
  108. </div>
  109. </div>
  110. {{end}}
  111. <div class="text-right panel-body">
  112. <div class="form-group">
  113. {{if .AttachmentsEnabled}}
  114. <input type="file" accept="{{.AllowedTypes}}" style="display: none;" id="attachments-input" name="attachments" multiple />
  115. <button class="btn-default btn attachment-add" id="attachments-button">Select Attachments...</button>
  116. {{end}}
  117. <input type="hidden" value="id" name="repo-id"/>
  118. <button class="btn-success btn">Create new issue</button>
  119. </div>
  120. </div>
  121. </div>
  122. </form>
  123. </div>
  124. </div>
  125. {{template "base/footer_old" .}}