diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Fields.php b/lib/Alchemy/Phrasea/Controller/Admin/Fields.php index d2dd834a9a..ce693f9868 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Fields.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Fields.php @@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\Controller\Admin; +use Alchemy\Phrasea\Application as PhraseaApplication; use Alchemy\Phrasea\Metadata\TagProvider; use Alchemy\Phrasea\Vocabulary\Controller as VocabularyController; use Silex\Application; @@ -140,8 +141,16 @@ class Fields implements ControllerProviderInterface public function displayApp(Application $app, Request $request, $sbas_id) { + $languages = array(); + + foreach (PhraseaApplication::getAvailableLanguages() as $code => $language) { + $data = explode('_', $code); + $languages[$data[0]] = $language; + } + return $app['twig']->render('/admin/fields/index.html.twig', array( - 'sbas_id' => $sbas_id + 'sbas_id' => $sbas_id, + 'languages' => $languages, )); } @@ -230,7 +239,8 @@ class Fields implements ControllerProviderInterface 'location' => $app->path('admin_fields_show_field', array( 'sbas_id' => $sbas_id, 'id' => $field->get_id() - )))); + )) + )); } public function listFields(Application $app, $sbas_id) { diff --git a/templates/web/admin/fields/index.html.twig b/templates/web/admin/fields/index.html.twig index a841cd8ae6..941e365145 100644 --- a/templates/web/admin/fields/index.html.twig +++ b/templates/web/admin/fields/index.html.twig @@ -21,4 +21,4 @@ {# bootstrap admin field backbone application #} - + diff --git a/templates/web/admin/fields/templates.html.twig b/templates/web/admin/fields/templates.html.twig index 503ff0ef14..fc2c3df91e 100644 --- a/templates/web/admin/fields/templates.html.twig +++ b/templates/web/admin/fields/templates.html.twig @@ -115,7 +115,7 @@ <% } else { %> - <% } %> {% trans %}Multivalued{% endtrans %} + <% } %> {% trans %}Multivalued{% endtrans %} @@ -168,7 +168,7 @@