wxiaoguang
43c7a2e7b1
Refactor names ( #31405 )
...
This PR only does "renaming":
* `Route` should be `Router` (and chi router is also called "router")
* `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`)
* Use lower case for private functions to avoid exposing or abusing
5 months ago
Jason Song
fd59cd9450
Avoid losing token when updating mirror settings ( #30429 )
...
Fix #30416 .
Before (it shows as "Unset" while there's a token):
<img width="980" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/d7148e3e-62c9-4d2e-942d-3d795b79515a ">
After:
<img width="977" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/24aaa1db-5baa-4204-9081-470b15ea72b5 ">
The username shows as "oauth2" because of
f9fdac9809/services/migrations/dump.go (L99)
I have checked that all usage of `MirrorRemoteAddress` has been updated.
<img width="1806" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2f042501-2824-4511-9203-c84a6731a02d ">
However, it needs to be checked again when backporting.
---------
Co-authored-by: Giteabot <teabot@gitea.io>
8 months ago
silverwind
3b139fa3a3
Improve feed icons and feed merge text color ( #27498 )
...
1. Improve various feed icons
2. Fix merge message color
<img width="763" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/3f5bcb23-6d90-4c63-85f2-46bd7e1c96d6 ">
<img width="769" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/466c37b4-e2f4-42bb-922d-b86596cdc6d0 ">
Fixes: https://github.com/go-gitea/gitea/issues/27495
Continues: https://github.com/go-gitea/gitea/pull/27356
1 year ago
JakobDev
cf0df023be
More `db.DefaultContext` refactor ( #27265 )
...
Part of #27065
This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.
1 year ago
wxiaoguang
4fc4f6e634
Refactor "editorconfig" ( #26391 )
...
There are 2 kinds of ".Editorconfig" in code, one is `JSON string` for
the web edtior, another is `*editorconfig.Editorconfig` for the file
rendering (used by `TabSizeClass`)
This PR distinguish them with different names.
And by the way, change the default tab size from 8 to 4, I think few
people would like to use 8-size tabs nowadays.
1 year ago
silverwind
88f835192d
Replace `interface{}` with `any` ( #25686 )
...
Result of running `perl -p -i -e 's#interface\{\}#any#g' **/*` and `make fmt`.
Basically the same [as golang did](2580d0e08d
).
1 year ago
wxiaoguang
56ae853ca0
Simplify template helper functions ( #24570 )
...
To avoid bloating the template helper functions, some functions could be
provided by type methods.
And the new code `data-line-type="{{.GetHTMLDiffLineType}}"` reads
better than `data-line-type="{{DiffLineTypeToStr .GetType}}"`
After the fix, screenshots (the same as before):
<details>
![image](https://user-images.githubusercontent.com/2114189/236657918-20ce01e0-1192-443e-aeb4-6b3fe1aa2102.png )
![image](https://user-images.githubusercontent.com/2114189/236657950-ee19727f-a1fc-4133-afc7-e5d1a8c1783f.png )
</details>
2 years ago
wxiaoguang
241b74f6c5
Improve template helper ( #24417 )
...
It seems that we really need the "context function" soon. So we should
clean up the helper functions first.
Major changes:
* Improve StringUtils and add JsonUtils
* Remove one-time-use helper functions like CompareLink
* Move other code (no change) to util_avatar/util_render/util_misc (no
need to propose changes for them)
I have tested the changed templates:
![image](https://user-images.githubusercontent.com/2114189/235283862-608dbf6b-2da3-4d06-8157-b523ca93edb4.png )
![image](https://user-images.githubusercontent.com/2114189/235283888-1dfc0471-e622-4d64-9d76-7859819580d3.png )
![image](https://user-images.githubusercontent.com/2114189/235283903-d559f14d-4abb-4a50-915f-2b9cbc381a7a.png )
![image](https://user-images.githubusercontent.com/2114189/235283955-b7b5adea-aca3-4758-b38a-3aae3f7c6048.png )
---------
Co-authored-by: Giteabot <teabot@gitea.io>
2 years ago