]> source.dussan.org Git - gitea.git/log
gitea.git
15 months agoMake "dismiss" content shown correctly (#25461)
wxiaoguang [Fri, 23 Jun 2023 10:33:20 +0000 (18:33 +0800)]
Make "dismiss" content shown correctly (#25461)

Close #25127

![image](https://github.com/go-gitea/gitea/assets/2114189/7d6be811-8e4a-4982-a5e4-857d171758d4)

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoGitea version in Makefile (#25456)
John Olheiser [Fri, 23 Jun 2023 07:52:15 +0000 (02:52 -0500)]
Gitea version in Makefile (#25456)

As title, this is how it was inferred before

https://github.com/go-gitea/gitea/blob/e24f651c86a5168da8181f2c75f5f99b56561224/Makefile#L83-L84

We moved to actions, however `GITEA_VERSION` should still work to use
`VERSION`

Signed-off-by: jolheiser <john.olheiser@gmail.com>
15 months agoImport additional secrets via file uri (#25408)
techknowlogick [Fri, 23 Jun 2023 00:16:12 +0000 (20:16 -0400)]
Import additional secrets via file uri (#25408)

15 months agoRemove `deps-tools` from `backend` job (#25454)
silverwind [Thu, 22 Jun 2023 23:24:55 +0000 (01:24 +0200)]
Remove `deps-tools` from `backend` job (#25454)

15 months agoUpdate octicons and use `octicon-file-directory-symlink` (#25453)
silverwind [Thu, 22 Jun 2023 22:05:52 +0000 (00:05 +0200)]
Update octicons and use `octicon-file-directory-symlink` (#25453)

Make use of the [new
octicon](https://github.com/primer/octicons/issues/945) that indicates a
symlink to a directory:

<img width="189" alt="Screenshot 2023-06-22 at 22 50 57"
src="https://github.com/go-gitea/gitea/assets/115237/a70690ea-ebfc-48fe-af23-cdc33bcb2098">

15 months agoadd `test-frontend` back to actions (#25452)
silverwind [Thu, 22 Jun 2023 21:37:50 +0000 (23:37 +0200)]
add `test-frontend` back to actions (#25452)

Apparently we were not running `test-frontend` on actions, this adds it
back.

15 months agoRemove test string (#25447)
Denys Konovalov [Thu, 22 Jun 2023 15:29:57 +0000 (17:29 +0200)]
Remove test string (#25447)

Remove test string on delete project button, I overlooked it in a
previous PR 😄

15 months agoFix `Permission` in API returned repository struct (#25388)
Jason Song [Thu, 22 Jun 2023 13:08:08 +0000 (21:08 +0800)]
Fix `Permission` in API returned repository struct (#25388)

The old code generates `structs.Repository.Permissions` with only
`access.Permission.AccessMode`, however, it should check the units too,
or the value could be incorrect. For example,
`structs.Repository.Permissions.Push` could be false even the doer has
write access to code unit.

Should fix
https://github.com/renovatebot/renovate/issues/14059#issuecomment-1047961128
(Not reported by it, I just found it when I was looking into this bug)

---

Review tips:

The major changes are
- `modules/structs/repo.go`
https://github.com/go-gitea/gitea/pull/25388/files#diff-870406f6857117f8b03611c43fca0ab9ed6d6e76a2d0069a7c1f17e8fa9092f7
- `services/convert/repository.go`
https://github.com/go-gitea/gitea/pull/25388/files#diff-7736f6d2ae894c9edb7729a80ab89aa183b888a26a811a0c1fdebd18726a7101

And other changes are passive.

15 months agoDiff page enhancements (#25398)
silverwind [Thu, 22 Jun 2023 11:05:22 +0000 (13:05 +0200)]
Diff page enhancements (#25398)

Two small tweaks:

1. Vertically center arrow here when editing a PR:

<img width="405" alt="Screenshot 2023-06-20 at 19 48 49"
src="https://github.com/go-gitea/gitea/assets/115237/1d63764d-9fd9-467e-8a8e-9258c06475eb">

2. Use 2-row layout on diff viewed status and show it again on mobile:

<img width="142" alt="Screenshot 2023-06-20 at 19 51 21"
src="https://github.com/go-gitea/gitea/assets/115237/3046e782-163c-4f87-910c-a22066de8f1b">

Mobile view:

<img width="370" alt="Screenshot 2023-06-20 at 19 44 40"
src="https://github.com/go-gitea/gitea/assets/115237/9cf56347-7323-4d05-99a5-17ad215ee44d">

15 months agoIntroduce shared template for search inputs (#25338)
silverwind [Thu, 22 Jun 2023 10:27:35 +0000 (12:27 +0200)]
Introduce shared template for search inputs (#25338)

- Set
[type=search](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search)
- Disable spellcheck
- Set maxLength 255 that I found in `templates/repo/issue/search.tmpl`
- Remove unnecessary `max-width`, it does nothing

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoImprove 'Privacy' section in profile settings (#25309)
Panagiotis "Ivory" Vasilopoulos [Thu, 22 Jun 2023 08:58:16 +0000 (08:58 +0000)]
Improve 'Privacy' section in profile settings (#25309)

- Improve "Hide the activity from the profile page" label
- E-Mail privacy icon in user profile now redirects to Privacy section
- E-Mail privacy settings moved to Privacy section

Previously, the user was redirected to the setting itself, however,
that is not a good design choice because the setting itself would
be at the very top of the user's browser window. This fix doesn't
fix the problem entirely, but it is definitely an improvement
compared to its previous iteration.

15 months agoChange default email domain for LDAP users (#25425)
Zettat123 [Thu, 22 Jun 2023 08:16:12 +0000 (16:16 +0800)]
Change default email domain for LDAP users (#25425)

Fixes #21169

Change `localhost` to `localhost.local`

15 months agoSwitch to ansi_up for ansi rendering in actions (#25401)
silverwind [Thu, 22 Jun 2023 02:15:19 +0000 (04:15 +0200)]
Switch to ansi_up for ansi rendering in actions (#25401)

Fixes: https://github.com/go-gitea/gitea/issues/24777
15 months agoVarious UI fixes (#25264)
silverwind [Thu, 22 Jun 2023 01:59:49 +0000 (03:59 +0200)]
Various UI fixes (#25264)

Numerous small UI fixes:

- Fix double border in collaborator list
- Fix system notice table background
- Mute links in repo and org lists
- Downsize projects edit buttons
- Improve milestones and project list rendering
- Condense milestone list entry to a single line of "metas"
- Mute ".." button in repo files list

15 months agoMove some regexp out of functions (#25430)
John Olheiser [Wed, 21 Jun 2023 19:57:18 +0000 (14:57 -0500)]
Move some regexp out of functions (#25430)

/cc @KN4CK3R
https://github.com/go-gitea/gitea/pull/25294#discussion_r1237425343

I also searched the codebase and found a few more.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
15 months agoShow outdated comments in files changed tab (#24936)
sebastian-sauer [Wed, 21 Jun 2023 16:08:12 +0000 (18:08 +0200)]
Show outdated comments in files changed tab (#24936)

If enabled show a clickable label in the comment. A click on the label
opens the Conversation tab with the comment focussed - there you're able
to view the old diff (or original diff the comment was created on).

**Screenshots**

![image](https://github.com/go-gitea/gitea/assets/1135157/63ab9571-a9ee-4900-9f02-94ab0095f9e7)

![image](https://github.com/go-gitea/gitea/assets/1135157/78f7c225-8d76-46f5-acfd-9b8aab988a6c)

When resolved and outdated:

![image](https://github.com/go-gitea/gitea/assets/1135157/6ece9ebd-c792-4aa5-9c35-628694e9d093)

Option to enable/disable this (stored in user settings - default is
disabled):

![image](https://github.com/go-gitea/gitea/assets/1135157/ed99dfe4-76dc-4c12-bd96-e7e62da50ab5)

![image](https://github.com/go-gitea/gitea/assets/1135157/e837a052-e92e-4a28-906d-9db5bacf93a6)

fixes #24913

---------

Co-authored-by: silverwind <me@silverwind.io>
15 months agoRemove "CHARSET" config option for MySQL, always use "utf8mb4" (#25413)
wxiaoguang [Wed, 21 Jun 2023 10:49:25 +0000 (18:49 +0800)]
Remove "CHARSET" config option for MySQL, always use "utf8mb4" (#25413)

In modern days, there is no reason to make users set "charset" anymore.

Close #25378

## :warning: BREAKING

The key `[database].CHARSET` was removed completely as every newer
(>10years) MySQL database supports `utf8mb4` already.
There is a (deliberately) undocumented new fallback option if anyone
still needs to use it, but we don't recommend using it as it simply
causes problems.

15 months agoFine tune project board label colors and modal content background (#25419)
HesterG [Wed, 21 Jun 2023 10:15:51 +0000 (18:15 +0800)]
Fine tune project board label colors and modal content background (#25419)

- The label text color on project board is not contrasting enough,
changed to colors that are same as places that also used
`useLightTextOnBackground` function
([util_render.go](https://github.com/go-gitea/gitea/blob/2cdf260f42d178d23a8db70db35664511aeab31e/modules/templates/util_render.go#L136-L141),
[Context
Popup](https://github.com/go-gitea/gitea/blob/2cdf260f42d178d23a8db70db35664511aeab31e/web_src/js/components/ContextPopup.vue#L81-L84))

- background of modal `content` is `#ffffff` (from fomantic) right now,
which does not look good on dark mode, so changed to `var(--color-body)`

Before:

<img width="1378" alt="Screen Shot 2023-06-21 at 14 24 13"
src="https://github.com/go-gitea/gitea/assets/17645053/1527ca28-c884-4ca9-a4be-7a72ad1a093a">

<img width="900" alt="Screen Shot 2023-06-21 at 14 25 52"
src="https://github.com/go-gitea/gitea/assets/17645053/fab82116-7376-4027-a0a4-9eedf9fb0a30">

After:

<img width="1383" alt="Screen Shot 2023-06-21 at 14 19 33"
src="https://github.com/go-gitea/gitea/assets/17645053/fe0997e7-fee6-4522-bc4e-545088ec1cc8">

<img width="797" alt="Screen Shot 2023-06-21 at 14 32 42"
src="https://github.com/go-gitea/gitea/assets/17645053/b0591af0-950c-4448-9430-34d6c7215971">

15 months agoFix missing commit message body when the message has leading newlines (#25418)
Jason Song [Wed, 21 Jun 2023 09:14:34 +0000 (17:14 +0800)]
Fix missing commit message body when the message has leading newlines (#25418)

Commit with `echo "\nmessage after a blank line\nsecond line of the
message" | git commit --cleanup=verbatim -F -` and push.

<img width="1139" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/f9a2c28c-e307-4c78-9e31-3d3ace7b9274">

15 months agoadd python/poetry to devcontainer (#25407)
techknowlogick [Wed, 21 Jun 2023 08:44:58 +0000 (04:44 -0400)]
add python/poetry to devcontainer (#25407)

with introduction of linter, this adds python/poetry to devcontainer

15 months agoRefactor path & config system (#25330)
wxiaoguang [Wed, 21 Jun 2023 05:50:26 +0000 (13:50 +0800)]
Refactor path & config system (#25330)

# The problem

There were many "path tricks":

* By default, Gitea uses its program directory as its work path
* Gitea tries to use the "work path" to guess its "custom path" and
"custom conf (app.ini)"
* Users might want to use other directories as work path
* The non-default work path should be passed to Gitea by GITEA_WORK_DIR
or "--work-path"
* But some Gitea processes are started without these values
    * The "serv" process started by OpenSSH server
    * The CLI sub-commands started by site admin
* The paths are guessed by SetCustomPathAndConf again and again
* The default values of "work path / custom path / custom conf" can be
changed when compiling

# The solution

* Use `InitWorkPathAndCommonConfig` to handle these path tricks, and use
test code to cover its behaviors.
* When Gitea's web server runs, write the WORK_PATH to "app.ini", this
value must be the most correct one, because if this value is not right,
users would find that the web UI doesn't work and then they should be
able to fix it.
* Then all other sub-commands can use the WORK_PATH in app.ini to
initialize their paths.
* By the way, when Gitea starts for git protocol, it shouldn't output
any log, otherwise the git protocol gets broken and client blocks
forever.

The "work path" priority is: WORK_PATH in app.ini > cmd arg --work-path
> env var GITEA_WORK_DIR > builtin default

The "app.ini" searching order is: cmd arg --config > cmd arg "work path
/ custom path" > env var "work path / custom path" > builtin default

## ⚠️ BREAKING

If your instance's "work path / custom path / custom conf" doesn't meet
the requirements (eg: work path must be absolute), Gitea will report a
fatal error and exit. You need to set these values according to the
error log.

----

Close #24818
Close #24222
Close #21606
Close #21498
Close #25107
Close #24981
Maybe close #24503

Replace #23301
Replace #22754

And maybe more

15 months agoAdd actor and status dropdowns to run list (#25118)
HesterG [Wed, 21 Jun 2023 04:25:14 +0000 (12:25 +0800)]
Add actor and status dropdowns to run list (#25118)

Part of #25042

1. Added actor and status dropdowns first in case something is offtrack
and PR is too large.

2. Also added "No results matched." and "The workflow has no runs yet.",
and "No results matched." will show if there is no filter results and
there is no workflows (with [reference to github
action](https://github.com/go-gitea/gitea/actions/workflows/files-changed.yml?query=actor%3AGiteaBot))

Demo:

https://github.com/go-gitea/gitea/assets/17645053/6e76292c-4c1f-450d-8b48-99944cfc920c

TODOs:

- [x] Get available status (same as those in `aggregateJobStatus`)
instead of getting from database
- [x] Use `JOIN` to get actors, actors order by name
- [x] Make self on top

15 months agoUse the new download domain replace the old (#25405)
Lunny Xiao [Wed, 21 Jun 2023 03:11:17 +0000 (11:11 +0800)]
Use the new download domain replace the old (#25405)

As title.

15 months agoAvoid polluting config file when "save" (#25395)
wxiaoguang [Wed, 21 Jun 2023 02:31:40 +0000 (10:31 +0800)]
Avoid polluting config file when "save" (#25395)

That's a longstanding INI package problem: the "MustXxx" calls change
the option values, and the following "Save" will save a lot of garbage
options into the user's config file.

Ideally we should refactor the INI package to a clear solution, but it's
a huge work.

A clear workaround is what this PR does: when "Save", load a clear INI
instance and save it.

Partially fix #25377, the "install" page needs more fine tunes.

15 months agoFix dropdown icon layout on diff page (#25397)
wxiaoguang [Tue, 20 Jun 2023 23:22:48 +0000 (07:22 +0800)]
Fix dropdown icon layout on diff page (#25397)

Address
https://github.com/go-gitea/gitea/pull/25163#issuecomment-1599207916

Remove the unused  "icon-button".

And fix the layout:

Without the dropdown icon:

```
{{svg "gitea-whitespace"}}
```

![image](https://github.com/go-gitea/gitea/assets/2114189/58a524ba-f289-4982-aea2-6f9f9f9cbdcf)

With the dropdown icon:

```
{{svg "gitea-whitespace" 16 "gt-mr-3"}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
```

![image](https://github.com/go-gitea/gitea/assets/2114189/eb99168b-5d49-40a7-8665-5296cbb4e486)

15 months agoSupport configuration variables on Gitea Actions (#24724)
sillyguodong [Tue, 20 Jun 2023 22:54:15 +0000 (06:54 +0800)]
Support configuration variables on Gitea Actions (#24724)

Co-Author: @silverwind @wxiaoguang
Replace: #24404

See:
- [defining configuration variables for multiple
workflows](https://docs.github.com/en/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows)
- [vars
context](https://docs.github.com/en/actions/learn-github-actions/contexts#vars-context)

Related to:
- [x] protocol: https://gitea.com/gitea/actions-proto-def/pulls/7
- [x] act_runner: https://gitea.com/gitea/act_runner/pulls/157
- [x] act: https://gitea.com/gitea/act/pulls/43

#### Screenshoot
Create Variable:

![image](https://user-images.githubusercontent.com/33891828/236758288-032b7f64-44e7-48ea-b07d-de8b8b0e3729.png)

![image](https://user-images.githubusercontent.com/33891828/236758174-5203f64c-1d0e-4737-a5b0-62061dee86f8.png)

Workflow:
```yaml
  test_vars:
    runs-on: ubuntu-latest
    steps:
      - name: Print Custom Variables
        run: echo "${{ vars.test_key }}"
      - name: Try to print a non-exist var
        run: echo "${{ vars.NON_EXIST_VAR }}"
```

Actions Log:

![image](https://user-images.githubusercontent.com/33891828/236759075-af0c5950-368d-4758-a8ac-47a96e43b6e2.png)

---
This PR just implement the org / user (depends on the owner of the
current repository) and repo level variables, The Environment level
variables have not been implemented.
Because
[Environment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#about-environments)
is a module separate from `Actions`. Maybe it would be better to create
a new PR to do it.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoSubstitute variables in path names of template repos too (#25294)
Kyle D [Tue, 20 Jun 2023 21:14:47 +0000 (17:14 -0400)]
Substitute variables in path names of template repos too (#25294)

### Summary

Extend the template variable substitution to replace file paths. This
can be helpful for setting up log files & directories that should match
the repository name.

### PR Changes

 - Move files matching glob pattern when setting up repos from template
- For security, added ~escaping~ sanitization for cross-platform support
and to prevent directory traversal (thanks @silverwind for the
reference)
 - Added unit testing for escaping function
- Fixed the integration tests for repo template generation by passing
the repo_template_id
- Updated the integration testfiles to add some variable substitution &
assert the outputs

I had to fix the existing repo template integration test and extend it
to add a check for variable substitutions.

Example:

![image](https://github.com/go-gitea/gitea/assets/12700993/621feb09-0ef3-460e-afa8-da74cd84fa4e)

15 months agoNavbar styling rework (#25343)
silverwind [Tue, 20 Jun 2023 20:35:25 +0000 (22:35 +0200)]
Navbar styling rework (#25343)

- Extract navbar CSS to own file
- Reduce height from 52px to 50px
- Give every item a hover effect of of 36px, including the logo and on
mobile
- Consistent horizontal padding of 10px left and right

<img width="549" alt="Screenshot 2023-06-18 at 13 41 16"
src="https://github.com/go-gitea/gitea/assets/115237/0b00d101-253e-4b1f-9ee2-322d60fb2e26">

<img width="98" alt="Screenshot 2023-06-18 at 14 03 43"
src="https://github.com/go-gitea/gitea/assets/115237/4ef5d98b-4d1e-45de-822e-c2c844e19876">
<img width="234" alt="Screenshot 2023-06-18 at 14 03 18"
src="https://github.com/go-gitea/gitea/assets/115237/a4d9b04b-83de-42aa-a9ce-f010a9690688">

<img width="873" alt="Screenshot 2023-06-18 at 13 58 28"
src="https://github.com/go-gitea/gitea/assets/115237/8cb8e31e-2adf-40c8-ae3f-d00d011b4d1b">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix blank dir message when uploading files from web editor (#25391)
Lunny Xiao [Tue, 20 Jun 2023 19:58:03 +0000 (03:58 +0800)]
Fix blank dir message when uploading files from web editor (#25391)

Fix #7883

15 months agoAdd git-lfs support to devcontainer (#25385)
yp05327 [Tue, 20 Jun 2023 19:28:46 +0000 (04:28 +0900)]
Add git-lfs support to devcontainer (#25385)

15 months agoUse qwtel.sqlite-viewer instead of alexcvzz.vscode-sqlite (#25386)
yp05327 [Tue, 20 Jun 2023 19:06:42 +0000 (04:06 +0900)]
Use qwtel.sqlite-viewer instead of alexcvzz.vscode-sqlite (#25386)

`alexcvzz.vscode-sqlite` doesn't work well in devcontainer.

qwtel.sqlite-viewer works well, maybe we can use this one instead.

15 months agoUse Actions git context instead of dynamically created buildkit one (#25381)
techknowlogick [Tue, 20 Jun 2023 05:37:32 +0000 (01:37 -0400)]
Use Actions git context instead of dynamically created buildkit one (#25381)

The [docker/build-push-action@v2
action](https://github.com/docker/build-push-action) by default ignores
the checkout created using the actions/checkout@v2 action. When you pass
a git build context to docker build, it wouldn't include the .git
directory.

By passing `context: .` to the build step then it'll use the Actions git
context which includes the git fetch from the earlier step.

15 months agorename tributeValues to mentionValues (#25375)
silverwind [Tue, 20 Jun 2023 03:32:49 +0000 (05:32 +0200)]
rename tributeValues to mentionValues (#25375)

Very simple change, just rename this variable so it does not feature the
name of the module.

15 months agoFix LDAP sync when Username Attribute is empty (#25278)
Zettat123 [Tue, 20 Jun 2023 03:04:13 +0000 (11:04 +0800)]
Fix LDAP sync when Username Attribute is empty (#25278)

Fix #21072

![image](https://github.com/go-gitea/gitea/assets/15528715/96b30beb-7f88-4a60-baae-2e5ad8049555)

Username Attribute is not a required item when creating an
authentication source. If Username Attribute is empty, the username
value of LDAP user cannot be read, so all users from LDAP will be marked
as inactive by mistake when synchronizing external users.

This PR improves the sync logic, if username is empty, the email address
will be used to find user.

16 months agoFetch all git data for embedding correct version in docker image (#25361)
techknowlogick [Mon, 19 Jun 2023 18:51:35 +0000 (14:51 -0400)]
Fetch all git data for embedding correct version in docker image (#25361)

Fix #25350

16 months agoFix sidebar label dropdown divider (#25359)
HesterG [Mon, 19 Jun 2023 17:49:50 +0000 (01:49 +0800)]
Fix sidebar label dropdown divider (#25359)

Follow #25312

Also fix the label dropdown on sidebar

Before:

<img width="1345" alt="Screen Shot 2023-06-19 at 08 55 05"
src="https://github.com/go-gitea/gitea/assets/17645053/3a98e871-b482-4ecb-8ce2-74df67fb65a7">

After:

<img width="1408" alt="Screen Shot 2023-06-19 at 08 57 17"
src="https://github.com/go-gitea/gitea/assets/17645053/09af15cc-1250-49b3-98b6-5b1a2b9021cb">

16 months agoFix issue filters on mobile view (#25368)
Denys Konovalov [Mon, 19 Jun 2023 17:12:15 +0000 (19:12 +0200)]
Fix issue filters on mobile view (#25368)

Fix #24846 applying the solution proposed by @silverwind

<details>
<summary>Screenshots</summary>

![Bildschirmfoto vom 2023-06-19
12-20-54](https://github.com/go-gitea/gitea/assets/47871822/3f4e4536-38c4-451b-bfc0-a7c39acd37f0)
![Bildschirmfoto vom 2023-06-19
12-21-02](https://github.com/go-gitea/gitea/assets/47871822/3403ecc2-4d7f-4acd-b0c0-1b7a10228ff7)
![Bildschirmfoto vom 2023-06-19
12-21-16](https://github.com/go-gitea/gitea/assets/47871822/ef28a2bf-b7cc-4aec-b54b-99d2cc46a1f6)
![Bildschirmfoto vom 2023-06-19
12-21-21](https://github.com/go-gitea/gitea/assets/47871822/f8cd72a5-379e-410b-b0ef-d58895719370)
![Bildschirmfoto vom 2023-06-19
12-21-28](https://github.com/go-gitea/gitea/assets/47871822/34c78301-820c-4106-a086-ae81dc97eb91)
![Bildschirmfoto vom 2023-06-19
12-21-48](https://github.com/go-gitea/gitea/assets/47871822/b677adf1-3a48-42c8-befe-fa9d2679f0a3)
</details>

Replaces #25335

16 months agoRefactor: TotalTimest return seconds (#25370)
6543 [Mon, 19 Jun 2023 16:40:06 +0000 (18:40 +0200)]
Refactor: TotalTimest return seconds (#25370)

so template/browser can deal with string format

---
*Sponsored by Kithara Software GmbH*

16 months agoFix incorrect actions ref_name (#25358)
Daniel Wolf [Mon, 19 Jun 2023 09:32:09 +0000 (05:32 -0400)]
Fix incorrect actions ref_name (#25358)

Fix #25357 .

Just a simple fix the result of `${{ gitea.ref_name }}` to show the
shortened name rather than the full ref.

16 months agoMake backend code respond correct JSON when creating PR (#25353)
wxiaoguang [Mon, 19 Jun 2023 08:25:36 +0000 (16:25 +0800)]
Make backend code respond correct JSON when creating PR (#25353)

Fix #25351

16 months agoFix loading state regression in markup content (#25349)
silverwind [Mon, 19 Jun 2023 08:00:18 +0000 (10:00 +0200)]
Fix loading state regression in markup content (#25349)

Fix regressions from https://github.com/go-gitea/gitea/pull/25219:

Math before and after:
<img width="630" alt="Screenshot 2023-06-18 at 16 00 52"
src="https://github.com/go-gitea/gitea/assets/115237/f2a01e4b-31ca-407c-8fc3-f0aec569b48e">
<img width="680" alt="Screenshot 2023-06-18 at 16 03 44"
src="https://github.com/go-gitea/gitea/assets/115237/faab8e39-f088-45ab-b460-15fc3654c99d">

Mermain before and after:
<img width="810" alt="Screenshot 2023-06-18 at 15 58 56"
src="https://github.com/go-gitea/gitea/assets/115237/d8c24e81-4702-4e17-b791-7dffe090c068">
<img width="786" alt="Screenshot 2023-06-18 at 15 58 37"
src="https://github.com/go-gitea/gitea/assets/115237/3a268e10-c071-410d-a66e-8c4427d1d61c">

16 months agoBatch delete issue and improve tippy opts (#25253)
wxiaoguang [Mon, 19 Jun 2023 07:46:50 +0000 (15:46 +0800)]
Batch delete issue and improve tippy opts (#25253)

1. Add "batch delete" button for selected issues, close #22273
2. Address the review in
https://github.com/go-gitea/gitea/pull/25219#discussion_r1229266083

16 months agoOnly run `docker-dryrun` when necessary (#25329)
silverwind [Mon, 19 Jun 2023 02:53:20 +0000 (04:53 +0200)]
Only run `docker-dryrun` when necessary (#25329)

`docker-dryrun` runs on almost any PR, which is a huge waste of CI
resources. Run it only when the Dockerfiles change and also add a step
that verifies the rootless file.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
16 months agofix a nit error output in Makefile (#25360)
a1012112796 [Mon, 19 Jun 2023 01:53:16 +0000 (09:53 +0800)]
fix a nit error output in Makefile (#25360)

fix ``make: write error: stdout``

ref:
https://stackoverflow.com/questions/70671525/write-error-stdout-when-calling-make-from-makefile

16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 19 Jun 2023 00:27:14 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoClean up pyproject.toml and package.json, fix poetry options (#25327)
silverwind [Sun, 18 Jun 2023 18:13:08 +0000 (20:13 +0200)]
Clean up pyproject.toml and package.json, fix poetry options (#25327)

- Reduce `pyproject.toml` and `package.json` to the minimal required
format, removing unneeded properties. `build-system` is not needed as
per
[this](https://github.com/python-poetry/poetry/issues/8110#issuecomment-1595846841).
- Fix `poetry.toml` options they were wrong previously.
- Add dependencies of poetry files to templates `files-changed`.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoFix label list divider (#25312)
wxiaoguang [Sun, 18 Jun 2023 17:33:12 +0000 (01:33 +0800)]
Fix label list divider (#25312)

We only needs 2 lines to hide the dividers.

```
  $dropdownLabelFilter.dropdown('setting', {'hideDividers': 'empty'});
  $dropdownLabelFilter.dropdown('refreshItems');
```

Other code blocks are refactored by the way.

![image](https://github.com/go-gitea/gitea/assets/2114189/74989996-fcea-4df4-b534-b06f7957939a)

![image](https://github.com/go-gitea/gitea/assets/2114189/ee3b3761-b96e-4fb5-b646-e9d3117e5f40)

16 months agoAvoid polluting the config (#25345)
wxiaoguang [Sun, 18 Jun 2023 16:10:44 +0000 (00:10 +0800)]
Avoid polluting the config (#25345)

Caught by #25330

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoFix incorrect link-action event target (#25306)
wxiaoguang [Sun, 18 Jun 2023 15:23:18 +0000 (23:23 +0800)]
Fix incorrect link-action event target (#25306)

A regression of #25210

The `e.target` is not "this", eg: `<button link-action><svg></button>`,
then `this` should be `button` but `e.target` is `svg`.

I will propose a clearer and complete solution for these "link-action"
"show-modal" elements after #24724

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoWrite absolute AppDataPath to app.ini when installing (#25331)
wxiaoguang [Sun, 18 Jun 2023 13:57:43 +0000 (21:57 +0800)]
Write absolute AppDataPath to app.ini when installing (#25331)

If the APP_DATA_PATH isn't written into the config when installing, then
its value is uncertain because some Gitea command doesn't run with
correct WorkPath.

This is a quick fix for #25330  and can be backported.

16 months agoAdd Exoscale to installation on cloud provider docs (#25342)
Philip Miglinci [Sun, 18 Jun 2023 13:00:33 +0000 (15:00 +0200)]
Add Exoscale to installation on cloud provider docs (#25342)

We created a Gitea application for the [Exoscale
Marketplace](https://www.exoscale.com/marketplace/listing/glasskube-gitea/)
for easier installation on the European cloud provider.

The installation is managed via the [Glasskube Kubernetes
Operator](https://github.com/glasskube/operator).

Signed-off-by: Philip Miglinci <pmig@glasskube.eu>
16 months agoFix UI on mobile view (#25315)
Denys Konovalov [Sun, 18 Jun 2023 10:31:42 +0000 (12:31 +0200)]
Fix UI on mobile view (#25315)

Various fixes to pages or elements which were looking ugly on mobile.
<details>
<summary>Screenshots</summary>

![Bildschirmfoto vom 2023-06-17
20-38-41](https://github.com/go-gitea/gitea/assets/47871822/30b5d3ce-df3b-43eb-a4c2-c3790667fb9d)
![Bildschirmfoto vom 2023-06-17
20-39-27](https://github.com/go-gitea/gitea/assets/47871822/27c07b25-3602-4fb2-b34d-d5e875e054e9)
![Bildschirmfoto vom 2023-06-17
20-41-27](https://github.com/go-gitea/gitea/assets/47871822/dacdbb4e-e3dd-4b94-abf0-c68e3d64bd3b)
![Bildschirmfoto vom 2023-06-17
20-41-48](https://github.com/go-gitea/gitea/assets/47871822/72432c35-7c4a-4c7f-a767-3562f26a5c14)
![Bildschirmfoto vom 2023-06-17
20-42-37](https://github.com/go-gitea/gitea/assets/47871822/737c26ed-1910-4467-98ef-e8769bbbe6f0)
![Bildschirmfoto vom 2023-06-17
20-42-52](https://github.com/go-gitea/gitea/assets/47871822/1813b4bc-43c0-4912-8acb-5d799c090bf3)
![Bildschirmfoto vom 2023-06-17
20-43-06](https://github.com/go-gitea/gitea/assets/47871822/136466e8-34e5-419d-97ec-5202ff819fd2)
![Bildschirmfoto vom 2023-06-17
20-43-42](https://github.com/go-gitea/gitea/assets/47871822/59270bb2-d661-4a84-8504-3e50f771f767)
![Bildschirmfoto vom 2023-06-17
20-44-44](https://github.com/go-gitea/gitea/assets/47871822/494e274d-3771-4141-9419-0a4bbd8b7f64)

</details>

Co-authored by @silverwind

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months agoWhen viewing a file, hide the add button (#25320)
hiifong [Sun, 18 Jun 2023 09:21:50 +0000 (17:21 +0800)]
When viewing a file, hide the add button (#25320)

Fix #25281
When viewing a file, hide the add button

![image](https://github.com/go-gitea/gitea/assets/89133723/839babaf-6b67-46e1-a103-677306fb8503)

![image](https://github.com/go-gitea/gitea/assets/89133723/32a8aeca-31f4-4ce1-a0fa-7656e16b66d3)

16 months agoUpdate JS dependencies, remove space after emoji completion (#25266)
silverwind [Sun, 18 Jun 2023 08:38:47 +0000 (10:38 +0200)]
Update JS dependencies, remove space after emoji completion (#25266)

- Update all JS dependencies
- Enable stylint
[`media-feature-name-value-no-unknown`](https://stylelint.io/user-guide/rules/media-feature-name-value-no-unknown)
- Make use of new features in webpack and text-expander-element
- Tested Swagger and Mermaid

To explain the `text-expander-element` change: Before this version, the
element added a unavoidable space after emoji completion. Now that
https://github.com/github/text-expander-element/pull/36 is in, we gain
control over this space and I opted to remove it for emoji completion
and retain it for `@` mentions.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoRefactor web package and context package (#25298)
wxiaoguang [Sun, 18 Jun 2023 07:59:09 +0000 (15:59 +0800)]
Refactor web package and context package (#25298)

1. The "web" package shouldn't depends on "modules/context" package,
instead, let each "web context" register themselves to the "web"
package.
2. The old Init/Free doesn't make sense, so simplify it
* The ctx in "Init(ctx)" is never used, and shouldn't be used that way
* The "Free" is never called and shouldn't be called because the SSPI
instance is shared

---------

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agobuild nightly docker images (#25317)
techknowlogick [Sun, 18 Jun 2023 05:04:23 +0000 (01:04 -0400)]
build nightly docker images (#25317)

followup of https://github.com/go-gitea/gitea/pull/25308 this time to
build & push nightly docker images

16 months agoAdd `stylelint-declaration-block-no-ignored-properties` (#25284)
silverwind [Sun, 18 Jun 2023 04:22:09 +0000 (06:22 +0200)]
Add `stylelint-declaration-block-no-ignored-properties` (#25284)

Add
[stylelint-declaration-block-no-ignored-properties](https://github.com/kristerkari/stylelint-declaration-block-no-ignored-properties)
and fix discovered issue. There is no visual difference in these markup
code blocks.

16 months agoRemove EasyMDE focus outline on text (#25328)
silverwind [Sun, 18 Jun 2023 04:10:07 +0000 (06:10 +0200)]
Remove EasyMDE focus outline on text (#25328)

EasyMDE in Firefox currently shows an ugly outline in the fake textarea
the CodeMirror uses. Hide it.

16 months agouse Actions environment variables in Makefile (#25319)
techknowlogick [Sun, 18 Jun 2023 03:26:49 +0000 (23:26 -0400)]
use Actions environment variables in Makefile (#25319)

16 months agoadd `stylelint-stylistic` (#25285)
silverwind [Sat, 17 Jun 2023 13:20:32 +0000 (15:20 +0200)]
add `stylelint-stylistic` (#25285)

Add
[stylelint-stylistic](https://github.com/elirasza/stylelint-stylistic),
autofix all issues with two manual tweaks. This restores all the
stylistic rules removed in Stylelint 15.

16 months agoRemove more unused Fomantic variants (#25292)
silverwind [Sat, 17 Jun 2023 08:15:33 +0000 (10:15 +0200)]
Remove more unused Fomantic variants (#25292)

Save another 50KB of CSS by removing unused and useless Fomantic
variants.

Removed the last instance if a `tertiary` button and fixed a TODO:

<img width="509" alt="Screenshot 2023-06-15 at 22 34 36"
src="https://github.com/go-gitea/gitea/assets/115237/8a16ae7b-2b17-439b-a096-60a52724e3d6">

16 months agoBuild nightly binaries with Actions (#25308)
techknowlogick [Fri, 16 Jun 2023 17:00:39 +0000 (13:00 -0400)]
Build nightly binaries with Actions (#25308)

Co-authored-by: silverwind <me@silverwind.io>
16 months agoFix displayed RPM repo url (#25310)
KN4CK3R [Fri, 16 Jun 2023 15:56:49 +0000 (17:56 +0200)]
Fix displayed RPM repo url (#25310)

Fixes #25302

16 months agoUse fetch to send requests to create issues/comments (#25258)
wxiaoguang [Fri, 16 Jun 2023 06:32:43 +0000 (14:32 +0800)]
Use fetch to send requests to create issues/comments (#25258)

Follow #23290

Network error won't make content lost. And this is a much better
approach than "loading-button".

The UI is not perfect and there are still some TODOs, they can be done
in following PRs, not a must in this PR's scope.

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/c94ba958-aa46-4747-8ddf-6584deeed25c)

</details>

16 months agoShow if File is Executable (#25287)
JakobDev [Fri, 16 Jun 2023 05:46:12 +0000 (07:46 +0200)]
Show if File is Executable (#25287)

This simply shows if a File has the executable Permission

![grafik](https://github.com/go-gitea/gitea/assets/15185051/1d50c105-6d55-4ecc-808a-c9cd5559d238)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoAdd devcontainer config for developing Gitea (#24781)
techknowlogick [Fri, 16 Jun 2023 05:13:06 +0000 (01:13 -0400)]
Add devcontainer config for developing Gitea (#24781)

With the recent release of https://github.com/loft-sh/devpod making
ephemeral dev environments (ala GitPod/Codespaces) much easier (aka, no
pre-configured infra required). This allows an alternative to using
GitPod for such development options.

---------

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoAdd link to support page for commercial support (#25293)
techknowlogick [Fri, 16 Jun 2023 04:08:08 +0000 (00:08 -0400)]
Add link to support page for commercial support (#25293)

16 months agoDocs about how to generate config for act runner with docker and setup it with docker...
Zisu Zhang [Fri, 16 Jun 2023 03:46:59 +0000 (11:46 +0800)]
Docs about how to generate config for act runner with docker and setup it with docker-compose (#25256)

In this pull request, the following changes are addressed:

- State user should create `config.yaml` before start container to avoid
errors.
- Provided instructions to deploy runners using docker compose.

16 months agoFix some UI alignments (#25277)
wxiaoguang [Thu, 15 Jun 2023 15:12:08 +0000 (23:12 +0800)]
Fix some UI alignments (#25277)

Fixes: https://github.com/go-gitea/gitea/issues/25282
Fix the problems:

1. The `repo-button-row` had various patches before, this PR makes it
consistent
2. The "Add File" has wrong CSS class "icon", remove it
3. The "Add File" padding was overridden by "!important", fix it by
`.repo-button-row .button.dropdown` with comment
4. The selector `.ui.segments ~ .ui.top.attached.header` is incorrect,
it should use `+`

16 months agoRemove fomantic inverted variations (#25286)
silverwind [Thu, 15 Jun 2023 14:40:34 +0000 (16:40 +0200)]
Remove fomantic inverted variations (#25286)

Remove all Fomantic `inverted` variations, we are no using any of them.
This reduces the index CSS bundle by 98kB.

16 months agoFix issue and commit status popup padding (#25254)
wxiaoguang [Thu, 15 Jun 2023 08:09:16 +0000 (16:09 +0800)]
Fix issue and commit status popup padding (#25254)

Close #25249

Use "dialog" for the role

![image](https://github.com/go-gitea/gitea/assets/2114189/2b5b7552-48bc-4ecf-947b-34917232cff9)

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months agoShow OAuth2 errors to end users (#25261)
wxiaoguang [Thu, 15 Jun 2023 01:12:50 +0000 (09:12 +0800)]
Show OAuth2 errors to end users (#25261)

Partially fix #23936

![image](https://github.com/go-gitea/gitea/assets/2114189/8aa7f3ad-a5f0-42ce-a478-289a03bd08a3)

![image](https://github.com/go-gitea/gitea/assets/2114189/bb901e7d-485a-47a5-b68d-9ebe7013a6b2)

![image](https://github.com/go-gitea/gitea/assets/2114189/9a1ce0f3-f011-4baf-8e2f-cc6304bc9703)

16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 15 Jun 2023 00:26:55 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoFix index generation parallelly failure (#25235)
Lunny Xiao [Thu, 15 Jun 2023 00:14:43 +0000 (08:14 +0800)]
Fix index generation parallelly failure (#25235)

Fix #22109

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months agoFix variable in template (#25267)
silverwind [Wed, 14 Jun 2023 20:42:52 +0000 (22:42 +0200)]
Fix variable in template (#25267)

Fix regression from https://github.com/go-gitea/gitea/pull/25212.

16 months agoAdd template linting via djlint (#25212)
silverwind [Wed, 14 Jun 2023 18:17:58 +0000 (20:17 +0200)]
Add template linting via djlint (#25212)

So I found this [linter](https://github.com/Riverside-Healthcare/djlint)
which features a mode for go templates, so I gave it a try and it did
find a number of valid issue, like unbalanced tags etc. It also has a
number of bugs, I had to disable/workaround many issues.

Given that this linter is written in python, this does add a dependency
on `python` >= 3.8 and `poetry` to the development environment to be
able to run this linter locally.

- `e.g.` prefixes on placeholders are removed because the linter had a
false-positive on `placeholder="e.g. cn=Search"` for the `attr=value`
syntax and it's not ideal anyways to write `e.g.` into a placeholder
because a placeholder is meant to hold a sample value.
- In `templates/repo/settings/options.tmpl` I simplified the logic to
not conditionally create opening tags without closing tags because this
stuff confuses the linter (and possibly the reader as well).

16 months agoFix edit OAuth application width (#25262)
Denys Konovalov [Wed, 14 Jun 2023 17:45:13 +0000 (19:45 +0200)]
Fix edit OAuth application width (#25262)

The `<div class="ui container">` broke the width of this section - fix
by removing it.

16 months agoUse flex to align SVG and text (#25163)
wxiaoguang [Wed, 14 Jun 2023 16:40:15 +0000 (00:40 +0800)]
Use flex to align SVG and text (#25163)

The code can be as simple as:

```html
<div class="flex-text-block">{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)</div>
<div><div class="flex-text-inline">{{svg "octicon-alert"}} {{svg "octicon-x"}} text</div> (inline)</div>
<div><button class="ui red button">{{svg "octicon-alert" 24}} {{svg "octicon-x" 24}} text</button></div>
```

![image](https://github.com/go-gitea/gitea/assets/2114189/1d3c10f1-0bc7-4c26-b236-bad537d5c465)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoGitHub Actions enhancements for frontend (#25150)
silverwind [Wed, 14 Jun 2023 15:30:37 +0000 (17:30 +0200)]
GitHub Actions enhancements for frontend (#25150)

- Don't run DB tests for frontend-only changes
- Build frontend as part of frontend step
- Build everything when actions change

16 months agoAdd missing `v` in migrations.go (#25252)
yp05327 [Wed, 14 Jun 2023 12:35:35 +0000 (21:35 +0900)]
Add missing `v` in migrations.go (#25252)

16 months agoChange form actions to fetch for submit review box (#25219)
HesterG [Wed, 14 Jun 2023 08:01:37 +0000 (16:01 +0800)]
Change form actions to fetch for submit review box (#25219)

Co-author: @wxiaoguang

Close #25096

The way to fix it in this PR is to change form submit to fetch using
formData, and add flags to avoid post repeatedly.
Should be able to apply to more forms that have the same issue after
this PR.

In the demo below, 'approve' is clicked several times, and then
'comment' is clicked several time after 'request changes' clicked.

After:

https://github.com/go-gitea/gitea/assets/17645053/beabeb1d-fe66-4b76-b048-4f022b4e83a0

Update: screenshots from /devtest

>
![image](https://user-images.githubusercontent.com/2114189/245680011-ee4231e0-a53d-4c2a-a9c2-71ccd98005cc.png)
>
>
![image](https://user-images.githubusercontent.com/2114189/245680057-9215d348-63d8-406d-8828-17e171163aaa.png)
>
>
![image](https://user-images.githubusercontent.com/2114189/245680148-89d7b3d1-d7b6-442f-b69e-eadaee112482.png)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoFix panic when migrating a repo from GitHub with issues (#25246)
Jason Song [Wed, 14 Jun 2023 06:12:39 +0000 (14:12 +0800)]
Fix panic when migrating a repo from GitHub with issues (#25246)

Fix #25245. Regression of #23946.

16 months agoFix description of drop custom_labels migration (#25243)
sillyguodong [Wed, 14 Jun 2023 04:46:55 +0000 (12:46 +0800)]
Fix description of drop custom_labels migration (#25243)

Follow: #24806

16 months agoFix all possible setting error related storages and added some tests (#23911)
Lunny Xiao [Wed, 14 Jun 2023 03:42:38 +0000 (11:42 +0800)]
Fix all possible setting error related storages and added some tests (#23911)

Follow up #22405

Fix #20703

This PR rewrites storage configuration read sequences with some breaks
and tests. It becomes more strict than before and also fixed some
inherit problems.

- Move storage's MinioConfig struct into setting, so after the
configuration loading, the values will be stored into the struct but not
still on some section.
- All storages configurations should be stored on one section,
configuration items cannot be overrided by multiple sections. The
prioioty of configuration is `[attachment]` > `[storage.attachments]` |
`[storage.customized]` > `[storage]` > `default`
- For extra override configuration items, currently are `SERVE_DIRECT`,
`MINIO_BASE_PATH`, `MINIO_BUCKET`, which could be configured in another
section. The prioioty of the override configuration is `[attachment]` >
`[storage.attachments]` > `default`.
- Add more tests for storages configurations.
- Update the storage documentations.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Jun 2023 00:26:25 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoRevert overflow: overlay (revert #21850) (#25231)
wxiaoguang [Tue, 13 Jun 2023 19:17:14 +0000 (03:17 +0800)]
Revert overflow: overlay (revert #21850) (#25231)

It causes not only one issue like #25221 (the footer width was also
affected by that change and was fixed some time ago)

The problem of "overflow: overlay" (#21850) is:

* It's not widely supported and is non-standard
https://caniuse.com/css-overflow-overlay
* It's not widely tested in Gitea (some standard layout like `ui
container + ui grid` may break it).
* The benefit seems smaller than the problems it brings.

So, I think it is good to revert it.

----

Let's leave enough time for testing and reviewing.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoSupport changing labels of Actions runner without re-registration (#24806)
sillyguodong [Tue, 13 Jun 2023 14:28:31 +0000 (22:28 +0800)]
Support changing labels of Actions runner without re-registration (#24806)

close #24540

related:
- Protocol: https://gitea.com/gitea/actions-proto-def/pulls/9
- Runner side: https://gitea.com/gitea/act_runner/pulls/201

changes:
- Add column of `labels` to table `action_runner`, and combine the value
of `agent_labels` and `custom_labels` column to `labels` column.
- Store `labels` when registering `act_runner`.
- Update `labels` when `act_runner` starting and calling `Declare`.
- Users cannot modify the `custom labels` in edit page any more.

other changes:
- Store `version` when registering `act_runner`.
- If runner is latest version, parse version from `Declare`. But older
version runner still parse version from request header.

16 months agoImprove AJAX link and modal confirm dialog (#25210)
wxiaoguang [Tue, 13 Jun 2023 12:10:10 +0000 (20:10 +0800)]
Improve AJAX link and modal confirm dialog (#25210)

Clarify the "link-action" behavior:

>  // A "link-action" can post AJAX request to its "data-url"
> // Then the browser is redirect to: the "redirect" in response, or
"data-redirect" attribute, or current URL by reloading.

And enhance the "link-action" to support showing a modal dialog for
confirm. A similar general approach could also help PRs like
https://github.com/go-gitea/gitea/pull/22344#discussion_r1062883436

> // If the "link-action" has "data-modal-confirm(-html)" attribute, a
confirm modal dialog will be shown before taking action.

And a lot of duplicate code can be removed now. A good framework design
can help to avoid code copying&pasting.

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months agoUse inline SVG for built-in OAuth providers (#25171)
silverwind [Tue, 13 Jun 2023 10:51:02 +0000 (12:51 +0200)]
Use inline SVG for built-in OAuth providers (#25171)

The plan is that all built-in auth providers use inline SVG for more
flexibility in styling and to get the GitHub icon to follow
`currentcolor`. This only removes the `public/img/auth` directory and
adds the missing svgs to our svg build.

It should map the built-in providers to these SVGs and render them. If
the user has set a Icon URL, it should render that as an `img` tag
instead.

```
gitea-azure-ad
gitea-bitbucket
gitea-discord
gitea-dropbox
gitea-facebook
gitea-gitea
gitea-gitlab
gitea-google
gitea-mastodon
gitea-microsoftonline
gitea-nextcloud
gitea-twitter
gitea-yandex
octicon-mark-github
```

GitHub logo is now white again on dark theme:

<img width="431" alt="Screenshot 2023-06-12 at 21 45 34"
src="https://github.com/go-gitea/gitea/assets/115237/27a43504-d60a-4132-a502-336b25883e4d">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoDisable `Create column` button while the column name is empty (#25192)
Punit Inani [Tue, 13 Jun 2023 09:57:03 +0000 (15:27 +0530)]
Disable `Create column` button while the column name is empty  (#25192)

![Jun-10-2023
18-43-04](https://github.com/go-gitea/gitea/assets/80308335/4796c9be-d161-43a0-a3e3-d9cd6a19cda4)

Fixes #25116

16 months agoFix profile render when the README.md size is larger than 1024 bytes (#25131)
yp05327 [Tue, 13 Jun 2023 09:02:25 +0000 (18:02 +0900)]
Fix profile render when the README.md size is larger than 1024 bytes (#25131)

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

`GetBlobContent` will only get the first 1024 bytes, if the README.md
size is larger than 1024 bytes,
We can not render the rest of them.
After this fix, we should provide the limited size to read when call
`GetBlobContent`.

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/22a42936-4cf8-40b4-a5c7-e384082beb0d)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoChange access token UI to select dropdowns (#25109)
Jonathan Tran [Tue, 13 Jun 2023 07:55:48 +0000 (03:55 -0400)]
Change access token UI to select dropdowns (#25109)

The current UI to create API access tokens uses checkboxes that have a
complicated relationship where some need to be checked and/or disabled
in certain states. It also requires that a user interact with it to
understand what their options really are.

This branch changes to use `<select>`s. It better fits the available
options, and it's closer to [GitHub's
UI](https://github.com/settings/personal-access-tokens/new), which is
good, in my opinion. It's more mobile friendly since the tap-areas are
larger. If we ever add more permissions, like Maintainer, there's a
natural place that doesn't take up more screen real-estate.

This branch also fixes a few minor issues:

- Hide the error about selecting at least one permission after second
submission
- Fix help description to call it "authorization" since that's what
permissions are about (not authentication)

Related: #24767.

<img width="883" alt="Screenshot 2023-06-07 at 5 07 34 PM"
src="https://github.com/go-gitea/gitea/assets/10803/6b63d807-c9be-4a4b-8e53-ecab6cbb8f76">

---

When it's open:

<img width="881" alt="Screenshot 2023-06-07 at 5 07 59 PM"
src="https://github.com/go-gitea/gitea/assets/10803/2432c6d0-39c2-4ca4-820e-c878ffdbfb69">

16 months agoFix task list checkbox toggle to work with YAML front matter (#25184)
Jonathan Tran [Tue, 13 Jun 2023 06:44:47 +0000 (02:44 -0400)]
Fix task list checkbox toggle to work with YAML front matter (#25184)

Fixes #25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.

16 months agoFix compatible for webhook ref type (#25195)
Lunny Xiao [Tue, 13 Jun 2023 06:05:28 +0000 (14:05 +0800)]
Fix compatible for webhook ref type (#25195)

Fix #25185
Caused by #24634

16 months agoHide limited users if viewed by anonymous ghost (#25214)
KN4CK3R [Tue, 13 Jun 2023 03:21:11 +0000 (05:21 +0200)]
Hide limited users if viewed by anonymous ghost (#25214)

The ghost user leads to inclusion of limited users/orgs in
`BuildCanSeeUserCondition`.

16 months agoUpdate `from-source.zh-cn.md` & `from-source.en-us.md` - Cross Compile Using Zig...
editfund-founder [Tue, 13 Jun 2023 02:53:51 +0000 (10:53 +0800)]
Update `from-source.zh-cn.md` & `from-source.en-us.md` - Cross Compile Using Zig (#25194)

## Compile & Cross Compile Gitea With CGO Dependencies Using Zig

---------

Co-authored-by: Jason Song <i@wolfogre.com>
16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 13 Jun 2023 00:27:02 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoRemove hacky patch for "safari emoji glitch fix" (#25208)
wxiaoguang [Mon, 12 Jun 2023 15:44:53 +0000 (23:44 +0800)]
Remove hacky patch for "safari emoji glitch fix"  (#25208)

According to my test, the UI (emoji) is fine in Safari

And actually the code is just dead code, because the "resize" event is
never fired on page loading. So for most cases users just view the pages
without this hacky patch, nobody ever complains.

16 months agoDo not overwrite the log mode when installing (#25203)
wxiaoguang [Mon, 12 Jun 2023 10:52:49 +0000 (18:52 +0800)]
Do not overwrite the log mode when installing (#25203)

Fix #24861

16 months agoFix fullscreen for action (#25200)
HesterG [Mon, 12 Jun 2023 10:18:01 +0000 (18:18 +0800)]
Fix fullscreen for action  (#25200)

An error occurs when clicking on `show full screen` on action page.

<img width="1440" alt="Screen Shot 2023-06-12 at 13 06 52"
src="https://github.com/go-gitea/gitea/assets/17645053/1d4ded3c-fb77-4dd8-9201-24d0696f96eb">

class name has changed in #25134, so the selector is not working.
Enhance the selectors to fix this.