Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions components/common/box-list/box-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,13 @@
margin: 0 8px;
}
}

/* Forks: the owner's avatar before the fork's name. */
.theme-fork-row {
min-height: 48px;
}

.theme-fork-row > img.ui.avatar {
flex: none;
border-radius: 50%;
}
6 changes: 6 additions & 0 deletions src/build-output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,12 @@ describe("Forgejo 15 native integration", () => {
expect(style).toContain("background: ${themeVars.color.box.header};");
});

it("lists forks in a box and shows GitHub's empty state without them", () => {
const forks = fs.readFileSync(path.join(ROOT_DIR, "templates", "repo", "forks.tmpl"), "utf-8");
expect(forks).toContain('<li class="theme-box-list-row theme-fork-row">');
expect(forks).toContain("No one has forked this repository yet");
});

it("matches GitHub's repository About, visibility, and code-search details", () => {
const headerStyle = fs.readFileSync(path.join(ROOT_DIR, "styles", "templates", "repo", "header.ts"), "utf-8");
const headerTemplate = fs.readFileSync(path.join(ROOT_DIR, "templates", "repo", "home_header.tmpl"), "utf-8");
Expand Down
32 changes: 32 additions & 0 deletions templates/repo/forks.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* GitHub's forks page: a heading over a box with a row per fork (its owner's avatar, owner and name), or GitHub's
empty state. Forgejo has no string for that state, so it is GitHub's English one. */}}
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content repository forks">
<div class="ui container">
<section class="theme-box-list-page">
<div class="theme-list-heading"><div class="theme-list-title"><h1>{{ctx.Locale.Tr "repo.forks"}}</h1></div></div>
{{if .Forks}}
<div class="theme-box-list">
<ul class="theme-box-list-rows">
{{range .Forks}}
<li class="theme-box-list-row theme-fork-row">
{{ctx.AvatarUtils.Avatar .Owner 20}}
<div class="theme-box-list-main">
<h3><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="{{.Link}}">{{.Name}}</a></h3>
</div>
</li>
{{end}}
</ul>
</div>
{{else}}
<div class="theme-empty">
{{svg "octicon-repo-forked" 24}}
<h3>No one has forked this repository yet</h3>
<p>Forks are a great way to contribute to a repository. After forking a repository, you can send the original author a pull request.</p>
</div>
{{end}}
</section>
{{template "base/paginate" .}}
</div>
</div>
{{template "base/footer" .}}
Loading