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 ...@@ -40,14 +40,14 @@ class AdminPresenter extends BasePresenter
if ($values->sentence) if ($values->sentence)
{ {
if ($this->insertSentence($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) if ($values->url)
{ {
$this->parseArticle($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) if ($values->paragraph)
...@@ -62,7 +62,7 @@ class AdminPresenter extends BasePresenter ...@@ -62,7 +62,7 @@ class AdminPresenter extends BasePresenter
} }
if ($success) if ($success)
{ {
$this->flashMessage('Vety z paragrafu boli spracované.'); $this->flashMessage('Vety z paragrafu boli spracované.','alert alert-success');
} }
} }
$this->redirect('this'); $this->redirect('this');
...@@ -70,7 +70,7 @@ class AdminPresenter extends BasePresenter ...@@ -70,7 +70,7 @@ class AdminPresenter extends BasePresenter
private function insertSentence($sentence) private function insertSentence($sentence)
{ {
$sentence = trim($sentence,'  "\'„“'); $sentence = trim($sentence,'  "\'„“.');
$word_count = count(explode(' ',$sentence)); $word_count = count(explode(' ',$sentence));
$exists = $this->db->table('sentences')->where(['sentence' => $sentence])->count('*'); $exists = $this->db->table('sentences')->where(['sentence' => $sentence])->count('*');
if ($word_count > 5 && !$exists) if ($word_count > 5 && !$exists)
...@@ -78,13 +78,13 @@ class AdminPresenter extends BasePresenter ...@@ -78,13 +78,13 @@ class AdminPresenter extends BasePresenter
$result = $this->db->table('sentences')->insert(['sentence' => $sentence,'word_count' => $word_count]); $result = $this->db->table('sentences')->insert(['sentence' => $sentence,'word_count' => $word_count]);
if ($result) if ($result)
{ {
$this->flashMessage('Veta '.$sentence.' nebola spracovaná', 'error'); $this->flashMessage("Veta '$sentence' nebola spracovaná", 'alert alert-danger');
return FALSE; return FALSE;
} }
} }
else 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; return FALSE;
} }
......
...@@ -70,7 +70,7 @@ class HomepagePresenter extends BasePresenter ...@@ -70,7 +70,7 @@ class HomepagePresenter extends BasePresenter
$form = new Nette\Application\UI\Form(); $form = new Nette\Application\UI\Form();
foreach ($this->sentences as $id => $sentence) 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']); $form->addRadioList('sentence'.$id,$label,['correct' => 'Správne','incorrect' => 'Nesprávne']);
foreach ($sentence[1] as $position => $word) foreach ($sentence[1] as $position => $word)
{ {
...@@ -201,7 +201,7 @@ class HomepagePresenter extends BasePresenter ...@@ -201,7 +201,7 @@ class HomepagePresenter extends BasePresenter
if ($this->en_words[$position] != null) 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>'; .'</span><span class="sk-word hidden">'.$this->words[$position].'</span></span>';
$sentence = implode(' ',$words); $sentence = implode(' ',$words);
if (!isset($this->sentences[$sentence])) if (!isset($this->sentences[$sentence]))
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
{block head}{/block} {block head}{/block}
</head> </head>
<body> <body class="container">
<!--[if lt IE 7]> <!--[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> <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]--> <![endif]-->
......
{var $robots = noindex} {layout '../@layout.latte'}
{block content} {block content}
<h1 n:block=title>Pridanie viet</h1> <h1 n:block=title>Pridanie viet</h1>
......
{layout '../@layout.latte'} {layout '../@layout.latte'}
{block content} {block content}
<h1 n:block="title">Annotacie správnosti zámeny prekladov slov.</h1> <div class="row">
<hgroup> <div class="col-md-4">
<h2>Veta:</h2><h3>{$sentence}</h3> <h1 n:block="title">
</hgroup> <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} {control translationForm}
</div>
</div>
{/block} {/block}
\ No newline at end of file
Supports Markdown
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