navid/veinsforge / f7153a2b9d81c99f7cdc3796d834953db63f94cd85065044ffee7659e7705b27 / internal/web/templates/issue.html
issue.html
← internal/web/templates · 2398 bytes · raw · download
{{define "content"}}
<p class="kicker"><a href="{{repoURL .Data.Repo}}">{{.Data.Repo.OwnerName}}/{{.Data.Repo.Name}}</a> / issue #{{.Data.Issue.Number}}</p>
<h1>{{.Data.Issue.Title}}</h1>
<p class="muted">
<span class="state {{stateClass .Data.Issue.State}}">{{.Data.Issue.State}}</span>
· opened by <a href="/u/{{.Data.Issue.AuthorName}}">{{.Data.Issue.AuthorName}}</a> {{timeago .Data.Issue.CreatedAt}}
{{if .Data.CanClose}}
· <form method="post" action="{{repoURL .Data.Repo}}/issues/{{.Data.Issue.Number}}/state" class="inline">
<input type="hidden" name="csrf" value="{{.CSRF}}">
{{if eq .Data.Issue.State "open"}}<input type="hidden" name="state" value="closed"><button class="link" type="submit">close</button>
{{else}}<input type="hidden" name="state" value="open"><button class="link" type="submit">reopen</button>{{end}}
</form>
{{end}}
</p>
<div class="post">
<p class="muted small"><strong>{{.Data.Issue.AuthorName}}</strong> · {{timeago .Data.Issue.CreatedAt}}</p>
<div class="markdown">{{.Data.BodyHTML}}</div>
</div>
{{if .Data.Attachments}}
<h2>Attachments</h2>
<ul class="link-list">{{range .Data.Attachments}}<li><a href="/attachments/{{.ID}}">{{.Filename}}</a> <span class="muted">{{.Size}} bytes</span></li>{{end}}</ul>
{{end}}
<div id="comments">
{{range .Data.Comments}}
<div class="post">
<p class="muted small"><strong><a href="/u/{{.AuthorName}}">{{.AuthorName}}</a></strong> · {{timeago .CreatedAt}}</p>
<div class="markdown">{{.BodyHTML}}</div>
</div>
{{else}}
<p class="muted">No comments yet.</p>
{{end}}
</div>
{{if .Data.CanComment}}
<h2>Add a comment</h2>
<form method="post" action="{{repoURL .Data.Repo}}/issues/{{.Data.Issue.Number}}/comments" class="form-narrow">
<input type="hidden" name="csrf" value="{{.CSRF}}">
<textarea name="body" rows="8" required maxlength="65536" placeholder="Markdown is supported."></textarea>
<button class="btn" type="submit">Comment</button>
</form>
<form method="post" action="{{repoURL .Data.Repo}}/attachments" enctype="multipart/form-data" class="attach-form">
<input type="hidden" name="csrf" value="{{.CSRF}}">
<input type="hidden" name="subject_type" value="issue">
<input type="hidden" name="subject_id" value="{{.Data.Issue.ID}}">
<input type="file" name="file" required>
<button class="btn" type="submit">Upload attachment</button>
</form>
{{end}}
{{end}}