Commit graph

11 commits

Author SHA1 Message Date
Caesar Schinas f0835feaff
[BRANDING] Custom loading animation for Forgejo
(cherry picked from commit a3b3b8a2dfb31f3b8000f1bfeae63ef3190c211f)
(cherry picked from commit de0fd2d2e459aec24dae1293cc1f8f04069dedac)
(cherry picked from commit e1bf4de211a92a2f4645b3f34039749456a10ea3)
(cherry picked from commit 60ffc88a47a158fe4920f05875ea8d156eecaa70)
(cherry picked from commit 7d2beea9ca4b47a29a1737b3a4d1d5486f2db1d3)
(cherry picked from commit 171eadb95225183b3c1a1dfd3a5181953868b7d2)
(cherry picked from commit 5e81f75ed2541fafb72d20911fa1db01154f8ff9)

Conflicts:
	templates/install.tmpl
	templates/post-install.tmpl
	templates/repo/migrate/migrating.tmpl
(cherry picked from commit 641c4a36c5c576d92d3dca952130542496c8c07f)
(cherry picked from commit f1dbb2dcff94bcd734309c55808470d29f497577)
(cherry picked from commit b66de5e5316b09eeaf6c3463542994293f7b2995)
(cherry picked from commit eeccdf21a11e13f796caa45c206c89d9c273bc6b)
(cherry picked from commit af37663f4d12aec35ee42769468e1e733a8bd4a0)
(cherry picked from commit ed3739dccbfdacb6e0c8408ff6a26fcac20f8eb4)
(cherry picked from commit f0036e37cf4f6e4402e2fbbe42763553399b51a8)
(cherry picked from commit 90d453898a5c6481b9b2b6fe356f0a7b3ad2eafc)
(cherry picked from commit c01154323832c57af7a84cadc4580a00bcc96e5e)
(cherry picked from commit a294f34165c4df7100589dd2b44baf60af9d14b3)
(cherry picked from commit cc00759140bc6bf3f68129ab97995c3bf01db276)
(cherry picked from commit abe6d83b85759a80d82d52faacd36e8f315d5777)
(cherry picked from commit 274d2863398cbb94f075a7532152eb9a090b504d)
(cherry picked from commit 594aaf3c95e9cf671d02a81195653e0dabb1cae9)
(cherry picked from commit 6059a376f48d96dccfaf99ff1eede2d4ba38afc5)
(cherry picked from commit 676eb49a123694beba3bed8c0f00608f80b6b03b)
(cherry picked from commit fc834fdb86e3678c3092d0e64be6ca2e0adb3a54)
(cherry picked from commit e1e89a43495612c4e9a2e57c717c2996f1ad8cce)
(cherry picked from commit 89e0d29cdb9ca413e0e31062997b9276482e5294)
(cherry picked from commit eb7fc7a27eaf7e32d53228b660dfb98049f89b4d)
(cherry picked from commit caa41ff62928df3b032234a945277bddb3c70f4f)
(cherry picked from commit a74b6adb6ae77332638fcc8325072e82ae7f0a2c)
(cherry picked from commit 4fc629b0d4c9fbc3f5933e4d5111dc67af59b393)
(cherry picked from commit 66a3fb5dcdb74c5b4d61f9aa80d14517744776f2)
(cherry picked from commit b26ec6315aa8c5ba2971affa2ac7d78fcfa4a9f4)
(cherry picked from commit 8d9d4d6f6baaa0974455949aa6f122b02062ff89)
(cherry picked from commit aa8e8666569fbf3993258568430d0b8d7ea318a3)
(cherry picked from commit 78a3b95bda479bccbc1b87e9f9e3c80af5ec7e00)
(cherry picked from commit bdeff07606ecec81be1276b87d9608ac1bf479c7)
(cherry picked from commit 47ffb47822c1e45069733b71f16b2bd1bab137b3)
(cherry picked from commit fa7dc92f2a5361c38ee7007e433d1abafdeb36d6)
(cherry picked from commit 2a7c8466a7ffc02c74204fc01e5918d364490e3b)
(cherry picked from commit e940e6c6a440d77d8e56ccdd7aa7cdafb24e5364)
(cherry picked from commit b3504e37906b41b89351e5a487fc1bf678c68678)
(cherry picked from commit 7cc5646dcc44ba64c5f05b9eea1c816b20f4322c)
(cherry picked from commit 5116eb2c6626f5a269e01bf20603e6aa0b55902c)
(cherry picked from commit 5ede0a190fc7007a60b747e26185679af1af58be)
(cherry picked from commit 0263de4160814efe080da4b7c33f037f1a40f993)
(cherry picked from commit 61e100f9039d82a0ec9b98c5f6acb020f9c97c55)
(cherry picked from commit 4a3967a2891b4858455a4a77fb9b1d9aeb3c1dce)
(cherry picked from commit f43115c5cbbe81007e012bc529cf5b28a42d969d)
(cherry picked from commit f8ced210447bf2638729a4a0592007a4c6d1fde8)
2024-02-05 16:02:13 +01:00
delvh 7960ba7e2b
Always use ctx.Locale.Tr inside templates (#27231) 2023-09-25 08:56:50 +00:00
wxiaoguang 3d020b57f8
Remove incorrect element ID on "post-install" page (#25104)
That ID is a "copy&paste" error, it conflicts with the
`initRepoMigrationStatusChecker` logic, which is the right function for
a real `#repo_migrating` element. That wrong ID causes incorrect page
navigation after installation.
2023-06-08 12:23:39 +08:00
wxiaoguang 31ab331b23
Remove incorrect HTML self close tag (#23748)
HTML is not XML.
2023-03-27 18:05:51 +02:00
wxiaoguang b2359f3df6
Fix various bugs for "install" page (#23194)
## TLDR

* Fix the broken page / broken image problem when click "Install"
* Close #20089
* Fix the Password Hash Algorithm display problem for #22942
* Close #23183
* Close #23184

## Details

### The broken page / broken image problem when click "Install"
(Redirect failed after install gitea #23184)

Before: when click "install", all new requests will fail, because the
server has been restarted. Users just see a broken page with broken
images, sometimes the server is not ready but the user would have been
redirect to "/user/login" page, then the users see a new broken page
(connection refused or something wrong ...)

After: only check InstallLock=true for necessary handlers, and sleep for
a while before restarting the server, then the browser has enough time
to load the "post-install" page. And there is a script to check whether
"/user/login" is ready, the user will only be redirected to the login
page when the server is ready.

### During new instance setup make 'Gitea Base URL' filled from
window.location.origin #20089

If the "app_url" input contains `localhost` (the default value from
config), use current window's location href as the `app_url` (aka
ROOT_URL)

### Fix the Password Hash Algorithm display problem for "Provide the
ability to set password hash algorithm parameters #22942"

Before: the UI shows `pbkdf2$50000$50`

<details>

![image](https://user-images.githubusercontent.com/2114189/221917143-e1e54798-1698-4fee-a18d-00c48081fc39.png)

</details>

After: the UI shows `pbkdf2`

<details>

![image](https://user-images.githubusercontent.com/2114189/221916999-97a15be8-2ebb-4a01-bf93-dac18e354fcc.png)

</details>

### GET data: net::ERR_INVALID_URL #23183

Cause by empty `data:` in `<link rel="manifest"
href="data:{{.ManifestData}}">`

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-03-04 10:12:02 +08:00
wxiaoguang e7ef94e00f
Introduce customized HTML elements, fix incorrect AppUrl usages in templates (#22861)
This PR follows:
* #21986
* #22831

This PR also introduce customized HTML elements, which would also help
problems like:
* #17760
* #21429
* #21440

With customized HTML elements, there won't be any load-search-replace
operations, and it can avoid page flicking (which @silverwind cares a
lot).

Browser support:
https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements

# FAQ

## Why the component has the prefix?

As usual, I would strongly suggest to add prefixes for our own/private
names. The dedicated prefix will avoid conflicts in the future, and it
makes it easier to introduce various 3rd components, like GitHub's
`relative-time` component. If there is no prefix, it's impossible to
introduce another public component with the same name in the future.

## Why the `custcomp.js` is loaded before HTML body? The `index.js` is
after HTML body.

Customized components must be registered before the content loading.
Otherwise there would be still some flicking.

`custcomp.js` should have its own dependencies and should be very light,
so it won't affect the page loading time too much.

## Why use `data-url` attribute but not use the `textContent`?

According to the standard, the `connectedCallback` occurs on the
tag-opening moment. The element's children are not ready yet.

## Why not use `{{.GuessCurrentOrigin $.ctx ...}}` to let backend decide
the absolute URL?

It's difficult for backend to guess the correct protocol(scheme)
correctly with zero configuration. Generating the absolute URL from
frontend can guarantee that the URL is 100% correct -- since the user is
visiting it.

# Screenshot

<details>

![image](https://user-images.githubusercontent.com/2114189/218256757-a267c8ba-3108-4755-9ae5-329f1b08f615.png)

</details>
2023-02-17 22:02:20 +08:00
Felipe Leopoldo Sologuren Gutiérrez 15c035775a
Add main landmark to templates and adjust titles (#22670)
* Add main aria landmark to templates
 * Adjust some titles to improve understanding of location in navigation

Contributed by @Forgejo
2023-02-01 22:56:10 +00:00
silverwind 24ad131221
Rename StaticUrlPrefix to AssetUrlPrefix (#15779)
Use a new name for this template/frontend variable to make it distinct
from the server variable StaticURLPrefix.
2021-05-08 16:27:25 +02:00
silverwind d848098f60
Enforce tab indentation in templates (#15289)
* Enforce tab indendation in templates

This adds editorconfig-checker [1] to lint the template files so they
conform the editorconfig files. I fixed all current identation issues
using the fix mode of eclint [2] and some manual corrections.

We can extend this linting to other files later, for now I'd like this
PR to focus on HTML template files only.

[1] https://github.com/editorconfig-checker/editorconfig-checker
[2] https://github.com/jedmao/eclint

* fix indendation

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-04-10 23:46:37 -04:00
silverwind b1cf7f4df1
Add class to page content to unify top margin (#13766)
* Add class to page content to unify top margin

Previously pages would individually set this margin but some didn't so
content would stick to the header without any space. Resolve this by
adding a new class that is added on all pages. The only place where we
remove this margin again is on the pages with menu or wrapper in the
header.

* fix admin notices

* fix team pages

* fix loading segment on gitgraph for arc-green

* fix last missing case

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-11-30 23:00:14 -05:00
zeripath 2f1353a2f3
Move install pages out of main macaron routes (#13195)
* Move install pages out of main macaron loop

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update templates/post-install.tmpl

Co-authored-by: Lauris BH <lauris@nix.lv>

* remove prefetch

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-10-19 17:03:08 -04:00