gitea icon indicating copy to clipboard operation
gitea copied to clipboard

hide "create repo" option if limit is reached

Open 6543 opened this issue 2 years ago • 11 comments

we currently show: image and image

but it would be better if this menue option do disapear if the limit is reached

6543 avatar Oct 17 '23 14:10 6543

Not disappear, disable

delvh avatar Oct 17 '23 14:10 delvh

I think we need to tell them user somehow why he can't create a repo

JakobDev avatar Oct 17 '23 14:10 JakobDev

That's why I meant disable. That way, we can display a tooltip

delvh avatar Oct 17 '23 14:10 delvh

typo in the title: reaced -> reached

lng2020 avatar Oct 18 '23 02:10 lng2020

Hi, can I take this up?

Manish-Giri avatar Oct 18 '23 04:10 Manish-Giri

@Manish-Giri Hi, sure :)

denyskon avatar Oct 18 '23 05:10 denyskon

if you need help just tell us here or via matrix/discord :)

6543 avatar Oct 19 '23 14:10 6543

@6543 Sorry for the delay, took a while to get caught up with templates in Go!

  1. I've managed to locate and temporarily disable the "New Repository" link as below.
Screenshot 2023-10-23 at 6 07 57 PM

This is currently set to disabled always just to get a screenshot, but to disable it conditionally, the head_navbar template here will need access to the CanCreateRepo data - similar to how the repo/create template here is assigned that info -

https://github.com/go-gitea/gitea/blob/6352114a77cb67e8797f2c8552328f684092c42d/routers/web/repo/repo.go#L179

Any suggestions on where the head_navbar template is normally assigned all its data, so I can look to pass the CanCreateRepo info too?

  1. Does a tooltip also need to be added with a short message on why it's disabled? If so, will a static message like this be sufficient?
Screenshot 2023-10-23 at 7 08 04 PM

If static message is allowed, any preference on the tooltip text? I can add the new text to the locale file then.

Thank you!

Manish-Giri avatar Oct 24 '23 00:10 Manish-Giri

@denyskon / @6543 Any thoughts?

Manish-Giri avatar Nov 01 '23 16:11 Manish-Giri

Hey @delvh Can i take this up (cc/ @Manish-Giri -- let me if you are looking forward to work on this)

hrshkshri avatar May 26 '24 06:05 hrshkshri

@hrshkshri sure.

delvh avatar May 26 '24 10:05 delvh

I added my fix here https://github.com/go-gitea/gitea/pull/31818. Let me know if it needs any adjustments.

sebluy avatar Aug 11 '24 15:08 sebluy

The problem is more complicated than it looks (not a "good first issue"). There are more logics for "creating repositories in an org"

wxiaoguang avatar Dec 22 '24 14:12 wxiaoguang