repos / pgit

Improved static site generator for git repos
git clone https://github.com/xplshn/pgit.git

pgit / html
[CI] pgitBot  ·  2026-02-26

issue.page.tmpl

Cheetah
  1{{template "base" .}}
  2
  3{{define "title"}}#{{.Issue.ID}} {{.Issue.Title}} - {{.Repo.RepoName}}{{end}}
  4{{define "meta"}}{{end}}
  5
  6{{define "content"}}
  7<div class="issue-container">
  8	<header class="issue-header">
  9		<h1 class="text-xl text-transform-none">{{.Issue.Title}} <span class="font-grey-light">#{{.Issue.ID}}</span></h1>
 10		<div class="issue-meta">
 11            <div class="issue-meta-actions">
 12			    <span class="issue-status issue-status-{{.Issue.StatusClass}}">{{.Issue.Status}}</span>
 13                <div class="dropdown">
 14                    <button class="btn btn-secondary dropdown-toggle">Mark as ▼</button>
 15                    <div class="dropdown-menu">
 16                        {{$issueID := .Issue.ID}}
 17                        {{range $status, $class := .Repo.IssueDB.MarkAs}}
 18                        <a href="#" class="dropdown-item mark-as-btn" data-issue-id="{{$issueID}}" data-status="{{$status}}">{{$status}}</a>
 19                        {{end}}
 20                    </div>
 21                </div>
 22            </div>
 23			<address class="author-info font-grey-light">{{getAuthor .Issue.Author}} opened this issue on <time datetime="{{.Issue.CreatedAt.Format "2006-01-02T15:04:05Z07:00"}}">{{.Issue.CreatedAt.Format "Jan 2, 2006"}}</time></address>
 24		</div>
 25	</header>
 26
 27	<div class="timeline">
 28		<article class="timeline-item" data-author="{{.Issue.Author}}" data-id="{{.Issue.ID}}" data-type="issue">
 29			<div class="comment-box">
 30				<header class="comment-header">
 31					<address class="author"><strong>{{getAuthor .Issue.Author}}</strong> commented</address>
 32					<div class="comment-actions">
 33						<button class="action-btn" data-action="react" title="Add reaction">☺</button>
 34						<button class="action-btn" data-action="quote" title="Quote reply">“</button>
 35						<button class="action-btn" data-action="edit" title="Edit comment">✎</button>
 36					</div>
 37				</header>
 38				<div class="comment-body md">
 39					{{markdown .Issue.Body}}
 40				</div>
 41                <div class="original-markdown" style="display: none;">{{.Issue.Body}}</div>
 42                {{if .Issue.History}}
 43                <details class="comment-history">
 44                    <summary>Edited</summary>
 45                    <ul>
 46                    {{range .Issue.History}}
 47                        <li>
 48                            <time>{{formatTime .Timestamp}}</time>
 49                            <pre>{{.Body}}</pre>
 50                        </li>
 51                    {{end}}
 52                    </ul>
 53                </details>
 54                {{end}}
 55                {{$reactionMap := .Repo.IssueDB.Reactions}}
 56                {{$groupedReactions := .Issue.GroupedReactions $reactionMap}}
 57                {{if $groupedReactions}}
 58				<footer class="comment-reactions">
 59					{{range $groupedReactions}}
 60                    <button class="reaction-badge" data-action="unreact" data-reaction-name="{{.Name}}" title="{{.AuthorString}} reacted with {{.Emoji}}">
 61                        <span>{{.Emoji}}</span>
 62                        <span class="count">{{.Count}}</span>
 63                    </button>
 64                    {{end}}
 65				</footer>
 66                {{end}}
 67			</div>
 68		</article>
 69
 70		{{range .Issue.Comments}}
 71		<article class="timeline-item" data-author="{{.Author}}" data-id="{{.ID}}" data-type="comment">
 72			<div class="comment-box">
 73				<header class="comment-header">
 74					<address class="author"><strong>{{getAuthor .Author}}</strong> commented</address>
 75					<div class="comment-actions">
 76						<button class="action-btn" data-action="react" title="Add reaction">☺</button>
 77						<button class="action-btn" data-action="quote" title="Quote reply">“</button>
 78						<button class="action-btn" data-action="edit" title="Edit comment">✎</button>
 79					</div>
 80				</header>
 81				<div class="comment-body md">
 82					{{markdown .Body}}
 83				</div>
 84                <div class="original-markdown" style="display: none;">{{.Body}}</div>
 85				{{if .History}}
 86                <details class="comment-history">
 87                    <summary>Edited</summary>
 88                    <ul>
 89                    {{range .History}}
 90                        <li>
 91                            <time>{{formatTime .Timestamp}}</time>
 92                            <pre>{{.Body}}</pre>
 93                        </li>
 94                    {{end}}
 95                    </ul>
 96                </details>
 97                {{end}}
 98				{{$reactionMap := $.Repo.IssueDB.Reactions}}
 99                {{$groupedReactions := .GroupedReactions $reactionMap}}
100				{{if $groupedReactions}}
101				<footer class="comment-reactions">
102                    {{range $groupedReactions}}
103                    <button class="reaction-badge" data-action="unreact" data-reaction-name="{{.Name}}" title="{{.AuthorString}} reacted with {{.Emoji}}">
104                        <span>{{.Emoji}}</span>
105                        <span class="count">{{.Count}}</span>
106                    </button>
107                    {{end}}
108				</footer>
109                {{end}}
110			</div>
111		</article>
112		{{end}}
113
114		<section class="timeline-item" id="reply-container">
115			<div class="comment-box">
116				<header class="comment-header">
117					<span id="current-user-alias"></span>
118					<button id="alias-btn" class="action-btn" title="Set your alias">Alias</button>
119				</header>
120				<div id="composer-container">
121                    <form onsubmit="return false;">
122					    <textarea id="reply-textarea" placeholder="Leave a comment..."></textarea>
123					    <div class="flex justify-end mt">
124						    <button id="submit-comment-btn" class="btn">Comment</button>
125					    </div>
126                    </form>
127				</div>
128			</div>
129		</section>
130	</div>
131</div>
132
133<div id="alias-modal" class="modal" style="display:none;">
134	<div class="modal-content">
135		<span class="close-btn" data-modal="alias-modal">&times;</span>
136		<h3>Set Your Alias</h3>
137		<p>Set a persistent alias for your comments. An email will be sent to the pgitBot, telling it to not expose your email address and instead use your alias. You can do/undo this as many times as you'd like.</p>
138        <p class="text-sm font-grey-light mt">NOTE: A cookie will also be stored in your browser. It will be used to warn you when you try to take an action such as "Delete" on an comment that you didn't create. This saves work for the pgitBot.</p>
139		<input type="text" id="alias-input" placeholder="Enter your alias (leave empty to unalias)">
140		<button id="save-alias-btn" class="btn mt">Save Alias</button>
141	</div>
142</div>
143
144<div id="reaction-picker" style="display:none; position:absolute;">
145</div>
146{{end}}