Commit Graph

4524 Commits

Author SHA1 Message Date
wxiaoguang def907de7b
Fix incorrect "tab" parameter for repo search sub-template (#27755)
![image](https://github.com/go-gitea/gitea/assets/2114189/c546824e-4824-4f4d-bd33-e558c6ddf0ef)


![image](https://github.com/go-gitea/gitea/assets/2114189/713eb72c-22fb-412b-a867-9cccbf7548ec)
2023-10-24 02:00:06 +00:00
silverwind d8c09c25d1
Enable followCursor for language stats bar (#27713)
Fixes: https://github.com/go-gitea/gitea/issues/27600


![](https://github.com/go-gitea/gitea/assets/115237/96743d90-0712-4f13-84ec-66f84e6ed2d7)

Also tested together with https://github.com/go-gitea/gitea/pull/27704,
works well.
2023-10-22 13:06:04 +00:00
tomholford e3afe4a248
teams: new View button (#27685)
Per the discussion on #22054, the flow for adding a new team member to
an org is not intuitive for new Gitea users.

The ideal solution would be to add a new button on the Org > Members
index view (see the screenshot mockup in the issue description).
However, this would require a refactor of the UX for the flow. The
current flow has an implicit context of which team within the org the
new member is being added to ('Owners' by default). From the Members
index, there is no implicit context; the flow would have to add a picker
for which team the new member should be added to.

So, as a stopgap, this change simply adds a button to the Teams index
page that performs the same action as clicking on the title of the team
(a behavior that is currently too obscure as indicated in the comments
on the issue). This should reduce support burden and serve as a decent
temporary measure until the Add Member flow is refactored.

---------

Co-authored-by: tomholford <tomholford@users.noreply.github.com>
2023-10-22 12:34:16 +00:00
6543 adbc995c34
Show total TrackedTime on issue/pull/milestone lists (#26672)
TODOs:
- [x] write test for `GetIssueTotalTrackedTime`
- [x] frontport kitharas template changes and make them mobile-friendly

---

![image](https://github.com/go-gitea/gitea/assets/24977596/6713da97-201f-4217-8588-4c4cec157171)

![image](https://github.com/go-gitea/gitea/assets/24977596/3a45aba8-26b5-4e6a-b97d-68bfc2bf9024)

---
*Sponsored by Kithara Software GmbH*
2023-10-19 14:08:31 +00:00
JakobDev 398eccb322
Fix required checkboxes in issue forms (#27592)
If you set a checkbox as required in a issue form at the moment, the
checkbox is checked and read only, what does not make much sense. With
this PR, the Checkbox actually needs to be checked. The label supports
now also Markdown. This matches GitHub's behaviour.

And yes, I know the CSS is a ugly workaround. It looks like the given
CSS code is part Fomantic and I don't know how to change that. The
Maintainers are free to change that.


![grafik](https://github.com/go-gitea/gitea/assets/15185051/3f35be75-b0b4-42a7-9048-a4970384a035)
2023-10-19 11:43:15 +00:00
sebastian-sauer 7210f23fa0
Add link for repositories README file (#27684)
this allows to deep link to the readme section of a repository.

fixes #27641

Screenshots:

No changes on initial display:

![image](https://github.com/go-gitea/gitea/assets/1135157/efbef50e-c24b-4cca-b19f-9092e70b5a5f)

On hover the link is shown:

![image](https://github.com/go-gitea/gitea/assets/1135157/c8dff2b8-31dc-4b7b-96d0-27642318483d)
2023-10-18 17:59:46 -05:00
yp05327 8abc1aae4a
Improve the list header in milestone page (#27302)
The ui of list header in milestone page is not same as issue and pr list
page.
And they are using different template codes which can be merged into
one.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/29eb426c-2dd6-4cf2-96e0-82339fb631bb)

![image](https://github.com/go-gitea/gitea/assets/18380374/b36c4dff-469a-4395-8a02-a8c54e17ab21)



![image](https://github.com/go-gitea/gitea/assets/18380374/d882c74a-451b-431d-b58e-3635a15d9718)

![image](https://github.com/go-gitea/gitea/assets/18380374/292cd38d-1b50-47f1-b32c-9b5de90ce5fb)


After:

![image](https://github.com/go-gitea/gitea/assets/18380374/4529234e-67dc-4e17-9440-e638be4fbc41)

![image](https://github.com/go-gitea/gitea/assets/18380374/c15b4d86-0762-497b-b28d-72d09443d629)

---------

Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
2023-10-18 00:03:42 +00:00
puni9869 4adc2a828d
Hide archived labels by default from the suggestions when assigning labels for an issue (#27451)
Followup of #27115
Finally closes #25237

## Screenshots
### Issue Sidebar
<img width="513" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/9f7fda2f-5a03-4684-8619-fd3498a95b41">

### PR sidebar
<img width="367" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/53db9b64-faec-4a67-91d6-76945596a469">

### PR sidebar with archived labels shown
<img width="352" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/9dc5050f-4e69-4f76-bb83-582480a2281e">

---------

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-10-17 16:10:45 +02:00
Denys Konovalov 0271114e64
cleanup repo details icons/labels (#27644)
Fix #27596 

Change confusing behavior when showing information about a repo via
labels and icons. Implement changes proposed by @lng2020 in
https://github.com/go-gitea/gitea/pull/27627#pullrequestreview-1678787673.
2023-10-16 23:06:15 +02:00
wxiaoguang 6c501b1498
Improve dropdown button alignment and fix hover bug (#27632)
1. fix #27631 , and add samples to devtest page
2. fix incorrect color for "ui dropdown button" when hover
2023-10-16 07:26:08 +00:00
Earl Warren 89c9a498fd
Add anchor to review types (#26894)
- The review type '22' is a general comment type that is attached to
single codecomments, reviews with multiple comments or to simple approve
and request changes comment. This comment can be used to create a link
towards this action on an pull request.
- Adds an anchor to the review comment type, so that when its getting
linked to it, it actually jumps towards that event.
- This also now fixes the behavior that after you created a review you
will be redirected to that review and because this is an general comment
type other mails will also be 'fixed' such as the approved or request
changes.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1248

(cherry picked from commit 1741a5f1fe6adc68bb5f87bdd1c5bdc5bfaa45c7)

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
2023-10-14 16:13:59 -05:00
JakobDev bf24852b20
Keep filter when showing unfiltered results on explore page (#27192)
Fixes https://codeberg.org/Codeberg/Community/issues/1302

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-11 22:10:51 +00:00
JakobDev 328da56a28
Don't show Link to TOTP if not set up (#27585) 2023-10-11 20:12:54 +00:00
Lunny Xiao fb74fe99d6
Fix template bug (#27581)
Regression from #27414
2023-10-11 14:02:15 +00:00
silverwind 73b63d9311
Replace ajax with fetch, improve image diff (#27267)
1. Dropzone attachment removal, pretty simple replacement
2. Image diff: The previous code fetched every image twice, once via
`img[src]` and once via `$.ajax`. Now it's only fetched once and a
second time only when necessary. The image diff code was partially
rewritten.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-11 12:34:21 +00:00
JakobDev ebe803e514
Penultimate round of `db.DefaultContext` refactor (#27414)
Part of #27065

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-10-11 04:24:07 +00:00
Kyle D ac4ae35542
Remove max-width and add hide text overflow (#27359)
Closes https://github.com/go-gitea/gitea/issues/27358
2023-10-09 19:04:31 -04:00
Michael Santos 5283ce9650
api: GetPullRequestCommits: return file list (#27483)
Fixes https://github.com/go-gitea/gitea/issues/27481

----

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-09 11:22:12 +00:00
wxiaoguang d1527dac3d
Improve file history UI and fix URL escaping bug (#27531)
Follow #27354

Major changes:

1. The `right aligned` in `<th class="one wide right aligned">` is a
no-op because it doesn't have any content
2. The `gt-df` in `<td class="sha gt-df">` was wrong, it causes UI
misalignment, a table cell shouldn't be "flex"
3. Use `gt-py-0` for `gt-pt-0 gt-pb-0`
4. Simplify the layout for buttons, because the `text right aligned` is
widely used and good enough, it doesn't make sense to introduce the
`<div class="gt-df gt-je">`
5. Escape the `$.FileName` correctly


Before:


![image](https://github.com/go-gitea/gitea/assets/2114189/eb2ced3f-1dad-4149-9ed2-aee4c0663621)

After:


![image](https://github.com/go-gitea/gitea/assets/2114189/08244b61-416b-4279-b495-029bc0a96f67)
2023-10-09 07:19:23 +00:00
silverwind 5bf367f904
Restore warning commit status (#27504)
Partial revert of https://github.com/go-gitea/gitea/pull/25839. This
commit status is used by a number of external integrations, so I think
we should not remove it (See
https://github.com/go-gitea/gitea/pull/25839#issuecomment-1729002077).
This is a rare case where an existing migration needed to be alterted to
avoid data loss.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-08 22:16:06 +00:00
Lunny Xiao f40538e667
Remove unnecessary desc for openssh key cron task (#27515) 2023-10-08 14:23:39 +00:00
mohammed ahmed 551dc8bb4d
[FIX] missing ctx in new_form (#27514)
added the ctx for the project link in new_form.tmpl

---

![Screenshot_20231008_075757](https://github.com/go-gitea/gitea/assets/64513301/8adaa287-9e55-4428-bc48-f8e6a2080624)
2023-10-08 14:35:20 +08:00
techknowlogick e96e440b8b
add a shortcut to user's profile page to admin user details (#27299) 2023-10-08 02:48:32 +00:00
silverwind 0bccf078c9
Update JS and PY dependencies (#27501)
- Update all JS and PY dependencies
- Enable eslint `prefer-object-has-own` and autofix issue
- Fix styling on citation buttons
- Tested citation, mermaid, monaco, swagger, katex

Citation button issue was that these buttons were not filled:

<img width="136" alt="Screenshot 2023-10-07 at 14 05 08"
src="https://github.com/go-gitea/gitea/assets/115237/435f0c91-28ac-46b3-bae4-dad768b29c05">

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-10-08 00:16:20 +00:00
silverwind 3b139fa3a3
Improve feed icons and feed merge text color (#27498)
1. Improve various feed icons
2. Fix merge message color


<img width="763" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/3f5bcb23-6d90-4c63-85f2-46bd7e1c96d6">
<img width="769" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/466c37b4-e2f4-42bb-922d-b86596cdc6d0">


Fixes: https://github.com/go-gitea/gitea/issues/27495
Continues: https://github.com/go-gitea/gitea/pull/27356
2023-10-07 23:26:27 +00:00
silverwind 023e937141
Rename the default themes to gitea-light, gitea-dark, gitea-auto (#27419)
Part of https://github.com/go-gitea/gitea/issues/27097:

- `gitea` theme is renamed to `gitea-light`
- `arc-green` theme is renamed to `gitea-dark`
- `auto` theme is renamed to `gitea-auto`

I put both themes in separate CSS files, removing all colors from the
base CSS. Existing users will be migrated to the new theme names. The
dark theme recolor will follow in a separate PR.

## ⚠️ BREAKING ⚠️

1. If there are existing custom themes with the names `gitea-light` or
`gitea-dark`, rename them before this upgrade and update the `theme`
column in the `user` table for each affected user.
2. The theme in `<html>` has moved from `class="theme-name"` to
`data-theme="name"`, existing customizations that depend on should be
updated.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-06 09:46:36 +02:00
wxiaoguang 9f8d59858a
Refactor system setting (#27000)
This PR reduces the complexity of the system setting system.

It only needs one line to introduce a new option, and the option can be
used anywhere out-of-box.

It is still high-performant (and more performant) because the config
values are cached in the config system.
2023-10-05 09:08:19 +08:00
Lunny Xiao dd221b9aec
Fix pr template (#27436)
Fix #27431
2023-10-04 12:28:25 +00:00
CaiCandong df56b1bf92
Fix missing `ctx` in new_form.tmpl (#27434)
Fix  #27432
Regression of #27265
2023-10-04 12:12:17 +02:00
silverwind cbc0b7307d
Use flex-container for repo and org settings (#27418)
Same as https://github.com/go-gitea/gitea/pull/26046 but for repo and
org settings pages, reducing the margins between the boxes:

<img width="1247" alt="Screenshot 2023-10-03 at 23 25 19"
src="https://github.com/go-gitea/gitea/assets/115237/4e68ad5e-5fdc-4466-aefb-ec71bf411d45">
<img width="1255" alt="Screenshot 2023-10-03 at 23 27 12"
src="https://github.com/go-gitea/gitea/assets/115237/9068369b-a75d-401e-8b8d-3bd4bbe097dc">

Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-04 08:47:54 +02:00
delvh 112f37c546
Fix yet another `ctx` template bug (#27417)
Fixes #27416
2023-10-04 02:11:01 +00:00
JakobDev cc5df26680
Even more `db.DefaultContext` refactor (#27352)
Part of #27065

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2023-10-03 10:30:41 +00:00
Denys Konovalov 33de64cb21
link to file from its history (#27354)
Fixes #3852
Fixes https://github.com/go-gitea/gitea/issues/26707

Add a button on file history which directs you to the file at the
selected commit.

Co-authored-by: silverwind <me@silverwind.io>
2023-10-02 04:04:32 +00:00
merlleu a112cf34d3
Cargo package - Fix missing domain in cargo sparse url (#27370)
Hello, it seems that one my previous PR (adding the sparse index to the
cargo package content page), did not worked as expected: the
gitea-origin-url does not add the AppURL because of the `sparse+` prefix
in the url.
Currently the rendered page gives the following:
```toml
[registry]
default = "gitea"

[registries.gitea]
index = "sparse+/api/packages/ownername/cargo/" # Sparse index
# index = "https://git.example.com/ownername/_cargo-index.git" # Git

[net]
git-fetch-with-cli = true
```
2023-10-01 13:43:15 +00:00
puni9869 50070550a8
Hide archived labels when filtering by labels on the issue list (#27115)
Followup  https://github.com/go-gitea/gitea/pull/26820
## Archived labels UI for issue filter and issue filter actions for
issues/pull request pages.

Changed:
* Enhanced the Issue filter and Issue filter actions UI page to
seamlessly incorporate a list of archived labels.
* Pagination functionality is same as before. If archived label checkbox
is checked then we are adding a query string`archived=true` in the url
to save the state of page.
* Issue filter actions menu is separated into different template.
* Adding the archived flag in issue url labels.
* Pull Request page is also work the same.

Outsourced:
* Defer the implementation of specialized handling for archived labels
to upcoming pull requests. This step will be undertaken subsequent to
the successful merge of this pull request.

Screenshots
### Issue page
<img width="1360" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/d7efb2ef-5b2b-449d-83f0-d430a32ec432">

### Issue page with label filter on archived label checkbox when not
checked --> No archived label is there in list
<img width="1249" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/ceea68ef-91f2-4693-910f-2e25e236bfc9">

### Issue page with label filter on archived label checkbox when checked
--> Show archived label in the list.
<img width="710" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/2414d26b-2079-4c3c-bd9e-f2f5411bcabf">

### Issue page with label filter on issue action menu on archived label
checkbox when checked --> Show archived label in the list.
<img width="409" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/259cac87-3e21-4778-99a2-a6a0b8c81178">


### Applied the archived=true in Issue labels when archived checkbox is
checked.
<img width="984" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/657ce3db-c0ae-402e-b12d-3b580d3c2ed0">

---




Part of https://github.com/go-gitea/gitea/issues/25237

---------

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-01 09:04:39 -04:00
CaiCandong 6b65c41ebf
Fix missing ctx for GetRepoLink in dashboard (#27372)
As title
Fix #27369
Regression of #27265
2023-10-01 09:26:28 +00:00
Denys Konovalov 4ab597f479
highlight user details link (#26998)
This PR adds a separated column in the users table for operations. The
username link now redirects back to user page.


![grafik](https://github.com/go-gitea/gitea/assets/47871822/df8c8b30-3da6-443c-ae0f-6e3cac7dd9bb)

Resolves
https://github.com/go-gitea/gitea/pull/26713#pullrequestreview-1603001285

Co-authored-by: silverwind <me@silverwind.io>
2023-10-01 11:58:24 +08:00
silverwind 83f571628d
Feed UI Improvements (#27356)
Various improvements related to feeds:

- Fix markdown rendering
- Increase font size from 13px to default 14px via `flex-item`
- Add style to hashes
- Move the timestamp to title line. I realize it's not optimal for
translation, we may need to change all these translations

Before:
<img width="768" alt="Screenshot 2023-09-29 at 22 52 58"
src="https://github.com/go-gitea/gitea/assets/115237/edda8b84-23cf-4a43-90ad-a892798f4e6c">

After:
<img width="781" alt="Screenshot 2023-09-29 at 22 58 09"
src="https://github.com/go-gitea/gitea/assets/115237/7097474d-efcf-4f22-a2ab-834a4e25c4e8">
2023-09-30 15:48:34 +00:00
Lunny Xiao 7d14aa062f
Fix template bug (#27362)
Fix #27361
2023-09-30 17:03:04 +08:00
Lunny Xiao c3b7231966
Add protected branch name description (#27257)
Co-authored-by: delvh <dev.lh@web.de>
2023-09-29 14:02:35 +00:00
JakobDev cf0df023be
More `db.DefaultContext` refactor (#27265)
Part of #27065

This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.
2023-09-29 12:12:54 +00:00
yp05327 3945c26722
Improve tree not found page (#26570)
Before:

![before](https://github.com/go-gitea/gitea/assets/18380374/383822d5-7d77-4ec3-b49b-4ab1e8b167ce)

After:

![after](https://github.com/go-gitea/gitea/assets/18380374/32afa0a3-fa05-4087-b96e-7d067f0ed756)

In Github:
https://github.com/yp05327/test/blob/main/test.drawio

Updated:
UI changed

![image](https://github.com/go-gitea/gitea/assets/18380374/41ed07ff-b815-4b4e-9779-5ab36b5f3980)

![image](https://github.com/go-gitea/gitea/assets/18380374/5d7b28d6-a2fc-4d4c-8d6d-d93f9c9a270b)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-09-29 07:42:39 +00:00
Dmitry Sharshakov 5e02e3b7ee
Add support for forking single branch (#25821)
Fixes #25117

Add UI for choosing branch to fork

Change default branch on single-branch forks


![image](https://github.com/go-gitea/gitea/assets/19504461/28505f69-a9a2-43a8-8b19-a0cdac3ddc5a)

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-09-29 09:48:39 +08:00
wxiaoguang 1f00bc44b2
Fix review UI (#27322)
Close #26730


1. The `diff-detail-box` was abused, it shouldn't be used for
"DiffFileList/DiffFileTree".
2. Fix the sticky position for various screens.



![image](https://github.com/go-gitea/gitea/assets/2114189/558a5c06-c94c-4e5c-8395-d38473dd21c2)


![image](https://github.com/go-gitea/gitea/assets/2114189/3390fb0e-7dc7-457f-bd0c-398fdb6d24c0)


![image](https://github.com/go-gitea/gitea/assets/2114189/d19dd350-aecf-4909-8ef9-73b09d94560e)
2023-09-28 10:00:26 +00:00
wxiaoguang 7ea2a910ce
Improve branch list UI (#27319)
1. Put the `"octicon-shield-lock"` into the flex container, then it
doesn't need a separate flex box
2. Remove some unnecessary `gt-df` helpers
3. Make `btn` button has the same flex behavior as `ui button`


![image](https://github.com/go-gitea/gitea/assets/2114189/60ce75f7-7fac-4157-9c42-91c7dee9300e)



![image](https://github.com/go-gitea/gitea/assets/2114189/ea606baf-6f52-41e1-b964-c4840d3b1529)
2023-09-28 04:04:32 +00:00
yp05327 e5e1d842c0
Fix protected branch icon location (#26576) 2023-09-27 22:21:31 +00:00
yp05327 5ef5a0ade6
Fix divider in subscription page (#27298)
the divider should always display in the subscription page.

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-09-27 04:00:57 +00:00
delvh 1f89a45926
Fix incorrect change from #27231 (#27275) 2023-09-26 13:10:29 +00:00
wxiaoguang 939d410a93
Add missing IconHTML size (#27269)
Fix #27223

Regression of #27122
2023-09-26 19:59:04 +08:00
wxiaoguang 93bd4351bf
Fix more "locale" usages (#27259) 2023-09-25 20:42:40 +08:00
delvh 7960ba7e2b
Always use `ctx.Locale.Tr` inside templates (#27231) 2023-09-25 08:56:50 +00:00
Yarden Shoham e6d8b14620
Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211)
These buttons are now disabled when the webhook is not active.

The buttons were always enabled before this change.

- Fixes #26824
- Replaces #26814

# Before


![image](https://github.com/go-gitea/gitea/assets/20454870/e783d0d8-b433-440e-b95f-50d7c42613d3)


![image](https://github.com/go-gitea/gitea/assets/20454870/b4886151-9f32-4e83-8001-dd3f20c23d70)

# After


![image](https://github.com/go-gitea/gitea/assets/20454870/74b76a72-0818-4143-8548-5d42c4119a05)


![image](https://github.com/go-gitea/gitea/assets/20454870/d5ae4e5c-c1ac-4751-a072-e6f7511b1e07)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2023-09-25 07:33:00 +00:00
yp05327 65d0b7c13a
Add missing public user visibility in user details page (#27246)
It seems that `Public` user visibility is missing in the template.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/a8e7f3e0-1b77-41a0-921a-10adba90211e)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/b0bffe13-0ca6-453e-95d7-0794528d5733)
2023-09-25 08:27:03 +02:00
silverwind 6af34c09a7
Use mask-based fade-out effect for `.new-menu` (#27181)
The `.new-menu` was using a pseudo-element based fade-out effect.
Replace this with a more modern mask-based effect which in this case
required a child element to avoid fading out the background as well, so
I applied it to child `new-menu-inner` which was present on all these
menus except explore where I added it.

There is no visual difference except that the items on the explore page
have no `gap` between them any longer, making it consistent with other
menus. Before and after:

<img width="221" alt="Screenshot 2023-09-21 at 21 13 19"
src="https://github.com/go-gitea/gitea/assets/115237/b4a38ce2-cee1-4c54-84a5-e1d0bfd79e29">
<img width="222" alt="Screenshot 2023-09-21 at 21 32 36"
src="https://github.com/go-gitea/gitea/assets/115237/bb6b1335-d935-4ad4-bb85-3b0fc3027c2b">

Also, this cleans up the related CSS vars:

- `--color-header-wrapper-transparent` is removed, no longer needed
- `--color-header-wrapper` is defined in base theme as well, was
previously unset and therefor transparent.

[no whitespace
diff](https://github.com/go-gitea/gitea/pull/27181/files?diff=unified&w=1)
[demo of mask fade](https://jsfiddle.net/silverwind/tsfadb3u/)
2023-09-25 01:03:00 +00:00
Denys Konovalov 2325fe777d
cleanup locale function usage (#27227) 2023-09-24 20:31:58 +00:00
silverwind 3a187eace5
Fix EOL handling in web editor (#27141)
Fixes https://github.com/go-gitea/gitea/issues/27136.

This does the following for Monaco's EOL setting:

1. Use editorconfig setting if present
2. Use the file's dominant line ending as detected by monaco, which uses
LF for empty file
2023-09-24 19:51:02 +00:00
Nabapadma-sarker 8e23524b18
Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203)
Fixes #27202
2023-09-24 19:02:47 +00:00
Denys Konovalov 63b25e816d
fix issues on action runners page (#27226)
- switch from some weird status badge to label
- translate untranslated `Reset registration token` string
- change documentation link from act_runner README to Gitea Docs site
- fix "No runners available" message width
- use `ctx.Locale.Tr` where possible


![grafik](https://github.com/go-gitea/gitea/assets/47871822/65547228-f9ed-4f80-9cfd-df5e55513a44)
2023-09-24 14:12:21 -04:00
wxiaoguang efd5176278
Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225)
Fix #27224

And add the case to the devtest page.
2023-09-24 21:07:57 +08:00
Daniel Kilimnik 0ee7cbf725
Fix push mirror, wrong timestamp format (#27153)
I noticed, that the push mirrors endpoint, is the only endpoint which
returns the times in long format rather than as time.Time().

I think the behavior should be consistent across the project.

----

## ⚠️ BREAKING ⚠️

This PR changes the time format used in API responses for all
push_mirror endpoints which return a push mirror.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-23 12:15:05 +00:00
JakobDev 5f7388e586
Allow copying issue comment link on archived repos and when not logged in (#27193)
Fixes https://codeberg.org/Codeberg/Community/issues/1303
2023-09-23 11:31:54 +00:00
metiftikci 6c563a302a
fix: text decorator on issue sidebar menu label (#27206)
fix underline for label on issue sidebar
2023-09-23 18:51:23 +08:00
JakobDev 28f9b313ba
Updates to the API for archived repos (#27149) 2023-09-21 23:43:29 +00:00
wxiaoguang 1f026bcb7e
Fix dropdown icon position (#27175)
According to https://fomantic-ui.com/modules/dropdown.html and our
"devtest" page, many dropdown elements has incorrect "icon" position.

This PR fixes all of them. Fix #27173
2023-09-21 15:54:26 +00:00
Nanguan Lin 218e719ea8
Fix the variable regexp pattern on web page (#27161)
same as (https://github.com/go-gitea/gitea/pull/26910)
2023-09-21 09:03:13 +00:00
silverwind 1b1c55f73f
Increase auth provider icon size on login page (#27122)
Before, 20px:
<img width="474" alt="Screenshot 2023-09-19 at 00 10 05"
src="https://github.com/go-gitea/gitea/assets/115237/4bed4edb-219d-4844-9d3c-0d747033b09f">

After, 28px:
<img width="576" alt="Screenshot 2023-09-19 at 00 20 40"
src="https://github.com/go-gitea/gitea/assets/115237/f482ac09-38ae-4c84-80d9-0bd39b7f9772">


Dropdown in account settings is unchanged at 20px:
<img width="157" alt="Screenshot 2023-09-19 at 00 09 11"
src="https://github.com/go-gitea/gitea/assets/115237/9c998cdf-eeed-4118-9262-664faaa56092">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-19 21:47:13 +00:00
silverwind 8099238618
Change green buttons to primary color (#27099)
I think it's better if the primary actions have primary color instead of
green which fits better into the overall single-color UI design. This PR
currently replaces every green button with primary:

<img width="141" alt="Screenshot 2023-09-16 at 14 07 59"
src="https://github.com/go-gitea/gitea/assets/115237/843c1e50-4fb2-4ec6-84ba-0efb9472dcbe">
<img width="161" alt="Screenshot 2023-09-16 at 14 07 51"
src="https://github.com/go-gitea/gitea/assets/115237/9442195a-a3b2-4a42-b262-8377d6f5c0d1">

Modal actions now use uncolored/primary instead of previous green/red
colors. I also removed the box-shadow on all basic buttons:

<img width="259" alt="Screenshot 2023-09-16 at 14 16 39"
src="https://github.com/go-gitea/gitea/assets/115237/5beea529-127a-44b0-8d4c-afa7b034a490">
<img width="261" alt="Screenshot 2023-09-16 at 14 17 42"
src="https://github.com/go-gitea/gitea/assets/115237/4757f7b2-4d46-49bc-a797-38bb28437b88">

The change currently includes the "Merge PR" button, for which we might
want to make an exception to match the icon color there:

<img width="442" alt="Screenshot 2023-09-16 at 14 33 53"
src="https://github.com/go-gitea/gitea/assets/115237/993ac1a5-c94d-4895-b76c-0d872181a70b">
2023-09-18 22:05:31 +00:00
CaiCandong 323135b97b
Fix the incorrect route path in the user edit page. (#27007)
Regression of #26713

After #26713 , the base path of user edit has been changed to
`/admin/users/{userid}/edit`
## Before

https://github.com/go-gitea/gitea/assets/50507092/5f4a3f64-fe2b-4499-b110-e01c9d87ea19
2023-09-18 14:08:09 +02:00
puni9869 a50d9af876
Display archived labels specially when listing labels (#26820)
Follow up https://github.com/go-gitea/gitea/pull/26741

Changes:
Added archived label for org labels and added into issue filter list.


Part of https://github.com/go-gitea/gitea/issues/25237

---------

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-09-18 04:54:05 +00:00
wxiaoguang e97baed800
Remove a `gt-float-right` and some unnecessary helpers (#27110)
Follow  Remove polluted .ui.right #26825 

Remove more `gt-float-right`, remove unnecessary helpers, remove
negative margin tricks.

![image](https://github.com/go-gitea/gitea/assets/2114189/2785c6e6-7823-4699-a4f3-184eef50ceda)
2023-09-18 12:25:36 +08:00
CaiCandong f93ee5937b
Fix token endpoints ignore specified account (#27080)
Fix #26234
close #26323
close #27040

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-09-18 00:21:15 +00:00
Lunny Xiao 47b878858a
Search branches (#27055)
Resolve #25233 

<img width="1315" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/3ba59b58-471a-4e1b-985c-87edac2268c0">

<img width="1297" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/b6caa12f-323b-4f70-9c44-ef91cb71a26c">
2023-09-17 08:24:40 +00:00
KN4CK3R ed64f1c2b8
Support `.git-blame-ignore-revs` file (#26395)
Closes #26329

This PR adds the ability to ignore revisions specified in the
`.git-blame-ignore-revs` file in the root of the repository.


![grafik](https://github.com/go-gitea/gitea/assets/1666336/9e91be0c-6e9c-431c-bbe9-5f80154251c8)

The banner is displayed in this case. I intentionally did not add a UI
way to bypass the ignore file (same behaviour as Github) but you can add
`?bypass-blame-ignore=true` to the url manually.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-09-16 17:42:34 +00:00
KN4CK3R c766140dad
Add `RemoteAddress` to mirrors (#26952)
This PR adds a new field `RemoteAddress` to both mirror types which
contains the sanitized remote address for easier (database) access to
that information. Will be used in the audit PR if merged.
2023-09-16 16:03:02 +00:00
KN4CK3R f3f445862e
Use `print` instead of `printf` (#27093)
A bit more performant when we only use it for appending strings.
2023-09-16 03:51:54 +00:00
Lunny Xiao 198a9ca635
Display all user types and org types on admin management UI (#27050)
Follow #24026 

<img width="1049" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/d3fc5159-b5e7-411a-b6f8-4a111a027e6b">

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-09-14 06:53:36 +00:00
yp05327 076eca8158
Fix incorrect default branch label while switching between branches (#27053)
Fix #27008
2023-09-14 03:54:25 +00:00
Kerwin Bryant a38eca3f52
Fix Fomantic's line-height causing vertical scrollbars to appear (#26961)
Before:

![before](https://github.com/go-gitea/gitea/assets/3371163/bc5a3b20-3490-4e14-ab1d-2fcfbc4a2e20)

After:

![after](https://github.com/go-gitea/gitea/assets/3371163/70e8be6a-11a2-46af-9e1e-78ac153cd2a4)

---  

1. **Remove the scroll bar exception that in the a tag**  
2. **Reduce the actual width of the a tag to the actual width of the
content**

![c363a5b5883e105a0c65d7337893b50](https://github.com/go-gitea/gitea/assets/3371163/789d9b83-ad14-46d2-8a1b-df551a063f6a)
As shown in the screenshot, the red box area should not be clickable
2023-09-13 09:08:45 +00:00
Dmitry Sharshakov 63b53af933
Show OpenID Connect and OAuth on signup page (#20242)
Fix #19809

---------

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Co-authored-by: jackHay22 <jack@allspice.io>
2023-09-13 05:14:21 +00:00
merlleu e6a059a3d0
add sparse url in cargo package guide (#26937)
Hello,

The current package guide for cargo gives you only the git index, with
the HTTP Index stabilized being used as default for crates.io and being
better for most use-cases.

However, it's not documented that gitea supports the sparse spec, and it
does not require the _crates-index git repo for the sparse api.

I personally think we should push users to use the sparse instead of the
git repository. (Even let users disable crates-index repos if they only
want to use sparse)
2023-09-13 12:14:10 +08:00
JakobDev aaeec2a392
Add missing 404 response to Swagger (#27038)
Most middleware throw a 404 in case something is not found e.g. a Repo
that is not existing. But most API endpoints don't include the 404
response in their documentation. This PR changes this.
2023-09-13 10:37:54 +08:00
wxiaoguang 739e47cd80
Improve repo/user/org search (#27030)
* Fix a regression from #26809 (the `data-org` is missing)
* Remove unnecessary style

Screenshots:


![image](https://github.com/go-gitea/gitea/assets/2114189/3f5cf628-db7f-4705-898a-7a4a1fbfbba8)


![image](https://github.com/go-gitea/gitea/assets/2114189/453d1fad-1090-4524-bf45-6c5da2465f04)


![image](https://github.com/go-gitea/gitea/assets/2114189/f14d9808-7596-42c8-84b4-0d57a0bf2278)
2023-09-12 16:44:48 +00:00
jladbrook e33f112e01
resolve issue with sort icons on admin/users and admin/runners (#24360)
Fixes #24327 to avoid the sort icon changing the table header over
multiple lines and adds missing sort icons on the runners page.
2023-09-12 12:26:51 +00:00
wxiaoguang 1875362383
Fix "delete" modal dialog for issue/PR (#27015)
Close #27012

By the way, rename the single-word ID to a long ID.


![image](https://github.com/go-gitea/gitea/assets/2114189/9f05ecc3-0a3d-4612-85e0-da60f7a45d2e)


![image](https://github.com/go-gitea/gitea/assets/2114189/9133808c-bd89-4265-99c5-83b986bd266f)
2023-09-11 17:06:05 +00:00
wxiaoguang dd6e8ab57b
Improve "language stats" UI (#26968)
Before:

* The layout is quite complex 
* The UI flickers when switch the stats (https://try.gitea.io/)

After:

* Simplify the code
* The UI doesn't flicker
2023-09-10 18:27:23 +08:00
wxiaoguang 58abd4f06c
Improve issue list layout (#26983)
Align everything with a new layout.

* Use "baseline" for some special elements, the "flex-item-icon" is for
the issue list only at the moment and I think it should be general
enough now (but not using "flex-item-leading" anymore in this case).
* Make the labels stretch themselves.
2023-09-09 20:23:57 +08:00
Lunny Xiao 9c0a3532a4
Add a new column schedule_id for action_run to track (#26975)
Fix #26971 

And the UI now will display it's scheduled but not triggered by a push.

<img width="954" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/d211845c-457e-4c3e-af1f-a0d654d3f365">
2023-09-08 23:01:19 +08:00
wxiaoguang ffa4949eaa
Improve flex list UI (#26970)
1. There is already `gt-ac`, so no need to introduce `flex-item-center`
2. The `flex-item-baseline` and `.flex-item-icon svg { margin-top: 1px
}` seem to be a tricky patch, they don't resolve the root problem, and
still cause misalignment in some cases.
* The root problem is: the "icon" needs to align with the sibling
"title"
    * So, make the "icon" and the "title" both have the same height 
3. `flex-text-inline` could only be used if the element is really
"inline", otherwise its `vertical-align` would make the box size change.
In most cases, `flex-text-block` is good enough.


![image](https://github.com/go-gitea/gitea/assets/2114189/1b7acfc2-b1c7-4e9c-a983-2fa932026479)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-08 13:57:18 +00:00
CaiCandong 30cea70dd8
Refactor dashboard/feed.tmpl (#26956)
- ~~Refactor `ActionType` to `models/activities/action_type.go`~~
- Replace the magic number in `feed.tmlp` with `InAction`
2023-09-07 16:23:13 +02:00
wxiaoguang 419003adb2
Improve SSH Key / GPG Key / Deploy Key UI (#26949)
1. In many cases, the `flex-list` has previous and next `gt-hidden`
siblings, so relax the CSS selector to remove all ".segument .flex-list"
paddings.
2. Make the "Add key" button can toggle
3. Move help message into the related segment(panel). Otherwise users
would misread the message, eg: the SSH help seemed for GPG because they
are so near
4. Move modal element into the segment element, otherwise it affects the
layout
2023-09-07 01:13:11 +00:00
Kerwin Bryant 9b0743ae33
Extract common code to new template (#26933)
Same as #26903
2023-09-06 10:11:06 +00:00
Nanguan Lin 01e71e2a47
Fix the secret regexp pattern on web page (#26910)
The error is caused by the web page not handling the post form
failure, which is 400 bad requests in this case.
2023-09-05 20:15:19 +00:00
techknowlogick e67ddaa0f8
update footer link to new landing page (#26916)
as title

Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-05 16:44:07 +00:00
KN4CK3R a99b96cbcd
Refactor secrets modification logic (#26873)
- Share code between web and api
- Add some tests
2023-09-05 15:21:02 +00:00
Bo-Yi Wu f79f6a26ae
feat(API): add routes and functions for managing user's secrets (#26909)
- Add routes for creating or updating a user's actions secrets in
`routers/api/v1/api.go`
- Add a new file `routers/api/v1/user/action.go` with functions for
creating or updating a user's secrets and deleting a user's secret
- Modify the `templates/swagger/v1_json.tmpl` file to include the routes
for creating or updating a user's secrets and deleting a user's secret

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-09-05 14:02:50 +00:00
Kerwin Bryant 65588b732c
Extract common code to new template (#26903)
I noticed that the code of several new webhook pages is highly
repetitive, so I pulled out the common parts to a new template, unified
reference, unified maintenance

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-09-05 12:00:28 +00:00
wxiaoguang 682552378f
More fixes for the "commit-body" (#26898)
The changes for "commit-body" in #26877 are not ideal.

The reason is: the "commit-body" is usually a `<pre>`, it has default
margins. In most cases, we do not need that large margin. So, this PR
introduces a general but small margin for all "commit-body" elements.
Then these `gt-m-0` could be removed.

The `:not` selector is not needed, because the `.timeline-item` selector
is already clear enough.
2023-09-04 13:38:59 +00:00
wxiaoguang c17fd68be7
Show queue's active worker number (#26896) 2023-09-04 21:07:32 +08:00
wxiaoguang 51cfe0e7de
Remove CSS `has` selector and improve various styles (#26891)
Replace  #26850

Major changes:

1. Remove all `has` selectors, it is still not supported by firefox.
Actually there could be some more general and clearer approaches
2. Remove `two-toggle-buttons`, the `.ui.buttons` just works well
3. Rewrite the `.ui.buttons` border styles, see the screenshots
4. Remove the "fine-tuning" paddings from the the flex children, they
could layout themselves well.

![image](https://github.com/go-gitea/gitea/assets/2114189/a32ed6f3-60f7-43d5-9492-62c45d2397f6)

![image](https://github.com/go-gitea/gitea/assets/2114189/5cb173c5-c942-4237-8cb4-2697220b3f06)

![image](https://github.com/go-gitea/gitea/assets/2114189/8a1c12b3-a632-48ff-b1a7-a01a4417f821)

![image](https://github.com/go-gitea/gitea/assets/2114189/46bde1bd-9113-4231-965d-6ec9076f6a3b)
2023-09-04 18:22:46 +08:00
BeYonme 918accaafa
Relocate the `RSS user feed` button (#26882)
before:

![before](https://github.com/go-gitea/gitea/assets/38558065/e33e0809-91cd-451a-9c36-ab20b9296038)

after:

![after](https://github.com/go-gitea/gitea/assets/38558065/9dbfb0ce-1d0e-4bc8-8502-6b4af0fba220)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-09-03 11:06:59 +00:00
wxiaoguang fba7150ca9
Refactor "shortsha" (#26877)
The old code used complex `if` blocks and strange HTML layouts.

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/7fbee2b8-d150-4e6b-b67e-83400fa290eb)

</details>

This PR refactors the template code and remove legacy CSS styles. The UI
doesn't change much.



![image](https://github.com/go-gitea/gitea/assets/2114189/3e195df9-0ab5-4182-bcb2-bb20cad823f2)


![image](https://github.com/go-gitea/gitea/assets/2114189/f707a49f-be41-4dfe-871f-2869f2230380)
2023-09-03 02:58:52 +00:00
wxiaoguang c802c46a9b
Refactor `og:description` to limit the max length (#26876)
1. The `og:description` should be "a one to two sentence description of
your object"
* It shouldn't output all the user inputted content -- it would be
pretty huge.
    * Maybe it only needs at most 300 bytes.
2. Do not render commit message as HTML
2023-09-03 01:43:29 +00:00
silverwind a625f3a761
Enable djlint H008 and fix issues (#26869)
Enable `H008 | Attributes should be double quoted` and fix issues.
2023-09-01 17:32:39 +00:00
Linus Groh 5743d7cb5b
Improve opengraph previews (#26851)
Add more useful Open Graph metadata for commit and file URLs:

- Set `og:title` to the page title, which is a concise summary in both
cases (`<commit message> · <commit hash>` and `<filename> at <branch>`,
respectively)
- Set `og:description` to the commit message body, if available
- Set `og:url` to the relevant URLs instead of the repo URL

Also move the relevant meta tags into a separate template as they now
take up the majority of the base head template.
2023-09-01 16:59:24 +00:00
Jack Hay 9881b8a4e2
Add more descriptive error on forgot password page (#26848)
## Changes
- Forces flashed error to render immediately when forgot password code
is incorrect or has expired.
- Adds a link back to the `forgot_password` page so that the user can
restart the process (in the event that their link has expired)
2023-09-01 16:15:39 +00:00
silverwind 02efd99010
Move licenses.txt to /assets directory (#26866)
Now that we have the `/assets` directory, we can put`licenses.txt`
directly into it instead of incorrect `/js` path which was previously
only done to avoid reserving a username.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-01 14:42:33 +00:00
Bo-Yi Wu 9eb4a9e601
feat(API): add secret deletion functionality for repository (#26808)
- Modify the `CreateOrUpdateSecret` function in `api.go` to include a
`Delete` operation for the secret
- Modify the `DeleteOrgSecret` function in `action.go` to include a
`DeleteSecret` operation for the organization
- Modify the `DeleteSecret` function in `action.go` to include a
`DeleteSecret` operation for the repository
- Modify the `v1_json.tmpl` template file to update the `operationId`
and `summary` for the `deleteSecret` operation in both the organization
and repository sections

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-09-01 13:02:49 +00:00
silverwind 9b76df53dc
Minor dashboard tweaks, fix flex-list margins (#26829)
Some small dashboard tweaks:

- Remove margin-bottom from divider so first item does not appear to
have un-equal margins
- Restore previous icon color
- Add slight margin-right to icon

Before:
<img width="783" alt="Screenshot 2023-08-31 at 00 10 28"
src="https://github.com/go-gitea/gitea/assets/115237/b75f70d7-8704-4afb-866d-fea0484c52d4">

After:
<img width="783" alt="Screenshot 2023-08-31 at 00 10 08"
src="https://github.com/go-gitea/gitea/assets/115237/50ed0c47-6f7c-449e-a054-13091369d43f">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-08-31 21:28:45 +00:00
Jack Hay c0ab7070e5
Update team invitation email link (#26550)
Co-authored-by: Kyle D <kdumontnu@gmail.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2023-08-31 16:26:13 +00:00
wxiaoguang d5703d4a1b
Remove "TODO" tasks from CSS file (#26835)
1. Use `gt-invisible` instead of `invisible`.
2. Use `gt-word-break` instead of `dont-break-out` (there is a slight
different "hyphens", but I think it won't affect too much since it is
only used for the "full name").
3. Remove `.small.button:has(svg)` , now our buttons could layout SVG
correctly, and actually I didn't see this CSS class is used in code.
2023-08-31 10:49:53 +00:00
Denys Konovalov 5b5bb8d354
User details page (#26713)
This PR implements a proposal to clean up the admin users table by
moving some information out to a separate user details page (which also
displays some additional information).

Other changes:
- move edit user page from `/admin/users/{id}` to
`/admin/users/{id}/edit` -> `/admin/users/{id}` now shows the user
details page
- show if user is instance administrator as a label instead of a
separate column
- separate explore users template into a page- and a shared one, to make
it possible to use it on the user details page
- fix issue where there was no margin between alert message and
following content on admin pages

<details>

<summary>Screenshots</summary>


![grafik](https://github.com/go-gitea/gitea/assets/47871822/1ad57ac9-f20a-45a4-8477-ffe572a41e9e)


![grafik](https://github.com/go-gitea/gitea/assets/47871822/25786ecd-cb9d-4c92-90f4-e7f4292c073b)


</details>

Partially resolves #25939

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-31 11:21:18 +02:00
silverwind 3d109861dd
Render code blocks in repo description (#26830)
Backtick syntax now works in repo description too. Also, I replaced the
CSS for this was a new single class, making it more flexible and not
dependent on a parent. Also, very slightly reduced font size from 16.8px
to 16px.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-08-31 05:01:01 +00:00
wxiaoguang 19a1e1b20e
Remove polluted `.ui.right` (#26825)
Each change is tested manually line by line. There are too many changes
so I can't share dozens of screenshots.

In short:

1. `ui right` could be still used in `ui top attached header`, because
there is a special case.
2. A lot of `ui right` are just no-op, so they can be removed safely.
3. Some of the `ui right` should be replaced by `gt-float-right` (to
avoid breaking, leave them to the future).
4. A few of the `ui right` could be rewritten by flex.
2023-08-31 02:29:59 +00:00
wxiaoguang 1bb9b1c4d9
Remove polluted ".ui.left" style (#26809) 2023-08-30 21:46:24 +08:00
wxiaoguang 1a9998ce91
Improve flex list item padding (#26779)
Replace #26761

It's better to keep children elements simple, and let parent containers
layout the necessary padding/margin.

The old `not(:last-child)` and `.flex-item + .flex-item` are not easy to
maintain (for example, what if the developer would like to use a "tiny
height" item?)

The old approach also makes some UI look strange because the first item
doesn't have proper padding-top.

In this PR, we just simply use `.flex-item { padding: ... }`:

* Developers could manually set the item height they want easily
* It's easier to make it work with various containers -- with padding
(`ui segment`) and without padding (`div`)

And added more samples/examples.


![image](https://github.com/go-gitea/gitea/assets/2114189/719ea712-0241-4426-b67f-5723993c4ed7)

Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-29 23:13:30 +00:00
Bo-Yi Wu b91057b172
feat(API): add route and implementation for creating/updating repository secret (#26766)
spec:
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret

- Add a new route for creating or updating a secret value in a
repository
- Create a new file `routers/api/v1/repo/action.go` with the
implementation of the `CreateOrUpdateSecret` function
- Update the Swagger documentation for the `updateRepoSecret` operation
in the `v1_json.tmpl` template file

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-29 20:54:49 +00:00
yp05327 008f5d8cf1
Add default label in branch select list (#26697) 2023-08-29 12:15:19 +00:00
CaiCandong c576b50441
Fix being unable to use a repo that prohibits accepting PRs as a PR source. (#26785)
## Description 
Sometimes, we need to use an upstream mirror repository to update the
current development repository, but mirror repositories are prohibited
from PR. It should not appear in `merge to,` but it can appear in `pull
from.`
Fix #24585 #26193 #26781
Related #24183

Many thanks to @apnote  for assisting me in reproducing this bug!

## ScreenShot
---
### Before

<img
src="https://github.com/go-gitea/gitea/assets/50507092/3d76c376-1f54-45b9-80c9-6ba8319d6a9a"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/fbfd9f7f-421f-4a2e-9a3e-f2958bbf3312"
width="400px">

### After

<img
src="https://github.com/go-gitea/gitea/assets/50507092/e6984524-4f61-4310-b795-4d8598bd8963"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/04065b44-78d7-4721-bf31-0f1674150727"
width="400px">
2023-08-29 12:07:15 +03:00
wxiaoguang 0ab70d4f2f
Improve modal dialog UI (#26764)
1. Fine tune the CSS styles, and add more examples
2. Add necessary "dimmer" animation for modal dialogs, otherwise the UI
seems flicking (follow #26469)
2023-08-28 23:49:21 +00:00
wxiaoguang 4803766f7a
Refactor some CSS styles and simplify code (#26771)
Refactor some CSS styles and simplify code.

Some styles are not in use, remove them.
2023-08-28 22:14:51 +08:00
Bo-Yi Wu 8cd46024fd
refactor(API): refactor secret creation and update functionality (#26751)
According to the GitHub API Spec:
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret

Merge the Create and Update secret into a single API.

- Remove the `CreateSecretOption` struct and replace it with
`CreateOrUpdateSecretOption` in `modules/structs/secret.go`
- Update the `CreateOrUpdateOrgSecret` function in
`routers/api/v1/org/action.go` to use `CreateOrUpdateSecretOption`
instead of `UpdateSecretOption`
- Remove the `CreateOrgSecret` function in
`routers/api/v1/org/action.go` and replace it with
`CreateOrUpdateOrgSecret`
- Update the Swagger documentation in
`routers/api/v1/swagger/options.go` and `templates/swagger/v1_json.tmpl`
to reflect the changes in the struct names and function names

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-08-28 13:08:19 +08:00
wxiaoguang 67daa7bcb0
Remove some transition related code (#26755)
Remove transition related code because the transition module has been
removed by #26469
2023-08-28 01:26:23 +00:00
Lunny Xiao 476b9d1589
Use docs.gitea.com instead of docs.gitea.io (#26739) 2023-08-27 11:59:12 +00:00
puni9869 e0a796a641
Adding hint `Archived` to archive label. (#26741)
Followup  https://github.com/go-gitea/gitea/pull/26478
## Archived labels UI

Changed:
* Enhanced the Filtered UI page to seamlessly incorporate a list of
archived labels.

Outsourced:
* Defer the implementation of specialized handling for archived labels
to upcoming pull requests. This step will be undertaken subsequent to
the successful merge of this pull request.

Screenshots

![image](https://github.com/go-gitea/gitea/assets/80308335/1f33cfb2-2bac-46f0-9103-9e62d235b1d2)

![image](https://github.com/go-gitea/gitea/assets/80308335/3609acd0-b1ba-4ee9-8c4e-1a34dbc37dd7)

![image](https://github.com/go-gitea/gitea/assets/80308335/9860196d-2391-409b-a9a0-1205ab4b412b)

---

Part of https://github.com/go-gitea/gitea/issues/25237

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
2023-08-27 09:32:54 +00:00
wxiaoguang 5914a2f8c0
Fix template bugs in recently_pushed_new_branches.tmpl (#26744)
Fix some bugs from #25715, fix #25830

1. `$.locale.Tr ... Safe` needs `Escape`, but not `PathEscapeSegments`
2. The attribute should be `role`
3. The `ComposeBranchCompareURL` already does escaping correctly
2023-08-27 08:16:02 +08:00
wxiaoguang 4fdb09de58
Fix incorrect "tabindex" attributes (#26733)
Fix #26731

Almost all "tabindex" in code are incorrect.

1. All "input/button" by default are focusable, so no need to use "tabindex=0"
2. All "div/span" by default are not focusable, so no need to use "tabindex=-1"
3. All "dropdown" are focusable by framework, so no need to use "tabindex"
4. Some tabindex values are incorrect (eg: `new_form.tmpl`), so remove them

Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-26 10:44:00 +08:00
wxiaoguang 576644d815
Simplify helper CSS classes and avoid abuse (#26728)
Removed CSS helper classes (some of them are not useful while some of
them are abused often)

* `gt-db`: in most cases it could be replaced by `gt-df` and the flex
layout should be encouraged. Other cases: either it does need the
`gt-df` (eg: by using `div` directly) or it is an abuse (eg: the warning
message in a form)
* `gt-di`: it doesn't seem useful, or it could be replaced by `gt-dib`
in most cases.
* `gt-dif`: not useful, it could be replaced by `flex-text-inline` or
`gt-df`
* `gt-js`: never used
* All `<i class="icon gt-df gt-ac gt-jc">` could be written as `<i
class="icon">`


## Some UI samples

### Admin Notice


![image](https://github.com/go-gitea/gitea/assets/2114189/d02010d4-dc7d-463f-bc99-dcc9b6e2e2ac)

### Admin Stacktrace


![image](https://github.com/go-gitea/gitea/assets/2114189/4045695c-a8c4-4e37-b720-e77a61b1e965)

### Org Home


![image](https://github.com/go-gitea/gitea/assets/2114189/069f02d0-76ad-4052-8a80-700d7e501d40)

### Org Team Repo


![image](https://github.com/go-gitea/gitea/assets/2114189/dc8d6106-bb6b-4f60-83ac-06cb28df3ab5)

### Release List


![image](https://github.com/go-gitea/gitea/assets/2114189/0845e8a5-d1a9-487a-9d25-3c200ad54c17)


### User Setting Application Token Scope


![image](https://github.com/go-gitea/gitea/assets/2114189/fffbde27-432b-49c6-827e-17b8cd3457ff)

Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-26 01:35:10 +02:00
silverwind 8b5c081d76
Remove fomantic loader module (#26670)
Replace Fomantic `loader` CSS module with our existing `is-loading`
spinner. Only three places in the UI used this module, which are
pictured here:

imagediff:
<img width="1237" alt="Screenshot 2023-08-22 at 22 18 01"
src="https://github.com/go-gitea/gitea/assets/115237/b0d82531-f05e-43c6-9e5b-1bfc268c056d">

webauthn:
<img width="894" alt="Screenshot 2023-08-22 at 22 05 05"
src="https://github.com/go-gitea/gitea/assets/115237/7b583425-d944-474a-a57a-22a65bbd8b29">

heatmap (I removed the previous loading text, it was unreadable because
it was tiny and on fast machines only visible for a fraction of a
second):
<img width="764" alt="Screenshot 2023-08-22 at 22 18 44"
src="https://github.com/go-gitea/gitea/assets/115237/1c7472d6-3e17-4224-a992-d8c0b380cc73">

Also, heatmap container does not resize any more after loading now and
previous duplicate id `user-heatmap` is gone.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-08-25 16:03:14 +00:00
silverwind f626366f53
Fix link in mirror docs (#26719)
Fix hash fragment in this link

Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-25 17:13:07 +02:00
wxiaoguang ee9e83b230
Remove incorrect CSS helper classes (#26712) 2023-08-25 06:47:59 +00:00
wxiaoguang 390ec619f3
Fix review bar misalignment (#26711) 2023-08-24 23:46:30 +08:00
wxiaoguang 09faf43ef8
Improve Image Diff UI (#26696)
1. Use `is-loading` instead of `ui loader`
2. Introduce class name `image-diff-tabs`, instead of searching `gt-hidden`, which is fragile
3. Align the UI elements, see the screenshots.
2023-08-24 12:13:23 +00:00
wxiaoguang 4de2244697
Make issue template field template access correct template data (#26698)
Regression of #23092, the `{{$field := .}}` was missing during that refactoring.
2023-08-24 11:09:36 +00:00
Earl Warren a9ce570298
add Upload URL to release API (#26663)
- Resolves https://codeberg.org/forgejo/forgejo/issues/580
- Return a `upload_field` to any release API response, which points to
the API URL for uploading new assets.
- Adds unit test.
- Adds integration testing to verify URL is returned correctly and that
upload endpoint actually works

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-08-24 10:36:10 +00:00
yp05327 d2e4039def
Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips (#26658)
GitHub like role descriptor

![image](https://github.com/go-gitea/gitea/assets/18380374/ceaed92c-6749-47b3-89e8-0e0e7ae65321)

![image](https://github.com/go-gitea/gitea/assets/18380374/8193ec34-cbf0-47f9-b0de-10dbddd66970)

![image](https://github.com/go-gitea/gitea/assets/18380374/56c7ed85-6177-425e-9f2f-926e99770782)

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-08-24 13:06:17 +08:00
Bo-Yi Wu b62c8e7765
feat(API): update and delete secret for managing organization secrets (#26660)
- Add `UpdateSecret` function to modify org or user repo secret
- Add `DeleteSecret` function to delete secret from an organization
- Add `UpdateSecretOption` struct for updating secret options
- Add `UpdateOrgSecret` function to update a secret in an organization
- Add `DeleteOrgSecret` function to delete a secret in an organization

GitHub API

1. Update Org Secret:
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret
2. Delete Org Secret:
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#delete-an-organization-secret

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-08-24 02:07:00 +00:00
yp05327 7e30986667
Remove ref name in PR commits page (#25876)
The branch name display here is based on the repo's default branch which
is not correct.

![image](https://github.com/go-gitea/gitea/assets/18380374/d899f6dc-b240-41ea-9a3e-ea0e103874ad)

For example, if I changed the default branch, the branch name here will
also be changed:

![image](https://github.com/go-gitea/gitea/assets/18380374/032ead94-2287-4158-a9e4-02e9fb74777d)

![image](https://github.com/go-gitea/gitea/assets/18380374/e1e6cbbc-31f8-40a2-b99a-508b5b2b3145)
you can confirm this in :
https://try.gitea.io/yp05327/testrepo/pulls/1/commits

I think we do not need to display branch name here, as we already have
the branch info above.

![image](https://github.com/go-gitea/gitea/assets/18380374/66f30a0c-3c2b-4d26-936d-bbe289f33be0)
2023-08-24 01:31:54 +00:00
wxiaoguang e8b990999f
Make "link-action" backend code respond correct JSON content (#26680)
Otherwise the `link-action` JS code couldn't parse the response.

Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-23 17:36:57 +08:00
wxiaoguang af33a1187b
Fix doubled box-shadow in branch dropdown menu (#26678) 2023-08-23 08:13:04 +00:00
wxiaoguang e4b2bdfbc0
More improvements for the "flex list" and the dashboard list (#26675)
Follow #26649 and #25790 and add one more example (text truncate) in the devtest page
2023-08-23 04:23:30 +00:00
Jason Song 5db21ce7e1
Fix counting and filtering on the dashboard page for issues (#26657)
This PR has multiple parts, and I didn't split them because
it's not easy to test them separately since they are all about the
dashboard page for issues.

1. Support counting issues via indexer to fix #26361
2. Fix repo selection so it also fixes #26653
3. Keep keywords in filter links.

The first two are regressions of #26012.

After:

https://github.com/go-gitea/gitea/assets/9418365/71dfea7e-d9e2-42b6-851a-cc081435c946

Thanks to @CaiCandong  for helping with some tests.
2023-08-23 02:29:17 +00:00
yp05327 75689b8973
Improve repo sub menu (#26531)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/9e71282c-4645-45f3-bdb8-13c4333f7c2b)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/656ff837-35cf-43f8-88d0-f5e123600e57)

Icons are not in the middle of the line.
2023-08-22 09:20:09 +00:00
yp05327 bd8a253220
Improve show role (#26621)
Add a general show role template.
2023-08-22 05:30:33 +00:00
wxiaoguang 7934602a4c
Improve some flex layouts (#26649)
Fix #26617

1. Separate the "flex-list" examples into a dedicated template, and add some more examples
2. Use `flex-basis` instead of `flex-shrink` for `flex-item-trailing`, to avoid wrapping the texts too aggressively
3. Some `flex-wrap: wrap;` are removed
2023-08-22 12:57:02 +08:00
Bo-Yi Wu 23addde28e
feat: implement organization secret creation API (#26566)
- Add a new `CreateSecretOption` struct for creating secrets
- Implement a `CreateOrgSecret` function to create a secret in an
organization
- Add a new route in `api.go` to handle the creation of organization
secrets
- Update the Swagger template to include the new `CreateOrgSecret` API
endpoint

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2023-08-22 11:20:34 +08:00
yp05327 a4a567f29f
Check disabled workflow when rerun jobs (#26535)
In GitHub, we can not rerun jobs if the workflow is disabled.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-08-22 10:30:02 +08:00
wxiaoguang 0731abc444
Remove avatarHTML from template helpers (#26598)
The HTML code is more readable and more correct (it needs `"ui avatar"`
class)

Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-21 15:00:14 +00:00
CaiCandong 5bd63f83e3
Improve translation of milestone filters (#26569)
https://github.com/go-gitea/gitea/issues/26567#issue-1855312074
> The terms `closest` and `furthest` don't describe the actual sorting
behavior as these two are semantically relative to the current date.
> Could we switch to `earliest` and `latest` instead?

close #26567

---------

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-21 21:11:07 +08:00
Yarden Shoham 16dee4f1b2
Add `branch_filter` to hooks API endpoints (#26599)
We now include the branch filler in the response.

- Closes #26591 

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/73933940-c1a7-4573-abae-f340b63028b2)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/3b3c4a85-0f7c-48c7-8617-def7a66c671d)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-21 11:43:52 +00:00
Jason Song c179ab4236
Fix "issueReposQueryPattern does not match query" (#26556)
Fix
`https://github.com/go-gitea/gitea/pull/26545#discussion_r1295734340`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-17 12:38:02 +00:00