Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/composer/knplabs/knp-snappy-1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gerMdz authored Sep 25, 2024
2 parents 0d8fa90 + 1448720 commit 18c326c
Show file tree
Hide file tree
Showing 9 changed files with 17,734 additions and 30,441 deletions.
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
MESSENGER_TRANSPORT_DSN=in-memory://

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Control + Alt + m

###### Gracias

[SymfonyCasts](https://symfonycasts.com/screencast/mailer/sender-authentication)
[SymfonyCasts](https://symfonycasts.com/screencast/mailer/encore-css#play)



Expand Down
1,489 changes: 770 additions & 719 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.6'
driver: 'mysql'
server_version: '8'
charset: utf8mb4
default_table_options:
charset: utf8mb4
Expand Down
1 change: 1 addition & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ services:
$site_temporal: '%site_temporal%'
$site_podcasts: '%env(resolve:URL_PODCAST)%'
$queue_enable: '%queue_enable%'
$publicDir: '%kernel.project_dir%/public'

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
Expand Down
38,259 changes: 14,069 additions & 24,190 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"devDependencies": {
"@symfony/webpack-encore": "^0.33.0",
"@symfony/webpack-encore": "^4.6.1",
"autoprefixer": "^10.1.0",
"bootstrap": "^4.4.1",
"core-js": "^3.0.0",
"foundation-emails": "^2.4.0",
"glob-all": "^3.2.1",
"node-sass": "^4.14.0",
"node-sass": "^9.0.0",
"path": "^0.12.7",
"postcss-loader": "^4.1.0",
"purgecss-webpack-plugin": "^3.1.2",
"regenerator-runtime": "^0.13.2",
"sass-loader": "^9.0.0",
"tailwindcss": "^2.0.2",
"tailwindcss": "^2.2.19",
"webpack-notifier": "^1.6.0"
},
"license": "MIT",
Expand All @@ -34,7 +34,7 @@
"codemirror": "^5.59.0",
"jquery": "^3.5.0",
"popper.js": "^1.16.1",
"postcss": "^8.2.2",
"postcss": "^8.4.31",
"select2": "^4.1.0-rc.0",
"summernote": "^0.8.18"
}
Expand Down
26 changes: 23 additions & 3 deletions src/Twig/BaseExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use InvalidArgumentException;
use Psr\Container\ContainerInterface;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookupInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
Expand All @@ -17,16 +18,20 @@ class BaseExtension extends AbstractExtension implements ServiceSubscriberInterf
{
protected $em;
private $container;
private string $publicDir;

/**
* BaseExtension constructor.
* @param EntityManagerInterface $em
* @param ContainerInterface $container
* @param string $publicDir
*/
public function __construct(EntityManagerInterface $em, ContainerInterface $container)
public function __construct(
EntityManagerInterface $em, ContainerInterface $container, string $publicDir)
{
$this->em = $em;
$this->container = $container;
$this->publicDir = $publicDir;
}

public function getFilters(): array
Expand All @@ -49,13 +54,14 @@ public function getFunctions(): array
new TwigFunction('capacidad_restante', [$this, 'capacidad_restante']),
new TwigFunction('capacidad_ocupada', [$this, 'capacidad_ocupada']),
new TwigFunction('redirection', [$this, 'redirection']),
new TwigFunction('encore_entry_css_source', [$this, 'getEncoreEntryCssSource']),
];
}

public function lema()
{
$lema = $this->em->getRepository(MetaBase::class)->findOneBy([]);
if(!$lema){
if (!$lema) {
return null;
}
return $lema->getLema();
Expand All @@ -65,7 +71,7 @@ public function metaDescripcion()
{
$base = $this->em->getRepository(MetaBase::class)->findOneBy([]);

if(!$base){
if (!$base) {
return null;
}

Expand Down Expand Up @@ -103,6 +109,7 @@ public static function getSubscribedServices()
return [
UploaderHelper::class,
EntityManagerInterface::class,
EntrypointLookupInterface::class
];
}

Expand All @@ -115,4 +122,17 @@ public function redirection(string $link)
echo "<meta http-equiv = 'refresh' content='0;url = $link' />";

}

public function getEncoreEntryCssSource(string $entryName): string
{
$entryPointLookupInterface = $this->container->get(EntrypointLookupInterface::class);
$entryPointLookupInterface->reset();
$files = $entryPointLookupInterface->getCssFiles($entryName);
$source = '';
foreach ($files as $file) {
$source .= file_get_contents($this->publicDir . $file);
}

return $source;
}
}
Loading

0 comments on commit 18c326c

Please sign in to comment.