Commit graph

1912 commits

Author SHA1 Message Date
Earl Warren
a0d9d8d576
test(js): false negative in sleep test
It is entirely possible that the difference between the specified
sleep time and the actual sleep time is greater than 15 seconds.

https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#Notes

> Note that in either case, the actual delay may be longer than
> intended; see Reasons for delays longer than specified below.

It is however an error for the delay to be shorter.

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
 FAIL  web_src/js/utils.test.js > sleep
AssertionError: expected false to be truthy
 ❯ testSleep web_src/js/utils.test.js:192:48
    190|   const endTime = Date.now();    // Record the end time
    191|   const actualSleepTime = endTime - startTime;
    192|   expect(Math.abs(actualSleepTime - ms) <= 15).toBeTruthy();
       |                                                ^
    193| }
    194|
 ❯ web_src/js/utils.test.js:184:3
2024-07-02 19:35:35 +02:00
Renovate Bot
15f9dde1c9 Lock file maintenance 2024-07-01 00:03:45 +00:00
Danko Aleksejevs
36b6444f34 Remove tab key handling in markdown editor, add toolbar buttons instead, re #4072 #4142 (#4263)
We haven't decided much (to my knowledge), and I've been using the main branch in production (as one does) and found out even I myself rely on Tab sometimes working to move focus and have been caught off guard by it indenting lines instead.

So this removes Tab handling and instead adds two new buttons to the toolbar. The indentation logic is unchanged (other than now focusing the textarea during button handling, to ensure execCommand works, and thus undo history is preserved).

I'm not sure which terminology to use in tooltips. Could also add keyboard shortcuts for the whole toolbar eventually, but as is this is hopefully an better solution to the problems I previously created than un-merging the whole thing :)

