mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2025-03-26 04:57:02 +00:00
Compare commits
No commits in common. "03e6a1cb9965b56350d0fae3c96ea16ce80703e6" and "387fdf968b7a629f319b552656bd91a4439e771a" have entirely different histories.
03e6a1cb99
...
387fdf968b
@ -2,6 +2,10 @@
|
||||
requireLib('shjs');
|
||||
requireLib('mathjax');
|
||||
|
||||
if (!Auth::check()) {
|
||||
become403Page(UOJLocale::get('need login'));
|
||||
}
|
||||
|
||||
echoUOJPageHeader(UOJLocale::get('help'));
|
||||
?>
|
||||
<article>
|
||||
|
@ -78,8 +78,7 @@ EOD;
|
||||
$new_group_form->printHTML();
|
||||
}
|
||||
},
|
||||
'head_pagination' => true,
|
||||
'pagination_table' => "`groups`"
|
||||
'head_pagination' => true
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
@ -99,8 +99,7 @@ EOD;
|
||||
'print_after_table' => function() {
|
||||
global $myUser;
|
||||
},
|
||||
'head_pagination' => true,
|
||||
'pagination_table' => 'lists'
|
||||
'head_pagination' => true
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
@ -127,11 +127,6 @@ EOD;
|
||||
$table_classes = array('table', 'table-bordered', 'table-hover', 'table-striped');
|
||||
?>
|
||||
<?php echoUOJPageHeader(UOJLocale::get('problems')) ?>
|
||||
<?php
|
||||
if (isSuperUser($myUser) || isProblemManager($myUser) || isProblemUploader($myUser)) {
|
||||
$new_problem_form->printHTML();
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<?= HTML::tablist($tabs_info, $cur_tab, 'nav-pills') ?>
|
||||
@ -163,22 +158,30 @@ $('#input-show_submit_mode').click(function() {
|
||||
location.reload();
|
||||
});
|
||||
</script>
|
||||
<div class="<?= join($div_classes, ' ') ?>">
|
||||
<table class="<?= join($table_classes, ' ') ?>">
|
||||
<thead><?= $header ?></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
foreach ($pag->get() as $idx => $row) {
|
||||
echoProblem($row);
|
||||
echo "\n";
|
||||
}
|
||||
if ($pag->isEmpty()) {
|
||||
echo '<tr><td class="text-center" colspan="233">'.UOJLocale::get('none').'</td></tr>';
|
||||
}
|
||||
echo '<div class="', join($div_classes, ' '), '">';
|
||||
echo '<table class="', join($table_classes, ' '), '">';
|
||||
echo '<thead>';
|
||||
echo $header;
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
foreach ($pag->get() as $idx => $row) {
|
||||
echoProblem($row);
|
||||
echo "\n";
|
||||
}
|
||||
if ($pag->isEmpty()) {
|
||||
echo '<tr><td class="text-center" colspan="233">'.UOJLocale::get('none').'</td></tr>';
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
|
||||
if (isSuperUser($myUser) || isProblemManager($myUser) || isProblemUploader($myUser)) {
|
||||
$new_problem_form->printHTML();
|
||||
}
|
||||
|
||||
echo $pag->pagination();
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?= $pag->pagination() ?>
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -127,16 +127,16 @@
|
||||
$ac_problems = DB::selectAll("select a.problem_id as problem_id, b.title as title from best_ac_submissions a inner join problems b on a.problem_id = b.id where submitter = '{$user['username']}';");
|
||||
?>
|
||||
<h4 class="list-group-item-heading"><?= UOJLocale::get('accepted problems').':'.UOJLocale::get('n problems in total', count($ac_problems))?> </h4>
|
||||
<div class="list-group-item-text">
|
||||
<p class="list-group-item-text">
|
||||
<?php
|
||||
foreach ($ac_problems as $problem) {
|
||||
echo '<a href="/problem/', $problem['problem_id'], '" role="button" class="btn btn-light mr-1">#', $problem['problem_id'], '. ', $problem['title'], '</a>';
|
||||
echo '<a href="/problem/', $problem['problem_id'], '" style="display:inline-block; margin-right:0.25em;">#', $problem['problem_id'], '. ', $problem['title'], '</a>';
|
||||
}
|
||||
if (empty($ac_problems)) {
|
||||
echo UOJLocale::get('none');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -165,11 +165,7 @@ function echoLongTable($col_names, $table_name, $cond, $tail, $header_row, $prin
|
||||
|
||||
$div_classes = isset($config['div_classes']) ? $config['div_classes'] : array('table-responsive');
|
||||
$table_classes = isset($config['table_classes']) ? $config['table_classes'] : array('table', 'table-bordered', 'table-hover', 'table-striped', 'table-text-center');
|
||||
|
||||
if (isset($config['head_pagination']) && $config['head_pagination']) {
|
||||
echo $pag->pagination();
|
||||
}
|
||||
|
||||
|
||||
echo '<div class="', join($div_classes, ' '), '">';
|
||||
echo '<table class="', join($table_classes, ' '), '">';
|
||||
echo '<thead>';
|
||||
|
@ -16,10 +16,7 @@ class Paginator {
|
||||
$this->cur_start = 0;
|
||||
$this->table = $config['data'];
|
||||
} elseif (!isset($config['echo_full'])) {
|
||||
if (!isset($config['pagination_table'])) {
|
||||
$config['pagination_table'] = $config['table'];
|
||||
}
|
||||
$this->n_rows = DB::selectCount("select count(*) from {$config['pagination_table']} where {$config['cond']}");
|
||||
$this->n_rows = DB::selectCount("select count(*) from {$config['table_name']} where {$config['cond']}");
|
||||
|
||||
$this->page_len = isset($config['page_len']) ? $config['page_len'] : 10;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user