Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add <overflow-menu>, rename webcomponents #29400

Merged
merged 86 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
8a8c625
WIP: Overflow menu
silverwind Feb 25, 2024
ba13360
fix calc
silverwind Feb 25, 2024
9cc21fe
progress
silverwind Feb 26, 2024
2a439ca
progress
silverwind Feb 26, 2024
c73d3ab
error handler stuff
silverwind Feb 26, 2024
049c6cf
const
silverwind Feb 26, 2024
708aad3
dot
silverwind Feb 26, 2024
c258536
progress
silverwind Feb 26, 2024
c945b61
revert bootstrap changes
silverwind Feb 26, 2024
93bcd09
more progress
silverwind Feb 26, 2024
ef7ecf7
rename variable
silverwind Feb 26, 2024
8c6acd9
rename another variable
silverwind Feb 26, 2024
9b261ea
Merge branch 'main' into overflow-menu
silverwind Mar 2, 2024
f1463f7
prevent layout shift when active element hides
silverwind Mar 2, 2024
eb90267
move it to a web component
silverwind Mar 2, 2024
2d404d0
rename to 'overflow-menu' and use it everywhere
silverwind Mar 2, 2024
ae228bc
rename 'gitea-origin-url' to 'origin-url', misc tweaks
silverwind Mar 2, 2024
886f105
fix justify on centered menus
silverwind Mar 2, 2024
16e7ffb
update tippy after creation
silverwind Mar 2, 2024
26a7d01
remove now-unnecessary class removal
silverwind Mar 2, 2024
73b2cb3
destroy tippy when removing button
silverwind Mar 2, 2024
1843a96
remove dead css
silverwind Mar 2, 2024
44b8019
rename variable and class
silverwind Mar 2, 2024
878f7e6
typo
silverwind Mar 2, 2024
ab70cb1
fix lint-templates
silverwind Mar 2, 2024
682ae3a
remove default background and add it via tailwind on login pages
silverwind Mar 3, 2024
8045ca3
use it on org page
silverwind Mar 3, 2024
f769241
use it on user page
silverwind Mar 3, 2024
27c94c0
hide sooner
silverwind Mar 3, 2024
b14e132
replace requestAnimationFrame with MutationObserver
silverwind Mar 3, 2024
8ab94ed
Merge branch 'main' into overflow-menu
silverwind Mar 3, 2024
6182d5f
add vue compat for custom elements, styling tweaks
silverwind Mar 3, 2024
6aa9f88
move observer disconnect
silverwind Mar 3, 2024
8a64b70
prevent fouc with defer in webcomponents script
silverwind Mar 3, 2024
e145a5d
split webcomponents into two scripts to avoid all FOUCs
silverwind Mar 3, 2024
07cea89
move back to one webcomponents file, remove getBoundingClientRect
silverwind Mar 3, 2024
2cf34a3
fix the fouc
silverwind Mar 3, 2024
551f910
avoid one querySelector
silverwind Mar 3, 2024
f74a491
avoid another querySelector, tweak comments
silverwind Mar 3, 2024
562543d
remove cloneNode
silverwind Mar 3, 2024
5dfe109
remove last querySelector
silverwind Mar 3, 2024
90a53b1
typo
silverwind Mar 3, 2024
d67b19d
Update .eslintrc.yaml
silverwind Mar 3, 2024
1830851
remove unneeded class
silverwind Mar 3, 2024
22e4e07
tweak comment
silverwind Mar 3, 2024
23e716f
Merge branch 'main' into overflow-menu
GiteaBot Mar 3, 2024
2d0ec1b
remove obsolete file
silverwind Mar 3, 2024
f37213a
use it in DashboardRepoList
silverwind Mar 3, 2024
77a8e1e
use requestAnimationFrame to avoid warning, add disconnects
silverwind Mar 3, 2024
6e93db1
Merge branch 'main' into overflow-menu
silverwind Mar 4, 2024
f13f8e0
use wc- prefix
silverwind Mar 4, 2024
b4583a9
add files, docs and enhance isCustomElement
silverwind Mar 4, 2024
ba8a47b
Update web_src/js/webcomponents/wc-overflow-menu.js
silverwind Mar 5, 2024
8718035
revert to unprefixed
silverwind Mar 6, 2024
de5074c
Merge remote-tracking branch 'origin/main' into overflow-menu
silverwind Mar 6, 2024
9fe309a
fix filenames
silverwind Mar 6, 2024
fe950b9
remove fomantic menu dependency
silverwind Mar 6, 2024
0ede830
remove from code-line-menu as well
silverwind Mar 6, 2024
f586358
add some aria
silverwind Mar 6, 2024
d7c0b01
set aria-haspopup on all tippy with click trigger
silverwind Mar 6, 2024
fc193c2
css tweaks
silverwind Mar 6, 2024
5df5e44
re-enable eslint rule
silverwind Mar 6, 2024
98b3523
add link
silverwind Mar 6, 2024
b37df74
move guide
silverwind Mar 6, 2024
680b032
remove unneeded polyfill, available in palemoon now
silverwind Mar 6, 2024
d524b24
de-intend via early exit button removal
silverwind Mar 6, 2024
22f71f6
Merge branch 'main' into overflow-menu
silverwind Mar 9, 2024
e168714
Merge branch 'main' into overflow-menu
silverwind Mar 12, 2024
40bfc8b
add padding
silverwind Mar 12, 2024
98893a4
use 'More items'
silverwind Mar 12, 2024
cd77433
tippy fixes, add missing box-shadow
silverwind Mar 12, 2024
b3703f8
add navigation role
silverwind Mar 12, 2024
84a7d6b
fix incorrect aria attribute
wxiaoguang Mar 13, 2024
9c2fdb9
add basic aria support
wxiaoguang Mar 13, 2024
b1e4857
Merge branch 'main' into overflow-menu
silverwind Mar 13, 2024
0532acb
rename to gitea-absolute-date to absolute-date
silverwind Mar 13, 2024
1b8f7ff
add absolute-date to vue config
silverwind Mar 13, 2024
9f9fbee
fix lint
silverwind Mar 13, 2024
19d55ec
add arrow key handling, move focus to target element initially
silverwind Mar 13, 2024
cbf3fc1
fix unfocusable vue links
silverwind Mar 13, 2024
ee51556
Merge branch 'main' into overflow-menu
silverwind Mar 13, 2024
05df5b6
add comment
silverwind Mar 13, 2024
a753af5
Merge branch 'main' into overflow-menu
silverwind Mar 14, 2024
7130333
Merge branch 'main' into overflow-menu
silverwind Mar 14, 2024
97ed9ed
move prevent/stop into conditionals
silverwind Mar 14, 2024
1f87f8f
Merge branch 'main' into overflow-menu
GiteaBot Mar 15, 2024
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
2 changes: 1 addition & 1 deletion modules/timeutil/datetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func DateTime(format string, datetime any, extraAttrs ...string) template.HTML {
switch format {
case "short", "long": // date only
attrs = append(attrs, `month="`+format+`"`, `day="numeric"`)
return template.HTML(fmt.Sprintf(`<gitea-absolute-date %s date="%s">%s</gitea-absolute-date>`, strings.Join(attrs, " "), datetimeEscaped, textEscaped))
return template.HTML(fmt.Sprintf(`<absolute-date %s date="%s">%s</absolute-date>`, strings.Join(attrs, " "), datetimeEscaped, textEscaped))
case "full": // full date including time
attrs = append(attrs, `format="datetime"`, `month="short"`, `day="numeric"`, `hour="numeric"`, `minute="numeric"`, `second="numeric"`, `data-tooltip-content`, `data-tooltip-interactive="true"`)
return template.HTML(fmt.Sprintf(`<relative-time %s datetime="%s">%s</relative-time>`, strings.Join(attrs, " "), datetimeEscaped, textEscaped))
Expand Down
10 changes: 5 additions & 5 deletions modules/timeutil/datetime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ func TestDateTime(t *testing.T) {
assert.EqualValues(t, "-", DateTime("short", TimeStamp(0)))

actual := DateTime("short", "invalid")
assert.EqualValues(t, `<gitea-absolute-date weekday="" year="numeric" month="short" day="numeric" date="invalid">invalid</gitea-absolute-date>`, actual)
assert.EqualValues(t, `<absolute-date weekday="" year="numeric" month="short" day="numeric" date="invalid">invalid</absolute-date>`, actual)

actual = DateTime("short", refTimeStr)
assert.EqualValues(t, `<gitea-absolute-date weekday="" year="numeric" month="short" day="numeric" date="2018-01-01T00:00:00Z">2018-01-01T00:00:00Z</gitea-absolute-date>`, actual)
assert.EqualValues(t, `<absolute-date weekday="" year="numeric" month="short" day="numeric" date="2018-01-01T00:00:00Z">2018-01-01T00:00:00Z</absolute-date>`, actual)

actual = DateTime("short", refTime)
assert.EqualValues(t, `<gitea-absolute-date weekday="" year="numeric" month="short" day="numeric" date="2018-01-01T00:00:00Z">2018-01-01</gitea-absolute-date>`, actual)
assert.EqualValues(t, `<absolute-date weekday="" year="numeric" month="short" day="numeric" date="2018-01-01T00:00:00Z">2018-01-01</absolute-date>`, actual)

actual = DateTime("short", refDateStr)
assert.EqualValues(t, `<gitea-absolute-date weekday="" year="numeric" month="short" day="numeric" date="2018-01-01">2018-01-01</gitea-absolute-date>`, actual)
assert.EqualValues(t, `<absolute-date weekday="" year="numeric" month="short" day="numeric" date="2018-01-01">2018-01-01</absolute-date>`, actual)

actual = DateTime("short", refTimeStamp)
assert.EqualValues(t, `<gitea-absolute-date weekday="" year="numeric" month="short" day="numeric" date="2017-12-31T19:00:00-05:00">2017-12-31</gitea-absolute-date>`, actual)
assert.EqualValues(t, `<absolute-date weekday="" year="numeric" month="short" day="numeric" date="2017-12-31T19:00:00-05:00">2017-12-31</absolute-date>`, actual)

actual = DateTime("full", refTimeStamp)
assert.EqualValues(t, `<relative-time weekday="" year="numeric" format="datetime" month="short" day="numeric" hour="numeric" minute="numeric" second="numeric" data-tooltip-content data-tooltip-interactive="true" datetime="2017-12-31T19:00:00-05:00">2017-12-31 19:00:00 -05:00</relative-time>`, actual)
Expand Down
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ enable_javascript = This website requires JavaScript.
toc = Table of Contents
licenses = Licenses
return_to_gitea = Return to Gitea
more_items = More items

username = Username
email = Email Address
Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@github/text-expander-element": "2.6.1",
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
"@primer/octicons": "19.8.0",
"@webcomponents/custom-elements": "1.6.0",
"add-asset-webpack-plugin": "2.0.1",
"ansi_up": "6.0.2",
"asciinema-player": "3.7.0",
Expand Down
1 change: 1 addition & 0 deletions templates/base/head_script.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ If you introduce mistakes in it, Gitea JavaScript code wouldn't run correctly.
remove_label_str: {{ctx.Locale.Tr "remove_label_str"}},
modal_confirm: {{ctx.Locale.Tr "modal.confirm"}},
modal_cancel: {{ctx.Locale.Tr "modal.cancel"}},
more_items: {{ctx.Locale.Tr "more_items"}},
},
};
{{/* in case some pages don't render the pageData, we make sure it is an object to prevent null access */}}
Expand Down
43 changes: 35 additions & 8 deletions templates/devtest/gitea-ui.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,45 @@
</div>

<div>
<h1>GiteaOriginUrl</h1>
<div><gitea-origin-url data-url="test/url"></gitea-origin-url></div>
<div><gitea-origin-url data-url="/test/url"></gitea-origin-url></div>
<h1>&lt;origin-url&gt;</h1>
<div><origin-url data-url="test/url"></origin-url></div>
<div><origin-url data-url="/test/url"></origin-url></div>
</div>

<div>
<h1>&lt;overflow-menu&gt;</h1>
<overflow-menu class="ui secondary pointing tabular borderless menu">
<div class="overflow-menu-items">
<a class="active item">item</a>
<a class="item">item 1</a>
<a class="item">item 2</a>
<a class="item">item 3</a>
<a class="item">item 4</a>
<a class="item">item 5</a>
<a class="item">item 6</a>
<a class="item">item 7</a>
<a class="item">item 8</a>
<a class="item">item 9</a>
<a class="item">item 10</a>
<a class="item">item 11</a>
<a class="item">item 12</a>
<a class="item">item 13</a>
<a class="item">item 14</a>
<a class="item">item 15</a>
<a class="item">item 16</a>
<a class="item">item 17</a>
<a class="item">item 18</a>
</div>
</overflow-menu>
</div>

<div>
<h1>GiteaAbsoluteDate</h1>
<div><gitea-absolute-date date="2024-03-11" year="numeric" day="numeric" month="short"></gitea-absolute-date></div>
<div><gitea-absolute-date date="2024-03-11" year="numeric" day="numeric" month="long"></gitea-absolute-date></div>
<div><gitea-absolute-date date="2024-03-11" year="" day="numeric" month="numeric"></gitea-absolute-date></div>
<div><gitea-absolute-date date="2024-03-11" year="" day="numeric" month="numeric" weekday="long"></gitea-absolute-date></div>
<div><gitea-absolute-date date="2024-03-11T19:00:00-05:00" year="" day="numeric" month="numeric" weekday="long"></gitea-absolute-date></div>
<div><absolute-date date="2024-03-11" year="numeric" day="numeric" month="short"></absolute-date></div>
<div><absolute-date date="2024-03-11" year="numeric" day="numeric" month="long"></absolute-date></div>
<div><absolute-date date="2024-03-11" year="" day="numeric" month="numeric"></absolute-date></div>
<div><absolute-date date="2024-03-11" year="" day="numeric" month="numeric" weekday="long"></absolute-date></div>
<div><absolute-date date="2024-03-11T19:00:00-05:00" year="" day="numeric" month="numeric" weekday="long"></absolute-date></div>
<div class="tw-text-text-light-2">relative-time: <relative-time format="datetime" datetime="2024-03-11" year="" day="numeric" month="numeric"></relative-time></div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions templates/explore/navbar.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
<div class="new-menu-inner">
<overflow-menu class="ui secondary pointing tabular top attached borderless menu navbar">
<div class="overflow-menu-items tw-justify-center">
<a class="{{if .PageIsExploreRepositories}}active {{end}}item" href="{{AppSubUrl}}/explore/repos">
{{svg "octicon-repo"}} {{ctx.Locale.Tr "explore.repos"}}
</a>
Expand All @@ -17,4 +17,4 @@
</a>
{{end}}
</div>
</div>
</overflow-menu>
71 changes: 35 additions & 36 deletions templates/org/menu.tmpl
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
<div class="ui container">
<div class="ui secondary stackable pointing menu">
<a class="{{if .PageIsViewRepositories}}active {{end}}item" href="{{$.Org.HomeLink}}">
{{svg "octicon-repo"}} {{ctx.Locale.Tr "user.repositories"}}
{{if .RepoCount}}
<div class="ui small label">{{.RepoCount}}</div>
<overflow-menu class="ui secondary pointing tabular borderless menu">
<div class="overflow-menu-items">
<a class="{{if .PageIsViewRepositories}}active {{end}}item" href="{{$.Org.HomeLink}}">
{{svg "octicon-repo"}} {{ctx.Locale.Tr "user.repositories"}}
{{if .RepoCount}}
<div class="ui small label">{{.RepoCount}}</div>
{{end}}
</a>
{{if .CanReadProjects}}
<a class="{{if .PageIsViewProjects}}active {{end}}item" href="{{$.Org.HomeLink}}/-/projects">
{{svg "octicon-project-symlink"}} {{ctx.Locale.Tr "user.projects"}}
{{if .ProjectCount}}
<div class="ui small label">{{.ProjectCount}}</div>
{{end}}
</a>
{{end}}
</a>
{{if .CanReadProjects}}
<a class="{{if .PageIsViewProjects}}active {{end}}item" href="{{$.Org.HomeLink}}/-/projects">
{{svg "octicon-project-symlink"}} {{ctx.Locale.Tr "user.projects"}}
{{if .ProjectCount}}
<div class="ui small label">{{.ProjectCount}}</div>
{{if and .IsPackageEnabled .CanReadPackages}}
<a class="{{if .IsPackagesPage}}active {{end}}item" href="{{$.Org.HomeLink}}/-/packages">
{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
</a>
{{end}}
</a>
{{end}}
{{if and .IsPackageEnabled .CanReadPackages}}
<a class="{{if .IsPackagesPage}}active {{end}}item" href="{{$.Org.HomeLink}}/-/packages">
{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
</a>
{{end}}
{{if and .IsRepoIndexerEnabled .CanReadCode}}
<a class="{{if .IsCodePage}}active {{end}}item" href="{{$.Org.HomeLink}}/-/code">
{{svg "octicon-code"}} {{ctx.Locale.Tr "org.code"}}
</a>
{{end}}
{{if .NumMembers}}
{{if and .IsRepoIndexerEnabled .CanReadCode}}
<a class="{{if .IsCodePage}}active {{end}}item" href="{{$.Org.HomeLink}}/-/code">
{{svg "octicon-code"}} {{ctx.Locale.Tr "org.code"}}
</a>
{{end}}
{{if .NumMembers}}
<a class="{{if $.PageIsOrgMembers}}active {{end}}item" href="{{$.OrgLink}}/members">
{{svg "octicon-person"}} {{ctx.Locale.Tr "org.members"}}
<div class="ui small label">{{.NumMembers}}</div>
</a>
{{end}}
{{if .IsOrganizationMember}}
{{end}}
{{if .IsOrganizationMember}}
<a class="{{if $.PageIsOrgTeams}}active {{end}}item" href="{{$.OrgLink}}/teams">
{{svg "octicon-people"}} {{ctx.Locale.Tr "org.teams"}}
{{if .NumTeams}}
<div class="ui small label">{{.NumTeams}}</div>
{{end}}
</a>
{{end}}

{{if .IsOrganizationOwner}}
<div class="right menu">
<a class="{{if .PageIsOrgSettings}}active {{end}}item" href="{{.OrgLink}}/settings">
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
</a>
</div>
{{end}}
</div>
{{end}}
{{if .IsOrganizationOwner}}
<a class="{{if .PageIsOrgSettings}}active {{end}}item" href="{{.OrgLink}}/settings">
{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
</a>
{{end}}
</div>
</overflow-menu>
</div>
4 changes: 2 additions & 2 deletions templates/package/content/alpine.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.alpine.registry"}}</label>
<div class="markup"><pre class="code-block"><code><gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/alpine"></gitea-origin-url>/$branch/$repository</code></pre></div>
<div class="markup"><pre class="code-block"><code><origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/alpine"></origin-url>/$branch/$repository</code></pre></div>
<p>{{ctx.Locale.Tr "packages.alpine.registry.info"}}</p>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.alpine.registry.key"}}</label>
<div class="markup"><pre class="code-block"><code>curl -JO <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/alpine/key"></gitea-origin-url></code></pre></div>
<div class="markup"><pre class="code-block"><code>curl -JO <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/alpine/key"></origin-url></code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.alpine.install"}}</label>
Expand Down
4 changes: 2 additions & 2 deletions templates/package/content/cargo.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
default = "gitea"

[registries.gitea]
index = "sparse+<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cargo/"></gitea-origin-url>" # Sparse index
# index = "<gitea-origin-url data-url="{{AppSubUrl}}/{{.PackageDescriptor.Owner.Name}}/_cargo-index.git"></gitea-origin-url>" # Git
index = "sparse+<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cargo/"></origin-url>" # Sparse index
# index = "<origin-url data-url="{{AppSubUrl}}/{{.PackageDescriptor.Owner.Name}}/_cargo-index.git"></origin-url>" # Git

[net]
git-fetch-with-cli = true</code></pre></div>
Expand Down
2 changes: 1 addition & 1 deletion templates/package/content/chef.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.chef.registry"}}</label>
<div class="markup"><pre class="code-block"><code>knife[:supermarket_site] = '<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/chef"></gitea-origin-url>'</code></pre></div>
<div class="markup"><pre class="code-block"><code>knife[:supermarket_site] = '<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/chef"></origin-url>'</code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.chef.install"}}</label>
Expand Down
2 changes: 1 addition & 1 deletion templates/package/content/composer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="markup"><pre class="code-block"><code>{
"repositories": [{
"type": "composer",
"url": "<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/composer"></gitea-origin-url>"
"url": "<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/composer"></origin-url>"
}
]
}</code></pre></div>
Expand Down
2 changes: 1 addition & 1 deletion templates/package/content/conan.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conan.registry"}}</label>
<div class="markup"><pre class="code-block"><code>conan remote add gitea <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conan"></gitea-origin-url></code></pre></div>
<div class="markup"><pre class="code-block"><code>conan remote add gitea <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conan"></origin-url></code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conan.install"}}</label>
Expand Down
6 changes: 3 additions & 3 deletions templates/package/content/conda.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.conda.registry"}}</label>
<div class="markup"><pre class="code-block"><code>channel_alias: <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></gitea-origin-url>
<div class="markup"><pre class="code-block"><code>channel_alias: <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></origin-url>
channels:
&#32;&#32;- <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></gitea-origin-url>
&#32;&#32;- <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></origin-url>
default_channels:
&#32;&#32;- <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></gitea-origin-url></code></pre></div>
&#32;&#32;- <origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></origin-url></code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conda.install"}}</label>
Expand Down
2 changes: 1 addition & 1 deletion templates/package/content/cran.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.cran.registry"}}</label>
<div class="markup"><pre class="code-block"><code>options("repos" = c(getOption("repos"), c(gitea="<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cran"></gitea-origin-url>")))</code></pre></div>
<div class="markup"><pre class="code-block"><code>options("repos" = c(getOption("repos"), c(gitea="<origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cran"></origin-url>")))</code></pre></div>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.cran.install"}}</label>
Expand Down
4 changes: 2 additions & 2 deletions templates/package/content/debian.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.debian.registry"}}</label>
<div class="markup"><pre class="code-block"><code>sudo curl <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian/repository.key"></gitea-origin-url> -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc] <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian"></gitea-origin-url> $distribution $component" | sudo tee -a /etc/apt/sources.list.d/gitea.list
<div class="markup"><pre class="code-block"><code>sudo curl <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian/repository.key"></origin-url> -o /etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
echo "deb [signed-by=/etc/apt/keyrings/gitea-{{$.PackageDescriptor.Owner.Name}}.asc] <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian"></origin-url> $distribution $component" | sudo tee -a /etc/apt/sources.list.d/gitea.list
sudo apt update</code></pre></div>
<p>{{ctx.Locale.Tr "packages.debian.registry.info"}}</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/package/content/generic.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.generic.download"}}</label>
<div class="markup"><pre class="code-block"><code>
{{- range .PackageDescriptor.Files -}}
curl -OJ <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/generic/{{$.PackageDescriptor.Package.Name}}/{{$.PackageDescriptor.Version.Version}}/{{.File.Name}}"></gitea-origin-url>
curl -OJ <origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/generic/{{$.PackageDescriptor.Package.Name}}/{{$.PackageDescriptor.Version.Version}}/{{.File.Name}}"></origin-url>
{{end -}}
</code></pre></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/package/content/go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.go.install"}}</label>
<div class="markup"><pre class="code-block"><code>GOPROXY=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/go"></gitea-origin-url> go install {{$.PackageDescriptor.Package.Name}}@{{$.PackageDescriptor.Version.Version}}</code></pre></div>
<div class="markup"><pre class="code-block"><code>GOPROXY=<origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/go"></origin-url> go install {{$.PackageDescriptor.Package.Name}}@{{$.PackageDescriptor.Version.Version}}</code></pre></div>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "packages.registry.documentation" "Go" "https://docs.gitea.com/usage/packages/go"}}</label>
Expand Down
Loading