diff --git a/web/app/models/HTML.php b/web/app/models/HTML.php index fa5b242..aeab070 100644 --- a/web/app/models/HTML.php +++ b/web/app/models/HTML.php @@ -307,17 +307,17 @@ class HTML { } public static function link(?string $uri, $text, $cfg = []) { - $cfg += ['location' => 'main', 'escape' => true]; + $cfg += ['location' => 'main', 'escape' => true, 'class' => '']; if ($cfg['escape']) { $text = HTML::escape($text); } if ($uri === null) { - return HTML::tag('a', [], $text); + return HTML::tag('a', ['class' => $cfg['class']], $text); } - return HTML::tag('a', ['href' => HTML::url($uri, $cfg)], $text); + return HTML::tag('a', ['href' => HTML::url($uri, $cfg), 'class' => $cfg['class']], $text); } public static function autolink(string $url, array $attr = [], $cfg = []) { diff --git a/web/app/models/UOJProblem.php b/web/app/models/UOJProblem.php index cc97442..465778e 100644 --- a/web/app/models/UOJProblem.php +++ b/web/app/models/UOJProblem.php @@ -367,7 +367,7 @@ class UOJProblem { } public function getLink(array $cfg = []) { - return HTML::link($this->getUri(), $this->getTitle($cfg), ['escape' => false]); + return HTML::link($this->getUri(), $this->getTitle($cfg), ['escape' => false, 'class' => $cfg['class'] ?: '']); } public function getAttachmentUri() { diff --git a/web/app/views/user-info.php b/web/app/views/user-info.php index 6cb986f..e5d1c63 100644 --- a/web/app/views/user-info.php +++ b/web/app/views/user-info.php @@ -252,17 +252,24 @@
- +