diff --git a/app/modules/Front/BaseFrontPresenter.php b/app/modules/Front/BaseFrontPresenter.php index 9f477cf..50b567d 100644 --- a/app/modules/Front/BaseFrontPresenter.php +++ b/app/modules/Front/BaseFrontPresenter.php @@ -49,7 +49,7 @@ abstract class BaseFrontPresenter extends UnsecuredPresenter foreach ($trs as $t) { $lang1 = $t->getLangName1(); $lang2 = $t->getLangName2(); - + $lang = mb_substr($lang1, 0, -1); $lang .= "o-" . $lang2; $slug = Strings::webalize($lang); @@ -59,6 +59,7 @@ abstract class BaseFrontPresenter extends UnsecuredPresenter $translations[$t->id]["t"] = $t; $slugs[$slug] = $t; } + $this->slug= $translations[1]["slug"]; $this->translations = $translations; $this->dictionaries = $drs; $this->drsSelect = $select; diff --git a/app/modules/Front/Home/@layout.latte b/app/modules/Front/Home/@layout.latte new file mode 100644 index 0000000..0ebab4d --- /dev/null +++ b/app/modules/Front/Home/@layout.latte @@ -0,0 +1,4 @@ +{layout '../templates/@layout.latte'} +{block #content} +{block form} +{/block} \ No newline at end of file diff --git a/app/modules/Front/Home/HomePresenter.php b/app/modules/Front/Home/HomePresenter.php index c871921..69f5116 100644 --- a/app/modules/Front/Home/HomePresenter.php +++ b/app/modules/Front/Home/HomePresenter.php @@ -99,7 +99,8 @@ final class HomePresenter extends BaseFrontPresenter public function actionIpa() { - $this->redirect('Search:ipa',$this->translation,$this->term); + if ($this->term) + $this->redirect('Search:ipa',$this->translation,$this->term); } public function actionInteractive() diff --git a/app/modules/Front/Home/templates/interactive.latte b/app/modules/Front/Home/templates/interactive.latte index 496ab97..2c7002c 100644 --- a/app/modules/Front/Home/templates/interactive.latte +++ b/app/modules/Front/Home/templates/interactive.latte @@ -1,104 +1 @@ -{block title}Slovnik{/block} -{block head} - -{/block} - -{block content} - -
- {form searchForm} - - - - - - - -
{label string /}{label translation /}
{input string}{input translation}{input search}
- {ifset $result} - - - - - - - -{var $last = ''} -{foreach $result as $term} -{if ($last != $term->string1 && $last != '') } - - - -{/if} -{if $last != $term->string1} - -
Preklad
- {$term->string1}  - {foreach $term->pronunciations as $pron} - [{$pron->ipa}] - Prehraj - {/foreach} -
-
-{/if} -{$last == $term->string1 && trim($last2) != '' && trim($term->string2) != '' ? ', ' : ''}{$term->string2}{** - Nutne kvoli newline -**} -{var $last = $term->string1} -{var $last2 = $term->string2} -{/foreach} -
- {/ifset} - {/form} - {control paginator} -
-{/block} - - +{block #content} \ No newline at end of file diff --git a/app/modules/Front/Home/templates/ipa.latte b/app/modules/Front/Home/templates/ipa.latte new file mode 100644 index 0000000..2c7002c --- /dev/null +++ b/app/modules/Front/Home/templates/ipa.latte @@ -0,0 +1 @@ +{block #content} \ No newline at end of file diff --git a/app/modules/Front/Search/templates/interactive.latte b/app/modules/Front/Search/templates/interactive.latte new file mode 100644 index 0000000..496ab97 --- /dev/null +++ b/app/modules/Front/Search/templates/interactive.latte @@ -0,0 +1,104 @@ +{block title}Slovnik{/block} +{block head} + +{/block} + +{block content} + +
+ {form searchForm} + + + + + + + +
{label string /}{label translation /}
{input string}{input translation}{input search}
+ {ifset $result} + + + + + + + +{var $last = ''} +{foreach $result as $term} +{if ($last != $term->string1 && $last != '') } + + + +{/if} +{if $last != $term->string1} + +
Preklad
+ {$term->string1}  + {foreach $term->pronunciations as $pron} + [{$pron->ipa}] + Prehraj + {/foreach} +
+
+{/if} +{$last == $term->string1 && trim($last2) != '' && trim($term->string2) != '' ? ', ' : ''}{$term->string2}{** + Nutne kvoli newline +**} +{var $last = $term->string1} +{var $last2 = $term->string2} +{/foreach} +
+ {/ifset} + {/form} + {control paginator} +
+{/block} + + diff --git a/app/modules/Front/Search/templates/ipa.latte b/app/modules/Front/Search/templates/ipa.latte index a49bff0..055be3c 100644 --- a/app/modules/Front/Search/templates/ipa.latte +++ b/app/modules/Front/Search/templates/ipa.latte @@ -17,10 +17,7 @@ $( document ).ready(function() { {block content} -{block form} - -{/block} - {ifset $result} +{ifset $result}
Preklad