summaryrefslogtreecommitdiffstats
path: root/templates
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Add Debian package registry" (#24412)Yarden Shoham2023-04-284-72/+0
| | | Reverts go-gitea/gitea#22854
* Add Debian package registry (#22854)KN4CK3R2023-04-284-0/+72
| | | | | | | | | | | | | | Co-authored-by: @awkwardbunny This PR adds a Debian package registry. You can follow [this tutorial](https://www.baeldung.com/linux/create-debian-package) to build a *.deb package for testing. Source packages are not supported at the moment and I did not find documentation of the architecture "all" and how these packages should be treated. --------- Co-authored-by: Brian Hong <brian@hongs.me> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Make repo size style matches others (commits/branches/tags) (#24408)wxiaoguang2023-04-281-1/+3
| | | The "unit" part shouldn't have bold style.
* Improve commit date in commit graph (#24399)yp053272023-04-281-1/+1
| | | | | | | | | | | | The commit date time is based on server's time zone not user's local time zone. Before: ![image](https://user-images.githubusercontent.com/18380374/235074112-cc1e032f-6b43-4876-a1bc-dd48b393866b.png) After: ![image](https://user-images.githubusercontent.com/18380374/235074056-329811e8-3e81-4b55-b5a1-580ac22b6d72.png)
* Fix layouts of admin table / adapt repo / email test (#24370)wxiaoguang2023-04-286-60/+59
| | | | | | | | | | | | | | | | | | | | | Ref: https://github.com/go-gitea/gitea/pull/24315#pullrequestreview-1403034993 And fix the incorrect layout for "dasbboard", the "form" shouldn't follow `<h4 class="ui top attached header">`, so move it to inner. Diff with ignoring spaces: https://github.com/go-gitea/gitea/pull/24370/files?diff=unified&w=1 A known bug: the adapt/delete button doesn't work due to a historical messy logic, will fix it in next PR (#24374) ![image](https://user-images.githubusercontent.com/2114189/234754656-d160b098-b8d4-4783-962a-27d5c764863c.png) ![image](https://user-images.githubusercontent.com/2114189/234762327-3e77e2e4-a156-4498-8a8b-092e14cf9204.png) ![image](https://user-images.githubusercontent.com/2114189/234767811-74b7272c-e40c-4850-8e3c-499e3b53b827.png) ![image](https://user-images.githubusercontent.com/2114189/234761247-e6aad889-dcad-443c-948f-2d44df68725b.png)
* Move secrets and runners settings to actions settings (#24200)Hester Gong2023-04-2713-35/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR moves the secrets and runners settings to actions settings on all settings(repo,org,user,admin) levels. After this PR, if [ENABLED](https://github.com/go-gitea/gitea/blob/5e7543fcf441afb30aba6188edac754ef32b9ac3/custom/conf/app.example.ini#L2604) inside `app.ini` under `[actions]` is set to `false`, the "Actions" tab (including runners management and secrets management) will not be shown. After, the settings under actions settings for each level: 1. Admin Level "Runners Management" <img width="1437" alt="Screen Shot 2023-04-26 at 14 34 20" src="https://user-images.githubusercontent.com/17645053/234489731-15822d21-38e1-4560-8bbe-69f122376abc.png"> 2. User Level "Secrets Management" <img width="1427" alt="Screen Shot 2023-04-26 at 14 34 30" src="https://user-images.githubusercontent.com/17645053/234489795-68c9c0cb-24f8-4f09-95c6-458ab914c313.png"> 3. Repo and Organization Levels "Runners Management" and "Secrets Management" Org: <img width="1437" alt="Screen Shot 2023-04-26 at 14 35 07" src="https://user-images.githubusercontent.com/17645053/234489996-f3af5ebb-d354-46ca-9087-a0b586845281.png"> <img width="1433" alt="Screen Shot 2023-04-26 at 14 35 14" src="https://user-images.githubusercontent.com/17645053/234490004-3abf8fed-81fd-4ce2-837a-935dade1793d.png"> Repo: <img width="1419" alt="Screen Shot 2023-04-26 at 14 34 50" src="https://user-images.githubusercontent.com/17645053/234489904-80c11038-4b58-462c-9d0b-8b7cf70bc2b3.png"> <img width="1430" alt="Screen Shot 2023-04-26 at 14 34 57" src="https://user-images.githubusercontent.com/17645053/234489918-4e8d1fe2-9bcd-4d8a-96c1-238a8088d92e.png"> It also finished these tasks : - [x] rename routers function "runners" to "actions", and refactor related file names - [x] check and modify part of the runners related functions to match their name - [x] Fix backend check caused by fmt check --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Display 'Unknown' when runner.version is empty (#24378)yp053272023-04-271-1/+1
| | | | | | | | Before: ![image](https://user-images.githubusercontent.com/18380374/234782197-43d8f86d-afe2-4626-8e46-b621d7cde8f9.png) After: ![image](https://user-images.githubusercontent.com/18380374/234782064-6828ae3b-5957-451f-82bb-22ab60b6c2a8.png)
* Fix incorrect last online time in runner_edit.tmpl (#24376)yp053272023-04-271-1/+1
| | | | | | | | | Before: ![image](https://user-images.githubusercontent.com/18380374/234772748-7f4b416f-4056-4a5e-89f0-727d2fa14a41.png) After: ![image](https://user-images.githubusercontent.com/18380374/234772682-8b076054-d0be-4f5f-892d-8d0427275493.png)
* Add custom helm repo name generated from url (#24363)Vladimir Smagin2023-04-271-2/+2
| | | | | | Fresh version of "Add custom helm repo name generated from url #21024" https://github.com/go-gitea/gitea/pull/21024 Co-authored-by: Giteabot <teabot@gitea.io>
* Add API for gitignore templates (#22783)JakobDev2023-04-271-0/+76
| | | This implements the [Gitignores template API of GitHub](https://docs.github.com/en/rest/gitignore?apiVersion=2022-11-28) in Gitea
* Modify width of ui container, fine tune css for settings pages and org ↵Hester Gong2023-04-2615-85/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | header (#24315) Close #24302 Part of #24229, Follows #24246 This PR focused on CSS style fine-tune, main changes: 1. Give `.ui.ui.ui.container` a width of `1280px` with a max-width of `calc(100vw - 64px)`, so the main contents looks better on large devices. 2. Share styles for table elements in all levels settings pages to fix overflow of runners table on mobile and for consistency (The headers on mobile can be further improved, but haven't found a proper way yet). 3. Use [stackable grid](https://fomantic-ui.com/collections/grid.html#stackable) and [device column width](https://fomantic-ui.com/examples/responsive.html) for responsiveness for some pages (repo/org collaborators settings pages, org teams related page) 4. Fixed #24302 by sharing label related CSS in reporg.css 5. Fine tune repo tags settings page --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Display when a repo was archived (#22664)JakobDev2023-04-264-3/+20
| | | | | | | | | | | | | | | | This adds the date a repo is archived to Gitea and shows it in the UI and API. A feature, that GitHub has been [introduced recently](https://github.blog/changelog/2022-11-23-repository-archive-date-now-shown-in-ui/). I currently don't know how to correctly deal with the Date in the template, as different languages have different ways of writing a date. ![grafik](https://user-images.githubusercontent.com/15185051/234315187-7db5763e-d96e-4080-b894-9be178bfb6e1.png) --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add missed column title in runner management page (#24328)yp053272023-04-261-1/+1
| | | ![image](https://user-images.githubusercontent.com/18380374/234214706-315a8465-8931-4693-8015-e50279db53ab.png)
* Remove unnecessary helper function `DateFmtLong` (#24343)Yarden Shoham2023-04-261-1/+1
| | | | | | 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>
* Add API for License templates (#23009)JakobDev2023-04-261-0/+107
| | | | | | | | This adds a API for getting License templates. This tries to be as close to the [GitHub API](https://docs.github.com/en/rest/licenses?apiVersion=2022-11-28) as possible, but Gitea does not support all features that GitHub has. I think they should been added, but this out f the scope of this PR. You should merge #23006 before this PR for security reasons.
* Don't set meta `theme-color` by default (#24340)silverwind2023-04-261-1/+1
| | | | | | | | | | | Fixes https://github.com/go-gitea/gitea/issues/24321. By not setting this meta tag, Safari will use body color for chrome and out-of-viewport areas, which looks much better then static mismatching green. As per [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color) it's really only Apple browsers who still support this tag, most others have dropped support.
* Fix runner button height (#24338)silverwind2023-04-261-1/+1
| | | | | | | | | | Fixes https://github.com/go-gitea/gitea/issues/24326. Set size class and downsize any such buttons that have a dropdown icon because the dropdown icon increases button height artificially. [`:has()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:has) is not supported in Firefox yet, but works fine with the experimental pref enabled. I see this as a graceful degradation in unsupporting browsers.
* Fix broken clone script on an empty archived repo (#24339)Yarden Shoham2023-04-251-1/+1
| | | | | | | I made it render the script even if the repo is archived - Fixes #24324 Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Improve RSS (#24335)wxiaoguang2023-04-253-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow #22719 ### Major changes 1. `ServerError` doesn't do format, so remove the `%s` 2. Simplify `RenderBranchFeed` (slightly) 3. Remove unused `BranchFeedRSS` 4. Make `feed.RenderBranchFeed` respect `EnableFeed` config 5. Make `RepoBranchTagSelector.vue` respect `EnableFeed` setting, otherwise there is always RSS icon 6. The `(branchURLPrefix + item.url).replace('src', 'rss')` doesn't seem right for all cases, for example, the string `src` could appear in `branchURLPrefix`, so we need a separate `rssURLPrefix` 7. The `<a>` in Vue menu needs `@click.stop`, otherwise the menu itself would be triggered at the same time 8. Change `<a><button></button></a>` to `<a role=button>` 9. Use `{{PathEscapeSegments .TreePath}}` instead of `{{range $i, $v := .TreeNames}}/{{$v}}{{end}}` Screenshot of changed parts: <details> ![image](https://user-images.githubusercontent.com/2114189/234315538-66603694-9093-48a8-af33-83575fd7a018.png) ![image](https://user-images.githubusercontent.com/2114189/234315786-f1efa60b-012e-490b-8ce2-d448dc6fe5c9.png) ![image](https://user-images.githubusercontent.com/2114189/234334941-446941bc-1baa-4256-8850-ccc439476cda.png) </details> ### Other thoughts Should we remove the RSS icon from the branch dropdown list? It seems too complex for a list UI, and users already have the chance to get the RSS feed URL from "branches" page. --------- Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io>
* Automatically select the org when click create repo from org dashboard (#24325)yp053272023-04-251-2/+4
| | | | | | ![image](https://user-images.githubusercontent.com/18380374/234209941-d661b07f-e963-427b-a673-78c46043a792.png) In org dashboard, the create repo link will be `repo/create?org={orgId}`
* Fix template function DateTime (#24317)wxiaoguang2023-04-2529-38/+38
| | | | | | Before, 500 error ![image](https://user-images.githubusercontent.com/2114189/234170176-403ffd1b-ec27-42be-bff9-86184dc8d74d.png)
* Add tags list for repos whose release setting is disabled (#23465)Zettat1232023-04-254-64/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close #23427 Co-Author: @wxiaoguang If a repo's release setting is enabled, the logic has't changed. Clicking the "Tags" button will jump to `/{user}/{repo}/tags` and `templates/repo/release/list.tmpl` template will be used. <img src="https://user-images.githubusercontent.com/15528715/224939362-bd8974fd-08b0-4f79-a114-3389d15847ca.png" width="600px" /> If the release setting is disabled, clicking the "Tags" button will still jump to `/{user}/{repo}/tags` but a new template `templates/repo/tag/list.tmpl` will be used. <img src="https://user-images.githubusercontent.com/15528715/233834564-74741e49-f4e9-47c8-ac12-e306642798dc.png" width="600px" /> Since both templates above need to render the tags list, I moved the tags list to a shared template located in `templates/repo/tag/table.tmpl`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Add RSS Feeds for branches and files (#22719)jladbrook2023-04-253-5/+20
| | | | | | | | | | | Fix #22228 adding RSS feeds for branches and files. RSS feeds are accessed through: * [gitea]/src/branch/{branch}.rss * [gitea]/src/branch/{branch}/{file_name}.rss No changes have been made to the UI to expose the feed urls for branches and files.
* Fix typo in API route (#24310)silverwind2023-04-241-27/+25
| | | | | | | Continuation of https://github.com/go-gitea/gitea/pull/23995 --------- Co-authored-by: bilogic <946010+bilogic@users.noreply.github.com>
* Improve External Wiki in Repo Header (#24304)JakobDev2023-04-241-2/+8
| | | | | | | | | | | | | | | | | If you use a External Wiki, with Gitea, it brings currently 2 Problems in the Header: 1. It always uses the Wiki Icon. When you use e.g. a External Issue Tracker, it shows the External Link icon to Indicate, that the User will send to a External Side. This helps preventing fishing. 2. If you use a External Wiki, the Link in the Header still goes to `{repo}/wiki` which will redirect the user to the External Wiki. That means, that if the users hovers with the Cursor over the link, it shows `{repo}/wiki`, so the User does not know, where he will land. This PR fixes both. ![grafik](https://user-images.githubusercontent.com/15185051/233964455-dbca9bbe-a224-44c5-b351-5649fd9b15fc.png)
* Wrap too long push mirror addresses (#21120)JakobDev2023-04-241-1/+1
| | | | | | | | | I noticed that it is possible to break the push mirror list by entering a too long URL. This should fix it. | Before | After | |--------------|-----------| |![Before](https://user-images.githubusercontent.com/15185051/189294585-333965d1-0f0f-48e2-96d5-e04b84b55ae3.png)|![After](https://user-images.githubusercontent.com/15185051/189294619-301e271c-b89b-4bc0-9c11-9536bd0302be.png)|
* Improve some modal action buttons (#24289)wxiaoguang2023-04-2455-128/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow #24097 and #24285 And add a devtest page for modal action button testing. http://localhost:3000/devtest/fomantic-modal Now the `modal_actions_confirm.tmpl` could support: green / blue / yellow positive buttons, the negative button is "secondary". ps: this PR is only a small improvement, there are still a lot of buttons not having proper colors. In the future these buttons could be improved by this approach. These buttons could also be improved according to the conclusion of #24285 in the future. ![image](https://user-images.githubusercontent.com/2114189/233847773-a6d6b29b-7b5c-490e-8425-40dfd0ad2529.png) And add GitHub-like single danger button (context: https://github.com/go-gitea/gitea/issues/24285#issuecomment-1519100312) ![image](https://user-images.githubusercontent.com/2114189/233891566-055d7611-894d-4d5a-baf5-f6369180bf8d.png) --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix no edit/close/delete button in org repo project view page (#24301)yp053272023-04-241-2/+2
| | | Part of #23318.
* Replace whitespace inside template parens during make fmt (#24293)silverwind2023-04-242-2/+2
| | | | Remove space/tab after `(` and before `)` in templates. Only two violations it seems.
* Add comments for Manually Merged feature (#24291)wxiaoguang2023-04-231-0/+9
| | | In case I would forget it again one day .....
* Allow using localized absolute date times within phrases with place holders ↵Yarden Shoham2023-04-2331-39/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ![image](https://user-images.githubusercontent.com/20454870/233791256-b454c455-aca0-4b76-b300-7866c7bd529e.png) # After ![image](https://user-images.githubusercontent.com/20454870/233790809-c4913355-2822-4657-bb29-2298deb6d4b3.png) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Tweak pull request branch delete ui (#23951)silverwind2023-04-231-29/+28
| | | | | | | | | | | | | | | | | | | | | | | - Move delete button to right and remove red color on it. - Remove CLI instructions when PR has been merged. Before: <img width="855" alt="Screenshot 2023-04-06 at 20 21 47" src="https://user-images.githubusercontent.com/115237/230463178-95735fc0-9632-4d51-bbd5-2131c40186c4.png"> After: <img width="865" alt="Screenshot 2023-04-06 at 20 23 17" src="https://user-images.githubusercontent.com/115237/230463347-8155cbf9-4e58-421a-93a8-56ce6188dab8.png"> After (deleted): <img width="860" alt="Screenshot 2023-04-06 at 20 19 30" src="https://user-images.githubusercontent.com/115237/230463442-f53d7500-191d-4d75-a097-d100a461672a.png"> --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Set type="password" on all auth_token fields (#22175)Dan Church2023-04-234-4/+4
| | | | | | | | | | | | | | | | | | | Set `type="password"` on all `auth_token` fields Seen when migrating from other hosting platforms. 1. Prevents exposing the token to screen capture/cameras/eyeballs. 2. Prevents the browser from saving the value in its autocomplete dictionary, which often is not secure. ![exposed auth token](https://user-images.githubusercontent.com/615684/208541005-e2c9c6b0-3c6c-4a56-95d9-357b987aa0c8.png) Closes #22174 --------- Signed-off-by: Dan Church <amphetamachine@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Change to vertical navbar layout for secondary navbar for repo/user/admin ↵Hester Gong2023-04-2385-582/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | settings (#24246) Co-Author: @wxiaoguang This is the first step of #24229. And this PR will only includes html changes, and followed by other PRs that fine tune css and change to submenus. After: Admin Level <img width="1400" alt="Screen Shot 2023-04-21 at 10 07 16" src="https://user-images.githubusercontent.com/17645053/233523870-f848b61d-056a-4b41-9760-a9a49fea1fe8.png"> User Level <img width="1422" alt="Screen Shot 2023-04-21 at 10 07 23" src="https://user-images.githubusercontent.com/17645053/233523878-979adb20-a657-43d9-99a6-ad414010c0ef.png"> Repo Level <img width="1404" alt="Screen Shot 2023-04-21 at 10 07 07" src="https://user-images.githubusercontent.com/17645053/233523863-337440bd-c03a-4dfd-87fa-cef40300bfe0.png"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor delete_modal_actions template and use it for project column related ↵Hester Gong2023-04-2358-251/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | actions (#24097) Co-Author: @wxiaoguang This PR is to fix https://github.com/go-gitea/gitea/issues/23318#issuecomment-1506275446 . The way to fix this in this PR is to use `delete_modal_actions.tmpl` here both to fix this issue and keep ui consistency (as suggested by [TODO here](https://github.com/go-gitea/gitea/blob/4299c3b7db61f8741eca0ba3d663bb65745a4acc/templates/projects/view.tmpl#L161)) And this PR also refactors `delete_modal_actions.tmpl` and its related styles, and use the template for more modal actions: 1. Added template attributes: * locale * ModalButtonStyle: "yes" (default) or "confirm" * ModalButtonCancelText * ModalButtonOkText 2. Rename `delete_modal_actions.tmpl` template to `modal_actions_confirm.tmpl` because it is not only used for action modals deletion now. 3. Refactored css related to modals into `web_src/css/modules/modal.css` and improved the styles. 4. Also use the template for PR deletion modal and remove issue dependency modal. 5. Some modals should also use the template, but not sure how to open them, so mark these modal actions by `{{/* TODO: Convert to base/modal_actions_confirm */}}` After (Also tested on arc green): Hovering on the left buttons <img width="711" alt="Screen Shot 2023-04-23 at 15 17 12" src="https://user-images.githubusercontent.com/17645053/233825650-76307e65-9255-44bb-80e8-7062f58ead1b.png"> <img width="786" alt="Screen Shot 2023-04-23 at 15 17 21" src="https://user-images.githubusercontent.com/17645053/233825652-4dc6f7d1-a180-49fb-a468-d60950eaee0d.png"> Test for functionalities: https://user-images.githubusercontent.com/17645053/233826857-76376fda-022c-42d0-b0f3-339c17ca4e59.mov --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add missing badges in user profile for /projects and /packages (#24232)Jakob2023-04-221-3/+6
| | | | | | | | | | | | | | | | | | | | - Implement fix for user and organization page - Add necessary ctx.Data When switching tabs on `user profile page` the badges are shown for `/gitea_user?tab=stars`, `/gitea_user?tab=activity` and missing under `gitea_user/-/projects` and `gitea_user/-/packages` This was added for users and organizations. Before: ![image](https://user-images.githubusercontent.com/72307968/233338877-f795fae3-b65a-4ea1-8784-dd2b0cd6618f.png) After: ![image](https://user-images.githubusercontent.com/72307968/233339012-90adb6c4-4de2-432e-ae49-69611eb7aec3.png) Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270)wxiaoguang2023-04-221-3/+0
| | | | | | | | | | The `SHOW_FOOTER_BRANDING` came from year 2015, and it seems nobody ever uses it. It only shows an GitHub icon which seems unrelated to Gitea, it doesn't do what document says. So, remove it. ## :warning: Breaking Users can now remove the key `[other].SHOW_FOOTER_BRANDING` from their app.ini.
* Improve template helper functions: string/slice (#24266)wxiaoguang2023-04-226-9/+9
| | | | | | | | | | | | | | | | | | | | | | | Follow #23328 The improvements: 1. The `contains` functions are covered by tests 2. The inconsistent behavior of `containGeneric` is replaced by `StringUtils.Contains` and `SliceUtils.Contains` 3. In the future we can move more help functions into XxxUtils to simplify the `helper.go` and reduce unnecessary global functions. FAQ: 1. Why it's called `StringUtils.Contains` but not `strings.Contains` like Golang? Because our `StringUtils` is not Golang's `strings` package. There will be our own string functions. --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix footer display (#24251)wxiaoguang2023-04-221-29/+27
| | | | | | | | | | | | | | | | | | | | | | | Fix #24249 Diff with ignoring spaces: https://github.com/go-gitea/gitea/pull/24251/files?diff=split&w=1 Screenshots: <details> <img width="1440" alt="image" src="https://user-images.githubusercontent.com/2114189/233592840-d9ef7296-64eb-4e48-a598-300807a7c2f9.png"> <img width="923" alt="image" src="https://user-images.githubusercontent.com/2114189/233593015-16edc531-43c2-4ff0-b27e-ca75dbadce0c.png"> </details> --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* Limit avatar upload to valid image files (#24258)JakobDev2023-04-213-3/+3
| | | | | | | | This causes the browser to allow only valid images in the file picker by default. --------- Co-authored-by: silverwind <me@silverwind.io>
* Add project type descriptions in issue badge and improve project icons (#23437)yp053272023-04-211-7/+15
| | | | | | | | | | | | | | | | | | | | Changes: - ~~Add project icons to issue badge~~ ~~After:~~ ![image](https://user-images.githubusercontent.com/18380374/224633165-9d899176-03dc-4c36-94f8-b2fd9583856c.png) Use `tooltip` to add a description of project type to the project name. ![image](https://user-images.githubusercontent.com/18380374/224923685-77201b5a-1c1f-4d37-b867-23299649df3f.png) - improve project icons we can use `project.icon` to get the svg name, which looks better and is easy to change all of them in templates. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix unclear "Owner" concept (#24233)wxiaoguang2023-04-205-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some user/org pages use `Owner` variable. It's an incorrect concept since year 2016: what is a user's owner? Actually, new code is right: use `ContextUser`. This PR cleans all legacy "Owner" variables. ## Screenshots for related pages and test results All pages are as before: ### `web/org/home.go` ![image](https://user-images.githubusercontent.com/2114189/233366687-a3643025-1f78-474d-a901-deea35b72f4d.png) ### `web/user/profile.go` ![image](https://user-images.githubusercontent.com/2114189/233366812-2e5c2fbc-3f78-44e7-88c1-ec2f612c241e.png) ### `web/user/setting/profile.go` ![image](https://user-images.githubusercontent.com/2114189/233366928-7a1e52c9-b400-4379-a4be-af06a853c5fa.png)
* Use secondary pointing menu for tabs on user/organization home page (#24162)Hester Gong2023-04-201-68/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close #24108 Use secondary pointing menu for tabs on user/organization home page so the tabs look the same. Main changes: 1. modified a part of dom structure in `templates/user/overview/header.tmpl` to make it the same as `templates/org/header.tmpl` in order to produce the same ui. 2. Move some css to `web_src/css/shared/repoorgshared.css` to make them shareable between `templates/user/overview/header.tmpl` and `templates/org/header.tmpl` After: https://user-images.githubusercontent.com/17645053/232400617-2add5bec-d483-4ab1-b48d-eaee157f7b09.mov For further improvements. Need some thoughts: For [this TODO](https://github.com/HesterG/gitea/blob/729ad294cbec7a77623b2e3eab750ea7a20e8ee0/templates/user/overview/header.tmpl#L1), it is viable to make it a shared template for [this part](https://github.com/HesterG/gitea/blob/729ad294cbec7a77623b2e3eab750ea7a20e8ee0/templates/user/overview/header.tmpl#L2-L17) and [this part](https://github.com/HesterG/gitea/blob/729ad294cbec7a77623b2e3eab750ea7a20e8ee0/templates/org/header.tmpl#L1-L16) because they are the same except for the variable. But for the menu parts, they are quite different so might not be suitable to use a shared template. So need some thoughts and advice about extracting the shared template from these two headers. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix issue attachment handling (#24202)wxiaoguang2023-04-204-23/+25
| | | | | | | | | | | | | | | | | | | | | | Close #24195 Some of the changes are taken from my another fix https://github.com/go-gitea/gitea/pull/20147/commits/f07b0de997125c9b79cc5af27966a7cdd1803a4d in #20147 (although that PR was discarded ....) The bug is: 1. The old code doesn't handle `removedfile` event correctly 2. The old code doesn't provide attachments for type=CommentTypeReview This PR doesn't intend to refactor the "upload" code to a perfect state (to avoid making the review difficult), so some legacy styles are kept. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* Fix internal sever error when visiting a PR that bound to the deleted team ↵sillyguodong2023-04-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#24127) Close: #23738 The actual cause of `500 Internal Server Error` in the issue is not what is descirbed in the issue. The actual cause is that after deleting team, if there is a PR which has requested reivew from the deleted team, the comment could not match with the deleted team by `assgin_team_id`. So the value of `.AssigneeTeam` (see below code block) is `nil` which cause `500 error`. https://github.com/go-gitea/gitea/blob/1c8bc4081a4f4d0d921ac218cb724ce97924d410/templates/repo/issue/view_content/comments.tmpl#L691-L695 To fix this bug, there are the following problems to be resolved: - [x] 1. ~~Stroe the name of the team in `content` column when inserting `comment` into DB in case that we cannot get the name of team after it is deleted. But for comments that already exist, just display "Unknown Team"~~ Just display "Ghost Team" in the comment if the assgined team is deleted. - [x] 2. Delete the PR&team binding (the row of which `review_team_id = ${team_id} ` in table `review`) when deleting team. - [x] 3.For already exist and undeleted binding rows in in table `review`, ~~we can delete these rows when executing migrations.~~ they do not affect the function, so won't delete them.
* Add repository counter badge to repository tab (#24205)Jakob2023-04-192-3/+9
| | | | | | | | | Add a new badge to the repository tab for users and organizations. The badge is only visible if a repo exists. Change the badge color of existing "Starred Repositories". (from primary to small) Closes #24188
* Fix template error in pull request with deleted head repo (#24192)Brecht Van Lommel2023-04-191-1/+1
| | | | Rendering of Allow Edits from Maintainers did not check if the head repo exists, while other parts of the page handle it gracefully.
* Make wiki title supports dashes and improve wiki name related features (#24143)wxiaoguang2023-04-192-29/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close #7570 1. Clearly define the wiki path behaviors, see `services/wiki/wiki_path.go` and tests 2. Keep compatibility with old contents 3. Allow to use dashes in titles, eg: "2000-01-02 Meeting record" 4. Add a "Pages" link in the dropdown, otherwise users can't go to the Pages page easily. 5. Add a "View original git file" link in the Pages list, even if some file names are broken, users still have a chance to edit or remove it, without cloning the wiki repo to local. 6. Fix 500 error when the name contains prefix spaces. This PR also introduces the ability to support sub-directories, but it can't be done at the moment due to there are a lot of legacy wiki data, which use "%2F" in file names. ![image](https://user-images.githubusercontent.com/2114189/232239004-3359d7b9-7bf3-4ff3-8446-bfb0e79645dd.png) ![image](https://user-images.githubusercontent.com/2114189/232239020-74b92c72-bf73-4377-a319-1c85609f82b1.png) Co-authored-by: Giteabot <teabot@gitea.io>
* Add unset default project column (#23531)yp053272023-04-192-14/+42
| | | | Close: https://github.com/go-gitea/gitea/issues/23401
* Allow adding new files to an empty repo (#24164)wxiaoguang2023-04-193-17/+30
| | | ![image](https://user-images.githubusercontent.com/2114189/232561612-2bfcfd0a-fc04-47ba-965f-5d0bcea46c54.png)