Skip to content
Snippets Groups Projects
Commit 0b3d4c27 authored by Anton Bagliy's avatar Anton Bagliy
Browse files

ADD: bonus module checkbox tooltip when discipline is locked or not author #463

parent e8148264
No related merge requests found
......@@ -212,3 +212,59 @@
.addSubmodule:active {
padding: 9px 19px 7px 41px;
}
[data-tip] {
position:relative;
}
// data-tip взят из
// https://stackoverflow.com/questions/19480010/adding-a-tooltip-to-an-input-box
[data-tip]:before {
content:'';
/* hides the tooltip when not hovered */
display:none;
content:'';
display:none;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #1a1a1a;
position:absolute;
top:30px;
left:35px;
z-index:8;
font-size:0;
line-height:0;
width:0;
height:0;
position:absolute;
top:30px;
left:35px;
z-index:8;
font-size:0;
line-height:0;
width:0;
height:0;
}
[data-tip]:after {
display:none;
content:attr(data-tip);
position:absolute;
top:35px;
left:0px;
padding:5px 8px;
background:#1a1a1a;
color:#fff;
z-index:9;
font-size: 0.75em;
height:18px;
line-height:18px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
white-space:nowrap;
word-wrap:normal;
}
[data-tip]:hover:before,
[data-tip]:hover:after {
display:block;
}
\ No newline at end of file
......@@ -18,7 +18,13 @@
<div class="title">Бонусные баллы:</div>
<div class="field">
<label>
<input name="BonusRate" class="BonusRate" type="checkbox" {{ Discipline.IsLocked ? 'disabled' }}
<input name="BonusRate" class="BonusRate" type="checkbox"
{% if not isAuthor %}
data-tip="Добавление или удаление бонусных баллов недоступно, потому что вы не автор"
{% elseif Discipline.IsLocked %}
data-tip="Добавление или удаление бонусных баллов недоступно, потому что были выставлены баллы"
{% endif %}
{{ Discipline.IsLocked or not isAuthor ? 'disabled' }}
{{ Discipline.IsBonus ? 'checked' }}>Добавить ли бонусные баллы?
</label>
</div>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment