Skip to content

Commit

Permalink
fix: custom title
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Oct 25, 2024
1 parent 32e964c commit 90da415
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Models/Character/CharacterImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public function getDisplayTitlesAttribute() {
$titles[] = $title->displayTitle;
}

return implode(' ', $titles);
return '<div class="row">'.implode('', $titles).'</div>';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Character/CharacterImageTitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ public function getDisplayTitleAttribute() {
return $this->title->displayTitle($this->data);
}

return '<div><span class="badge ml-1" style="color: white; background-color: #ddd;">'.isset($this->data['short']) ?? $this->data['full'].'</span></div>';
return '<div><span class="badge ml-1" style="color: white; background-color: #ddd;">'.(isset($this->data['short']) ? $this->data['short'] : $this->data['full']).'</span></div>';
}
}
2 changes: 1 addition & 1 deletion app/Models/Character/CharacterTitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function getAssetTypeAttribute() {
*/
public function displayTitle($data) {
return '<a href="'.$this->idUrl.'"><span class="badge ml-1" style="color: white; background-color: '.$this->colour.';"'.
($data['full'] ? 'data-toggle="tooltip" title="'.$this->title.'">'.$data['full'] : '>'.$this->title)
($data['full'] ? ' data-toggle="tooltip" title="'.$this->title.'">'.$data['full'] : '>'.$this->title)
.'</span></a>';
}
}

0 comments on commit 90da415

Please sign in to comment.