mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-27 17:56:21 +00:00
Compare commits
5 Commits
387fdf968b
...
03e6a1cb99
Author | SHA1 | Date | |
---|---|---|---|
03e6a1cb99 | |||
03ba52b90d | |||
6926a6f912 | |||
7b4fb77260 | |||
a73b212b32 |
@ -2,10 +2,6 @@
|
|||||||
requireLib('shjs');
|
requireLib('shjs');
|
||||||
requireLib('mathjax');
|
requireLib('mathjax');
|
||||||
|
|
||||||
if (!Auth::check()) {
|
|
||||||
become403Page(UOJLocale::get('need login'));
|
|
||||||
}
|
|
||||||
|
|
||||||
echoUOJPageHeader(UOJLocale::get('help'));
|
echoUOJPageHeader(UOJLocale::get('help'));
|
||||||
?>
|
?>
|
||||||
<article>
|
<article>
|
||||||
|
@ -78,7 +78,8 @@ EOD;
|
|||||||
$new_group_form->printHTML();
|
$new_group_form->printHTML();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'head_pagination' => true
|
'head_pagination' => true,
|
||||||
|
'pagination_table' => "`groups`"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
@ -99,7 +99,8 @@ EOD;
|
|||||||
'print_after_table' => function() {
|
'print_after_table' => function() {
|
||||||
global $myUser;
|
global $myUser;
|
||||||
},
|
},
|
||||||
'head_pagination' => true
|
'head_pagination' => true,
|
||||||
|
'pagination_table' => 'lists'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
@ -127,6 +127,11 @@ EOD;
|
|||||||
$table_classes = array('table', 'table-bordered', 'table-hover', 'table-striped');
|
$table_classes = array('table', 'table-bordered', 'table-hover', 'table-striped');
|
||||||
?>
|
?>
|
||||||
<?php echoUOJPageHeader(UOJLocale::get('problems')) ?>
|
<?php echoUOJPageHeader(UOJLocale::get('problems')) ?>
|
||||||
|
<?php
|
||||||
|
if (isSuperUser($myUser) || isProblemManager($myUser) || isProblemUploader($myUser)) {
|
||||||
|
$new_problem_form->printHTML();
|
||||||
|
}
|
||||||
|
?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<?= HTML::tablist($tabs_info, $cur_tab, 'nav-pills') ?>
|
<?= HTML::tablist($tabs_info, $cur_tab, 'nav-pills') ?>
|
||||||
@ -158,13 +163,11 @@ $('#input-show_submit_mode').click(function() {
|
|||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<div class="<?= join($div_classes, ' ') ?>">
|
||||||
|
<table class="<?= join($table_classes, ' ') ?>">
|
||||||
|
<thead><?= $header ?></thead>
|
||||||
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
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) {
|
foreach ($pag->get() as $idx => $row) {
|
||||||
echoProblem($row);
|
echoProblem($row);
|
||||||
@ -173,15 +176,9 @@ $('#input-show_submit_mode').click(function() {
|
|||||||
if ($pag->isEmpty()) {
|
if ($pag->isEmpty()) {
|
||||||
echo '<tr><td class="text-center" colspan="233">'.UOJLocale::get('none').'</td></tr>';
|
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() ?>
|
<?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']}';");
|
$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>
|
<h4 class="list-group-item-heading"><?= UOJLocale::get('accepted problems').':'.UOJLocale::get('n problems in total', count($ac_problems))?> </h4>
|
||||||
<p class="list-group-item-text">
|
<div class="list-group-item-text">
|
||||||
<?php
|
<?php
|
||||||
foreach ($ac_problems as $problem) {
|
foreach ($ac_problems as $problem) {
|
||||||
echo '<a href="/problem/', $problem['problem_id'], '" style="display:inline-block; margin-right:0.25em;">#', $problem['problem_id'], '. ', $problem['title'], '</a>';
|
echo '<a href="/problem/', $problem['problem_id'], '" role="button" class="btn btn-light mr-1">#', $problem['problem_id'], '. ', $problem['title'], '</a>';
|
||||||
}
|
}
|
||||||
if (empty($ac_problems)) {
|
if (empty($ac_problems)) {
|
||||||
echo UOJLocale::get('none');
|
echo UOJLocale::get('none');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -166,6 +166,10 @@ function echoLongTable($col_names, $table_name, $cond, $tail, $header_row, $prin
|
|||||||
$div_classes = isset($config['div_classes']) ? $config['div_classes'] : array('table-responsive');
|
$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');
|
$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 '<div class="', join($div_classes, ' '), '">';
|
||||||
echo '<table class="', join($table_classes, ' '), '">';
|
echo '<table class="', join($table_classes, ' '), '">';
|
||||||
echo '<thead>';
|
echo '<thead>';
|
||||||
|
@ -16,7 +16,10 @@ class Paginator {
|
|||||||
$this->cur_start = 0;
|
$this->cur_start = 0;
|
||||||
$this->table = $config['data'];
|
$this->table = $config['data'];
|
||||||
} elseif (!isset($config['echo_full'])) {
|
} elseif (!isset($config['echo_full'])) {
|
||||||
$this->n_rows = DB::selectCount("select count(*) from {$config['table_name']} where {$config['cond']}");
|
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->page_len = isset($config['page_len']) ? $config['page_len'] : 10;
|
$this->page_len = isset($config['page_len']) ? $config['page_len'] : 10;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user