-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Make "Ghost" not link to 404 page #6410
Make "Ghost" not link to 404 page #6410
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6410 +/- ##
=========================================
+ Coverage 39.39% 39.4% +<.01%
=========================================
Files 393 393
Lines 53264 53271 +7
=========================================
+ Hits 20986 20989 +3
- Misses 29292 29297 +5
+ Partials 2986 2985 -1
Continue to review full report at Codecov.
|
* Create and use GetLastEventLabelFake for when a Ghost user has made the action, thus not linking to a user profile * Add corresponding _fake entries to locale_en-US
@oscarlofwenhamn, I also found the same link here: gitea/templates/repo/issue/milestone_issues.tmpl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... Shouldn't we just have these users link to a fake page saying that they're no longer real users. Then you don't need to have these multiple "fake" variants?
@zeripath Personally, I disagree, as I think making a link at that point leads to unnecessary jumping about on the site, which I think I myself would be frustrated with. I would rather add a hover text instead, with an explanation. |
It looks like you're missing one more label - issue_opened_by_fake My only worry is that we're creating multiple copies of the same code and template. Perhaps, it's better to use a subtemplate? I dunno, but it's certainly distasteful to have these multiple copies of the same code. I think it's also worth looking at what the API gives. I suspect 404 is probably acceptable as a response to looking at a non existent user, but I wonder, is it always clear in our responses that the user doesn't exist? |
Thanks, I'll sort it to make the PR more complete, regardless of what we'll do with it.
That's not a bad idea at all, adding a template would mean it's all about adding a one-liner to the relevant places. I'll look into it, unless the consensus is to keep the links clickable and rather review the 404 responses. Again, my vote is to display the "This user does not exist"-info on hover or something like that, and make Ghost non-clickable. |
I think you're right, making the ghost users non clickable is most right. (We probably do need a nonexistent user page in case any are missed or someone tries to craft a link to one.) |
Agreed: Say I type out an explicit link to a collaborators page in a README, and later that user is removed, we'd want to have something catching that. Though, I think that is outside the scope of this PR. Either way, I'll continue with the last label and look at making a subtemplate. |
@zeripath I've ran into an issue: I need to either pass the variable $timeStr to the new template or, if I pass the current element of .Issues and evaluate the Something like {{ range .Issues }}
...
{{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.Lang }}
{{ template "repo/issue/poster_link" {{. , $timeStr}} }}
... so I can evaluate the time outside the template would be preferred, in my opinion, if possible. |
I think any template to create the user link should just be as simple as possible - almost be as simple as calling a function on the user, eg. If it's not clear how to do it - we can just do the fakes and think about it later. |
Fixes #6270