mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 04:28:42 +00:00
feat: countdown rest time use uoj-countdown
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d42c2a2c25
commit
ae1d798795
@ -90,15 +90,17 @@ $friend_links = DB::selectAll([
|
|||||||
<ul class="list-unstyled mb-0">
|
<ul class="list-unstyled mb-0">
|
||||||
<?php foreach ($countdowns as $countdown) : ?>
|
<?php foreach ($countdowns as $countdown) : ?>
|
||||||
<?php
|
<?php
|
||||||
$enddate = strtotime($countdown['end_time']);
|
$end_time = UOJTime::str2time($countdown['end_time'])->getTimestamp();
|
||||||
$nowdate = time();
|
$now_time = UOJTime::$time_now->getTimestamp();
|
||||||
$diff = ceil(($enddate - $nowdate) / (24 * 60 * 60));
|
$diff = floor(($end_time - $now_time) / (24 * 60 * 60));
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
<?php if ($diff > 0) : ?>
|
<?php if ($diff > 0) : ?>
|
||||||
<?= UOJLocale::get('x days until countdown title', $countdown['title'], $diff) ?>
|
<?= UOJLocale::get('x days before countdown {title}', $countdown['title'], $diff) ?>
|
||||||
|
<?php elseif ($diff == 0) : ?>
|
||||||
|
<?= UOJLocale::get('{rest} before countdown {title}', $countdown['title'], $end_time - $now_time) ?>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?= UOJLocale::get("countdown title has begun", $countdown['title']) ?>
|
<?= UOJLocale::get("countdown {title} has begun", $countdown['title']) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
@ -190,7 +190,7 @@ if ($cur_tab == 'index') {
|
|||||||
return '标题不能为空';
|
return '标题不能为空';
|
||||||
}
|
}
|
||||||
|
|
||||||
$vdata['title'] = $title;
|
$vdata['title'] = HTML::escape($title);
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@ return [
|
|||||||
'all the announcements' => 'All the Announcements……',
|
'all the announcements' => 'All the Announcements……',
|
||||||
'solved' => 'Solved',
|
'solved' => 'Solved',
|
||||||
'top solver' => 'Top solver',
|
'top solver' => 'Top solver',
|
||||||
'n accepted in last year' => function($n) {
|
'n accepted in last year' => function ($n) {
|
||||||
return "Submitted $n AC code" . ($n > 1 ? "s" : "") . " in last year";
|
return "Submitted $n AC code" . ($n > 1 ? "s" : "") . " in last year";
|
||||||
},
|
},
|
||||||
'help' => 'Help',
|
'help' => 'Help',
|
||||||
@ -53,8 +53,8 @@ return [
|
|||||||
'browse' => 'Browse',
|
'browse' => 'Browse',
|
||||||
'score range' => 'Score range',
|
'score range' => 'Score range',
|
||||||
'details' => 'Details',
|
'details' => 'Details',
|
||||||
'hours' => function($h) {
|
'hours' => function ($h) {
|
||||||
return "$h ".($h <= 1 ? 'hour' : 'hours');
|
return "$h " . ($h <= 1 ? 'hour' : 'hours');
|
||||||
},
|
},
|
||||||
'title' => 'Title',
|
'title' => 'Title',
|
||||||
'content' => 'Content',
|
'content' => 'Content',
|
||||||
@ -64,15 +64,15 @@ return [
|
|||||||
'user profile' => 'User profile',
|
'user profile' => 'User profile',
|
||||||
'send private message' => 'Send private message',
|
'send private message' => 'Send private message',
|
||||||
'modify my profile' => 'Modify my profile',
|
'modify my profile' => 'Modify my profile',
|
||||||
'modify his profile' => function($name) {
|
'modify his profile' => function ($name) {
|
||||||
return "Modify $name's profile";
|
return "Modify $name's profile";
|
||||||
},
|
},
|
||||||
'visit his blog' => function($name) {
|
'visit his blog' => function ($name) {
|
||||||
return "Visit $name's blog";
|
return "Visit $name's blog";
|
||||||
},
|
},
|
||||||
'accepted problems' => 'Accepted problems',
|
'accepted problems' => 'Accepted problems',
|
||||||
'n problems in total' => function($n) {
|
'n problems in total' => function ($n) {
|
||||||
return "$n ".($n <= 1 ? 'problem' : 'problems');
|
return "$n " . ($n <= 1 ? 'problem' : 'problems');
|
||||||
},
|
},
|
||||||
'please enter your password for authorization' => 'Please enter your password for authorization',
|
'please enter your password for authorization' => 'Please enter your password for authorization',
|
||||||
'please enter your new profile' => 'Please enter your new profile',
|
'please enter your new profile' => 'Please enter your new profile',
|
||||||
@ -90,11 +90,14 @@ return [
|
|||||||
'male' => 'Male',
|
'male' => 'Male',
|
||||||
'female' => 'Female',
|
'female' => 'Female',
|
||||||
'countdowns' => 'Countdowns',
|
'countdowns' => 'Countdowns',
|
||||||
'countdown title has begun' => function($title) {
|
'countdown {title} has begun' => function ($title) {
|
||||||
return "<b>$title</b> has begun.";
|
return "<b>$title</b> has begun.";
|
||||||
},
|
},
|
||||||
'x days until countdown title' => function($title, $days) {
|
'{rest} before countdown {title}' => function ($title, $rest_seconds) {
|
||||||
return "<b>$days</b> ".($days <= 1 ? 'day' : 'days')." until <b>$title</b>.";
|
return '<b><span class="countdown" data-rest="' . $rest_seconds . '">less than a day</span></b>' . " before <b>$title</b>.";
|
||||||
|
},
|
||||||
|
'x days before countdown {title}' => function ($title, $days) {
|
||||||
|
return "<b>$days</b> " . ($days <= 1 ? 'day' : 'days') . " before <b>$title</b>.";
|
||||||
},
|
},
|
||||||
'friend links' => 'Frequently Used Links',
|
'friend links' => 'Frequently Used Links',
|
||||||
'server time' => 'Server Time',
|
'server time' => 'Server Time',
|
||||||
|
@ -90,10 +90,13 @@ return [
|
|||||||
'male' => '男',
|
'male' => '男',
|
||||||
'female' => '女',
|
'female' => '女',
|
||||||
'countdowns' => '倒计时',
|
'countdowns' => '倒计时',
|
||||||
'countdown title has begun' => function($title) {
|
'countdown {title} has begun' => function($title) {
|
||||||
return "<b>$title</b> 已开始。";
|
return "<b>$title</b> 已开始。";
|
||||||
},
|
},
|
||||||
'x days until countdown title' => function($title, $days) {
|
'{rest} before countdown {title}' => function ($title, $rest_seconds) {
|
||||||
|
return "距离 <b>$title</b> 还有 " . '<b><span class="countdown" data-rest="' . $rest_seconds . '">不足 1 天</span></b>。';
|
||||||
|
},
|
||||||
|
'x days before countdown {title}' => function($title, $days) {
|
||||||
return "距离 <b>$title</b> 还有 <b>$days</b> 天。";
|
return "距离 <b>$title</b> 还有 <b>$days</b> 天。";
|
||||||
},
|
},
|
||||||
'friend links' => '常用链接',
|
'friend links' => '常用链接',
|
||||||
|
Loading…
Reference in New Issue
Block a user