Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular to js #455

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Controller/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Lexik\Bundle\TranslationBundle\Translation\Translator;
use Lexik\Bundle\TranslationBundle\Util\Csrf\CsrfCheckerTrait;
use Lexik\Bundle\TranslationBundle\Util\Overview\StatsAggregator;
use Lexik\Bundle\TranslationBundle\Util\Profiler\TokenFinder;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -45,12 +44,25 @@ public function overviewAction()
*/
public function gridAction()
{
$translations = $this->translationStorage->getTransUnitList($this->getManagedLocales());
$translationsCount = $this->translationStorage->countTransUnits();

$tokens = null;
if ($this->getParameter('lexik_translation.dev_tools.enable') && $this->tokenFinder !== null) {
$tokens = $this->tokenFinder->find();
}

return $this->render('@LexikTranslation/Translation/grid.html.twig', ['layout' => $this->getParameter('lexik_translation.base_layout'), 'inputType' => $this->getParameter('lexik_translation.grid_input_type'), 'autoCacheClean' => $this->getParameter('lexik_translation.auto_cache_clean'), 'toggleSimilar' => $this->getParameter('lexik_translation.grid_toggle_similar'), 'locales' => $this->getManagedLocales(), 'tokens' => $tokens]);
return $this->render('@LexikTranslation/Translation/grid.html.twig', [
'layout' => $this->getParameter('lexik_translation.base_layout'),
'inputType' => $this->getParameter('lexik_translation.grid_input_type'),
'autoCacheClean' => $this->getParameter('lexik_translation.auto_cache_clean'),
'toggleSimilar' => $this->getParameter('lexik_translation.grid_toggle_similar'),
'locales' => $this->getManagedLocales(),
'tokens' => $tokens,
'translations' => $translations,
'page' => 1,
'translationsCount' => $translationsCount
]);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions Entity/TransUnitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ protected function addTranslationFilter(QueryBuilder $builder, array $locales =

if ((is_countable($ids) ? count($ids) : 0) > 0) {
$builder->andWhere($builder->expr()->in('tu.id', $ids));
} else {
$builder->andWhere($builder->expr()->eq(1, 0));
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions Resources/public/css/translation.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,19 @@ table .actions {
table button.delete {
padding: 2px 5px;
}

.disabled {
pointer-events: none;
cursor: not-allowed;
text-decoration: none;
color: gray !important;
}

.content div.actions {
display: flex;
gap: 5px;
}

.content div.action.action-button {
margin: 0;
}
Loading