summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Rename "People" to "Members" in organization page and use a better icon (#22960)Yarden Shoham2023-02-185-5/+5
| | | | | | | | | | | | | | | | | `member` is how it's named in the code Closes #22931 Before | After --- | --- ![image](https://user-images.githubusercontent.com/20454870/219781155-69a8476e-0f04-4b70-bda5-ea6fa8ce676c.png) | ![image](https://user-images.githubusercontent.com/20454870/219780887-61644c27-36a2-4e1f-8f98-be3911883b49.png) --------- Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: delvh <leon@kske.dev>
* Rename `repo.GetOwner` to `repo.LoadOwner` (#22967)yp053272023-02-1833-68/+68
| | | | | | | Fixes https://github.com/go-gitea/gitea/issues/22963 --------- Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
* Notify on container image create (#22806)KN4CK3R2023-02-181-4/+22
| | | | | | | Fixes #22791 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* webview: Fix overflowing diff body (#22959)Ferdinand Thiessen2023-02-181-0/+5
| | | | | | | | | | | | | | | If the content is quite large the diff body overflows the container and can not be read. This is fixed by setting the diff body maximum width to 100% and enable overflow scrollbars: before | after ---|--- ![Screenshot_20230217_184716](https://user-images.githubusercontent.com/1855448/219733934-75bec38c-7cfe-47bb-b001-b090c02b769e.png) | ![Screenshot_20230217_184655](https://user-images.githubusercontent.com/1855448/219733971-4db092d1-ffcb-4298-a640-f740a3ac430b.png) Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
* Introduce customized HTML elements, fix incorrect AppUrl usages in templates ↵wxiaoguang2023-02-1721-27/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#22861) This PR follows: * #21986 * #22831 This PR also introduce customized HTML elements, which would also help problems like: * #17760 * #21429 * #21440 With customized HTML elements, there won't be any load-search-replace operations, and it can avoid page flicking (which @silverwind cares a lot). Browser support: https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements # FAQ ## Why the component has the prefix? As usual, I would strongly suggest to add prefixes for our own/private names. The dedicated prefix will avoid conflicts in the future, and it makes it easier to introduce various 3rd components, like GitHub's `relative-time` component. If there is no prefix, it's impossible to introduce another public component with the same name in the future. ## Why the `custcomp.js` is loaded before HTML body? The `index.js` is after HTML body. Customized components must be registered before the content loading. Otherwise there would be still some flicking. `custcomp.js` should have its own dependencies and should be very light, so it won't affect the page loading time too much. ## Why use `data-url` attribute but not use the `textContent`? According to the standard, the `connectedCallback` occurs on the tag-opening moment. The element's children are not ready yet. ## Why not use `{{.GuessCurrentOrigin $.ctx ...}}` to let backend decide the absolute URL? It's difficult for backend to guess the correct protocol(scheme) correctly with zero configuration. Generating the absolute URL from frontend can guarantee that the URL is 100% correct -- since the user is visiting it. # Screenshot <details> ![image](https://user-images.githubusercontent.com/2114189/218256757-a267c8ba-3108-4755-9ae5-329f1b08f615.png) </details>
* Sort issues and pulls by recently updated in user and organization home (#22925)Brecht Van Lommel2023-02-172-2/+7
| | | | | | | | | | | | | | The main purpose of these home pages should be getting an overview of what's going on or needs attention. Recently updated is a better default than newest for that purpose, to avoid missing active issues and pulls that were not created recently. The default sorting order in repository issues and pulls remains newest. Repositories in an organization are already sorted by recently updated. --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix 404 error viewing the LFS file (#22945)Zettat1232023-02-171-1/+1
| | | | | | | | | Fix #22734. According to [`view_file.tmpl`](https://github.com/go-gitea/gitea/blob/main/templates/repo/view_file.tmpl#L82), `lfs_file.tmpl` should use `AssetUrlPrefix` instead of `AppSubUrl`. Co-authored-by: Jason Song <i@wolfogre.com>
* Always go full width in PR view (#22844)gempir2023-02-163-3/+3
| | | | | | | | | | | | This is an alternative solution to #22824 and would also close #22781 This makes the PR diff view always full width. It makes sense to make use of that screen real estate. If you want a more narrow view you can always resize your browser. It also avoids cluttering the UI with another button + the database with another column for the setting. This is also how github and gitlab do it.
* Increase Content field size of gpg_key_import to MEDIUMTEXT (#22897)zeripath2023-02-163-1/+29
| | | | | | | | Unfortunately #20896 does not completely prevent Data too long issues and GPGKeyImport needs to be increased too. Fix #22896 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix context bug (#22940)Lunny Xiao2023-02-161-1/+1
| | | Fix https://try.gitea.io/wxiaoguang/test/issues/19
* Allow custom "created" timestamps in user creation API (#22549)Sybren2023-02-165-1/+91
| | | | | | | | | | | | | | | Allow back-dating user creation via the `adminCreateUser` API operation. `CreateUserOption` now has an optional field `created_at`, which can contain a datetime-formatted string. If this field is present, the user's `created_unix` database field will be updated to its value. This is important for Blender's migration of users from Phabricator to Gitea. There are many users, and the creation timestamp of their account can give us some indication as to how long someone's been part of the community. The back-dating is done in a separate query that just updates the user's `created_unix` field. This was the easiest and cleanest way I could find, as in the initial `INSERT` query the field always is set to "now".
* Use "Title Case" for text "Reference in new issue" (#22936)Dalai Felinto2023-02-161-1/+1
| | | | | | | | | | | | | | | | | The "Reference in new issue" option shows up in a menu when looking at pull requests. All the other options there follow the "Title case": * Copy Link * Quote Reply * Edit This patch makes sure this option also follow the Title case. Screenshot of how it looks without this patch: ![image](https://user-images.githubusercontent.com/843498/219346003-728d07c1-d150-41a5-b084-faef118228b1.png) Co-authored-by: Dalai Felinto <dalai@blender.org> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* First step to refactor the `.hide` to `.gt-hidden` (#22916)wxiaoguang2023-02-165-26/+20
| | | A separate PR from #22884 (without touching the jQuery methods)
* Add continue option to backport.go (#22930)zeripath2023-02-161-6/+41
| | | | | | | | | | Sometimes it can be helpful to continue from a broken cherry-pick. This PR adds another option which can be used to determine the version and pr number from the current branch name instead of reading the config.yaml file. --------- Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add `title` to PR file tree items (#22918)delvh2023-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a file/directory name was simply cut when it was too long. Now, we display the browser-native tooltip (`title`) instead, so you can still see it when hovering over it. In this case, we don't use the normal `tippy` tooltips for three reasons: 1. Vue components are not included in the global tooltip initialization 2. Vue components would need to initialize their tooltips themselves whenever their content is changed 3. The tooltips are shown too long under the default configuration (the tooltip one element above is still shown when hovering on the element below) Fixes #22915 ## Appearance ![image](https://user-images.githubusercontent.com/51889757/219049642-43668a38-0e86-42bf-a1d0-3742c4dc7fd9.png) ## Room for future improvement We could think about displaying the whole file path in the title, not just its name. This is not done at the moment: ![image](https://user-images.githubusercontent.com/51889757/219050689-1e6e3d57-f2bf-48be-8553-415e744a6e10.png) --------- Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix shabox regression (#22924)Gusted2023-02-161-2/+2
| | | | | | | - Regression from https://github.com/go-gitea/gitea/pull/22294 Error: ![image](https://user-images.githubusercontent.com/25481501/219115669-52b98fdb-bcbb-430d-a205-beb305c37e85.png)
* fix incorrect role labels for migrated issues and comments (#22914)Zettat1232023-02-153-4/+18
| | | | | | | | | | | | | | | Fix #22797. ## Reason If a comment was migrated from other platforms, this comment may have an original author and its poster is always not the original author. When the `roleDescriptor` func get the poster's role descriptor for a comment, it does not check if the comment has an original author. So the migrated comments' original authors might be marked as incorrect roles. --------- Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Always show the `command line instructions` button even if there are ↵wxiaoguang2023-02-152-16/+18
| | | | | | conflicts (#22909) Always show the `command line instructions` button even if there are conflicts.
* Remove thehowl from maintainers (#22917)Morgan2023-02-151-1/+0
|
* Add context cache as a request level cache (#22294)Lunny Xiao2023-02-15150-516/+663
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid duplicated load of the same data in an HTTP request, we can set a context cache to do that. i.e. Some pages may load a user from a database with the same id in different areas on the same page. But the code is hidden in two different deep logic. How should we share the user? As a result of this PR, now if both entry functions accept `context.Context` as the first parameter and we just need to refactor `GetUserByID` to reuse the user from the context cache. Then it will not be loaded twice on an HTTP request. But of course, sometimes we would like to reload an object from the database, that's why `RemoveContextData` is also exposed. The core context cache is here. It defines a new context ```go type cacheContext struct { ctx context.Context data map[any]map[any]any lock sync.RWMutex } var cacheContextKey = struct{}{} func WithCacheContext(ctx context.Context) context.Context { return context.WithValue(ctx, cacheContextKey, &cacheContext{ ctx: ctx, data: make(map[any]map[any]any), }) } ``` Then you can use the below 4 methods to read/write/del the data within the same context. ```go func GetContextData(ctx context.Context, tp, key any) any func SetContextData(ctx context.Context, tp, key, value any) func RemoveContextData(ctx context.Context, tp, key any) func GetWithContextCache[T any](ctx context.Context, cacheGroupKey string, cacheTargetID any, f func() (T, error)) (T, error) ``` Then let's take a look at how `system.GetString` implement it. ```go func GetSetting(ctx context.Context, key string) (string, error) { return cache.GetWithContextCache(ctx, contextCacheKey, key, func() (string, error) { return cache.GetString(genSettingCacheKey(key), func() (string, error) { res, err := GetSettingNoCache(ctx, key) if err != nil { return "", err } return res.SettingValue, nil }) }) } ``` First, it will check if context data include the setting object with the key. If not, it will query from the global cache which may be memory or a Redis cache. If not, it will get the object from the database. In the end, if the object gets from the global cache or database, it will be set into the context cache. An object stored in the context cache will only be destroyed after the context disappeared.
* Add tooltip to issue reference (#22913)delvh2023-02-151-2/+2
| | | | | | | | | | | | | | | Previously, you had no idea what you are copying with the issue reference button for either long repo names, user names, or issue indexes. Now, it is simply a bit redundant for short references but a lot easier for long references. ## Before ![image](https://user-images.githubusercontent.com/51889757/218995943-3b609ee9-4138-49ce-99b1-73fb1ea80280.png) ## After ![image](https://user-images.githubusercontent.com/51889757/218996119-4b6bf6c1-abfa-4618-81ca-a72914e73eb8.png)
* Add command to bulk set must-change-password (#22823)zeripath2023-02-1410-406/+598
| | | | | | | | | As part of administration sometimes it is appropriate to forcibly tell users to update their passwords. This PR creates a new command `gitea admin user must-change-password` which will set the `MustChangePassword` flag on the provided users. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remember to attach the parent tree when converting TreeEntry() -> Tree() ↵Nick2023-02-141-1/+2
| | | | | | | | | | | | (#22902) !fixup https://github.com/go-gitea/gitea/pull/22177 The only place this function is used so far is in findReadmeFileInEntries(), so the only visible effect of this oversight was in an obscure README-related corner: if the README was in a subfolder and was a symlink that pointed up, as in .github/README.md -> ../docs/old/setup.md, the README would fail to render when FollowLinks() hit the nil ptree. This makes the ptree non-nil and thus repairs it.
* Fix dark-colored description text in arc-green theme (#22908)Zettat1232023-02-141-0/+4
| | | Fix #22873.
* Fix the full-height problem for all pages (#22905)wxiaoguang2023-02-141-5/+5
| | | | | | | | | | | | | | | | | | | | Really fix #22883, close #22901 I made a mistake that the global styles in RepoActionView.vue could still pollute global styles (I forgot that the code of this component is still loaded on every page, instead of loaded on demand) This PR makes a complete fix: only change the page's full-height behavior if the component is used. Screenshot after the fix: <details> ![image](https://user-images.githubusercontent.com/2114189/218664776-0dbcd469-2c36-4e17-972f-e44fa3b81ba6.png) </details> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove Fomantic-UI's `.hidden` CSS class for menu elements (#22895)wxiaoguang2023-02-145-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Like #22851 * All other dropdown menu elements do not have such `hidden` class. * Actually the dropdown menu elements do not need it in HTML, so this PR removes it. * There is already `.ui.dropdown .menu { display: none; }`, so when loading the page, the menu is correctly hidden initially, no need to add any more CSS classes. * The Fomantic UI's `.hidden` class should still exist until there is no its checkbox/dropdown module anymore. The Fomantic UI JS code still addes `hidden` for `ui checkbox` and addes `transition hidden` for `ui menu` at the moment. * This PR also cleans the legacy inline `style`, which is quite hacky and no need anymore. All these dropdown menus work well. I have tested these 5 places: * The code search from User Profile * The issue sidebar to lock issue * The repo search form * The repo setting page: branch list * The repo setting page: merge option list Screenshot: ![image](https://user-images.githubusercontent.com/2114189/218534515-e7dfe291-6765-4e0b-833c-b74f17e30117.png)
* Move `IsReadmeFile*` from `modules/markup/` to `modules/util` (#22877)Nick2023-02-135-131/+122
| | | | | | | | | These functions don't examine contents, just filenames, so they don't fit in well in a markup module. This was originally part of https://github.com/go-gitea/gitea/pull/22177. Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
* Move helpers to be prefixed with `gt-` (#22879)zeripath2023-02-13137-921/+922
| | | | | | | | | | | | | | | | | | | | As discussed in #22847 the helpers in helpers.less need to have a separate prefix as they are causing conflicts with fomantic styles This will allow us to have the `.gt-hidden { display:none !important; }` style that is needed to for the reverted PR. Of note in doing this I have noticed that there was already a conflict with at least one chroma style which this PR now avoids. I've also added in the `gt-hidden` style that matches the tailwind one and switched the code that needed it to use that. Signed-off-by: Andrew Thornton <art27@cantab.net> --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove _actions.less (#22885)Jason Song2023-02-133-46/+53
| | | | | Fix #22883. Revert commit 59beb2dba6b35b88dae5ac5c3d094bc6c1bba19c.
* Highlight focused diff file (#22870)delvh2023-02-131-0/+8
| | | | | | | | | | | | | When a diff file has been focused through the URL ID fragment, it will be highlighted. ![light theme](https://user-images.githubusercontent.com/51889757/218283880-ce551cb3-0c21-4044-adb0-d9ceb8a15ec5.png) ![dark theme](https://user-images.githubusercontent.com/51889757/218283885-e96e989a-4670-49b6-9733-fbd6fffabf20.png) --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Pull Requests: setting to allow edits by maintainers by default, tweak UI ↵Brecht Van Lommel2023-02-1311-34/+72
| | | | | | | | | | | | | | | | | | (#22862) Add setting to allow edits by maintainers by default, to avoid having to often ask contributors to enable this. This also reorganizes the pull request settings UI to improve clarity. It was unclear which checkbox options were there to control available merge styles and which merge styles they correspond to. Now there is a "Merge Styles" label followed by the merge style options with the same name as in other menus. The remaining checkboxes were moved to the bottom, ordered rougly by typical order of operations. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* docs: Update translation from-binary.zh-cn.md (#22820)Xinyu Zhou2023-02-132-11/+142
| | | | Signed-off-by: Xinyu Zhou <i@sourcehut.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Move delete user to service (#22478)Lunny Xiao2023-02-133-23/+51
| | | | | | Move delete user to service Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Jason Song <i@wolfogre.com>
* Remove Fomantic-UI's `.hidden` CSS class for checkbox elements (#22851)wxiaoguang2023-02-138-50/+50
| | | | | | | | | | Fomantic-UI's `.hidden` CSS class is badly designed. * Checkbox elements do not need it in HTML, so this PR removes it (JS adds the `.hidden` class back by `$('.ui.checkbox').checkbox()`) * `menu transaction hidden` is still needed, and it should be the only usage for the `.hidden` from now on (until they get refactored properly) Co-authored-by: zeripath <art27@cantab.net>
* Add some headings to repo views (#22869)Felipe Leopoldo Sologuren Gutiérrez2023-02-122-3/+3
| | | | | | | | | | | | | | | * Add role heading level 1 to username/repo title. * Copy behaviour of Releases to some other views. Contributed by @Forgejo. ![Screenshot with h2](https://user-images.githubusercontent.com/5055343/218287363-dfae9ab2-7297-4367-ab64-ab141506e131.png) ![Screenshot with former div](https://user-images.githubusercontent.com/5055343/218287419-77d0ed56-935d-492f-b3ed-71051d169ba8.png) Co-authored-by: delvh <leon@kske.dev> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix style of actions rerun button (#22835)Jason Song2023-02-121-18/+30
| | | | | | | | | | | | | | | | | | | | Authored by @a1012112796 at https://github.com/go-gitea/gitea/pull/22798#issuecomment-1421820001 Avoid putting `button` in `a`. A patch for #22798 . Now it looks like: <img width="393" alt="image" src="https://user-images.githubusercontent.com/9418365/217791913-b491fc86-ee9b-4672-80ea-7286eef2d11f.png"> <img width="389" alt="image" src="https://user-images.githubusercontent.com/9418365/217791967-d8c09c8b-4cea-4011-b01e-db0d1333e7f6.png"> --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make issue and code search support camel case (#22829)sillyguodong2023-02-122-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #22714 ### Changes: 1. Add a token filter which named "camelCase" between custom unicode token filter and "to_lower" token filter when add custom analyzer. ### Notice: If users want this feature to work, they should delete folder under {giteaPath}/data/indexers and restart application. Then application will create a new IndexMapping. ### Screenshots: ![image](https://user-images.githubusercontent.com/33891828/217715692-c18c41f2-57a1-4727-861c-470935c8e0c8.png) ### Others: I originally attempted to give users the ability to configure the "token_filters" in the "app.ini" file. But I found that if users does not strictly follow a right order to register "token_filters", they won't get the expected results. I think it is difficult to ask users to do this. So I finally give up this idea. --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Revert "Fix notification and stopwatch empty states" (#22876)Lunny Xiao2023-02-122-2/+0
| | | | | | | | | | | Per https://github.com/go-gitea/gitea/pull/22845#issuecomment-1426950234 Reverts go-gitea/gitea#22845 Let's have a better PR. @silverwind @zeripath Co-authored-by: zeripath <art27@cantab.net>
* Deduplicate findReadmeFile() (#22177)Nick2023-02-122-98/+78
| | | | | | | | | | | | This code was copy-pasted at some point. Revisit it to reunify it. ~~Doing that then encouraged simplifying the types of a couple of related functions.~~ ~~As a follow-up, move two helper functions, `isReadmeFile()` and `isReadmeFileExtension()`, intimately tied to `findReadmeFile()`, in as package-private.~~ Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
* Fix milestone title font problem (#22863)wxiaoguang2023-02-122-4/+4
| | | | | | | | | | | | | | | | | | | | Replace #22853 since it's closed, and actually there are 2 places need to be fixed. ~~Follow @fsologureng 's suggestion to keep the `<hX>` tags.~~ Update: from fsologureng: this doesn't change anything from a11y's point of view. So I think this PR could be fine to fix the UI looking problems as a quick patch, then defer the a11y problems to new PRs together. Before: the font-size is too large. After: it seems better. ![image](https://user-images.githubusercontent.com/2114189/218266257-fc2d5872-9e96-4c6a-87ea-f27531ac15c0.png) ![image](https://user-images.githubusercontent.com/2114189/218266247-efc09d83-405f-4495-967a-30d9744134ce.png) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix PR file tree folders no longer collapsing (#22864)gempir2023-02-122-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Collapsing folders currently just throws a console error ``` index.js?v=1.19.0~dev-403-gb6b8feb3d:10 TypeError: this.$set is not a function at Proxy.handleClick (index.js?v=1.19.0~dev-403-gb6b8feb3d:58:7159) at index.js?v=1.19.0~dev-403-gb6b8feb3d:58:6466 at index.js?v=1.19.0~dev-403-gb6b8feb3d:10:93922 at ce (index.js?v=1.19.0~dev-403-gb6b8feb3d:10:1472) at Q (index.js?v=1.19.0~dev-403-gb6b8feb3d:10:1567) at HTMLDivElement.$e (index.js?v=1.19.0~dev-403-gb6b8feb3d:10:79198) ``` This PR fixes this and allows folders to be collapsed again. Also: - better cursor interaction with folders - added some color to the diff detail stats - remove green link color from all the file names Screenshots: ![image](https://user-images.githubusercontent.com/9765622/218269712-2f3dda55-6d70-407f-8d34-2a5d9c8df548.png) ![image](https://user-images.githubusercontent.com/9765622/218269714-6ce8a954-daea-4ed6-9eea-8b2323db4d8f.png) --------- Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* escape filename when assemble URL (#22850)sillyguodong2023-02-122-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #22843 ### Cause: https://github.com/go-gitea/gitea/blob/affdd40296960a08a4223330ccbd1fb88c96ea1a/services/repository/files/content.go#L161 Previously, we did not escape the **"%"** that might be in "treePath" when call "url.parse()". ![image](https://user-images.githubusercontent.com/33891828/218066318-5a909e50-2a17-46e6-b32f-684b2aa4b91f.png) This function will check whether "%" is the beginning of an escape character. Obviously, the "%" in the example (hello%mother.txt) is not that. So, the function will return a error. ### Solution: We can escape "treePath" by call "url.PathEscape()" function firstly. ### Screenshot: ![image](https://user-images.githubusercontent.com/33891828/218069781-1a030f8b-18d0-4804-b0f8-73997849ef43.png) --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Fix notification and stopwatch empty states (#22845)silverwind2023-02-112-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Previous solution was relying on fomantic selector `.ui.label.hidden` to hide the elements in their empty state, but this doesn't work any more with the removal of the `label` class. Instead, introduce a standalone CSS rule for the `hidden` class, which is universally usable as a single class. We can unfortunately not use the existing `hide` class because without the `!important`, it does not have enough specificity to win against fomantic's `.ui.menu:not(.vertical) .item {display: flex}` rule. Followup and fixes regression from https://github.com/go-gitea/gitea/pull/22169. Before: <img width="98" alt="image" src="https://user-images.githubusercontent.com/115237/217959380-d3279ff3-526a-4ac4-9a18-3ab7c9ae91dd.png"> After: <img width="77" alt="image" src="https://user-images.githubusercontent.com/115237/217959463-44852716-cb25-4110-8481-668842ad4454.png">
* Fix .golangci.yml (#22868)zeripath2023-02-112-3/+6
| | | | | | | | | When we updated the .golangci.yml for 1.20 we should have used a string as 1.20 is not a valid number. In doing so we need to restore the nolint markings within the pq driver. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix migration issue. (#22867)Nathaniel Sabanski2023-02-111-1/+1
| | | | See: https://github.com/go-gitea/gitea/pull/22112#issuecomment-1426872992
* Add `/$count` endpoints for NuGet v2 (#22855)KN4CK3R2023-02-113-19/+80
| | | | | Fixes #22838 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Preview images for Issue cards in Project Board view (#22112)Nathaniel Sabanski2023-02-1115-17/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original Issue: https://github.com/go-gitea/gitea/issues/22102 This addition would be a big benefit for design and art teams using the issue tracking. The preview will be the latest "image type" attachments on an issue- simple, and allows for automatic updates of the cover image as issue progress is made! This would make Gitea competitive with Trello... wouldn't it be amazing to say goodbye to Atlassian products? Ha. First image is the most recent, the SQL will fetch up to 5 latest images (URL string). All images supported by browsers plus upcoming formats: *.avif *.bmp *.gif *.jpg *.jpeg *.jxl *.png *.svg *.webp The CSS will try to center-align images until it cannot, then it will left align with overflow hidden. Single images get to be slightly larger! Tested so far on: Chrome, Firefox, Android Chrome, Android Firefox. Current revision with light and dark themes: ![image](https://user-images.githubusercontent.com/24665/207066878-58e6bf73-0c93-4caa-8d40-38f4432b3578.png) ![image](https://user-images.githubusercontent.com/24665/207066555-293f65c3-e706-4888-8516-de8ec632d638.png) --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Fix improper HTMLURL usages in Go code (#22839)wxiaoguang2023-02-1117-33/+33
| | | | | | | | | In Go code, HTMLURL should be only used for external systems, like API/webhook/mail/notification, etc. If a URL is used by `Redirect` or rendered in a template, it should be a relative URL (aka `Link()` in Gitea) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Use proxy for pull mirror (#22771)Gusted2023-02-113-4/+20
| | | | | | | | | | | - Use the proxy (if one is specified) for pull mirrors syncs. - Pulled the code from https://github.com/go-gitea/gitea/blob/c2774d9e80d9a436d9c2044960369c4db227e3a0/modules/git/repo.go#L164-L170 Downstream issue: https://codeberg.org/forgejo/forgejo/issues/302 --------- Co-authored-by: Lauris BH <lauris@nix.lv>
* Make issue title edit buttons focusable and fix incorrect ajax requests (#22807)wxiaoguang2023-02-094-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace #19922 , which is stale since my last review: https://github.com/go-gitea/gitea/pull/19922#pullrequestreview-1003546506 and https://github.com/go-gitea/gitea/pull/19922#issuecomment-1153181546 Close #19769 Changes: 1. Use `<button>` instead of `<div>` for buttons 2. Prevent default event handler in `initGlobalButtonClickOnEnter` 3. Fix the incorrect call to `pullrequest_targetbranch_change` 4. Add a slight margin-left to the input element to make UI look better The logic in repo-issue.js is not ideal, but this PR isn't going to touch the logic. This is also an example for future developers to understand how to make buttons work properly. ### Before ![image](https://user-images.githubusercontent.com/2114189/217262515-ec0462f7-7051-46a5-bfa2-2f6c6a807b7d.png) ### After * Add a slight margin-left. * The `Cancel` button is focused. ![image](https://user-images.githubusercontent.com/2114189/217264891-934c9c8d-d190-4866-98b5-666cea57e28d.png) Co-authored-by: techknowlogick <techknowlogick@gitea.io>