<img width="414" alt="Screenshot with two new buttons" src="/attachments/b7af3aa4-a195-48d1-be0a-1559f25dce8e">

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4263
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Danko Aleksejevs <danko@very.lv>
Co-committed-by: Danko Aleksejevs <danko@very.lv>
2024-06-30 13:03:32 +00:00
mritunjayr
9634d954d4 test: add test coverage for web_src/js/utils/time.test.js (#4252)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4252
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: mritunjayr <mritunjaykumar694@gmail.com>
Co-committed-by: mritunjayr <mritunjaykumar694@gmail.com>
2024-06-29 09:08:29 +00:00
0ko
dc0d3a40ab ui: improve button gap consistency 2024-06-28 13:11:32 +05:00
0ko
7299b2def4 chore: rename class issue-title-buttons to button-row 2024-06-28 13:11:16 +05:00
Mai-Lapyst
51735c415b Add support for workflow_dispatch (#3334)
Closes #2797

I'm aware of https://github.com/go-gitea/gitea/pull/28163 exists, but since I had it laying around on my drive and collecting dust, I might as well open a PR for it if anyone wants the feature a bit sooner than waiting for upstream to release it or to be a forgejo "native" implementation.

This PR Contains:
- Support for the `workflow_dispatch` trigger
- Inputs: boolean, string, number, choice

Things still to be done:
- [x] API Endpoint `/api/v1/<org>/<repo>/actions/workflows/<workflow id>/dispatches`
- ~~Fixing some UI bugs I had no time figuring out, like why dropdown/choice inputs's menu's behave weirdly~~ Unrelated visual bug with dropdowns inside dropdowns
- [x] Fix bug where opening the branch selection submits the form
- [x] Limit on inputs to render/process

Things not in this PR:
- Inputs: environment (First need support for environments in forgejo)

Things needed to test this:
- A patch for https://code.forgejo.org/forgejo/runner to actually consider the inputs inside the workflow.
  ~~One possible patch can be seen here: https://code.forgejo.org/Mai-Lapyst/runner/src/branch/support-workflow-inputs~~
  [PR](https://code.forgejo.org/forgejo/runner/pulls/199)

![image](/attachments/2db50c9e-898f-41cb-b698-43edeefd2573)

## Testing

- Checkout PR
- Setup new development runner with [this PR](https://code.forgejo.org/forgejo/runner/pulls/199)
- Create a repo with a workflow (see below)
- Go to the actions tab, select the workflow and see the notice as in the screenshot above
- Use the button + dropdown to run the workflow
  - Try also running it via the api using the `` endpoint
- ...
- Profit!

<details>
<summary>Example workflow</summary>

```yaml
on:
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log Level'
        required: true
        default: 'warning'
        type: choice
        options:
        - info
        - warning
        - debug
      tags:
        description: 'Test scenario tags'
        required: false
        type: boolean
      boolean_default_true:
        description: 'Test scenario tags'
        required: true
        type: boolean
        default: true
      boolean_default_false:
        description: 'Test scenario tags'
        required: false
        type: boolean
        default: false
      number1_default:
        description: 'Number w. default'
        default: '100'
        type: number
      number2:
        description: 'Number w/o. default'
        type: number
      string1_default:
        description: 'String w. default'
        default: 'Hello world'
        type: string
      string2:
        description: 'String w/o. default'
        required: true
        type: string

jobs:
  test:
    runs-on: docker
    steps:
      - uses: actions/checkout@v3
      - run: whoami
      - run: cat /etc/issue
      - run: uname -a
      - run: date
      - run: echo ${{ inputs.logLevel }}
      - run: echo ${{ inputs.tags }}
      - env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
        run: echo "$GITHUB_CONTEXT"
      - run: echo "abc"
```
</details>

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3334
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Co-committed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-06-28 05:17:11 +00:00
vikaschoudhary
2121a29f89 test: add test coverage for web_src/js/utils.js (#4235)
[Added tests for methods]
---------------------------------
- isDarkTheme
- getCurrentLocale
- parseDom
- serializeXml
- sleep
- toAbsoluteUrl

[Pending tests for methods]
---------------------------------
- convertImage
- blobToDataURI

Co-authored-by: Vikas Choudhary <vikaschoudharycs097@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4235
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: vikaschoudhary <vikaschoudhary@noreply.codeberg.org>
Co-committed-by: vikaschoudhary <vikaschoudhary@noreply.codeberg.org>
2024-06-27 15:46:46 +00:00
Earl Warren
c6a6294046 Merge pull request '[gitea] week 2024-26 cherry pick (gitea/main -> forgejo)' (#4213) from earl-warren/wcp/2024-26 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4213
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-06-25 06:15:54 +00:00
0ko
c82547bf30 Size/gap changes and cleanup in commit graph (#4214)
Changes:
* increased font size of tag/branch labels from tiny to normal, so they're readable, it doesn't impact layout
* increased font size of branch selector from tiny to small, so it's readable and usable. Branch selector on main repo tab has the same size
* increased gap between the icon and the text in the selector, it is too small currently
* removed obsolete CSS rule, it wasn't fully utilized in the first place, it is no longer needed with the other changes

Preview:
Before: https://codeberg.org/attachments/e6eccdde-59fe-446c-99ed-d8a2f1dce9bd
First: https://codeberg.org/attachments/6d710118-18cb-4258-9d9a-79dfca377294
Last: https://codeberg.org/attachments/fc9517aa-d498-43cc-a186-a184e4c6fe8c

Before: https://codeberg.org/attachments/057f971b-2c3b-4500-923f-49f4e545daf6
First: https://codeberg.org/attachments/de4683ad-95da-48d5-b2ac-b9567fed6fcd
Last: https://codeberg.org/attachments/2abb0333-dea1-4123-b3ee-9cb54dca98cd

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4214
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-06-24 18:59:57 +00:00
Brecht Van Lommel
585d62c0cd
Fix labels and projects menu overflow on issue page (#31435)
It was correct only on the new issue page.

Resolves #31415

(cherry picked from commit 5afafe22a34183c9c053a7ceac2c9dc05d9943e2)
2024-06-23 12:41:07 +02:00
Earl Warren
0e7095720b Merge pull request 'Show edit tab initially also when saved in preview tab previously' (#3969) from beowulf/show-edit-tab-initially-also-editing-comments-multiple-times-and-saving-in-preview-mode into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3969
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-06-21 06:54:54 +00:00
oliverpool
65f8c22cc7 [BUG] admin oauth2 source required check (#4194)
#4059 was unfortunately incomplete: some custom_url fields are currently shown, even if they are not used by the provider. Moreover the `Use Custom URLs Instead of Default URLs` is always checked by default.

Manual testing:
- go to http://localhost:3000/admin/auths
- click on `Add authentication source`
- Choose `Authentication type`: `OAuth2`
- Choose `OAuth2 provider`: `GitLab`
- verify that the `Use Custom URLs Instead of Default URLs` option is **initially unchecked**
- enable the `Use Custom URLs Instead of Default URLs` checkbox
- verify that only the fields "Authorize", "Token" and "Profile" URLs are shown (no "Email URL", nor "Tenant").
- Switch the `OAuth2 provider` to `Azure AD v2`
- verify that the `Use Custom URLs Instead of Default URLs` option is **initially checked**
- verify that only the field "Tenant" is shown (with the default "organizations").

![image](/attachments/0e2b1508-861c-4b0e-ae6a-6eb24ce94911)

Note: this is loosely based on the upstream fix https://github.com/go-gitea/gitea/pull/31246 which I initially overlooked.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4194
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2024-06-21 06:21:37 +00:00
Earl Warren
d03a169dae Merge pull request 'Add headers to follower lists' (#4174) from 0ko/forgejo:ui-profile-followers-title into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4174
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-06-19 09:54:41 +00:00
0ko
53215726e1 Add headers to follower lists 2024-06-19 11:53:59 +05:00
wxiaoguang
35447463ba
Fix Activity Page Contributors dropdown (#31264)
Fix #31261

(cherry picked from commit e728fd741be7848d476663eec1c9caaf34b46e61)
2024-06-18 20:05:23 +02:00
Shiny Nematoda
b5d96e7db7 [FEAT] expose fuzzy search for issues/repo (#4160)
Ports fuzzy search for `/issues` and `/pulls` from gitea.
Adds fuzzy search for `/user/repo/issues` and `/user/repo/pulls`.

---
## Notes
### Port: [`gitea#be5be0ac81`](be5be0ac81)

- CONFLICT (content): Merge conflict in routers/web/user/home.go

Conflict resolved by
  1. keeping both `PageIsOrgIssues` and the newly introduced `IsFuzzy`
  2. using `pager.AddParam(ctx, "fuzzy", "IsFuzzy")` rather than `pager.AddParamString("fuzzy", fmt.Sprintf("%v", isFuzzy))`

- CONFLICT (content): Merge conflict in templates/user/dashboard/issues.tmpl

Conflict resolved by keeping the changes from #4096, and picking the `&fuzzy=${{.IsFuzzy}}` inclusion to all urls and `{{if .PageIsPulls}}...`

### Port: [`gitea#fede3cbada`](fede3cbada)

- CONFLICT (content): Merge conflict in templates/user/dashboard/issues.tmpl

Conflict resolved by keeping previous changes and picking the replacement of `{{if .PageIsPulls}}...` with `{{template "shared/search/combo_fuzzy"...` which contains the replacement of `explorer.go` to `explorer.go_to`

### Fixup commit

replaces `Iif` with `if` which was introduced in gitea#fede3cbada

### Feature commit

adds in support for /user/repo/(issues|pulls) + test

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Kerwin Bryant <kerwin612@qq.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4160
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
2024-06-17 18:58:24 +00:00
oliverpool
82ae7460bf [BUG] admin authentication source JS errors (#4059)
While trying to understand #1236, I was quite confused not to see the `Use Custom URLs` checkbox.

This checkbox disappeared in b95a893b22 (because `getElementById` does not expect a `#` as first char), fixed in 4e816e1326.

After solving this, switching from `Nextcloud` to `OpenID Connect` triggered a JS error, which is addressed in 3efa4d836a.

Manual testing:
- go to http://localhost:3000/admin/auths
- click on `Add authentication source`
- Choose `Authentication type`: `OAuth2`
- Choose `OAuth2 provider`: `Nextcloud`
- check that the `Use Custom URLs Instead of Default URLs` checkbox toggles the fields below
- let the checkbox be checked
- Switch the `OAuth2 provider` to `OpenID Connect`
- ensure that no JS error is shown
- Switch the `OAuth2 provider` to `Mastodon`
- check that the fields below `Use Custom URLs Instead of Default URLs` have the right defaults (mastodon.social)

![2024-06-07-101638.png](/attachments/5bd6692e-3457-4dd8-b1c1-50e9a95a3100)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4059
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2024-06-17 10:05:59 +00:00
Beowulf
c984e62378 Restore old image pasting behavior (#3965)
This removes the difference between high density images and other images regarding the pasting.

## Why

With this change, all images are clickable by default again. I don't think there is any problem regarding the img size because 1. it is the old behaviour, 2. the comment container already limits the size of the image.

## Alternatives

We can add an a-tag automatically when the user pastes an image. I do not prefer this because this adds a really long text (it's already bad with the img-tag) e.g.: `<a href="/attachments/28cf2254-13be-46c6-a433-efc77f556083" target="_blank"><img width="385" alt="grafik" src="/attachments/28cf2254-13be-46c6-a433-efc77f556083"></a>`

## Testing

1. Open an issue or pull request
2. Paste an image in the comment text box
3. The image should be pasted with valid Markdown syntax

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3965
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2024-06-16 12:45:34 +00:00
Danko Aleksejevs
221ca0c404 Implement tab indentation and list continuation in the new editor (#3848, #3849) (#4072)
This overrides handling of Tab and Enter keys in the ComboMarkdownEditor, so that:

* Pressing Tab prepending 4 spaces to the line under cursor, or all the lines in the selection.
* Pressing Shift+Tab removes up to 4 spaces.
* Pressing Enter repeats any indentation and a "repeatable" prefix (list or blockquote) from the current line.

Since Tab "capture" can interfere with keyboard navigation, it's only done if there was any previous input in the textarea or if it was selected with a pointer. Additionally, presing Esc will make the textarea lose focus, resuming tab navigation. This seems adequate to me, but I might be wrong.

Had to use the "deprecated" execCommand method, since anything else I tried messes up the undo history. There's a fallback for when (if?) it's actually removed.

Only tested in desktop Firefox and Chrome so far.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4072
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
Co-authored-by: Danko Aleksejevs <danko@very.lv>
Co-committed-by: Danko Aleksejevs <danko@very.lv>
2024-06-15 13:40:31 +00:00
Beowulf
09aa1c57f1
show edit textfield always initially when editing comments
When a comment was added and saved with the preview tab active, the
preview tab is still active, when the comment is edited again.
This adds a "hacky" solution, but it works and is simple.
Every time the edit is "started" and the editor already exists, the tab
with the edit text field gets clicked to activate it.

Fixes #1334
2024-06-14 15:42:21 +02:00
0ko
377165a38f Cleanup commit graph CSS (#4065)
Very little visual changes:
* class `labelled` is not used in CSS, removed from elements
* `margin-right: 0;` in `#git-graph-container .color-buttons` wasn't doing anything
* `width: 100%;` in `#git-graph-container #rev-container` and `#git-graph-container #rev-list` wasn't doing anything
(Checked on both desktop and mobile screens.)
* the now unused class `color-buttons` is left for now because it might come useful later. The button coloring is broken here and I would like to touch it separately
* removed `font-size: 80%;` from dates to ensure proper readability, it wasn't saving much space but was inconvenient to look at because other dates in the UI are normal sized
* the small size of branch labels are left as is for now because removing `small` breaks alignment, and this is a cleanup PR

So, the only visual change is date sizes, other than that there's just styling code removed.

https://codeberg.org/attachments/d02f2771-8517-4b8b-9ac7-76b020f7b14e

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4065
Reviewed-by: Otto <otto@codeberg.org>
2024-06-11 19:06:56 +00:00
Earl Warren
d6140093c0 Merge pull request 'Replace gt-word-break with tw-break-anywhere' (#4102) from 0ko/forgejo:ui-replace-gt-word-break into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4102
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-06-11 10:39:03 +00:00
Earl Warren
df373c9f7e Merge pull request '[gitea] week 2024-24 cherry pick (gitea/main -> forgejo)' (#4083) from earl-warren/wcp/2024-24 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4083
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-06-11 10:37:26 +00:00
0ko
467460679b Replace gt-word-break with tw-break-anywhere
Mass replace based on https://github.com/go-gitea/gitea/pull/31183/files.
2024-06-11 08:57:27 +05:00
Beowulf
187860bded Fix margin above headline in rendered org-mode (#4076)
This Fixes #3962 by adding `!important` to the margin of the heading in the rendered markdown.

In the current behaviour, the margin-top was always overridden by a global css-rule. This is prevented by this change.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4076
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2024-06-11 03:34:21 +00:00
Mai-Lapyst
0a7767eaaa [FEAT] Adds x-mode-only anchor styles to display images based if the theme is light or dark mode. (#3985)
Adds a feature similar to this https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/ , by adding styles to elements which `src` or `href` attribute ends with `#light-mode-only` or `#dark-mode-only`. To improve compability, the github variants with the `gh-` prefix are also contained.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3985
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Co-committed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-06-09 10:50:53 +00:00
silverwind
23a82bcd7a
Remove .segment from .project-column (#31204)
Using `.segment` on the project columns is a major abuse of that class,
so remove it and instead set the border-radius directly on it.

Fixes: https://github.com/go-gitea/gitea/issues/31129
(cherry picked from commit 4ca65fabdad75e39f9948b9a2a18e32edc98ec02)
2024-06-09 11:13:39 +02:00
silverwind
237d18974e
Move custom tw- helpers to tailwind plugin (#31184)
Move the previous custom `tw-` classes to be defined in a tailwind
plugin. I think it's cleaner that way and I also verified double-class
works as expected:

<img width="299" alt="Screenshot 2024-05-30 at 19 06 24"
src="https://github.com/go-gitea/gitea/assets/115237/003cbc76-2013-46a0-9e27-63023fa7c7a4">

(cherry picked from commit 8c68c5e436805848197d98313e9ee77e8d540a83)
2024-06-09 11:13:39 +02:00
silverwind
b62fa72ceb
Remove unnecessary inline style for tab-size (#31224)
Move the rule to the parent node. `tab-size` is inherited so will work
just as before.

(cherry picked from commit 0f0db6a14fd10a493ba73f211e2e627c3884d114)
2024-06-09 11:13:39 +02:00
0ko
f71a240239 UI improvements to optional sections in installation page (#4062)
Currently the collapsed sections on the installation page have bad visibility, clickability and don't look good. This commit attempts to improve this. It is also worth noting that the amount of these sections might increase.

### Changes

* make custom style for these collapsible sections of the form. This is not a standard design to Forgejo, but we also don't have forms this large anywhere else, and it's fit in a few small CSS rules, so I think that's justified. I'm curious how it looks to others visually, good or bad.
* improve the positioning of the installation location hint.
* remove very rare occasion of dashed horizontal divider as this rule is no longer needed with the new borders. It was [added](c16ae1ab39 (diff-f8dad1e2c95a9e959d4688c763f3e02d1878c8e0)) just a month ago and had a visual bug with duplicated dividers.

### Preview

|Before|After|
|-|-|
|![](/attachments/c5360e33-1694-4e75-bedc-b24717172ee9)|![](/attachments/2363e1ac-b4cb-4d96-9b6a-4315c1bd6416)|

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4062
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-06-07 17:57:54 +00:00
Earl Warren
c2382d4f5b Merge pull request '[gitea] week 2024-23 cherry pick (gitea/main -> forgejo)' (#3989) from earl-warren/wcp/2024-23 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3989
Reviewed-by: Otto <otto@codeberg.org>
2024-06-04 07:40:35 +00:00
0ko
6672cf0812 Fix org view on mobile for members (#3949)
The row of buttons on the org view is pretty bad on mobile, as it doesn't leave enough space for the org name. My recent PR 3642 made it worse. I added a mitigation to allow buttons to go to an other row, so that the layout is usable on mobile. It is still non-ideal as it will continue going out of bounds on small screens, but is much better.

## Preview

[Old preview](/attachments/1e280a77-533c-41b5-954d-b336f1b72186)

![](/attachments/4a2c45e2-7da8-4d87-afb7-7c281e14c756)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3949
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-06-04 04:08:54 +00:00
metiftikci
ca0921a95a
Prevent simultaneous editing of comments and issues (#31053)
fixes #22907

Tested:
- [x] issue content edit
- [x] issue content change tasklist
- [x] pull request content edit
- [x] pull request change tasklist

![issue-content-edit](https://github.com/go-gitea/gitea/assets/29250154/a0828889-fb96-4bc4-8600-da92e3205812)

(cherry picked from commit aa92b13164e84c26be91153b6022220ce0a27720)

Conflicts:
	models/issues/comment.go
	 c7a389f2b2 [FEAT] allow setting the update date on issues and comments

	options/locale/locale_en-US.ini
	 trivial context conflicts

	routers/api/v1/repo/issue_comment.go
	routers/api/v1/repo/issue_comment_attachment.go
	services/issue/comments.go
	services/issue/content.go
         user blocking is implemented differently in Forgejo

	routers/web/repo/issue.go
	 trivial difference from 6a0750177f Allow to save empty comment
         user blocking is implemented differently in Forgejo

	templates/repo/issue/view_content/conversation.tmpl
	 templates changed a lot in Forgejo but the change is
	 trivially ported

	tests/integration/issue_test.go
	 other tests were added in the same region

	web_src/js/features/repo-issue-edit.js
	 the code is still web_src/js/features/repo-legacy.js
	 trivially ported
2024-06-02 16:26:54 +02:00
Lunny Xiao
a7591f9738
Rename project board -> column to make the UI less confusing (#30170)
This PR split the `Board` into two parts. One is the struct has been
renamed to `Column` and the second we have a `Template Type`.

But to make it easier to review, this PR will not change the database
schemas, they are just renames. The database schema changes could be in
future PRs.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 98751108b11dc748cc99230ca0fc1acfdf2c8929)

Conflicts:
	docs/content/administration/config-cheat-sheet.en-us.md
	docs/content/index.en-us.md
	docs/content/installation/comparison.en-us.md
	docs/content/usage/permissions.en-us.md
	non existent files

	options/locale/locale_en-US.ini
	routers/web/web.go
	templates/repo/header.tmpl
	templates/repo/settings/options.tmpl
	trivial context conflicts
2024-06-02 09:42:39 +02:00
0ko
1084362f7c CSS improvements around commit status icons (#3948)
- make sure margins are all consistent and good, elements are not too close or too apart
- this also applies to "Show commit body" button
- remove unused code. The class `commit-status-link` doesn't exist in templates, nor I could find it on any related pages in case it's generated in runtime

## Preview

![](/attachments/9cf6d73a-8132-4f30-8094-5687d7dd98e9)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3948
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-06-01 15:20:40 +00:00
0ko
503953fb9b Unify vertical and horizontal paddings in markup file view (#3944)
Use the same padding horizontally and vertically, so the views like readme look a bit nicer. Just slightly adjusted two values, nothing really test-able here.

## Motivation

I came to the conclusion that they should be the same myself, later I checked GitHub and it turned out to also use the same paddings. I would like to notice that the padding here (2em = 32px) is the same as GitHub uses too.
I find this as a logical UI change because the paddings are usually same on both axis across the UI (like on PR sidebar).

Also updated paddings for when the files are shown in profile, but copied the `1.5em` that GitHub uses. This, once again, makes sense, because the overview markdown isn't the primary content, or as primary as the readme on the repo is, taking the full usable width.

## Preview

https://codeberg.org/attachments/55f6685c-1978-410a-a17b-9fac91f0642e
---
https://codeberg.org/attachments/d9016a1c-13cf-4ea6-a8e4-2619d93f3560

## Note

`.non-diff-file-content .plain-text` is left untouched with `1em 2em`, because the plaintext seems to add it's own margins, so it would make it look worse.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3944
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-05-31 03:38:45 +00:00
0ko
68c9e9c2b9 Remove unused CSS rules (#3937)
Remove CSS code that was made unused by some changes in Gitea. I was working on a layout change here but was bothered a bit by these. I dug a bit into the git history to find out how they were made unused but it's relatively uneasy.

- remove rule that was setting `width: 100%;`: the exactly same selector setting this exact value is duplicated below
- remove rules with `followers` in selectors: we don't use this class in templates (would be nice if someone double-checks)
- my editor forced EoF fix

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3937
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-05-30 11:41:45 +00:00
Earl Warren
7af3a981b5 Merge pull request '[gitea] week 2024-22 cherry pick (gitea/main -> forgejo)' (#3917) from earl-warren/wcp/2024-22 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3917
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-05-28 10:50:48 +00:00
silverwind
afa1380672
Change --border-radius-circle to --border-radius-full (gitea#30936)
Cherry-pick of 2ced31e81d adapted to Forgejo releases UI.

Percentage-based `border-radius` [creates undesirable
ellipse](https://jsfiddle.net/silverwind/j9ko5wnt/4/) on non-square
content. Instead, use pixel value and use same wording `full` like
tailwind does, but increast to 99999px over their 9999px.

(cherry picked from commit 2ced31e81dd9e45659660c1abff529d0192fd8ed)
2024-05-27 13:15:20 +02:00
0ko
b6849b8e7d Merge pull request 'Port: Fix long branch name overflows (https://github.com/go-gitea/gitea/pull/30345)' (#3890) from 0ko/forgejo:fix-branch-overflow-2 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3890
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-05-27 04:24:41 +00:00
0ko
b2eba34506 Unify usercards margins (#3915)
These are some slight design changes to how usercards are presented.

- `margin`: removed one of the sides so the margins are the same in both axis
- `margin`: increased from 10px to 15px
Previously it was (Y, X) = (20, 10); now it's (15, 15)
 - `width`: slightly decreased so that the point, where too small screen width causes card relocation to another row, doesn't increase
- `padding`: this change does nothing visually. `padding-bottom` was useless because padding was already set for all sides by another rule `.ui.segment {padding: 1em};`. This change just ensures that padding stays the same for all sides even if `.ui.segment` changes, instead of causing inconsistency
- `margin-bottom`: added as an override to margin caused by `display: flex`. From my research, usually there's `25px` gap between the content and the pagination. It was `39px` here, now it's `25px` too

### Before

![image](/attachments/0ebf6f44-6b27-4d4d-8856-77568291518c)

### After

![image](/attachments/1e0a3d95-ac49-4d10-8e00-86cc041d4338)

I can't show the distance between the content and the pagination, but the change does work when applying via devtools on https://codeberg.org/forgejo/forgejo/stars.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3915
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
Reviewed-by: Caesar Schinas <caesar@caesarschinas.com>
2024-05-27 04:22:48 +00:00
0ko
da12320a0c Replace imgage diff png background pattern with gradient (#3870)
Made the checkerboard background be more flexible in terms of scale and coloring. Provides dark theme for image diff.

I suppose these colors should not be re-used for a color-picker for a example, because it's usually more convenient to always have it in the light mode.

## Test

* go to e6d3623c7e
* or migrate https://next.forgejo.org/image-test/image-diff to your local instance

## Before/after

![image](/attachments/3835a455-69e0-4aec-bc67-5b226d8016c1)

(Old any - New Forgejo dark - New Gitea dark - New Forgejo/Gitea light)

---

Gradient property is taken from [here](https://www.reddit.com/r/css/comments/u08pf3/how_to_make_a_checkerboard_using_background/).

[CSS compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/conic-gradient#browser_compatibility): about four years of browser versions.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3870
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-24 17:33:13 +00:00
silverwind
f6c1fd76f2 Fix long branch name overflows (https://github.com/go-gitea/gitea/pull/30345)
Fixes: https://github.com/go-gitea/gitea/issues/27971
Fixes: https://github.com/go-gitea/gitea/pull/28010

<img width="689" alt="Screenshot 2024-04-09 at 00 19 57"
src="https://github.com/go-gitea/gitea/assets/115237/7c895a47-274f-40a6-a126-290658f1982d">

Also fixes a similar issue in issue list where CSS was there but not
active because of missing `display: block`.

<img width="372" alt="Screenshot 2024-04-09 at 00 18 25"
src="https://github.com/go-gitea/gitea/assets/115237/cfbee7cd-2e15-4ac7-96ce-020816f48798">

---
Little conflict in branch_selector_field (repo.pulls.no_results is renamed in Gitea)
And some weird conflict on new CSS rules added.
2024-05-24 22:11:37 +05:00
Mai-Lapyst
d4b1ed859c Port: Fix issue/PR title edit (gitea#30858) (#3797)
This PR ports [gitea#30858](https://github.com/go-gitea/gitea/pull/30858) / [this commit](5c236bd4c0) to forgejo.

[week 2024-20 cherry pick](https://codeberg.org/forgejo/forgejo/pulls/3729)

## Tests
- [ ] Click "edit" to get into edit mode, change the title and then use Alt+Enter to save the title

## Screenshots

Before:
![grafik](/attachments/bb0b2562-7da0-4205-a647-3270d66f2ad7)
![grafik](/attachments/c3d05a21-659d-4616-b357-87de57232182)

After:
![grafik](/attachments/d9af6966-3282-439b-a845-76618a24b9a6)
![grafik](/attachments/5acd6684-69c4-41a4-8e27-7cb75fe3c7e4)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3797
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Co-committed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-20 23:32:48 +00:00
David Davies-Payne
e4c3c039be Suppress Monaco JavaScript errors in Safari (#3805)
Fix #3638

This is a manual Forgejo-specific version of the Gitea PR https://github.com/go-gitea/gitea/pull/30862. The weekly Forgejo PR #3772 could not cherry-pick this commit due to conflicts (eg subsequent CodeSpell changes).

Only occurs with Webkit in Safari over eg `http://192..`. (not localhost).
See https://webkit.org/blog/10855/async-clipboard-api/

---
**Before**
![Before.jpg](/attachments/c570d030-fcce-48ea-ac96-06b624541c7b)

**After**
![After.jpg](/attachments/1a9132ab-f7f3-43a5-b3ea-37b6f2b671c4)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3805
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: David Davies-Payne <d2p@me.com>
Co-committed-by: David Davies-Payne <d2p@me.com>
2024-05-18 21:07:09 +00:00
Beowulf
853f005180
fixed overflow of projects column title
This fixes that titles of project columns can overflow and push the
action menu out of the card, so that interaction is no longer possible.

Fixes #3717
2024-05-17 23:11:11 +02:00
Beowulf
82e0066ed4
Fixed contrast for issue count in projects column
Regression introduced by 9934931f1f

See #3772
2024-05-17 00:54:10 +02:00
wxiaoguang
c16ae1ab39
Fix some UI problems (install) (#30854)
(cherry picked from commit ce8b11ae131bef6cd7df0849ed39da7984953a4b)
2024-05-15 20:12:14 +02:00
Earl Warren
48813e6be1 Merge pull request 'Port "Enable declaration-block-no-redundant-longhand-properties (#30950)' (#3769) from beowulf/gitea-port-pull-30950 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3769
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 22:23:54 +00:00