Commit graph

4753 commits

Author SHA1 Message Date
Earl Warren 33ede09135 Merge pull request '[PORT] Unify search boxes (gitea#29530)' (#2688) from snematoda/port-29530 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2688
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-24 05:33:13 +00:00
Gergely Nagy 3c57a62050
Restore the "repo.pulls.no_results" translation key
The previous (cherry picked) commit changed a translation key, from
`repo.pulls.no_results` to `common.no_results_found`. This would break
existing translations, and will have to be handled differently, if at
all.

This changes the affected code to continue using the old key.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 17:29:06 +01:00
HEREYUA 729849a2fd
Improve branch select list ui in go templates (#29729)
Relate:[#27417](https://github.com/go-gitea/gitea/issues/27471)
Reference:  [#26631](https://github.com/go-gitea/gitea/pull/26631)

Before

![image](https://github.com/go-gitea/gitea/assets/37935145/88ca8da5-25dd-4f60-bea8-a80107f19cc5)

After

![image](https://github.com/go-gitea/gitea/assets/37935145/3cb180dc-1331-43e9-8633-be5e288401e8)

---------

Co-authored-by: silverwind <me@silverwind.io>

(cherry picked from commit 2eb7c564df950fb96a1970559719003e979ff30a)
2024-03-23 17:29:06 +01:00
Earl Warren 012ed7019a Merge pull request '[port] Move all login and account creation page labels to be above inputs (gitea#29432)' (#2742) from algernon/forgejo:gitea/port/29432/move-some-labels-above-inputs into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2742
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 13:56:18 +00:00
Rafael Heard 3acea02eb6
Move all login and account creation page labels to be above inputs (#29432)
There are a few inconsistencies within Gitea and this PR addresses one
of them. This PR updates the sign-in page layout, including the register
and openID tabs, to match the layout of the settings pages
(/user/settings) for more consistency.

This PR updates the following routes:
`/user/login`
`/user/sign_up`
`/user/login/openid`
`/user/forgot_password`
`/user/link_account`
`/user/recover_account`

**Before**
<img width="968" alt="Screenshot 2024-02-05 at 8 27 24 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/fb0cb517-57c0-4eed-be1d-56f36bd1960d">

**After**
<img width="968" alt="Screenshot 2024-02-05 at 8 26 39 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/428d691d-0a42-4a67-a646-05527f2a7b41">

This PR addresses a revert of the original PR due to this
[comment](https://github.com/go-gitea/gitea/pull/28753#issuecomment-1956596817).

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
2024-03-23 12:36:12 +01:00
wxiaoguang eb4061baba
Move citiation button to proper place (#29374)
The citiation button shouldn't be controlled by
DisableDownloadSourceArchives (line 134)

So move it out of that "if" block.

Co-authored-by: Giteabot <teabot@gitea.io>
2024-03-23 11:58:54 +01:00
wxiaoguang 44221a3cd7
Customizable "Open with" applications for repository clone (#29320)
Users could customize the "clone" menu with their own application URLs on the admin panel.

Replace #22378
Close #21121
Close #22149
2024-03-23 11:58:54 +01:00
Gergely Nagy 3123725ff3
Revert "[GITEA] Configurable clone methods"
This reverts commit 1d8bca07f3.
2024-03-23 11:58:54 +01:00
0ko debeedfe42
Add plural support for PR subtitles 2024-03-22 07:11:24 +01:00
Shiny Nematoda 4a061ca26c simplify template 2024-03-20 12:31:36 +00:00
Shiny Nematoda ed15c92668 fixes for port 2024-03-20 12:31:36 +00:00
Denys Konovalov 847f03b6a6 Unify search boxes (#29530)
Unify all but a few search boxes to use uniform style, uniform
translations and shared templates where possible.
Remove a few duplicated search templates, e. g. code search.

<details><summary>Example after screenshots:</summary>

![grafik](https://github.com/go-gitea/gitea/assets/47871822/e20e7d6b-c6be-4a47-b132-672766f41421)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/d5b11b9c-c12f-4a29-8fb0-24e5aa511d18)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/d86bb444-36c7-426d-9cf1-c634963dffb1)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/a76c0319-0518-484a-a840-563d02b61198)

</details>

Also includes #29700

Co-authored-by: 6543 <6543@obermui.de>

---------

Co-authored-by: 6543 <m.huber@kithara.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
Conflicts:
	routers/web/repo/search.go
	templates/repo/home.tmpl
	templates/repo/search.tmpl
	templates/shared/repo_search.tmpl
2024-03-20 12:31:05 +00:00
Earl Warren 6d340bcfea Merge pull request 'Update look of repo/org tabs on homepage' (#2593) from 0ko/forgejo:hometab into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2593
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-20 11:45:17 +00:00
Earl Warren 84f33ead4e Merge pull request '[BUG] Reflect Cargo index state in settings' (#2698) from gusted/forgejo-cargo-index into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2698
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-20 11:38:26 +00:00
Gusted b06110715c Merge pull request 'Accessibility: Label Stars/Forks links in repo explore' (#2634) from fnetx/explore-label into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2634
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-20 08:20:32 +00:00
Gusted 461f925554
[BUG] Reflect Cargo index state in settings
- Currently in the Cargo section of the packages setting menu two
buttons are always shown, "Initalize index" and "Rebuild index", however
only of these should be shown depending on the state of the index, if
there's no index the "Initalize index" button should be shown and if
there's an index the "Rebuild index" button should be shown. This patch
does exactly that.
- Resolves #2628
2024-03-20 09:17:49 +01:00
Earl Warren 2f78daa3af Merge pull request '[gitea] week 12 cherry-pick' (#2679) from algernon/forgejo:wcp/week-12 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2679
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-20 08:15:06 +00:00
Yarden Shoham a1bdf214ab
Fix for attribute not pointing to the ID of the color picker (#29813)
It didn't include the word picker.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 3b6e57273ae3fbefefd60daa0f826b0b3d15cf27)
2024-03-20 08:46:29 +01:00
silverwind ca39d74363
Fix Citation modal responsiveness and clipboard copy (#29799)
The modal was broken in two ways:

- On small screens, the input box was partially hanging outside the
modal. Fixed with flexbox and increased modal width.
- The clipboard copy was not working because the modal had both
`data-clipboard-text` and `data-clipboard-target`, while we only support
one of those. Made a small tweak in clipboard as well so that it will
still fall back to target if text is empty.

(cherry picked from commit 94512ee0628dc0d2b697441a4355ace54b6515cd)
2024-03-20 08:46:29 +01:00
silverwind 5a16c9d9c0
Add <overflow-menu>, rename webcomponents (#29400)
1. Add `<overflow-menu>` web component
2. Rename `<gitea-origin-url>` to `<origin-url>` and make filenames
match.

<img width="439" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/2fbe4ca4-110b-4ad2-8e17-c1e116ccbd74">

<img width="444" alt="Screenshot 2024-03-02 at 21 36 52"
src="https://github.com/go-gitea/gitea/assets/115237/aa8f786e-dc8c-4030-b12d-7cfb74bdfd6e">

<img width="537" alt="Screenshot 2024-03-03 at 03 05 06"
src="https://github.com/go-gitea/gitea/assets/115237/fddd50aa-adf1-4b4b-bd7f-caf30c7b2245">

![image](https://github.com/go-gitea/gitea/assets/115237/0f43770c-834c-4a05-8e3d-d30eb8653786)

![image](https://github.com/go-gitea/gitea/assets/115237/4b4c6bd7-843f-4f49-808f-6b3aed5e9f9a)

TODO:

- [x] Check if removal of `requestAnimationFrame` is possible to avoid
flash of content. Likely needs a `MutationObserver`.
- [x] Hide tippy when button is removed from DOM.
- [x] ~~Implement right-aligned items
(https://github.com/go-gitea/gitea/pull/28976)~~. Not going to do it.
- [x] Clean up CSS so base element has no background and add background
via tailwind instead.
- [x] Use it for org and user page.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 256a1eeb9a67b18c62a10f5909b584b7b220848a)

Conflicts:
	options/locale/locale_en-US.ini
	templates/package/content/cargo.tmpl
	templates/package/content/cran.tmpl
	templates/package/content/debian.tmpl
	templates/package/content/maven.tmpl
2024-03-20 08:46:29 +01:00
yp05327 ed1798f66d
Improve commit record's ui in comment list (#26619)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/795f9941-9989-4045-b0fc-d6dd0262269b)

![image](https://github.com/go-gitea/gitea/assets/18380374/f6505f5e-4248-456e-a98d-e714c6484b2f)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/321dda1e-6999-4851-afff-2e6c8d20367b)

![image](https://github.com/go-gitea/gitea/assets/18380374/182f18d1-2295-4004-852b-c0ebb498b411)

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit ce085b26fc5076b36c55e6a0a30ba8f11105c0bf)
2024-03-20 08:46:29 +01:00
wxiaoguang 071d871dcf
Fix incorrect locale Tr for gpg command (#29754)
(cherry picked from commit df60dbfb9918081962614d063485337fb42e0ee7)
2024-03-20 08:46:29 +01:00
silverwind f98211f13a
Fix date rendering by adding <gitea-absolute-date> (#29725)
Alternative to: https://github.com/go-gitea/gitea/pull/29698
Fixes: https://github.com/go-gitea/gitea/issues/29034

<img width="278" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/12ecd967-2723-410d-8a28-a1b0f41b7bba">

It also fixes a secondary issue that we were showing timestamp tooltips
over date, which makes no sense, so these are now gone as well:

<img width="284" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/a70432f3-97b6-41e6-b202-b53b76924a66">

(cherry picked from commit 857243bed7f9dccdc597c2941df41e821781cb0f)
2024-03-20 08:46:28 +01:00
pengqiseven e825d007b1
remove repetitive words (#29695)
Signed-off-by: pengqiseven <912170095@qq.com>
(cherry picked from commit 7f856d5d742dcb6febdb8a3f22cd9a8fecc69a4d)
2024-03-20 08:46:28 +01:00
0ko 26e4af4268
Fix heatmap localization
Fixes #2552

(cherry picked from commit 708f4bc3b6)
2024-03-20 08:20:08 +01:00
Earl Warren ba75514887
Revert "Fix heatmap localization"
It conflicts with unmerged translations.

This reverts commit 708f4bc3b6.
2024-03-20 07:31:23 +01:00
Otto Richter 9e69ef9c51 Label stars/forks link in repo explore 2024-03-19 23:38:08 +01:00
Gusted 9551c1a6f8
[BUG] Fix manual merge button
- Add `form-fetch-action` to indicate that this form POST to an link
that returns JSON and thus should be handled by Javascript code.
- Found by @fnetx
- Regression of https://codeberg.org/forgejo/forgejo/pulls/1793
2024-03-19 18:47:09 +01:00
Gusted 7cfdd51dd9 Merge pull request 'Use separate keys for tabs on login screen' (#2630) from 0ko/forgejo:signintabs into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2630
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-19 14:56:03 +00:00
Earl Warren 2c80727e8f Merge pull request 'Plurals and translations for heatmap' (#2612) from 0ko/forgejo:oneisone into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2612
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-19 13:24:12 +00:00
0ko 708f4bc3b6 Fix heatmap localization
Fixes #2552
2024-03-19 14:37:03 +05:00
Earl Warren e05396fcdd Merge pull request 'Fixes for project selector in sidebar' (#2608) from 0ko/forgejo:projectsfix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2608
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-19 08:16:42 +00:00
Earl Warren c16866d4a5 Merge pull request 'English fixes and improvements' (#2631) from 0ko/forgejo:english20240311 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2631
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-19 08:09:27 +00:00
Gusted b90fda395a
[BUG] Make write and preview tabs interactive
- Make the 'Write' and 'Preview' tabs of the markdown editor interactive
by adding `href="#"`, this causes it to appear in the document order and
that while focused pressing `Enter` fires a click event (which isn't the
case by doing `tabindex="0"`).
- Resolves #2675
2024-03-17 23:38:10 +01:00
0ko 4c1af0d9a6 [I18N] Fix capitalization in English and reword a few strings
fixes #2551
2024-03-17 21:04:11 +05:00
Gusted cd7cdf06ed Merge pull request 'Fix milestone sorting translation keys' (#2644) from 0ko/forgejo:fix-the-sort-milestones-bug-noone-have-noticed-in-a-half-of-a-year into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2644
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-03-14 19:06:59 +00:00
0ko ec5c68da4f [I18N] Use separate keys for tabs on login screen 2024-03-13 21:03:09 +05:00
0ko e2394222b2 [BUG] Fix milestone sorting translation keys 2024-03-12 22:04:44 +05:00
Chongyi Zheng 1b48084e59
Fix action runner offline label padding (#29691)
Before:

The `offline` padding is `calc(.833em - 1px)` from `basic` CSS class,
but `idle` padding is `6px`.

<img width="1035" alt="image"
src="https://github.com/go-gitea/gitea/assets/37034805/ccb42615-20d7-4032-a805-40cd9643012d">

After:

<img width="1035" alt="image"
src="https://github.com/go-gitea/gitea/assets/37034805/d6af99c8-76cb-4850-96d6-5289b06e1ca8">

(cherry picked from commit a192a5ed99c2a244d0f015d62088642eb5a81d75)
2024-03-11 23:37:00 +07:00
silverwind 0802784744
Replace more gt- with tw- (#29678)
This will conclude the trivial class replacements.

(cherry picked from commit 82e102f8b09faf1ac2786ccad36d4a20fcb392b8)
2024-03-11 23:36:59 +07:00
Tim-Niclas Oelschläger 1090734255
Filter for default-branch selection (#29388)
Filter for default-branch selection (fixes #4751)

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/dcae266d-2e04-41bf-8739-64a85c9007f6)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/5f27c0a7-1d30-4ccd-b4bb-6c34fff1b79f)

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit c8f4897f7f5de5b391be806f4738de1f0d9c4c09)
2024-03-11 23:36:59 +07:00
oliverpool 53f6f62ad4
Store webhook event in database (#29145)
Refactor the webhook logic, to have the type-dependent processing happen
only in one place.

---

1. An event happens
2. It is pre-processed (depending on the webhook type) and its body is
added to a task queue
3. When the task is processed, some more logic (depending on the webhook
type as well) is applied to make an HTTP request

This means that webhook-type dependant logic is needed in step 2 and 3.
This is cumbersome and brittle to maintain.

Updated webhook flow with this PR:
1. An event happens
2. It is stored as-is and added to a task queue
3. When the task is processed, the event is processed (depending on the
webhook type) to make an HTTP request

So the only webhook-type dependent logic happens in one place (step 3)
which should be much more robust.

- the raw event must be stored in the hooktask (until now, the
pre-processed body was stored)
- to ensure that previous hooktasks are correctly sent, a
`payload_version` is added (version 1: the body has already been
pre-process / version 2: the body is the raw event)

So future webhook additions will only have to deal with creating an
http.Request based on the raw event (no need to adjust the code in
multiple places, like currently).

Moreover since this processing happens when fetching from the task
queue, it ensures that the queuing of new events (upon a `git push` for
instance) does not get slowed down by a slow webhook.

As a concrete example, the PR #19307 for custom webhooks, should be
substantially smaller:
- no need to change `services/webhook/deliver.go`
- minimal change in `services/webhook/webhook.go` (add the new webhook
to the map)
- no need to change all the individual webhook files (since with this
refactor the `*webhook_model.Webhook` is provided as argument)

(cherry picked from commit 26653b196bd1d15c532af41f60351596dd4330bd)

Conflicts:
	services/webhook/deliver_test.go
	trivial context conflict
2024-03-11 23:36:59 +07:00
Yarden Shoham 6403d5fca7
Remove jQuery AJAX from the repo editor (#29636)
# Preview Tab
- Removed the jQuery AJAX call and replaced with our fetch wrapper
- Tested the preview tab functionality and it works as before

# Diff Tab
- Removed the jQuery AJAX call and replaced with htmx
- Tested the diff tab functionality and it works as before

## htmx Attributes
- `hx-post="{{.RepoLink}}..."`: make a POST request to the endpoint
- `hx-indicator=".tab[data-tab='diff']"`: attach the loading indicator
to the tab body
- `hx-target=".tab[data-tab='diff']"`: target the tab body for swapping
with the response
- `hx-swap="innerHTML"`: swap the target's inner HTML
- `hx-include="#edit_area"`: include the value of the textarea (content)
in the request body
- `hx-vals='{"context":"{{.BranchLink}}"}'`: include the context in the
request body
- `hx-params="context,content"`: include only these keys in the request
body

# Demo using `fetch` and `htmx` instead of jQuery AJAX

![demo](https://github.com/go-gitea/gitea/assets/20454870/585cd6e8-f329-4c9e-ab53-a540acbd7988)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit c1331d1f7ab60249ed2f080b24f3e32093fa708d)
2024-03-11 23:36:59 +07:00
yp05327 ee4443c998
Fix wrong header of org project view page (#29626)
Follow #29248

The project view page still using `user/overview/header.tmpl`

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/9cb638a3-7cc6-4efa-979a-e2592007fd12)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/62b0b2ea-8cb0-459f-b27a-bad3908eb1c0)

(cherry picked from commit c6cc392b55b71ae1787e86e75b7121c3769adcbe)
2024-03-11 23:36:58 +07:00
Earl Warren 60aa763c51
templates: remove superfluous SanitizeHTML
Introduced by Rename Str2html to SanitizeHTML and clarify its behavior (followup)
2024-03-11 23:36:58 +07:00
silverwind 907c3d0c20
Replace more gt- with tw-, update frontend docs (#29595)
Tested a few things, all working fine. Not sure if the chinese machine
translation is good.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 7e8c1c5ba18e1ac8861f429b825163b8210fd178)

Conflicts:
	docs/content/contributing/guidelines-frontend.zh-cn.md
	Gitea docs
2024-03-11 23:36:58 +07:00
wxiaoguang 5f65028312
Remove unnecessary ctxData for "attachments" template (#29600)
The "attachments" template never uses it

(cherry picked from commit 3e84bfdf410ec1fdf22711156d729e51d7355a8e)
2024-03-11 23:36:58 +07:00
Lunny Xiao 145bebc829
Make admin pages wider because of left sidebar added and some tables become too narrow (#29581)
Fix #25939

screenshots

<img width="1895" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/937eb28d-bb7d-4765-b580-bc991d61f467">

(cherry picked from commit fad232054542ade88268304fea9b09f778d74a29)
2024-03-11 23:36:58 +07:00
wxiaoguang a44805e5b3
Remove unnecessary SanitizeHTML from code (#29575)
* "mail/issue/default.tmpl": the body is rendered by backend
`markdown.RenderString() HTML`, it has been already sanitized
* "repo/settings/webhook/base_list.tmpl": "Description" is prepared by
backend `ctx.Tr`, it doesn't need to be sanitized

(cherry picked from commit dae7f1ebdbe19620f40e110b285f7c0ecd0bb33b)
2024-03-11 23:36:58 +07:00
wxiaoguang 3c05986fcf
Fix incorrect package link method calls in templates (#29580)
Fix #29562
Follow  #29531

(cherry picked from commit 7ec4c65ea5d5a3765d24ee68ae421f2f911b6b5d)
2024-03-11 23:36:57 +07:00