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.

105 lines
7.9 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. {{template "base/head" .}}
  2. {{template "base/navbar" .}}
  3. {{template "repo/nav" .}}
  4. {{template "repo/toolbar" .}}
  5. <div id="body" class="container">
  6. <div id="issue">
  7. <div id="issue-{{.Issue.Id}}" class="issue-whole issue-is-opening">
  8. <div class="issue-head clearfix">
  9. <div class="number pull-right">#{{.Issue.Index}}</div>
  10. <a class="author pull-left" href="/user/{{.Issue.Poster.Name}}"><img class="avatar" src="{{.Issue.Poster.AvatarLink}}" alt="" width="30"/></a>
  11. <h1 class="title pull-left">{{.Issue.Name}}</h1>
  12. <input id="issue-edit-title" class="form-control input-lg pull-left hidden" type="text" value="{{.Issue.Name}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="title"/>
  13. <input type="hidden" value="{{.Issue.Id}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="issue_id"/>
  14. <p class="info pull-left">
  15. {{if .IsIssueOwner}}<a class="btn btn-default pull-right issue-edit" href="#" id="issue-edit-btn">Edit</a>
  16. <a class="btn btn-danger pull-right issue-edit-cancel hidden" href="#">Cancel</a>
  17. <a class="btn btn-primary pull-right issue-edit-save hidden" href="#" data-ajax="{{.RepoLink}}/issues/{{.Issue.Index}}" data-ajax-name="issue-edit-save" data-ajax-method="post">Save</a>{{end}}
  18. <span class="status label label-{{if .Issue.IsClosed}}danger{{else}}success{{end}}">{{if .Issue.IsClosed}}Closed{{else}}Open{{end}}</span>
  19. <a href="/user/{{.Issue.Poster.Name}}" class="author"><strong>{{.Issue.Poster.Name}}</strong></a> opened this issue
  20. <span class="time">{{TimeSince .Issue.Created}}</span> · {{.Issue.NumComments}} comments
  21. </p>
  22. </div>
  23. <div class="issue-main">
  24. <div class="panel panel-default issue-content">
  25. <div class="panel-body markdown">
  26. <div class="content">
  27. {{str2html .Issue.RenderedContent}}
  28. </div>
  29. <textarea class="form-control hidden" name="content" id="issue-edit-content" rows="10" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="content">{{.Issue.Content}}</textarea>
  30. </div>
  31. </div>
  32. {{range .Comments}}
  33. {{if eq .Type 0}}
  34. <div class="issue-child" id="issue-comment-{{.Id}}">
  35. <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
  36. <div class="issue-content panel panel-default">
  37. <div class="panel-heading">
  38. <a href="/user/{{.Poster.Name}}" class="user">{{.Poster.Name}}</a> commented <span class="time">{{TimeSince .Created}}</span>
  39. <!-- <a class="issue-comment-del pull-right issue-action" href="#" title="Edit Comment"><i class="fa fa-times-circle"></i></a>
  40. <a class="issue-comment-edit pull-right issue-action" href="#" title="Remove Comment" data-url="{remove-link}"><i class="fa fa-edit"></i></a> -->
  41. <span class="role label label-default pull-right">Owner</span>
  42. </div>
  43. <div class="panel-body markdown">
  44. {{str2html .Content}}
  45. </div>
  46. </div>
  47. </div>
  48. {{else if eq .Type 1}}
  49. <div class="issue-child issue-opened">
  50. <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" /></a>
  51. <div class="issue-content">
  52. <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-success">Reopened</span> this issue <span class="time">{{TimeSince .Created}}</span>
  53. </div>
  54. </div>
  55. {{else if eq .Type 2}}
  56. <div class="issue-child issue-closed">
  57. <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
  58. <div class="issue-content">
  59. <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-danger">Closed</span> this issue <span class="time">{{TimeSince .Created}}</span>
  60. </div>
  61. </div>
  62. {{end}}
  63. {{end}}
  64. <hr class="issue-line"/>
  65. {{if .SignedUser}}<div class="issue-child issue-reply">
  66. <a class="user pull-left" href="/user/{{.SignedUser.Name}}"><img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/></a>
  67. <form class="panel panel-default issue-content" action="{{.RepoLink}}/comment/new" method="post">
  68. {{.CsrfTokenHtml}}
  69. <div class="panel-body">
  70. <div class="form-group">
  71. <div class="md-help pull-right">Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
  72. </div>
  73. <ul class="nav nav-tabs" data-init="tabs">
  74. <li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li>
  75. <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown?repoLink={{.RepoLink}}" data-ajax-name="issue-preview" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
  76. </ul>
  77. <div class="tab-content">
  78. <div class="tab-pane" id="issue-textarea">
  79. <div class="form-group">
  80. <input type="hidden" value="{{.Issue.Index}}" name="issueIndex"/>
  81. <textarea class="form-control" name="content" id="issue-reply-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="content">{{.content}}</textarea>
  82. </div>
  83. </div>
  84. <div class="tab-pane issue-preview-content" id="issue-preview">Loading...</div>
  85. </div>
  86. </div>
  87. <div class="text-right">
  88. <div class="form-group">
  89. {{if .Issue.IsClosed}}
  90. <input type="submit" class="btn-default btn issue-open" id="issue-open-btn" data-origin="Reopen" data-text="Reopen & Comment" name="change_status" value="Reopen"/>{{else}}
  91. <input type="submit" class="btn-default btn issue-close" id="issue-close-btn" data-origin="Close" data-text="Close & Comment" name="change_status" value="Close"/>{{end}}&nbsp;&nbsp;
  92. <button class="btn-success btn" id="issue-reply-btn">Comment</button>
  93. </div>
  94. </div>
  95. </div>
  96. </form>
  97. </div>{{else}}<div class="alert alert-warning"><a class="btn btn-success btn-lg" href="/user/sign_up">Sign up for free</a> to join this conversation. Already have an account? <a href="/user/login">Sign in to comment</a></div>{{end}}
  98. </div><!--
  99. <div class="col-md-3">
  100. label assignment milestone dashboard
  101. </div>-->
  102. </div>
  103. </div>
  104. </div>
  105. {{template "base/footer" .}}