alpha
Login
or
Join now
dunkirk.sh
/
core
forked from
tangled.org/core
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
minor fixes and improvements
author
Anirudh Oppiliappan
date
1 year ago
(Feb 24, 2025, 8:04 AM +0200)
commit
b735cc94
b735cc94e234e1317d1f7d8eb5cad41aa567240d
parent
5ff7bd93
5ff7bd93c4faa517233dd8f588cb958b67eb5848
+28
-20
4 changed files
Expand all
Collapse all
Unified
Split
appview
db
issues.go
pages
templates
repo
commit.html
issue.html
state
repo.go
+1
-1
appview/db/issues.go
Reviewed
···
95
95
func (d *DB) GetIssues(repoAt string) ([]Issue, error) {
96
96
var issues []Issue
97
97
98
98
-
rows, err := d.db.Query(`select owner_did, issue_id, created, title, body, open from issues where repo_at = ?`, repoAt)
98
98
+
rows, err := d.db.Query(`select owner_did, issue_id, created, title, body, open from issues where repo_at = ? order by created desc`, repoAt)
99
99
if err != nil {
100
100
return nil, err
101
101
}
+21
-15
appview/pages/templates/repo/commit.html
Reviewed
···
11
11
<div id="commit-message">
12
12
{{ $messageParts := splitN $commit.Message "\n\n" 2 }}
13
13
<div>
14
14
-
{{ index $messageParts 0 }}
14
14
+
<p class="pb-2">{{ index $messageParts 0 }}</p>
15
15
{{ if gt (len $messageParts) 1 }}
16
16
-
<p class="mt-1 cursor-text pb-2">{{ nl2br (unwrapText (index $messageParts 1)) }}</p>
16
16
+
<p class="mt-1 cursor-text pb-2 text-sm">{{ nl2br (unwrapText (index $messageParts 1)) }}</p>
17
17
{{ end }}
18
18
</div>
19
19
</div>
20
20
21
21
-
<p class="text-sm text-gray-500">
22
22
-
<a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500">{{ $commit.Author.Name }}</a>
23
23
-
<span class="px-1 select-none before:content-['\00B7']"></span>
24
24
-
{{ timeFmt $commit.Author.When }}
25
25
-
<span class="px-1 select-none before:content-['\00B7']"></span>
26
26
-
<span class="font-mono">{{ $stat.FilesChanged }}</span> files <span class="font-mono">(+{{ $stat.Insertions }}, -{{ $stat.Deletions }})</span>
27
27
-
<span class="px-1 select-none before:content-['\00B7']"></span>
28
28
-
<a href="/{{ $repo }}/commit/{{ $commit.This }}" class="no-underline hover:underline text-gray-500">{{ slice $commit.This 0 8 }}</a>
29
29
-
{{ if $commit.Parent }}
30
30
-
<span class="select-none">←</span>
31
31
-
<a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="no-underline hover:underline text-gray-500">{{ slice $commit.Parent 0 8 }}</a>
32
32
-
{{ end }}
33
33
-
</p>
21
21
+
<div class="flex items-center">
22
22
+
<p class="text-sm text-gray-500">
23
23
+
<a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500">{{ $commit.Author.Name }}</a>
24
24
+
<span class="px-1 select-none before:content-['\00B7']"></span>
25
25
+
{{ timeFmt $commit.Author.When }}
26
26
+
<span class="px-1 select-none before:content-['\00B7']"></span>
27
27
+
<span class="font-mono">{{ $stat.FilesChanged }}</span> files <span class="font-mono">(+{{ $stat.Insertions }}, -{{ $stat.Deletions }})</span>
28
28
+
<span class="px-1 select-none before:content-['\00B7']"></span>
29
29
+
</p>
30
30
+
31
31
+
<p class="flex items-center text-sm text-gray-500">
32
32
+
<a href="/{{ $repo }}/commit/{{ $commit.This }}" class="no-underline hover:underline text-gray-500">{{ slice $commit.This 0 8 }}</a>
33
33
+
{{ if $commit.Parent }}
34
34
+
<i class="w-3 h-3 mx-1" data-lucide="arrow-left"></i>
35
35
+
<a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="no-underline hover:underline text-gray-500">{{ slice $commit.Parent 0 8 }}</a>
36
36
+
{{ end }}
37
37
+
</p>
38
38
+
</div>
39
39
+
34
40
<div class="diff-stat">
35
41
<br>
36
42
<strong>jump to</strong>
+2
appview/pages/templates/repo/issue.html
Reviewed
···
93
93
{{ end }}
94
94
<form
95
95
hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/{{ $action }}"
96
96
+
hx-swap="none"
96
97
class="mt-8"
97
98
>
98
99
<button type="submit" class="btn hover:bg-{{ $hoverColor }}-300">
···
102
103
></i>
103
104
<span class="text-black">{{ $action }}</span>
104
105
</button>
106
106
+
<div id="issue-action" class="error"></div>
105
107
</form>
106
108
{{ end }}
107
109
{{ end }}
+4
-4
appview/state/repo.go
Reviewed
···
572
572
issue, err := s.db.GetIssue(f.RepoAt, issueIdInt)
573
573
if err != nil {
574
574
log.Println("failed to get issue", err)
575
575
-
s.pages.Notice(w, "issues", "Failed to close issue. Try again later.")
575
575
+
s.pages.Notice(w, "issue-action", "Failed to close issue. Try again later.")
576
576
return
577
577
}
578
578
···
596
596
597
597
if err != nil {
598
598
log.Println("failed to update issue state", err)
599
599
-
s.pages.Notice(w, "issues", "Failed to close issue. Try again later.")
599
599
+
s.pages.Notice(w, "issue-action", "Failed to close issue. Try again later.")
600
600
return
601
601
}
602
602
603
603
err := s.db.CloseIssue(f.RepoAt, issueIdInt)
604
604
if err != nil {
605
605
log.Println("failed to close issue", err)
606
606
-
s.pages.Notice(w, "issues", "Failed to close issue. Try again later.")
606
606
+
s.pages.Notice(w, "issue-action", "Failed to close issue. Try again later.")
607
607
return
608
608
}
609
609
···
636
636
err := s.db.ReopenIssue(f.RepoAt, issueIdInt)
637
637
if err != nil {
638
638
log.Println("failed to reopen issue", err)
639
639
-
s.pages.Notice(w, "issues", "Failed to reopen issue. Try again later.")
639
639
+
s.pages.Notice(w, "issue-action", "Failed to reopen issue. Try again later.")
640
640
return
641
641
}
642
642
s.pages.HxLocation(w, fmt.Sprintf("/%s/issues/%d", f.OwnerSlashRepo(), issueIdInt))