Commit graph

4929 commits

Author SHA1 Message Date
Giteabot
4c5e4e672d
Show lock owner instead of repo owner on LFS setting page (#31788) (#31817)
Backport #31788 by @wolfogre

Fix #31784.

Before:

<img width="1648" alt="image"
src="https://github.com/user-attachments/assets/03f32545-4a85-42ed-bafc-2b193a5d8023">

After:

<img width="1653" alt="image"
src="https://github.com/user-attachments/assets/e5bcaf93-49cb-421f-aac1-5122bc488b02">

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit a39fe5325266f1c079e0e54abc68e6470764eb44)

Conflicts:
	models/git/lfs_lock.go
  trivial context conflict
2024-08-18 07:01:03 +02:00
Gusted
bcc1e17775 [UI] Show AGit label on merged PR
- The label wasn't show on merged PRs.
- Integration test added

(cherry picked from commit 358ec8002e)
2024-07-29 14:23:45 +00:00
Gusted
88426b578f [UI] Fix scoped-access-token
- Regression of #4571
- Refactor to not use the component API of Vue. The root cause is still
unknown.

(cherry picked from commit aa5163d5c4)
2024-07-24 21:35:59 +00:00
Beowulf
f7499dd7c4
[v7.0/forgejo] Fix label selector popup width (issue creation)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/4551

This aligns the popup width of the label selector during issue creation
to the width of the label selector in an already created issue.

(The inherited width from "ui form" is reset to prevent width: 100% on the
input element in the search box.)

This is a follow-up to https://codeberg.org/forgejo/forgejo/pulls/4546

(cherry picked from commit b32a03531c)
2024-07-23 00:55:27 +02:00
0ko
2dc87d389d
[v7.0/forgejo] ui: fix issue labels
* Fixes https://codeberg.org/forgejo/forgejo/issues/4522
* Fixes https://codeberg.org/forgejo/forgejo/issues/4522#issuecomment-2095542
* Fixes https://codeberg.org/forgejo/forgejo/issues/4544
* Fixes regression of https://codeberg.org/forgejo/forgejo/pulls/4486
* Fixes regression of some cherry-pick
* Fixes an overflow that wasn't even reported

