Skip to content

Commit

Permalink
use link
Browse files Browse the repository at this point in the history
  • Loading branch information
fpellet committed Jan 11, 2025
1 parent d28fe3f commit 354d92f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
21 changes: 10 additions & 11 deletions src/main/resources/templates/macro.vm
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
<div class="row mbn userbox user-${userboxid}">
<div class="col s4 m5 l3">
#if ($showu)
<a href="$profilelink/$!showu.creatorid/#stripstr($!showu.name)" title="$!showu.name">
<a href="$!showu.getProfileLink()" title="$!showu.name">
<img src="#profilepic($!showu, 'Square50')" width="50" class="profile-pic responsive-img" alt="pic">
</a>
#else
Expand All @@ -368,7 +368,7 @@
</div>
<div class="userbox-body">
#if ($showu)
<a href="$profilelink/$!showu.creatorid/#stripstr($!showu.name)" class="userbox-name">$showu.name</a>
<a href="$!showu.getProfileLink()" class="userbox-name">$showu.name</a>
#else
<span class="grey-text">$!lang.get("profile.deleted")</span>
#end
Expand Down Expand Up @@ -396,7 +396,7 @@
#macro(tinypersonbox $showu)
<div>
#if ($showu)
<a href="$profilelink/$!showu.creatorid/#stripstr($!showu.name)" title="$!showu.name [$!showu.votes]">
<a href="$!showu.getProfileLink()" title="$!showu.name [$!showu.votes]">
<img src="#profilepic($!showu, 'Square32')" width="32" class="profile-pic responsive-img" alt="pic">
</a>
#else
Expand All @@ -408,8 +408,7 @@
#macro(personlink $showu)
<span>
#if ($showu)
#if ($showu.name)#set($seopsuffix = "/#stripstr($!showu.name)" )#else#set($seopsuffix = "" )#end
<a href="$profilelink/$!{showu.id}$!{seosuffix}" title="Go to profile">$!showu.name</a>
<a href="$!showu.getProfileLink()" title="Go to profile">$!showu.name</a>
#else
$!lang.get("profile.deleted")
#end
Expand Down Expand Up @@ -444,7 +443,7 @@
<div class="card personbox ${personboxClass} #if($scooldUtils.isBanned($showFriend) && $isMod)yellow lighten-5 #end">
<div class="row ${cardClass}">
<div class="col ${cardCol1Class}" title="$!showFriend.name">
<a href="$profilelink/$!showFriend.creatorid/#stripstr($!showFriend.name)" title="$!showFriend.name">
<a href="$!showFriend.getProfileLink()" title="$!showFriend.name">
<img src="#profilepic($showFriend, 'Square127')" class="profile-pic responsive-img" alt="pic">
</a>
</div>
Expand All @@ -466,12 +465,12 @@
<label for="$!showFriend.id">
<input type="checkbox" name="selectedUsers" value="$!showFriend.id" class="filled-in" id="$!showFriend.id">
<span>
<a href="$profilelink/${showFriend.creatorid}/#stripstr($!showFriend.name)">$!{showFriend.name}</a>
<a href="$!showFriend.getProfileLink()">$!{showFriend.name}</a>
</span>
</label>
</span>
#else
<a href="$profilelink/${showFriend.creatorid}/#stripstr($!showFriend.name)">$!{showFriend.name}</a>
<a href="$!showFriend.getProfileLink()">$!{showFriend.name}</a>
#end
</div>
#if($isAdmin && $request.getParameter("bulkedit") && !$hideSpacesForMods)
Expand Down Expand Up @@ -550,7 +549,7 @@
#macro(questionspage $posts )
#set($showSpaceLabel = $scooldUtils.isAllSpaces($currentSpace) || $isMod)
#foreach($showpost in $posts)
#set($actionlink = "#getpostlink($showpost false true)")
#set($actionlink = "#getpostlink($showpost false false)")
#set($actionlink2 = "#getpostlink($showpost true true)")
#if($showpost.id == $request.getParameter("deleted"))
#set($deleted = "hide")
Expand Down Expand Up @@ -624,7 +623,7 @@
#if($showpost.type == "unapprovedquestion")
<i class="fa fa-exclamation-circle grey-text tooltipped" data-tooltip="$!lang.get('posts.unapproved')"></i>
#end
<a href="$!actionlink/$!utils.urlEncode($showpost.id)/#stripstr($!showpost.title)" class="mediumText">
<a href="$!actionlink" class="mediumText">
#if($showSpaceLabel)
#set($spaceLabel = "$!scooldUtils.getSpaceName($!showpost.space)")
#if(!$spaceLabel.trim().isEmpty())
Expand Down Expand Up @@ -687,7 +686,7 @@
#if($showpost.type == "unapprovedquestion")
<i class="fa fa-exclamation-circle grey-text tooltipped" data-tooltip="$!lang.get('posts.unapproved')"></i>
#end
<a href="$!actionlink/$!utils.urlEncode($showpost.id)/#stripstr($!showpost.title)" class="mediumText">$!showpost.title</a>
<a href="$!actionlink" class="mediumText">$!showpost.title</a>
</div>
<div class="mbs">
#set($showBody = $utils.stripHtml($utils.markdownToHtml($utils.stripHtml($!showpost.body))) )
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/templates/question.vm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</span>
<div id="post-title" class="largeText">
#if($showPost.isReply())
<a href="$questionlink/$showPost.parentid/#stripstr($!showPost.title)" class="tooltipped" data-tooltip="⮪ $!lang.get('backtopost')">
<a href="$!showPost.getPostLinkForRedirect()" class="tooltipped" data-tooltip="⮪ $!lang.get('backtopost')">
<i class="fa fa-reply smallText grey-text"></i> $!{showPost.title}
</a>
#else
Expand All @@ -50,9 +50,9 @@
#set($sortarr = {'votes': "", 'newest': ""} )
#setsortbyselection($sortarr 'votes')
<span class="right">
<a href="$questionlink/$showPost.id/#stripstr($showPost.title)#sortorderparam('?')" title="Most voted answers"
<a href="$!showPost.getPostLinkForRedirect()#sortorderparam('?')" title="Most voted answers"
class="chip $sortarr.votes">#sortordericon() $!lang.get("votes")</a>
<a href="$questionlink/$showPost.id/#stripstr($showPost.title)?sortby=newest#sortorderparam('&' 'newest')" title="Newest answers"
<a href="$!showPost.getPostLinkForRedirect()?sortby=newest#sortorderparam('&' 'newest')" title="Newest answers"
class="chip $sortarr.newest">#sortordericon("newest") $!lang.get("newest")</a>
</span>
<h3 class="grey-text">$!lang.get("answers.title") #showcount($itemcount.count)</h3>
Expand Down

0 comments on commit 354d92f

Please sign in to comment.