Commit graph

11 commits

Author SHA1 Message Date
Caesar Schinas f0835feaff
[BRANDING] Custom loading animation for Forgejo
(cherry picked from commit a3b3b8a2df)
(cherry picked from commit de0fd2d2e4)
(cherry picked from commit e1bf4de211)
(cherry picked from commit 60ffc88a47)
(cherry picked from commit 7d2beea9ca)
(cherry picked from commit 171eadb952)
(cherry picked from commit 5e81f75ed2)

Conflicts:
	templates/install.tmpl
	templates/post-install.tmpl
	templates/repo/migrate/migrating.tmpl
(cherry picked from commit 641c4a36c5)
(cherry picked from commit f1dbb2dcff)
(cherry picked from commit b66de5e531)
(cherry picked from commit eeccdf21a1)
(cherry picked from commit af37663f4d)
(cherry picked from commit ed3739dccb)
(cherry picked from commit f0036e37cf)
(cherry picked from commit 90d453898a)
(cherry picked from commit c011543238)
(cherry picked from commit a294f34165)
(cherry picked from commit cc00759140)
(cherry picked from commit abe6d83b85)
(cherry picked from commit 274d286339)
(cherry picked from commit 594aaf3c95)
(cherry picked from commit 6059a376f4)
(cherry picked from commit 676eb49a12)
(cherry picked from commit fc834fdb86)
(cherry picked from commit e1e89a4349)
(cherry picked from commit 89e0d29cdb)
(cherry picked from commit eb7fc7a27e)
(cherry picked from commit caa41ff629)
(cherry picked from commit a74b6adb6a)
(cherry picked from commit 4fc629b0d4)
(cherry picked from commit 66a3fb5dcd)
(cherry picked from commit b26ec6315a)
(cherry picked from commit 8d9d4d6f6b)
(cherry picked from commit aa8e866656)
(cherry picked from commit 78a3b95bda)
(cherry picked from commit bdeff07606)
(cherry picked from commit 47ffb47822)
(cherry picked from commit fa7dc92f2a)
(cherry picked from commit 2a7c8466a7)
(cherry picked from commit e940e6c6a4)
(cherry picked from commit b3504e3790)
(cherry picked from commit 7cc5646dcc)
(cherry picked from commit 5116eb2c66)
(cherry picked from commit 5ede0a190f)
(cherry picked from commit 0263de4160)
(cherry picked from commit 61e100f903)
(cherry picked from commit 4a3967a289)
(cherry picked from commit f43115c5cb)
(cherry picked from commit f8ced21044)
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