Skip to content

Commit 6a88906

Browse files
committed
feat(frontend): add catalog stub template files
q
1 parent 03abccc commit 6a88906

File tree

4 files changed

+128
-3
lines changed

4 files changed

+128
-3
lines changed

templates/repo/catalog.tmpl

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
{{template "base/head" .}}
2-
<div class="page-content repository catalog">
2+
{{$showSidebar := not .HideRepoInfo}}
3+
<div role="main" aria-label="{{.Title}}" class="page-content repository file list">
34
{{template "repo/header" .}}
45
<div class="ui container">
5-
<h2>Repository Catalog</h2>
6-
<!-- Your catalog content here -->
6+
{{template "base/alert" .}}
7+
8+
{{if .Repository.IsArchived}}
9+
<div class="ui warning message tw-text-center">
10+
{{if .Repository.ArchivedUnix.IsZero}}
11+
{{ctx.Locale.Tr "repo.archive.title"}}
12+
{{else}}
13+
{{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}}
14+
{{end}}
15+
</div>
16+
{{end}}
17+
18+
<div class="{{Iif $showSidebar "repo-grid-filelist-sidebar" "repo-grid-filelist-only"}}">
19+
<div class="repo-home-filelist">
20+
{{template "repo/catalog/view_content" .}}
21+
</div>
22+
23+
{{if $showSidebar}}
24+
{{template "repo/catalog/sidebar_top" .}}
25+
{{template "repo/catalog/sidebar_bottom" .}}
26+
{{end}}
27+
</div>
728
</div>
829
</div>
930
{{template "base/footer" .}}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div class="repo-home-sidebar-bottom">
2+
<div class="flex-list">
3+
<div class="flex-item">
4+
<div class="flex-item-main">
5+
<div class="flex-item-title">
6+
Recent Updates
7+
</div>
8+
<div class="flex-item-body">
9+
<!-- Add recent dataset updates here -->
10+
</div>
11+
</div>
12+
</div>
13+
</div>
14+
</div>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<div class="repo-home-sidebar-top">
2+
<form class="ignore-dirty tw-flex tw-flex-1" action="{{.RepoLink}}/catalog/search" method="get">
3+
<div class="ui small action input tw-flex-1">
4+
<input name="q" size="10" placeholder="Search metadata"> {{template "shared/search/button"}}
5+
</div>
6+
</form>
7+
8+
<div class="flex-list">
9+
<div class="flex-item">
10+
<div class="flex-item-main">
11+
<div class="flex-item-title">Catalog Description</div>
12+
<div class="flex-item-body tw-text-16">
13+
<div class="tw-flex tw-flex-col tw-gap-2 tw-mt-2">
14+
<div class="repo-description tw-break-anywhere tw-gap-2">
15+
PLACEHOLDER DESCRIPTION
16+
</div>
17+
18+
<div id="catalog-topics" class="flex-text-block tw-flex-wrap tw-gap-1 tw-my-1 tw-text-text">
19+
{{range .CatalogTags}}
20+
<a class="repo-topic ui large label gt-ellipsis" title={{.Name}} href="{{$.RepoLink}}/catalog/tags/{{.Name}}">{{.Name}}</a>
21+
{{end}}
22+
</div>
23+
24+
{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
25+
<button id="manage_catalog_tags" class="btn interact-fg tw-mb-2 tw-text-12">Manage Tags</button>
26+
<div class="ui form tw-hidden tw-my-2" id="catalog_tags_edit">
27+
<div class="ui fluid multiple search selection dropdown tw-flex-wrap tw-flex-1">
28+
<input type="hidden" name="tags" value="">
29+
<div class="text"></div>
30+
</div>
31+
<div class="tw-my-2">
32+
<button class="ui primary button" id="save_catalog_tags" data-link="{{.RepoLink}}/catalog/tags">{{ctx.Locale.Tr "save"}}</button>
33+
<button class="ui basic button" id="cancel_catalog_tags_edit">{{ctx.Locale.Tr "cancel"}}</button>
34+
</div>
35+
</div>
36+
{{end}}
37+
38+
<span class="flex-text-block muted">
39+
{{svg "octicon-database"}} <b>{{.NumDatasets}}</b> Datasets
40+
</span>
41+
<span class="flex-text-block muted">
42+
{{svg "octicon-tag"}} <b>{{.NumTags}}</b> Tags
43+
</span>
44+
</div>
45+
</div>
46+
</div>
47+
</div>
48+
</div>
49+
</div>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{template "repo/sub_menu" .}}
2+
<div class="repo-button-row">
3+
<div class="repo-button-row-left">
4+
{{template "repo/branch_dropdown" dict
5+
"Repository" .Repository
6+
"ShowTabBranches" true
7+
"ShowTabTags" true
8+
"CurrentRefType" .RefFullName.RefType
9+
"CurrentRefShortName" .RefFullName.ShortName
10+
"CurrentTreePath" .TreePath
11+
"RefLinkTemplate" "{RepoLink}/catalog/{RefType}/{RefShortName}/{TreePath}"
12+
"AllowCreateNewRef" .CanCreateBranch
13+
"ShowViewAllRefsEntry" true
14+
}}
15+
16+
<a href="{{.Repository.Link}}/catalog/find" class="ui compact basic button">{{ctx.Locale.Tr "repo.find_dataset"}}</a>
17+
18+
{{if .CanWriteCode}}
19+
<button class="ui dropdown basic compact jump button">
20+
{{ctx.Locale.Tr "repo.catalog.add_dataset"}}
21+
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
22+
<div class="menu">
23+
<a class="item" href="{{.RepoLink}}/catalog/_new">
24+
{{ctx.Locale.Tr "repo.catalog.new_dataset"}}
25+
</a>
26+
{{if .RepositoryUploadEnabled}}
27+
<a class="item" href="{{.RepoLink}}/catalog/_upload">
28+
{{ctx.Locale.Tr "repo.catalog.upload_dataset"}}
29+
</a>
30+
{{end}}
31+
</div>
32+
</button>
33+
{{end}}
34+
</div>
35+
</div>
36+
37+
<div class="ui segments">
38+
<div class="ui segment">
39+
<h2>{{svg "octicon-table"}} TABLE PLACEHOLDER</h2>
40+
</div>
41+
</div>

0 commit comments

Comments
 (0)