New Sign in

fierj

Public

Tiny personal git forge

← fierj / templates / thread_view.html
{{template "head" .}}
{{define "title"}}{{.Thread.Title}} - {{.Repo}} - fierj{{end}}
{{template "repo-header" .}}
{{template "repo-tabs" .}}

<div class="thread-detail">
    <div class="thread-detail-header">
        <h2>{{.Thread.Title}}</h2>
        <span class="thread-state thread-state-{{.Thread.State}}">{{.Thread.State}}</span>
    </div>
    <p class="thread-meta-line">
        <strong>{{.Thread.AuthorName}}</strong> opened this thread · {{timeAgo .Thread.Created}}
    </p>
</div>

<!-- Original post -->
<div class="thread-comment">
    <div class="thread-comment-header">
        <strong>{{.Thread.AuthorName}}</strong>
        <span>{{timeAgo .Thread.Created}}</span>
    </div>
    <div class="thread-comment-body markdown-body">{{.Thread.Body}}</div>
</div>

<!-- Replies -->
{{range .Thread.Replies}}
<div class="thread-comment">
    <div class="thread-comment-header">
        <strong>{{.AuthorName}}</strong>
        <span>{{timeAgo .Created}}</span>
    </div>
    <div class="thread-comment-body markdown-body">{{.Body}}</div>
</div>
{{end}}

<!-- Reply form -->
<div class="thread-reply-form">
    <form method="POST" action="/{{.Repo}}/threads/{{.Thread.ID}}/reply">
        <input type="hidden" name="csrf_token" value="{{.CSRF}}">
        <div class="form-group">
            <textarea name="body" rows="4" placeholder="Leave a comment..."></textarea>
        </div>
        <div class="thread-actions">
            {{if eq .Thread.State "open"}}
            <button type="submit" class="btn btn-primary">Comment</button>
            <button type="submit" formaction="/{{.Repo}}/threads/{{.Thread.ID}}/close" class="btn btn-secondary">Close
                thread</button>
            {{else}}
            <button type="submit" class="btn btn-primary">Comment</button>
            <button type="submit" formaction="/{{.Repo}}/threads/{{.Thread.ID}}/reopen" class="btn btn-secondary">Reopen
                thread</button>
            {{end}}
        </div>
    </form>
</div>
{{template "foot" .}}