* Revert changes done in https://codeberg.org/forgejo/forgejo/pulls/4486.
* Apply changes proposed in https://codeberg.org/forgejo/forgejo/issues/3875#issuecomment-1840611.
* Introduce new label `ugc-labels` to mark ui labels that are named by
users and therefore need special care. Currently the generic label
classes are used for too many things to work with them directly without
affecting other UI.
2024-07-23 00:53:32 +02:00
Beowulf
e45c409c20
Remove APA as cite format
This removes APA as cite format, because it depends on an copyleft
dependency (https://github.com/Juris-M/citeproc-js).

(cherry picked from commit 7dc0b2bab6)
2024-07-20 17:57:21 +02:00
Gusted
f45928e608
[UI] Replace vue-bar-graph with chart.js
- Backport of #4571
- The usage of the `vue-bar-graph` is complicated, because of the `GSAP`
dependency they pull in, the dependency uses a non-free license.
- The code is rewritten to use the `chart.js` library, which is already
used to draw other charts in the activity tab. Due to the limitation of
`chart.js`, we have to create a plugin in order to have images as labels
and do click handling for those images.
- The chart isn't the same as the previous one, once again simply due to
how `chart.js` works, the amount of commits isn't drawn anymore in the
bar, you instead have to hover over it or look at the y-axis.
- Resolves #4569

(cherry picked from commit a83002679d)
2024-07-20 14:56:25 +02:00
Gusted
b2d3ae4dc0 [UI] Remove unnecessary vertical space in empty labels list
- Don't show the labels-list element, if no labels are selected.
- The labels-list was taking up vertical space, even if no labels were
selected which caused an inconsistency in how the sidebar looked.
- Adds integration test

(cherry picked from commit 013b89eb13)
2024-07-14 14:40:50 +00:00
Beowulf
a580dcc7aa Fix AGit checkout instruction
The checkout instruction for pull requests created with the AGit
workflow where incorrect.

(cherry picked from commit 0a5fa31edb)
2024-07-13 18:27:51 +00:00
Kwonunn
e551bed57f Fix: Name conan remote forgejo
(cherry picked from commit 6efaf155d9)
2024-07-12 13:28:14 +00:00
Earl Warren
4010232452 Merge pull request '[v7.0/forgejo] [accessibility] Anchor elements' missing href added' (#4422) from bp-v7.0/forgejo-0996828 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4422
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-07-09 12:25:59 +00:00
Gusted
46115041b8 [BUG] Fix mobile UI for organisation creation
- Don't make checkpoints or radio inputs full width on a small screen,
these obviously shouldn't try to take up the whole width of a container.
- Wrap the label for organisation permission box inside a `<span
class="inline field">`, so it gets a left-margin from the `.inline.field
> :first-child` selector. This make the checkboxes and radio buttons
groups look indented from the left.
- Resolves #4361

(cherry picked from commit 610487eb83)
2024-07-08 18:48:58 +00:00
banaanihillo
b27ff92352 accessibility: anchor elements' missing href added (#4375)
Add an empty hash `href="#"` attribute to anchors that did not yet have any `href` attribute, as a quick work-around to make those elements possible to interact with via keyboard. See discussion on linked issue (https://codeberg.org/forgejo/forgejo/issues/4273) for more information on how the button-like elements like this could eventually be improved even more.

Fixes https://codeberg.org/forgejo/forgejo/issues/4273.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4375
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: banaanihillo <banaanihillo@noreply.codeberg.org>
Co-committed-by: banaanihillo <banaanihillo@noreply.codeberg.org>
(cherry picked from commit 099682892b)
2024-07-08 17:37:32 +00:00
0ko
d3a0eb3bdd ui: fix wrong string used in a search box (#4258)
Resolves https://codeberg.org/forgejo/forgejo/issues/4256.
Fixes regression caused by https://github.com/go-gitea/gitea/pull/29530/files#diff-b46ae540c8eb41d1ccaa1659489fcc47d72eee4c4f04dc83c5ccf4d6d1a3395eR45.

Preview:
Before - https://codeberg.org/forgejo/forgejo/attachments/d629f2e9-0d07-4719-9250-52d3ba9f4a9e
After - https://codeberg.org/forgejo/forgejo/attachments/6a5f5cb2-124d-4673-a387-8483125a89eb

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4258
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
(cherry picked from commit 28ceec6fad)
2024-06-28 16:29:11 +00:00
Gusted
dc228b4734 [SWAGGER] Make it consistent with reality
- Make the `UserSettings` definition an non-array, this is consistent
with the existing endpoints that uses this definition.
- Resolves #4179

(cherry picked from commit 5926ed1f73)
2024-06-19 06:40:17 +00:00
wxiaoguang
7b443b6b54 Fix Activity Page Contributors dropdown (#31264)
Fix #31261

(cherry picked from commit e728fd741be7848d476663eec1c9caaf34b46e61)
(cherry picked from commit 35447463ba)
2024-06-18 19:42:31 +00:00
0ko
e997cbc8d5 Rename repo_updated to repo_updated_v7 to prevent regressions (#4117)
Currently this string has different amount of placeholders in v8 and v7 because https://codeberg.org/forgejo/forgejo/pulls/3837 was not backported to v7.

### The problem

This string is currently [not translated](https://translate.codeberg.org/translate/forgejo/forgejo/en/?checksum=405b09ee2c2371d4) in every language. For example, when UI is in Slovenian, it would be in English.
But if someone translates it into Slovenian, it will be something like `Posodobljen %s`. Then we merge the Weblate PR, @forgejo-backport-action creates a backport and we forget to check this backport for presence of `repo_updated`. We ship this as a point release of our LTS v7, and then Slovenian users will literally see `Posodobljen %s` in the UI instead of `Posodobljen včeraj`.

By renaming this key in v7 we protect it from these kinds of regressions.

### Test

Go to Explore, look at repo entries, they should contain relative time.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4117
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-06-14 13:26:46 +00:00
Earl Warren
f132e98d12 Merge pull request '[gitea] week 2024-24-v7.0 cherry pick (release/v1.22 -> v7.0/forgejo)' (#4084) from earl-warren/wcp/2024-24-v7.0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4084
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-06-11 10:37:57 +00:00
forgejo-backport-action
6c570bc3bd [v7.0/forgejo] Org buttons add missing vertical padding (#4088)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/3964

This adds the missing vertical padding between the new repository and new migration button.

| Before | After (btns horizontal) | After (btns vertical) |
| -- | -- | -- |
| ![](/attachments/4f74c5c5-ccc7-4b57-936b-09e3a226c170) | <img width="293" alt="grafik" src="/attachments/560a0e85-3453-4357-bca0-75b1cbdfe658">  | <img width="284" alt="grafik" src="/attachments/2be0383b-2d44-48ef-8a35-1bd143ef044c"> |

## Manual test steps:

- Open org page
- Resize window
- Check padding

Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4088
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2024-06-11 06:26:07 +00:00
wxiaoguang
816e77485f
Fix some URLs whose sub-path is missing (#31289)
Fix #31285

(cherry picked from commit 0188d82e4908eb173f7203d577f801f3168ffcb8)

Conflicts:
	templates/user/settings/applications.tmpl
(cherry picked from commit 3723d8c32059a571b84dc8636cb3649be6e6f1b3)

Conflicts:
	templates/user/settings/applications.tmpl
	trivial context conflict <i> vs <p>

(cherry picked from commit bbe98a3254e65eb8b9ec8fddf5e0ffe416a96614)
2024-06-09 12:05:43 +02:00
Giteabot
67fd0cea1b
Optimize runner-tags layout to enhance visual experience (#31258) (#31263)
Backport #31258 by @kerwin612

![image](https://github.com/go-gitea/gitea/assets/3371163/b8199005-94f2-45be-8ca9-4fa1b3f221b2)

Co-authored-by: Kerwin Bryant <kerwin612@qq.com>
(cherry picked from commit 83cf348e07fa83070d8a50d7d96943de08104fd4)
2024-06-09 11:57:05 +02:00
Giteabot
9f89724324
Fix overflow on push notification (#31179) (#31238)
Backport #31179 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/30063

<img width="1301" alt="Screenshot 2024-05-30 at 14 43 24"
src="https://github.com/go-gitea/gitea/assets/115237/00443af0-088d-49a5-be9e-8c9adcc2c01d">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 331c32f9b680f0e25efe5d48ec57dfc1db194adf)
2024-06-09 11:48:07 +02:00
Giteabot
568300cf6b
Remove .segment from .project-column (#31204) (#31239)
Backport #31204 by @silverwind

Using `.segment` on the project columns is a major abuse of that class,
so remove it and instead set the border-radius directly on it.

Fixes: https://github.com/go-gitea/gitea/issues/31129

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 298d05df3b79634a0364926f34fb02b73d442c31)
2024-06-09 11:47:34 +02:00
Giteabot
5a2904166e
Fix overflow on notifications (#31178) (#31237)
Backport #31178 by @silverwind

Fixes https://github.com/go-gitea/gitea/issues/31170.

<img width="1312" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/627711ed-93ca-4be6-b958-10d673ae9517">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 85a81767083efd49bf675b3de30de5421ab2ae69)
2024-06-09 11:46:37 +02:00
Zettat123
d841e95191
Return access_denied error when an OAuth2 request is denied (#30974)
According to [RFC
6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1),
when the resource owner or authorization server denied an request, an
`access_denied` error should be returned. But currently in this case
Gitea does not return any error.

For example, if the user clicks "Cancel" here, an `access_denied` error
should be returned.

<img width="360px"
src="https://github.com/go-gitea/gitea/assets/15528715/be31c09b-4c0a-4701-b7a4-f54b8fe3a6c5"
/>

(cherry picked from commit f1d9f18d96050d89a4085c961f572f07b1e653d1)
(cherry picked from commit 886a675f62)
2024-06-05 17:19:22 +02:00
Giteabot
e04b490cf6
Fix overflow in issue card (#31203) (#31225)
Backport #31203 by @silverwind

Before:

<img width="373" alt="Screenshot 2024-06-01 at 01 31 26"
src="https://github.com/go-gitea/gitea/assets/115237/82a210f2-c82e-4b7e-ac43-e70e46fa1186">

After:
<img width="376" alt="Screenshot 2024-06-01 at 01 31 32"
src="https://github.com/go-gitea/gitea/assets/115237/82d1b9f7-4fad-47bd-948a-04e1e7e006e6">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 0328f31fdc9b82efe7110cd2107628c2004e5be4)
2024-06-03 17:41:13 +02:00
0ko
af49331f38 Revert "Fix error on renaming merged PRs (#3840)"
This reverts commit 0b01434aa3.
2024-06-02 13:38:00 +05:00
Earl Warren
6bb1b001f9 Merge pull request '[gitea] week 2024-21-v7.0 cherry pick (release/v1.22 -> v7.0/forgejo)' (#3859) from earl-warren/wcp/2024-21-v7.0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3859
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-05-24 19:59:51 +00:00
wxiaoguang
1fd1100ac9
Simplify mirror repository API logic (#30963)
Fix #30921

(cherry picked from commit 821d2fc2a3cc897f21d707455850177077b72410)
(cherry picked from commit 50b4e7f26e)

Equivalent to the Gitea v1.22 commit
(cherry picked from commit 8eac16de217978c1f7034f8e360f54d8d638e95e)
2024-05-24 15:15:07 +02:00
wxiaoguang
d3b4f9d326 Fix incorrect "blob excerpt" link when comparing files (#31013)
When comparing files between the base repo and forked repo, the "blob
excerpt" link should point to the forked repo, because the commit
doesn't exist in base repo.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit f48cc501c46a2d34eb701561f01d888d689d60d5)

Conflicts:
	- templates/repo/diff/section_split.tmpl
	- templates/repo/diff/section_unified.tmpl
          Resolved the conflict by picking Gitea's change over ours, and
	  porting it.
	- tests/integration/compare_test.go
	  Kept our test, but picked the "compare all of the relevant
	  links" part of the Gitea test.
(cherry picked from commit a62a887649)
2024-05-24 12:45:35 +00:00
0ko
0b01434aa3 Fix error on renaming merged PRs (#3840)
Closes https://codeberg.org/forgejo/forgejo/issues/3743.

This is a simple fix for https://codeberg.org/forgejo/forgejo/issues/3743, based on changes in [gitea#30990](https://github.com/go-gitea/gitea/pull/30990), which was not included in https://codeberg.org/forgejo/forgejo/pulls/3838 due to large code differences.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3840
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
(cherry picked from commit 3351ce2bc5)
2024-05-19 18:20:50 +00:00
Earl Warren
f7e9db75c4 Merge pull request '[v7.0/forgejo] Port: Fix some UI problems (install) (gitea#30854)' (#3799) from bp-v7.0/forgejo-c16ae1a into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3799
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-16 15:39:08 +00:00
Earl Warren
4ecbb2ef1b Merge pull request '[gitea] week 2024-20-v7.0 cherry pick (release/v1.22 -> v7.0/forgejo)' (#3772) from earl-warren/wcp/2024-20-v7.0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3772
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-05-16 15:36:08 +00:00
forgejo-backport-action
7a8b2d8eb8 [v7.0/forgejo] Improve base locale related to settings and accounts (#3742)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/3733

- general English improvements
- separated the header of Language part in user settings into a new string for better translatability
- made that header contain "Default", just like the theme one, because this is how this actually works: the bottom selector saves the language temporarily, the selector in the settings saves it permanently. Not many users know about this difference. This clarification will help some
- removed some of "Manage" from the headers where they aren't really needed. This improves the consistency with some other headers

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3742
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2024-05-16 14:15:33 +00:00
wxiaoguang
4feb183d91 Fix some UI problems (install) (#30854)
(cherry picked from commit ce8b11ae131bef6cd7df0849ed39da7984953a4b)
(cherry picked from commit c16ae1ab39)
2024-05-16 13:22:15 +00:00
Frank Villaro-Dixon
aefe770255 template: label fix correct input id
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
(cherry picked from commit 208eed05ff)
2024-05-16 10:16:28 +00:00
Giteabot
10a9b6b806
Fix some UI regressions for commit list (#30920) (#30937)
Backport #30920 by wxiaoguang

Close #30919

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 94c5a30c8bd2ae78ffd7bd3b39bee019c531e1e7)
2024-05-14 16:14:38 +02:00
silverwind
6917b25ad3
Fix and tweak pull request commit list (#30528)
Fixes https://github.com/go-gitea/gitea/issues/30493, regression from
https://github.com/go-gitea/gitea/pull/30374.

Also did the flexbox convertion as suggested by the existing comment.

<img width="850" alt="Screenshot 2024-04-16 at 22 28 48"
src="https://github.com/go-gitea/gitea/assets/115237/e8905944-620a-4211-b5c5-53ed3b3ee23e">

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 311f5261cdb23b46d3f510e40fd4e2ac06e376c0)
(cherry picked from commit eea7ea9d0a)
2024-05-14 16:14:14 +02:00
Lunny Xiao
d91839692f
Fix various problems around projects board view (#30696)
The previous implementation will start multiple POST requests from the
frontend when moving a column and another bug is moving the default
column will never be remembered in fact.

- [x] This PR will allow the default column to move to a non-first
position
- [x] And it also uses one request instead of multiple requests when
moving the columns
- [x] Use a star instead of a pin as the icon for setting the default
column action
- [x] Inserted new column will be append to the end
- [x] Fix #30701 the newly added issue will be append to the end of the
default column
- [x] Fix when deleting a column, all issues in it will be displayed
from UI but database records exist.
- [x] Add a limitation for columns in a project to 20. So the sorting
will not be overflow because it's int8.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a303c973e0264dab45a787c4afa200e183e0d953)

Conflicts:
	routers/web/web.go
	e91733468ef726fc9365aa4820cdd5f2ddfdaa23 Add missing database transaction for new issue (#29490) was not cherry-picked
	services/issue/issue.go
	fe6792dff3 Enable/disable owner and repo projects independently (#28805) was not cherry-picked
(cherry picked from commit 7d3ca90dfe)

(cherry picked from commit 084bec89ed7ae0816fc2d8db6784ad22523d1fc4)
2024-05-14 15:51:15 +02:00
silverwind
9934931f1f
[PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs
1. The previous color contrast calculation function was incorrect at
least for the `#84b6eb` where it output low-contrast white instead of
black. I've rewritten these functions now to accept hex colors and to
match GitHub's calculation and to output pure white/black for maximum
contrast. Before and after:
<img width="94" alt="Screenshot 2024-04-02 at 01 53 46"
src="https://github.com/go-gitea/gitea/assets/115237/00b39e15-a377-4458-95cf-ceec74b78228"><img
width="90" alt="Screenshot 2024-04-02 at 01 51 30"
src="https://github.com/go-gitea/gitea/assets/115237/1677067a-8d8f-47eb-82c0-76330deeb775">

2. Fix project-related issues:

- Expose the new `ContrastColor` function as template helper and use it
for project cards, replacing the previous JS solution which eliminates a
flash of wrong color on page load.
- Fix a bug where if editing a project title, the counter would get
lost.
- Move `rgbToHex` function to color utils.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>

---
Conflict resolution: Trivial.
(cherry picked from commit 36887ed3921d03f1864360c95bd2ecf853bfbe72)
(cherry picked from commit f6c0c39f1a)
2024-05-14 15:50:47 +02:00
Earl Warren
98afc8fcdb Merge pull request '[v7.0/forgejo] Expand code diffs against the commits repo' (#3767) from bp-v7.0/forgejo-220c3fe into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3767
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 12:42:18 +00:00
forgejo-backport-action
0dc681ed13 [v7.0/forgejo] Improve translatability of "Transfer ownership" (#3750)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/3739

This text can have different forms in other languages depending on context.

The commit also contains a change to .editorconfig to prevent EoF changes when mass-replacing strings, as that causes unintentional merge conflicts with Weblate.

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3750
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2024-05-14 12:14:36 +00:00
Gergely Nagy
dc13eecc04 Expand code diffs against the commits repo
When expanding code diffs, the expansion should search for more context
in the commits repo, rather than in the repo in context, because the
commit may not be available in the base repo. For example, when
previewing a pull request, the commit is not in the target repo yet -
it's in the fork.

Fixes #3746.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 220c3fe3b3)
2024-05-14 12:06:44 +00:00
Earl Warren
8b86b6f1a0 Rename Str2html to SanitizeHTML and clarify its behavior (followup) (take 2)
In
  801792e4dc Rename Str2html to SanitizeHTML and clarify its behavior (followup)
the replacement was incorrect because
  c9d0e63c20  Remove unnecessary "Str2html" modifier from templates
was not applied and Str2html should have not been present in the first
place.

Fixes: https://codeberg.org/forgejo/forgejo/issues/3554
(cherry picked from commit 337f4f9d87)
2024-05-13 18:38:48 +00:00
0ko
9673355bf3 Port "Fix project name wrapping, remove horizontal margin on header"
Port of 370b1bdb37.
2024-05-12 17:37:36 +05:00
Gergely Nagy
00cfe9aef9 templates: Be more forgiving about missing package metadata
When rendering templates for packages, be more forgiving about missing
metadata. For some repository types - like maven - metadata is uploaded
separately. If that upload fails, or does not happen, there will be no
metadata.

In that case, Forgejo should handle it gracefully, and render as much of
the information as possible, without erroring out. Rendering without
metadata allows one to delete a partial package, while if we throw
errors, that becomes a whole lot harder.

This patch adjusts the generic metadata template, and also the maven
template. There may be more cases of the same problem lying around.

Fixes #3663.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit ac4d535dbf)
2024-05-10 18:10:25 +00:00
Kemal Zebari
5678e9ab20
Catch and handle unallowed file type errors in issue attachment API (#30791)
Before, we would just throw 500 if a user passes an attachment that is
not an allowed type. This commit catches this error and throws a 422
instead since this should be considered a validation error.

(cherry picked from commit 872caa17c0a30d95f85ab75c068d606e07bd10b3)

Conflicts:
	tests/integration/api_comment_attachment_test.go
	tests/integration/api_issue_attachment_test.go
	trivial context conflict because of 'allow setting the update date on issues and comments'
(cherry picked from commit 9cd0441cd3)
2024-05-07 08:12:34 +01:00
Earl Warren
ac34a68a93 Merge pull request 'Port Fix checkbox field markup' (#3592) from 0ko/forgejo:a-commit into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3592
Reviewed-by: Otto <otto@codeberg.org>
2024-05-02 18:10:20 +00:00
Earl Warren
fcf85b12af Merge pull request '[v7.0/forgejo] UI: Actions: Replace runs list description semicolon' (#3582) from bp-v7.0/forgejo-870a1c8 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3582
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-02 18:01:28 +00:00
Panagiotis "Ivory" Vasilopoulos
d758633c91 UI: Actions: Replace runs list description semicolon
The current format makes the text look somewhat like this:

```
testing.yml #15065 :Commit 103306f00c pushed by n0toose
```

This looks wrong. We will have to work on that list at a later point
in time anyways, as well as make the way that we separate information
in subheaders in lists like this one more consistent.

However, this should do for now.

This change should make each entry look like this instead:

```
testing.yml #15065 - Commit 103306f00c pushed by n0toose
```

(cherry picked from commit 870a1c85c7)
2024-05-02 17:10:28 +00:00