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} - -
| {label string /} | {label translation /} | -|
|---|---|---|
| {input string} | {input translation} | {input search} | -
| Preklad | -
|---|
- {$term->string1}
- {foreach $term->pronunciations as $pron}
- [{$pron->ipa}]
-
- {/foreach}
- -
-{/if}
-{$last == $term->string1 && trim($last2) != '' && trim($term->string2) != '' ? ', ' : ''}{$term->string2}{**
- Nutne kvoli newline
-**}
-{var $last = $term->string1}
-{var $last2 = $term->string2}
-{/foreach}
- |
| {label string /} | {label translation /} | +|
|---|---|---|
| {input string} | {input translation} | {input search} | +
| Preklad | +
|---|
+ {$term->string1}
+ {foreach $term->pronunciations as $pron}
+ [{$pron->ipa}]
+
+ {/foreach}
+ +
+{/if}
+{$last == $term->string1 && trim($last2) != '' && trim($term->string2) != '' ? ', ' : ''}{$term->string2}{**
+ Nutne kvoli newline
+**}
+{var $last = $term->string1}
+{var $last2 = $term->string2}
+{/foreach}
+ |
| Preklad |
|---|