Commit 6d6afdd6 authored by Martin Gregor's avatar Martin Gregor
Browse files

finalna uprava css,instalacia popover

parent 7cff66f7
......@@ -70,6 +70,7 @@ class HomepagePresenter extends BasePresenter
$form = new Nette\Application\UI\Form();
foreach ($this->sentences as $id => $sentence)
{
$form->addGroup();
$label = \Nette\Utils\Html::el()->setHtml('<div class="well well-sm">'.$sentence[0].'</div>');
$form->addRadioList('sentence'.$id,$label,['correct' => 'Správne','incorrect' => 'Nesprávne']);
foreach ($sentence[1] as $position => $word)
......@@ -80,7 +81,7 @@ class HomepagePresenter extends BasePresenter
}
$form->addHidden('sentence_id',$this->sentence_id);
$form->addSubmit('send','Ďalej');
$form->addSubmit('send','Ďalej')->setAttribute('class','btn btn-success');
$form->onSuccess[] = $this->translationFormSucceeded;
return $form;
}
......@@ -201,7 +202,10 @@ class HomepagePresenter extends BasePresenter
if ($this->en_words[$position] != null)
{
$words[$position] = '<span class="translation label label-primary"><span class="en-word">'.$this->en_words[$position]->word
$words[$position] = '<span class="translation label label-primary" data-animation="true" data-html="true" data-placement="auto bottom"'
.' data-trigger="hover" data-content="test">'
.'<span class="en-word">'
.$this->en_words[$position]->word
.'</span><span class="sk-word hidden">'.$this->words[$position].'</span></span>';
$sentence = implode(' ',$words);
if (!isset($this->sentences[$sentence]))
......
......@@ -2,20 +2,20 @@
{block content}
<div class="row">
<div class="col-md-4">
<h1 n:block="title">
<div class="col-md-12">
<h1 n:block="title" class="page-title">
<span class="label label-default">
Annotacie správnosti zámeny prekladov slov.
</span>
</h1>
<button type="button" class="btn btn-info highlight">Zvýrazniť preklady</button>
</div>
</div>
<div class="panel panel-primary center-block">
<div class="panel-heading">
<h2 class="panel-title">
<strong>Veta:</strong>{$sentence}
<strong>Veta: </strong>{$sentence}
</h2>
<button type="button" class="btn btn-info">Zvýrazniť preklady</button>
</div>
<div class="panel-body">
{control translationForm}
......
......@@ -7,6 +7,32 @@
input[type="radio"]:checked+label{ font-weight: bold; }
.container
{
padding-top: 0;
}
.well
{
margin-bottom: 0;
}
.page-title
{
display: inline-block;
margin: 12px 0;
}
table
{
width: 100%;
}
.center
{
text-align: center;
}
......
$(function(){
$('#frm-translationForm fieldset').each(function() {
$(this).find('tbody tr').each(function(i) {
if (i != 0 && i != 4)
{
$(this).hide();
}
else if (i == 4)
{
$(this).find('th').addClass('hidden');
$(this).find('td').addClass('center');
$(this).find('td').addClass('center');
}
else
{
$(this).find('td').hide();
}
});
});
$('.highlight').on('click',function() {
$('.translation').toggleClass('label').toggleClass('label-primary');
});
$('.translation').popover();
});
This diff is collapsed.
This diff is collapsed.
Markdown is supported
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