mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-08 16:08:41 +00:00
feat: hide click_zan_block text
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
82d4bf59f3
commit
82ca33db5e
@ -81,7 +81,7 @@ EOD;
|
||||
echo "<td>{$extra_config['difficulty']}</td>";
|
||||
}
|
||||
}
|
||||
echo '<td class="text-left">', getClickZanBlock('P', $problem['id'], $problem['zan']), '</td>';
|
||||
echo '<td class="text-left">', getClickZanBlock('P', $problem['id'], $problem['zan'], null, false), '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
@ -97,7 +97,7 @@ EOD;
|
||||
if (isset($_COOKIE['show_difficulty'])) {
|
||||
$header .= '<th class="text-center" style="width:3em;">'.UOJLocale::get('problems::difficulty').'</th>';
|
||||
}
|
||||
$header .= '<th class="text-center" style="width:180px;">'.UOJLocale::get('appraisal').'</th>';
|
||||
$header .= '<th class="text-center" style="width:100px;">'.UOJLocale::get('appraisal').'</th>';
|
||||
$header .= '</tr>';
|
||||
|
||||
$pag_config = array('page_len' => 40);
|
||||
|
@ -100,7 +100,7 @@ EOD;
|
||||
echo "<td>{$extra_config['difficulty']}</td>";
|
||||
}
|
||||
}
|
||||
echo '<td class="text-left">', getClickZanBlock('P', $problem['id'], $problem['zan']), '</td>';
|
||||
echo '<td class="text-center">', getClickZanBlock('P', $problem['id'], $problem['zan'], null, false), '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ EOD;
|
||||
if (isset($_COOKIE['show_difficulty'])) {
|
||||
$header .= '<th class="text-center" style="width:3em;">'.UOJLocale::get('problems::difficulty').'</th>';
|
||||
}
|
||||
$header .= '<th class="text-center" style="width:180px;">'.UOJLocale::get('appraisal').'</th>';
|
||||
$header .= '<th class="text-center" style="width:100px;">'.UOJLocale::get('appraisal').'</th>';
|
||||
$header .= '</tr>';
|
||||
|
||||
$tabs_info = array(
|
||||
|
@ -49,7 +49,7 @@
|
||||
<tr>
|
||||
<th>标题</th>
|
||||
<th style="width: 20%">发表时间</th>
|
||||
<th class="text-center" style="width: 180px">评价</th>
|
||||
<th class="text-center" style="width: 100px">评价</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -67,7 +67,7 @@
|
||||
<?php endforeach ?>
|
||||
</td>
|
||||
<td><?= $blog['post_time'] ?></td>
|
||||
<td><?= getClickZanBlock('B', $blog['id'], $blog['zan']) ?></td>
|
||||
<td><?= getClickZanBlock('B', $blog['id'], $blog['zan'], null, false) ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
|
@ -158,11 +158,11 @@ function getBlogLink($id) {
|
||||
|
||||
return $result;
|
||||
}
|
||||
function getClickZanBlock($type, $id, $cnt, $val = null) {
|
||||
function getClickZanBlock($type, $id, $cnt, $val = null, $show_text = true) {
|
||||
if ($val == null) {
|
||||
$val = queryZanVal($id, $type, Auth::user());
|
||||
}
|
||||
return '<div class="uoj-click-zan-block" data-id="'.$id.'" data-type="'.$type.'" data-val="'.$val.'" data-cnt="'.$cnt.'"></div>';
|
||||
return '<div class="uoj-click-zan-block" data-id="'.$id.'" data-type="'.$type.'" data-val="'.$val.'" data-cnt="'.$cnt.'" '.($show_text ? ' data-show-text="1" ' : '') . '></div>';
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,9 +53,14 @@ label {
|
||||
|
||||
.uoj-click-zan-block {
|
||||
display: inline-block;
|
||||
min-width: 100px;
|
||||
text-align: center;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.uoj-click-zan-block[data-show-text] {
|
||||
min-width: 140px;
|
||||
text-align: left;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.uoj-click-zan-up,
|
||||
|
@ -342,6 +342,12 @@ pre {
|
||||
|
||||
.uoj-click-zan-block {
|
||||
display: inline-block;
|
||||
min-width: 100px;
|
||||
text-align: center;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.uoj-click-zan-block[data-show-text] {
|
||||
min-width: 140px;
|
||||
text-align: left;
|
||||
}
|
||||
|
@ -277,6 +277,7 @@ $.fn.click_zan_block = function() {
|
||||
var type = $(this).data('type');
|
||||
var val = parseInt($(this).data('val'));
|
||||
var cnt = parseInt($(this).data('cnt'));
|
||||
var show_text = Boolean($(this).data('show-text'));
|
||||
if (isNaN(cnt)) {
|
||||
return;
|
||||
}
|
||||
@ -305,11 +306,11 @@ $.fn.click_zan_block = function() {
|
||||
: '<span class="glyphicon glyphicon-thumbs-down"></span>';
|
||||
|
||||
var node = this;
|
||||
var up_node = $('<a href="#" class="uoj-click-zan-up">'+up_icon_html+uojLocale('click-zan::good')+'</a>').click(function(e) {
|
||||
var up_node = $('<a href="#" class="uoj-click-zan-up">'+up_icon_html+(show_text ? uojLocale('click-zan::good') : '')+'</a>').click(function(e) {
|
||||
e.preventDefault();
|
||||
click_zan(id, type, 1, node);
|
||||
}).addClass(isBootstrap5Page ? 'text-decoration-none' : '');
|
||||
var down_node = $('<a href="#" class="uoj-click-zan-down">'+down_icon_html+uojLocale('click-zan::bad')+'</a>').click(function(e) {
|
||||
var down_node = $('<a href="#" class="uoj-click-zan-down">'+down_icon_html+(show_text ? uojLocale('click-zan::bad') : '')+'</a>').click(function(e) {
|
||||
e.preventDefault();
|
||||
click_zan(id, type, -1, node);
|
||||
}).addClass(isBootstrap5Page ? 'text-decoration-none' : '');
|
||||
|
Loading…
Reference in New Issue
Block a user