Skip to content

Issues-527: Made tcadmin handle unclickable #82

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

Merged
merged 1 commit into from
Apr 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions Topcoder/class.topcoder.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,10 @@ private static function topcoderUserTopcoderCache($userFields) {
return $cached;
}

public static function isUnclickableUser($userName) {
return strtolower($userName) == 'tcadmin';
}

public static function log($message, $data = []) {
if (c('Vanilla.SSO.Debug') || c('Debug')) {
Logger::event(
Expand Down Expand Up @@ -2046,7 +2050,8 @@ function userPhoto($user, $options = []) {

$isTopcoderAdmin = val('IsAdmin', $topcoderProfile);
$photoUrl = isset($photoUrl) && !empty(trim($photoUrl)) ? $photoUrl: UserModel::getDefaultAvatarUrl();
$href = (val('NoLink', $options)) ? '' : ' href="'.url($userLink).'"';
$isUnlickableUser = TopcoderPlugin::isUnclickableUser($name);
$href = (val('NoLink', $options)) || $isUnlickableUser ? '' : ' href="'.url($userLink).'"';

Gdn::controller()->EventArguments['User'] = $user;
Gdn::controller()->EventArguments['Title'] =& $title;
Expand Down Expand Up @@ -2136,7 +2141,8 @@ function userAnchor($user, $cssClass = null, $options = null) {
}

// Go to Topcoder user profile link instead of Vanilla profile link
$userUrl = topcoderUserUrl($user, $px);
$isUnlickableUser = TopcoderPlugin::isUnclickableUser($name);
$userUrl = $isUnlickableUser? '#' : topcoderUserUrl($user, $px);

$topcoderProfile = TopcoderPlugin::getTopcoderUser($userID);
$topcoderRating = val('Rating',$topcoderProfile, false);
Expand All @@ -2150,6 +2156,11 @@ function userAnchor($user, $cssClass = null, $options = null) {
$attributes['class'] = $attributes['class'].' '. 'topcoderAdmin' ;
}

if($isUnlickableUser) {
$attributes['class'] = $attributes['class'].' '. 'disabledLink' ;
}


Gdn::controller()->EventArguments['User'] = $user;
Gdn::controller()->EventArguments['IsTopcoderAdmin'] =$isTopcoderAdmin;
Gdn::controller()->EventArguments['Text'] =& $text;
Expand Down
4 changes: 4 additions & 0 deletions Topcoder/design/topcoder.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,8 @@ a:hover span.challengeRoles {
font-weight: 500 !important;
line-height: 38px !important;
text-transform: uppercase !important;
}

.disabledLink {
pointer-events:none
}