mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 08:18:41 +00:00
chore(web): HTML::navListGroup
This commit is contained in:
parent
aeab23cc9a
commit
92626c1193
@ -610,16 +610,7 @@ EOD);
|
||||
<!-- left col -->
|
||||
<div class="col-md-3">
|
||||
|
||||
<div class="list-group">
|
||||
<?php foreach ($tabs_info as $id => $tab): ?>
|
||||
<a
|
||||
role="button"
|
||||
class="list-group-item list-group-item-action <?= $cur_tab == $id ? 'active' : '' ?>"
|
||||
href="<?= $tab['url'] ?>">
|
||||
<?= $tab['name'] ?>
|
||||
</a>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?= HTML::navListGroup($tabs_info, $cur_tab) ?>
|
||||
|
||||
</div>
|
||||
<!-- end left col -->
|
||||
|
@ -277,16 +277,7 @@ EOD);
|
||||
<!-- left col -->
|
||||
<div class="col-md-3">
|
||||
|
||||
<div class="list-group">
|
||||
<?php foreach ($tabs_info as $id => $tab): ?>
|
||||
<a
|
||||
role="button"
|
||||
class="list-group-item list-group-item-action <?= $cur_tab == $id ? 'active' : '' ?>"
|
||||
href="<?= $tab['url'] ?>">
|
||||
<?= $tab['name'] ?>
|
||||
</a>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?= HTML::navListGroup($tabs_info, $cur_tab) ?>
|
||||
|
||||
<a
|
||||
class="btn btn-light d-block mt-2 w-100 text-start text-primary"
|
||||
|
@ -33,6 +33,15 @@ class HTML {
|
||||
$html .= '</ul>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function navListGroup($tabs_info, $cur) {
|
||||
$html = '<div class="list-group">';
|
||||
foreach ($tabs_info as $id => $tab) {
|
||||
$html .= '<a role="button" class="list-group-item list-group-item-action'.($cur == $id ? ' active' : '').'" href="'.$tab['url'].'">'.$tab['name'].'</a>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function hiddenToken() {
|
||||
return '<input type="hidden" name="_token" value="'.crsf_token().'" />';
|
||||
|
Loading…
Reference in New Issue
Block a user