-
Notifications
You must be signed in to change notification settings - Fork 176
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
Create styling for dead services that indicate that they're no longer available #3139
base: main
Are you sure you want to change the base?
Conversation
…et no_link to 1 when printing a dead service
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.
Thanks so much for working on this! I hope you are enjoying the process 😅
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.
I feel like this is getting close! Adding [site] to the printed username is something requested from the original issue that I just noticed was missing; the rest of my comments are mere syntax suggestions. 👍
@@ -69,13 +70,17 @@ sub ljuser_display { | |||
my $display_class = $opts{no_ljuser_class} ? "" : " class='ljuser'"; | |||
my $domain = $self->site->{domain} ? $self->site->{domain} : $self->site->{hostname}; | |||
|
|||
$nolink = 1 if exists $DW::External::Site::deadsites{$domain}; |
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.
I would suggest combining this line and the initial nolink declaration as follows:
my $nolink = exists $DW::External::Site::deadsites{$domain} ? 1 : 0;
This is called the ternary operator 😄
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.
Since we're now using a get_deadsites
function, this syntax needs to be updated:
my %deadsites = DW::External::Site::get_deadsites();
my $nolink = exists $deadsites{$domain} ? 1 : 0;
Sorry for not noticing that in my previous review! I think that's the last update necessary for this to work.
I would also highly encourage you to make sure your Perl edits are tidy going forward. @momijizukamori posted a pre-commit hook in dw-dev recently to help make this easier!
CODE TOUR: I went on an arduous journey and learned a lot about arrays in Perl to tweak username display so that dead services aren't linked out and display a default userhead.
Closes #3056.