view_title.tmpl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <div class="sixteen wide column title">
  2. <div class="ui grid">
  3. <h1 class="twelve wide column">
  4. <span class="index">#{{.Issue.Index}}</span> <span id="issue-title" class="has-emoji">{{.Issue.Name}}</span>
  5. <div id="edit-title-input" class="ui input" style="display: none">
  6. <input value="{{.Issue.Name}}">
  7. </div>
  8. </h1>
  9. {{if .IsIssueOwner}}
  10. <div class="four wide column">
  11. <div class="edit-zone text right">
  12. <div id="edit-title" class="ui basic green not-in-edit button">{{.i18n.Tr "repo.issues.edit"}}</div>
  13. <div id="cancel-edit-title" class="ui basic blue in-edit button" style="display: none">{{.i18n.Tr "repo.issues.cancel"}}</div>
  14. <div id="save-edit-title" class="ui green in-edit button" style="display: none" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title">{{.i18n.Tr "repo.issues.save"}}</div>
  15. </div>
  16. </div>
  17. {{end}}
  18. </div>
  19. {{if .HasMerged}}
  20. <div class="ui purple large label"><i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls.merged"}}</div>
  21. {{else if .Issue.IsClosed}}
  22. <div class="ui red large label"><i class="octicon octicon-issue-closed"></i> {{.i18n.Tr "repo.issues.closed_title"}}</div>
  23. {{else}}
  24. <div class="ui green large label"><i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues.open_title"}}</div>
  25. {{end}}
  26. {{if .Issue.IsPull}}
  27. {{if .Issue.HasMerged}}
  28. {{ $mergedStr:= TimeSince .Issue.Merged $.Lang }}
  29. <a {{if gt .Issue.Merger.ID 0}}href="{{.Issue.Merger.HomeLink}}"{{end}}>{{.Issue.Merger.Name}}</a>
  30. <span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Safe}}</span>
  31. {{else}}
  32. <a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a>
  33. <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span>
  34. {{end}}
  35. {{else}}
  36. {{ $createdStr:= TimeSince .Issue.Created $.Lang }}
  37. <span class="time-desc">
  38. {{if gt .Issue.Poster.ID 0}}
  39. {{$.i18n.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink .Issue.Poster.Name | Safe}}
  40. {{else}}
  41. {{$.i18n.Tr "repo.issues.opened_by_fake" $createdStr .Issue.Poster.Name | Safe}}
  42. {{end}}
  43. ·
  44. {{$.i18n.Tr "repo.issues.num_comments" .Issue.NumComments}}
  45. </span>
  46. {{end}}
  47. <div class="ui divider"></div>
  48. </div>