Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ui bug in wiki commit page #12089

Merged
merged 8 commits into from
Jul 2, 2020
Merged

Conversation

a1012112796
Copy link
Member

Detail: If the repo is empty but the wiki is not empty. The commit ui will be broken. I'm not sure if TabSizeClass will become a bug in other places, maybe should have more check.

view:
jtt

TODO: Maybe we should allow wiki to have its own .editorconfig file.

@@ -79,7 +79,7 @@
</h4>
</div>
{{else}}
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}" id="diff-{{.Index}}">
<div class="diff-file-box diff-box file-content {{if $.Editorconfig}}{{TabSizeClass $.Editorconfig $file.Name}}{{else}}tab-size-8{{end}}" id="diff-{{.Index}}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div class="diff-file-box diff-box file-content {{if $.Editorconfig}}{{TabSizeClass $.Editorconfig $file.Name}}{{else}}tab-size-8{{end}}" id="diff-{{.Index}}">
<div class="diff-file-box diff-box file-content {{if $.Editorconfig}}{{TabSizeClass $.Editorconfig $file.Name}}{{else}}tab-size-4{{end}}" id="diff-{{.Index}}">

I think 4 is a better default. 8 is rather archaic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, It is kept same with TabSizeClass define now. Maybe your change is meaningful, but I don't like to change it in this pr, because it's not the main aim of this pr. Thanks.

ref:

}
return "tab-size-8"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, yeah keep it at 8 for now.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 29, 2020
@silverwind
Copy link
Member

silverwind commented Jun 29, 2020

Can we make the TabSizeClass not throw up like that and return it's default value in such a case? I see this helper is used in two more places without such a if.

Maybe it should take a interface as the first argument and then we can somehow check if it's a editorconfig.Editorconfig or at least not nil?

TODO: Maybe we should allow wiki to have its own ``.editorconfig`` file.

Signed-off-by: a1012112796 <1012112796@qq.com>
@a1012112796
Copy link
Member Author

Can we make the TabSizeClass not throw up like that and return it's default value in such a case? I see this helper is used in two more places without such a if.

Maybe it should take a interface as the first argument and then we can somehow check if it's a editorconfig.Editorconfig or at least not nil?

Good idea, Thanks

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 30, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 30, 2020
@lunny lunny added the type/bug label Jul 2, 2020
@lunny
Copy link
Member

lunny commented Jul 2, 2020

Should this PR be backport?

@a1012112796
Copy link
Member Author

Should this PR be backport?

I think it's necessary. Thanks

@lunny lunny added this to the 1.13.0 milestone Jul 2, 2020
@zeripath
Copy link
Contributor

zeripath commented Jul 2, 2020

make lg-tm work

@zeripath zeripath merged commit cd994f6 into go-gitea:master Jul 2, 2020
@lafriks
Copy link
Member

lafriks commented Jul 2, 2020

please send backport

@a1012112796 a1012112796 deleted the fix_nil branch July 3, 2020 03:19
a1012112796 added a commit to a1012112796/gitea that referenced this pull request Jul 3, 2020
* Fix ui bug in wiki commit page

TODO: Maybe we should allow wiki to have its own ``.editorconfig`` file.

Signed-off-by: a1012112796 <1012112796@qq.com>

* fix a small nit

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
@techknowlogick techknowlogick added the backport/done All backports for this PR have been created label Jul 3, 2020
techknowlogick pushed a commit that referenced this pull request Jul 3, 2020
* Fix ui bug in wiki commit page

TODO: Maybe we should allow wiki to have its own ``.editorconfig`` file.

Signed-off-by: a1012112796 <1012112796@qq.com>

* fix a small nit

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
* Fix ui bug in wiki commit page

TODO: Maybe we should allow wiki to have its own ``.editorconfig`` file.

Signed-off-by: a1012112796 <1012112796@qq.com>

* fix a small nit

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants