324626a11c
Fix htmx rendering the login page in frame on session logout ( #29405 )
...
- Fix #29391
With this change, htmx will not follow the redirect in the AJAX request
but instead redirect the whole browser.
To reproduce the bug fixed by this change without waiting a long time
for the token to expire, you can logout in another tab then look in the
original tab. Just make sure to comment out both instances of
`window.location.href = appSubUrl` in the codebase so you won't be
redirected immediately on logout. This is what I did in the following
gifs.
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2024-02-26 20:40:41 +08:00
Yarden Shoham and GitHub
ed3892d843
Remove jQuery AJAX from the archive download links ( #29380 )
...
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo archive download links dropdown functionality and it
works as before
# Demo using `fetch` instead of jQuery AJAX

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-25 16:53:44 +00:00
Yarden Shoham and GitHub
0676bf52f9
Remove jQuery AJAX from the notice selection deletion button ( #29381 )
...
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo notice selection deletion button functionality and it
works as before
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-25 20:36:11 +08:00
Yarden Shoham and GitHub
4e3d81e44e
Remove jQuery from the code diff expansion buttons ( #29385 )
...
- Removed all jQuery AJAX calls and replaced with htmx
- Tested the code diff expansion buttons functionality and it works as
before plus a loading indicator
# Demo using `htmx` instead of jQuery AJAX

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-25 05:07:23 +00:00
Yarden Shoham and GitHub
1f6de13897
Remove jQuery AJAX from the markdown editor preview ( #29384 )
...
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the markdown editor preview button functionality and it works
as before
# Demo using `fetch` instead of jQuery AJAX

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-25 04:42:29 +00:00
b616f666b8
Remove jQuery AJAX from the repo commit graph ( #29373 )
...
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo collaborator mode dropdown functionality and it works
as before
# Demo using `fetch` instead of jQuery AJAX

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2024-02-25 12:09:55 +08:00
15d071f4f8
Remove jQuery AJAX from repo collaborator mode dropdown ( #29371 )
...
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo collaborator mode dropdown functionality and it works
as before
# Demo using `fetch` instead of jQuery AJAX

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: Giteabot <teabot@gitea.io >
2024-02-25 00:08:51 +01:00
c86d033a3e
Remove jQuery from the Unicode escape button ( #29369 )
...
- Switched to plain JavaScript
- Tested the Unicode escape button functionality and it works as before
# Demo using JavaScript without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2024-02-24 20:11:51 +01:00
267dbb4e93
Remove jQuery from the issue reference context popup ( #29367 )
...
- Removed all jQuery calls
- Tested the context popup functionality and it works as before
# Demo without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2024-02-24 13:03:53 +01:00
Yarden Shoham and GitHub
12d233faf7
Remove jQuery from the stopwatch ( #29351 )
...
- Switched to plain JavaScript
- Tested the stopwatch functionality and it works as before
# Demo using JavaScript without jQuery

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-23 22:19:54 +01:00
eaede2de98
Remove jQuery from the repo commit functions ( #29230 )
...
- Switched to plain JavaScript
- Tested the commit ellipsis button functionality and it works as before
- Tested the commits statuses tippy functionality and it works as before
- Tested the last commit loader functionality and it works as before
# Demo using JavaScript without jQuery


---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2024-02-22 17:13:25 +00:00
Yarden Shoham and GitHub
f390d5eb4f
Remove jQuery from the image pasting functionality ( #29324 )
...
- Switched to plain JavaScript
- Tested the image pasting functionality and it works as before
# Demo using JavaScript without jQuery

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-22 17:35:58 +01:00
Yarden Shoham and GitHub
4e536edaea
Remove jQuery from the installation page ( #29284 )
...
- Switched to plain JavaScript
- Tested the installation page functionality and it works as before
# Demo using JavaScript without jQuery

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-21 09:13:48 +01:00
ade1110e8b
Remove jQuery from repo wiki creation page ( #29271 )
...
- Switched to plain JavaScript
- Tested the wiki creation form functionality and it works as before
# Demo using JavaScript without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2024-02-20 11:37:37 +01:00
100031f5f1
Remove jQuery from the repo migration form ( #29229 )
...
- Switched to plain JavaScript
- Tested the repo migration form functionality and it works as before
# Demo using JavaScript without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2024-02-19 23:34:35 +01:00
d73223bfc6
Remove jQuery from the repo release form ( #29225 )
...
- Switched to plain JavaScript
- Tested the repo release form functionality and it works as before
# Demo using JavaScript without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2024-02-18 09:22:09 +08:00
5e1bf3efe2
Remove jQuery from repo migrate page ( #29219 )
...
- Switched to plain JavaScript
- Tested the repo migrate functionality and it works as before
# Demo using JavaScript without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2024-02-17 21:07:47 +01:00
3da2c63354
Remove unneccesary initUserAuthLinkAccountView from "link account" page ( #29217 )
...
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2024-02-17 18:51:35 +01:00
Yarden Shoham and GitHub
1d275c1748
Fix labels referencing the wrong ID in the user profile settings ( #29199 )
...
2 instances of `for` with a wrong value and 1 `for` that had a reference
to a `name` instead of `id`.
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-17 15:01:25 +00:00
Yarden Shoham and GitHub
0157db84b1
Fix label for pointing to a name instead of id in webhook settings ( #29209 )
...
Here's the spec for the `for` attribute:
https://html.spec.whatwg.org/multipage/forms.html#attr-label-for
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-17 14:32:43 +00:00
Yarden Shoham and GitHub
aa6f88638f
Fix missing template for follow button in organization ( #29215 )
...
Leftover from https://github.com/go-gitea/gitea/pull/29005
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-17 13:42:52 +00:00
27192bc321
Remove jQuery from the webhook editor ( #29211 )
...
- Switched to plain JavaScript
- Tested the webhook editing functionality and it works as before
# Demo using JavaScript without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2024-02-17 13:17:04 +00:00
Yarden Shoham and GitHub
c282d378bd
Remove jQuery from issue reference context popup attach ( #29216 )
...
- Switched to plain JavaScript
- Tested the context popup functionality and it works as before
# Demo using JavaScript without jQuery

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-17 21:11:56 +08:00
Yarden Shoham and GitHub
d8d4b33b31
Remove jQuery from the "quick submit" handler ( #29200 )
...
- Switched to plain JavaScript
- Tested the quick submit functionality and it works as before
# Demo using JavaScript without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-16 21:03:50 +01:00
Yarden Shoham and GitHub
2d8756a960
Fix initCompLabelEdit not being called ( #29198 )
...
Fix broken `if` from https://github.com/go-gitea/gitea/pull/29195
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-16 17:03:52 +01:00
0768842ef5
Remove jQuery from username change prompt and fix its detection ( #29197 )
...
- Switched to plain JavaScript
- Tested the user rename prompt toggling functionality and it works as
before
- Fixed bug that allowed pasting with the mouse to avoid the prompt
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2024-02-16 15:52:50 +00:00
5902372e63
Remove jQuery from organization rename prompt toggle ( #29195 )
...
- Switched to plain JavaScript
- Tested the organization rename prompt toggling functionality and it
works as before
# Demo using JavaScript without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2024-02-16 16:48:01 +01:00
Yarden Shoham and GitHub
7132a0ba75
Reference labels by IDs instead of names in keys settings ( #29194 )
...
Here's the spec for the `for` attribute:
https://html.spec.whatwg.org/multipage/forms.html#attr-label-for
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-16 13:59:48 +00:00
236e121844
Remove jQuery from SSH key form parser ( #29193 )
...
- Switched to plain JavaScript
- Tested the SSH key title functionality and it works as before
# Demo using JavaScript without jQuery

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2024-02-16 13:34:29 +00:00
c70f65e83b
Auto-update the system status in admin dashboard ( #29163 )
...
- Refactor the system status list into its own template
- Change the backend to return only the system status if htmx initiated
the request
- `hx-get="{{$.Link}}/system_status`: reuse the backend handler
- `hx-swap="innerHTML"`: replace the `<div>`'s innerHTML (essentially
the new template)
- `hx-trigger="every 5s"`: call every 5 seconds
- `hx-indicator=".divider"`: the `is-loading` class shouldn't be added
to the div during the request, so set it on an element it has no effect
on
- Render "Since Last GC Time" with `<relative-time>`, so we send a
timestamp
# Auto-update in action GIF

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2024-02-16 02:52:25 +00:00
542480a9b0
Remove jQuery from the comment task list ( #29170 )
...
- Switched to plain JavaScript
- Tested the task list functionality and it works as before
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: Giteabot <teabot@gitea.io >
Co-authored-by: silverwind <me@silverwind.io >
2024-02-15 13:27:07 +00:00
Yarden Shoham and GitHub
4f34691683
Fix Gitpod logic of setting ROOT_URL ( #29162 )
2024-02-13 17:57:55 -05:00
a8748eedae
Remove jQuery from the user search form in admin page ( #29151 )
...
- Switched to plain JavaScript
- Tested the form and it works as before
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2024-02-13 15:13:06 +01:00
Yarden Shoham and GitHub
f9c3459831
Use Markdown alert syntax for notes in README ( #29150 )
...
- It looks nicer
- This syntax is supported on both GitHub and Gitea
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-12 15:14:24 -06:00
12865ae9c6
Add alert blocks in markdown ( #29121 )
...
- Follows https://github.com/go-gitea/gitea/pull/21711
- Closes https://github.com/go-gitea/gitea/issues/28316
Implement GitHub's alert blocks markdown feature
Docs:
-
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
- https://github.com/orgs/community/discussions/16925
### Before

### After

## ⚠️ BREAKING ⚠️
The old syntax no longer works
How to migrate:
If you used
```md
> **Note** My note
```
Switch to
```md
> [!NOTE]
> My note
```
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: Giteabot <teabot@gitea.io >
2024-02-10 18:43:09 +00:00
Yarden Shoham and GitHub
5f5b5ba6e3
Make blockquote border size less aggressive ( #29124 )
...
It's too thick
I made it match GitHub's size
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-02-10 14:55:46 +02:00
6992ef98fc
Don't do a full page load when clicking Watch or Star ( #29001 )
...
- The watch/unwatch button and star/unstar get their own template
- The backend returns HTML instead of redirect
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: John Olheiser <john.olheiser@gmail.com >
2024-02-05 09:56:20 +00:00
4989ad0a9f
Add htmx guidelines ( #28993 )
...
To make sure we don't abuse it.
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: delvh <dev.lh@web.de >
2024-01-31 23:36:23 +01:00
3e8414179c
Introduce htmx and use it to avoid full page load on Subscribe and Follow ( #28908 )
...
- Closes https://github.com/go-gitea/gitea/issues/28880
This change introduces htmx with the hope we could use it to make Gitea
more reactive while keeping our "HTML rendered on the server" approach.
- Add `htmx.js` that imports `htmx.org` and initializes error toasts
- Place `hx-headers='{"x-csrf-token": "{{.CsrfToken}}"}'` on the
`<body>` tag so every request that htmx sends is authenticated
- Place `hx-swap="outerHTML"` on the `<body>` tag so the response of
each htmx request replaces the tag it targets (as opposed to its inner
content)
- Place `hx-push-url="false"` on the `<body>` tag so no changes to the
URL happen in `<form>` tags
- Add the `is-loading` class during request
### Error toasts in action

## Don't do a full page load when clicking the subscribe button
- Refactor the form around the subscribe button into its own template
- Use htmx to perform the form submission
- `hx-boost="true"` to prevent the default form submission behavior of a
full page load
- `hx-sync="this:replace"` to replace the current request (in case the
button is clicked again before the response is returned)
- `hx-target="this"` to replace the form tag with the new form tag
- Change the backend response to return a `<form>` tag instead of a
redirect to the issue page
### Before

### After

## Don't do a full page load when clicking the follow button
- Use htmx to perform the button request
- `hx-post="{{.ContextUser.HomeLink}}?action=follow"` to send a POST
request to follow the user
- `hx-target="#profile-avatar-card"` to target the card div for
replacement
- `hx-indicator="#profile-avatar-card"` to place the loading indicator
on the card
- Change the backend response to return a `<div>` tag (the card) instead
of a redirect to the user page
### Before

### After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: 6543 <m.huber@kithara.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2024-01-30 15:45:54 +01:00
Yarden Shoham and GitHub
0e650dca30
Make loading animation less aggressive ( #28955 )
...
The current animation loops in a very fast manner, causing a slight
feeling of uncomfortableness. This change slows it a bit for a smoother
experience.
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-01-27 20:27:37 +08:00
Yarden Shoham and GitHub
1df06e3f39
Don't do a full page load when clicking the follow button ( #28872 )
...
- Use htmx to perform the button request
- `hx-headers='{"x-csrf-token": "{{.CsrfToken}}"}'` to authenticate (we
should probably learn to reuse this)
- `hx-post="{{.ContextUser.HomeLink}}?action=follow"` to send a POST
request to follow the user
- `hx-target="#profile-avatar-card"` to target the card div for
replacement
- `hx-swap="outerHTML"` to replace the card (as opposed to its inner
content) with the new card that shows the new follower count and button
color
- Change the backend response to return a `<div>` tag (the card) instead
of a redirect to the user page
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-01-20 23:37:22 +01:00
Yarden Shoham and GitHub
14f6fcf448
Don't do a full page load when clicking the subscribe button ( #28871 )
...
- Refactor the form around the subscribe button into its own template
- Use htmx to perform the form submission
- `hx-boost="true"` to prevent the default form submission behavior of a
full page load
- `hx-sync="this:replace"` to replace the current request (in case the
button is clicked again before the response is returned)
- `hx-target="this"` to replace the form tag with the new form tag
- `hx-push-url="false"` to disable a change to the URL
- `hx-swap="show:no-scroll"` to preserve the scroll position
- Change the backend response to return a `<form>` tag instead of a
redirect to the issue page
- Include `htmx.org` in javascript imports
This change introduces htmx with the hope we could use it to make Gitea
more reactive while keeping our "HTML rendered on the server" approach.
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-01-20 20:44:51 +01:00
Yarden Shoham and GitHub
6c771a311b
Run npm audit fix ( #28866 )
2024-01-20 15:37:32 +00:00
Yarden Shoham and GitHub
5574968ecb
Set the isPermaLink attribute to false in the guid sub-element ( #28860 )
...
Our `guid` is not a valid URL so according to the RSS spec the
`isPermaLink` attribute needs to be set to `false`.
Example:
```diff
<item>
<title>yardenshoham opened issue <a href="https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2">yardenshoham/test#2</a> ;</title>
<link>https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2 </link>
<description>2#hey</description>
<content:encoded><![CDATA[2#hey]]></content:encoded>
<author>yardenshoham</author>
- <guid>355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2 </guid>
+ <guid isPermaLink="false">355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2 </guid>
<pubDate>Tue, 16 Jan 2024 18:54:36 +0000</pubDate>
</item>
```
References:
-
https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt
- Fixes https://github.com/go-gitea/gitea/issues/28734
- https://github.com/gorilla/feeds/issues/78
- https://github.com/go-gitea/gitea/pull/21550
- https://github.com/gorilla/feeds/pull/107
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-01-20 02:38:16 +00:00
Yarden Shoham and GitHub
9c869b10b5
Bump @github/relative-time-element to 4.3.1 ( #28819 )
...
- Fixes https://github.com/go-gitea/gitea/issues/28747
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-01-16 22:52:19 +01:00
Yarden Shoham and GitHub
5a7bacb005
Warn that DISABLE_QUERY_AUTH_TOKEN is false only if it's explicitly defined ( #28783 )
...
So we don't warn on default behavior
- Fixes https://github.com/go-gitea/gitea/issues/28758
- Follows https://github.com/go-gitea/gitea/pull/28390
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2024-01-14 21:20:18 +01:00
cdc33b29a0
Add global setting how timestamps should be rendered ( #28657 )
...
- Resolves https://github.com/go-gitea/gitea/issues/22493
- Related to https://github.com/go-gitea/gitea/issues/4520
Some admins prefer all timestamps to display the full date instead of
relative time. They can do that now by setting
```ini
[ui]
PREFERRED_TIMESTAMP_TENSE = absolute
```
This setting is set to `mixed` by default, allowing dates to render as
"5 hours ago". Here are some screenshots of the UI with this setting set
to `absolute`:



---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: delvh <dev.lh@web.de >
2024-01-02 09:25:30 +08:00
Yarden Shoham and GitHub
d9ed931c4d
Fix wrong due date rendering in issue list page ( #28588 )
...
It included the hours, minutes, and seconds. By removing these, the date
renders correctly.
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-12-22 10:53:12 -06:00
Yarden Shoham and GitHub
1c0566f66d
Render email addresses as such if followed by punctuation ( #27987 )
...
Added the following characters to the regular expression for the email:
- ,
- ;
- ?
- !
Also added a test case.
- Fixes #27616
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-11-11 05:08:19 +01:00
Yarden Shoham and GitHub
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


# After


Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-09-25 07:33:00 +00:00
16dee4f1b2
Add branch_filter to hooks API endpoints ( #26599 )
...
We now include the branch filler in the response.
- Closes #26591
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-21 11:43:52 +00:00
220f236ff5
Add pull request review request webhook event ( #26401 )
...
Add webhook events for pull request review requests
- Fixes #26371
- Added support for the "Pull request review requested" and "Pull
request review request removed" webhook events.
- Updated the `getPullRequestPayloadInfo` function in `general.go` to
handle these new webhook events.
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-08-09 10:30:34 +02:00
Yarden Shoham and GitHub
edd93fcfbc
Fix due date rendering the wrong date in issue ( #26268 )
...
Closes #26263
We have to pass the date without the time.
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-08-01 16:21:04 +02:00
Yarden Shoham and GitHub
d36ddfe26c
Fix CLI allowing creation of access tokens with existing name ( #26071 )
...
We are now:
- Making sure there is no existing access token with the same name
- Making sure the given scopes are valid (we already did this before but
now we have a message)
The logic is mostly taken from
https://github.com/go-gitea/gitea/blob/a12a5f3652c339b17b187ff424a480631a3c1e1e/routers/api/v1/user/app.go#L101-L123
Closes #26044
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-07-25 23:06:11 +00:00
Yarden Shoham and GitHub
dbbae67f44
Remove commit status running and warning from the dashboard repo list ( #26036 )
...
Also added comments so the next time the dashboard repo list won't be
forgotten
Follows #25839
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-07-21 10:32:25 +00:00
Yarden Shoham and GitHub
4486dd39e7
Remove cancel button from branch protection form ( #25063 )
...
It caused bugs. To cancel, just navigate away.
- Follows #21381 and #21872
- Resolves #25038
## Before

## After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-06-03 20:06:09 +08:00
Yarden Shoham and GitHub
abccb86b36
Show bot label next to username when rendering autor link if the user is a bot ( #24943 )
...
If the user is a bot, we'll add a label next to the author link that
says `bot`. I didn't localize `bot` because passing `locale` into the
`autorlink` template would require changing all calls.
# Example
`yardenshoham` is a bot.
## Before

## After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-05-26 18:58:11 +02:00
Yarden Shoham and GitHub
edd8ea0b0d
Fix topics deleted via API not being deleted in org page ( #24825 )
...
The topics are saved in the `repo_topic` table.
They are also saved directly in the `repository` table.
Before this PR, only `AddTopic` and `SaveTopics` made sure the `topics`
field in the `repository` table was synced with the `repo_topic` table.
This PR makes sure `GenerateTopics` and `DeleteTopic`
also sync the `topics` in the repository table.
`RemoveTopicsFromRepo` doesn't need to sync the data
as it is only used to delete a repository.
Fixes #24820
2023-05-21 11:03:20 +02:00
c641a22f2a
Mute repo names in dashboard repo list ( #24811 )
...
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-05-19 17:03:09 +00:00
f5ce2ed292
Allow all URL schemes in Markdown links by default ( #24805 )
...
- Closes #21146
- Closes #16721
## ⚠️ BREAKING ⚠️
This changes the default behavior to now create links for any URL scheme
when the user uses the markdown form for links (`[label](URL)`), this
doesn't affect the rendering of inline links. To opt-out set the
`markdown.CUSTOM_URL_SCHEMES` setting to a list of allowed schemes, all
other schemes (except `http` and `https`) won't be allowed.
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-05-19 17:17:07 +02:00
Yarden Shoham and GitHub
c839d6f92a
Revert "Fix missed table name on iterate lfs meta objects" ( #24764 )
...
This reverts commit 3364092013 .
It was accidentally pushed to `main` without a review.
2023-05-17 21:20:11 +08:00
Yarden Shoham and GitHub
0a3c4d4a59
Fix team members API endpoint pagination ( #24754 )
...
Now it's 1-based instead of 0-based
- Fixes #24747
### Before

### After

## ⚠️ BREAKING ⚠️
Previous API consumers may have relied on the 0-based pagination of this
endpoint. The page numbering now starts at 1, as documented.
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-05-17 08:12:37 +08:00
Yarden Shoham and GitHub
6d2c63f6ff
Don't filter action runs based on state ( #24711 )
...
We should just show all runs. This removes the filtering altogether.
- Replaces https://github.com/go-gitea/gitea/pull/24553
# Before


# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-05-14 16:04:24 +00:00
53a00017bb
Fix flash of unstyled content in action view page ( #24712 )
...
# Before

# After

Ref: https://github.com/go-gitea/gitea/issues/24625
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-05-14 14:58:59 +00:00
Yarden Shoham and GitHub
116f8e12a7
Optimize actions list by removing an unnecessary git call ( #24710 )
...
We already have the default branch so we don't need to make a `git` call
to get it.
2023-05-14 20:00:35 +08:00
4810fe55e3
Add status indicator on main home screen for each repo ( #24638 )
...
It will show the calculated commit status state of the latest commit on
the default branch for each repository in the dashboard repo list
- Closes #15620
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-05-13 21:59:01 +00:00
9f1d377b87
Fix docs documenting invalid @every for OLDER_THAN cron settings ( #24695 )
...
Looks like a copy-paste leftover
- Fixes #20868
Co-authored-by: Giteabot <teabot@gitea.io >
2023-05-13 15:22:31 +00:00
542adf50d5
Fix organization field being null in GET /api/v1/teams/{id} ( #24694 )
...
Enabled the organization loading flag.
- Fixes #20399
# Before
```json
{
...
"description": "",
"organization": null,
"includes_all_repositories": true,
"permission": "owner",
...
}
```
# After
```json
{
...
"description": "",
"organization": {
"id": 2,
"name": "bigorg",
"full_name": "",
"avatar_url": "https://3000-yardenshoham-gitea-3gfrlc9gn4h.ws-us96b.gitpod.io/avatars/e2649b0c016d9102664a7d4349503eb9 ",
"description": "",
"website": "",
"location": "",
"visibility": "public",
"repo_admin_change_team_access": true,
"username": "bigorg"
},
"includes_all_repositories": true,
"permission": "owner",
...
}
```
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-05-13 14:47:58 +00:00
ae9ac50072
Make the actions control button look like an actual button ( #24611 )
...
- Follows #24595
# Before



# After



---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-05-10 08:09:23 +00:00
Yarden Shoham and GitHub
de7dcc7cd9
Add a tooltip to the job rerun button ( #24617 )
...
This one doesn't look very good as a real button (at least not in the
ways I tried), so I've opted to simply add a tooltip for it.
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-05-10 07:37:10 +00:00
Yarden Shoham and GitHub
9a0652f0b2
Attach a tooltip to the action status icon ( #24614 )
...
To clearly communicate the current state of the action






---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-05-09 21:39:16 +02:00
4f1065030f
Use official Vue extension in Gitpod ( #24609 )
...
The previous one didn't work well
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2023-05-09 18:03:50 +00:00
46e97986f5
Attach a tooltip to the action control button ( #24595 )
...
The first time I saw the big red X button I thought something failed but
apparently, it was just a "Cancel" button
# Before



# After



---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
Co-authored-by: silverwind <me@silverwind.io >
2023-05-08 23:59:59 +00:00
Yarden Shoham and GitHub
9ad5b59cd9
Do not select line numbers when selecting text from the action run logs ( #24594 )
...
- Fixes #24578
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-05-08 20:50:05 +02:00
46679554d0
Change add_on translation to added_on and include placeholder for the date ( #24562 )
...
- Very similar to #24550
The correct thing to do is to translate the entire phrase into a single
string. The previous translation assumed all languages have a space
between the "added on" and the date (and that "added on" comes before
the date).
Some languages, like Hebrew, have no space between the "added on" and
the date. For example:
```ini
added_on=נוסף ב-%s
```
("added" becomes נוסף, "on" is ב and when paired with a date we use a
dash to connect ב with the date)
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: delvh <dev.lh@web.de >
2023-05-06 21:11:27 +08:00
Yarden Shoham and GitHub
95e2e3aa30
Change valid_until translation to valid_until_date and include placeholder for the date ( #24563 )
...
- Similar to #24550
- Similar to #24562
The correct thing to do is to translate the entire phrase into a single
string. The previous translation assumed all languages have a space
between the "valid until" and the date (and that "valid until" comes
before the date).
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-05-06 12:37:02 +00:00
Yarden Shoham and GitHub
ef92459e18
Fix docs failing the build on main ( #24561 )
...
Regression from https://github.com/go-gitea/gitea/pull/23380
First failing build: https://drone.gitea.io/go-gitea/gitea/74565
https://github.com/go-gitea/gitea/actions/runs/4897332409/jobs/8745242395
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-05-06 11:52:44 +00:00
Yarden Shoham and GitHub
291c868046
Change join_on translation to joined_on and include placeholder for the date ( #24550 )
...
The correct thing to do is to translate the entire phrase into a single
string. The previous translation assumed all languages have a space
between the "joined on" and the date (and that "joined on" comes before
the date).
Some languages, like Hebrew, have no space between the "joined on" and
the date. For example:
```ini
joined_on=נרשם ב-%s
```
("joined" becomes נרשם, "on" is ב and when paired with a date we use a
dash to connect ב with the date)
2023-05-06 18:10:30 +08:00
a2fe68e50b
Changelog for 1.19.3 ( #24495 ) ( #24506 )
...
Frontport #24495
Co-authored-by: techknowlogick <techknowlogick@gitea.io >
Co-authored-by: John Olheiser <john.olheiser@gmail.com >
2023-05-03 22:05:47 -04:00
Yarden Shoham and GitHub
97991596bd
Remove all direct references to font-awesome ( #24448 )
...
- Related #10410
- I had to add an SVG for an empty checkbox
https://github.com/primer/octicons/issues/942
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-05-01 00:02:56 +02:00
cc84c58aff
Remove unused setting time.FORMAT ( #24430 )
...
It's loaded and then never used.
---------
Co-authored-by: Giteabot <teabot@gitea.io >
2023-04-29 22:51:43 +02:00
Yarden Shoham and GitHub
94d6b5b09d
Add "Updated" column for admin repositories list ( #24429 )
...
- Closes #12454
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-04-29 20:40:10 +02:00
Yarden Shoham and GitHub
c0ddec8a2a
Revert "Add Debian package registry" ( #24412 )
...
Reverts go-gitea/gitea#22854
2023-04-28 18:06:41 -04:00
3843252938
Changelog 1.19.2 ( #24365 ) ( #24403 )
...
Frontport #24365
Add changelog for 1.19.2
Signed-off-by: jolheiser <john.olheiser@gmail.com >
Co-authored-by: John Olheiser <john.olheiser@gmail.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-04-28 15:20:52 -04:00
Yarden Shoham and GitHub
eea23bbc8e
Remove unnecessary helper function DateFmtLong ( #24343 )
...
After #24317 this function is only used in one place where it is not
needed. I confirmed the timestamp still renders correctly
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-04-26 02:52:50 -04:00
Yarden Shoham and GitHub
f2f0fb43e0
Fix broken clone script on an empty archived repo ( #24339 )
...
I made it render the script even if the repo is archived
- Fixes #24324
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-04-25 23:28:37 -04:00
70bb4984cd
Allow using localized absolute date times within phrases with place holders and localize issue due date events ( #24275 )
...
This refactors the `shared/datetime/short|long|full` templates into a
template helper function, which allows us to render absolute date times
within translatable phrases.
- Follows #23988
- The first attempt was in #24055
- This should help #22664
Changes:
1. Added the `DateTime` template helper that replaces the
`shared/datetime/short|long|full` templates
2. Used find-and-replace with varying regexes to replace the templates
from step 1 (for example, `\{\{template "shared/datetime/(\S+) \(dict
"Datetime" ([^"]+) "Fallback" ([^\)]+\)?) ?\)?\}\}` -> `{{DateTime "$1
$2 $3}}`)
3. Used the new `DateTime` helper in the issue due date timestamp
rendering
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-04-23 15:12:33 -04:00
3cc87370c3
Improve emoji and mention matching ( #24255 )
...
Prioritize matches that start with the given text, then matches that
contain the given text.
I wanted to add a heart emoji on a pull request comment so I started
writing `:`, `h`, `e`, `a`, `r` (at this point I still couldn't find the
heart), `t`... The heart was not on the list, that's weird - it feels
like I made a typo or a mistake. This fixes that.
This also feels more like GitHub's emoji auto-complete.
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2023-04-22 11:32:34 -04:00
Yarden Shoham and GitHub
75b9845420
Mark public/img/svg/*.svg as generated files ( #24193 )
...
These files are generated using `make svg`
2023-04-18 13:52:18 -04:00
Yarden Shoham and GitHub
2002584986
Bump GitHub's relative-time-element to v4.3.0 ( #24187 )
...
https://github.com/github/relative-time-element/releases/tag/v4.3.0
I checked and everything still works
2023-04-19 00:00:01 +08:00
f045e58cc7
Localize activity heatmap (except tooltip) ( #24131 )
...
The calculation of the total sum is moved to the backend so a full HTML
string could be sent.

- Closes #10669
- 2nd attempt (the first was in #21570 )
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-04-17 14:26:01 -04:00
b4e952545b
Remove untranslatable on_date key ( #24106 )
...
- Follows #23988
- Fixes : #24074 by removing this key
GitHub's `relative-time` elements allow us to force their rendering to
`auto`, `past`, or `future` tense. We will never show an absolute date
`on ...` in `TimeSince`
## Before

## After

---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-04-15 13:01:54 +02:00
97176754be
Localize milestone related time strings ( #24051 )
...
- With #23988 in place, we can improve these timestamps
---------
Co-authored-by: silverwind <me@silverwind.io >
2023-04-12 02:29:49 -04:00
b7b5834831
Use auto-updating, natively hoverable, localized time elements ( #23988 )
...
- Added [GitHub's `relative-time` element](https://github.com/github/relative-time-element )
- Converted all formatted timestamps to use this element
- No more flashes of unstyled content around time elements
- These elements are localized using the `lang` property of the HTML file
- Relative (e.g. the activities in the dashboard) and duration (e.g.
server uptime in the admin page) time elements are auto-updated to keep
up with the current time without refreshing the page
- Code that is not needed anymore such as `formatting.js` and parts of `since.go` have been deleted
Replaces #21440
Follows #22861
## Screenshots
### Localized


### Tooltips
#### Native for dates

#### Interactive for relative

### Auto-update

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: delvh <dev.lh@web.de >
2023-04-11 01:01:20 +02:00
Yarden Shoham and GitHub
42e009fa11
Reference the zh-CN version of reverse-proxies in https-support ( #24016 )
2023-04-09 17:31:31 +08:00
Yarden Shoham and GitHub
768ee158f5
Fix lint problem in https-support.zh-cn.md ( #24014 )
...
https://github.com/DavidAnson/markdownlint/blob/v0.26.2/doc/Rules.md#md051
2023-04-09 17:06:31 +08:00
Yarden Shoham and GitHub
518d384346
Remove docs from automatically building in Gitpod ( #23978 )
...
I couldn't find a way to build the docs without `trans-copy` and
spinning up a dev environment that generates files untracked by git on
startup is not a good development experience
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-04-07 15:55:25 -04:00
Yarden Shoham and GitHub
6a0ef71984
Yarden Shoham has a new email address ( #23767 )
...
Got a domain
2023-03-28 18:24:08 +08:00