Commit 7cff66f7 authored by Martin Gregor's avatar Martin Gregor
Browse files

pridanie zakladnych stylov

parent a7a819f6
......@@ -40,14 +40,14 @@ class AdminPresenter extends BasePresenter
if ($values->sentence)
{
if ($this->insertSentence($values->sentence))
$this->flashMessage('Veta '.$values->sentence.' bola uložená.');
$this->flashMessage("Veta '$values->sentence' bola uložená.",'alert alert-success');
}
if ($values->url)
{
$this->parseArticle($values->url);
$this->flashMessage('Článok '.$values->url.' bol spracovaný.');
$this->flashMessage("Článok '$values->url' bol spracovaný.",'alert alert-success');
}
if ($values->paragraph)
......@@ -62,7 +62,7 @@ class AdminPresenter extends BasePresenter
}
if ($success)
{
$this->flashMessage('Vety z paragrafu boli spracované.');
$this->flashMessage('Vety z paragrafu boli spracované.','alert alert-success');
}
}
$this->redirect('this');
......@@ -70,7 +70,7 @@ class AdminPresenter extends BasePresenter
private function insertSentence($sentence)
{
$sentence = trim($sentence,'  "\'„“');
$sentence = trim($sentence,'  "\'„“.');
$word_count = count(explode(' ',$sentence));
$exists = $this->db->table('sentences')->where(['sentence' => $sentence])->count('*');
if ($word_count > 5 && !$exists)
......@@ -78,13 +78,13 @@ class AdminPresenter extends BasePresenter
$result = $this->db->table('sentences')->insert(['sentence' => $sentence,'word_count' => $word_count]);
if ($result)
{
$this->flashMessage('Veta '.$sentence.' nebola spracovaná', 'error');
$this->flashMessage("Veta '$sentence' nebola spracovaná", 'alert alert-danger');
return FALSE;
}
}
else
{
$this->flashMessage("Veta '.$sentence.' obsahuje nedostatočný počet slov alebo v systéme už existuje.",'error');
$this->flashMessage("Veta '$sentence' obsahuje nedostatočný počet slov alebo v systéme už existuje.",'alert alert-danger');
return FALSE;
}
......
......@@ -70,7 +70,7 @@ class HomepagePresenter extends BasePresenter
$form = new Nette\Application\UI\Form();
foreach ($this->sentences as $id => $sentence)
{
$label = \Nette\Utils\Html::el()->setHtml($sentence[0]);
$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)
{
......@@ -201,7 +201,7 @@ class HomepagePresenter extends BasePresenter
if ($this->en_words[$position] != null)
{
$words[$position] = '<span class="translation"><span class="en-word">'.$this->en_words[$position]->word
$words[$position] = '<span class="translation label label-primary"><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]))
......
......@@ -38,7 +38,7 @@
{block head}{/block}
</head>
<body>
<body class="container">
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
......
{var $robots = noindex}
{layout '../@layout.latte'}
{block content}
<h1 n:block=title>Pridanie viet</h1>
......
{layout '../@layout.latte'}
{block content}
<h1 n:block="title">Annotacie správnosti zámeny prekladov slov.</h1>
<hgroup>
<h2>Veta:</h2><h3>{$sentence}</h3>
</hgroup>
{control translationForm}
<div class="row">
<div class="col-md-4">
<h1 n:block="title">
<span class="label label-default">
Annotacie správnosti zámeny prekladov slov.
</span>
</h1>
</div>
</div>
<div class="panel panel-primary center-block">
<div class="panel-heading">
<h2 class="panel-title">
<strong>Veta:</strong>{$sentence}
</h2>
<button type="button" class="btn btn-info">Zvýrazniť preklady</button>
</div>
<div class="panel-body">
{control translationForm}
</div>
</div>
{/block}
\ No newline at end of file
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