1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00

up assets and homepage

This commit is contained in:
Tykayn 2021-02-12 15:53:28 +01:00 committed by tykayn
parent 0fc4802770
commit d1aa07aca6
4 changed files with 44 additions and 22 deletions

View File

@ -15,21 +15,19 @@ use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
/** /**
* Class DefaultController * Class DefaultController
* @package App\Controller * @package App\Controller
* @Route("/page",name="api_") * @Route("/",name="home_")
*/ */
class DefaultController extends FramadateController { class DefaultController extends FramadateController {
/** /**
* @Get(path ="/", * @Get(path ="/",
* name = "page_home") * name = "sweet_home")
*/ */
public function indexAction() { public function indexAction() {
$polls = $this->getDoctrine()->getRepository( Poll::class )->findAll(); $polls = $this->getDoctrine()->getRepository( Poll::class )->findAll();
return $this->render( 'pages/home.html.twig',[ return $this->render( 'pages/home.html.twig',[ ]);
'polls' => $polls,
]);
} }

View File

@ -2,11 +2,18 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<base href="/">
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<link href="favicon.ico" rel="icon" type="image/x-icon"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
<link rel="stylesheet" href="styles.css" crossorigin="anonymous">
<title>{% block title %}Framdate{% endblock %}</title> <title>{% block title %}Framdate{% endblock %}</title>
{% block stylesheets %} {# {% block stylesheets %}#}
<link rel="stylesheet" href="{{ asset('build/vendors~app.css') }}"> {# <link rel="stylesheet" href="{{ asset('build/vendors~app.css') }}">#}
<link rel="stylesheet" href="{{ asset('build/app.css') }}"> {# <link rel="stylesheet" href="{{ asset('build/app.css') }}">#}
{% endblock %} {# {% endblock %}#}
</head> </head>
<body> <body>
{% include 'split/header.html.twig' %} {% include 'split/header.html.twig' %}
@ -14,14 +21,15 @@
{% block outerBody %} {% block outerBody %}
<div class="container"> <div class="container">
{% block body %}{% endblock %} {% block body %}
{% endblock %}
</div> </div>
{% endblock %} {% endblock %}
{% include 'split/footer.html.twig' %} {% include 'split/footer.html.twig' %}
{% block javascripts %} {# {% block javascripts %} #}
<script href="{{ asset('build/vendors~app.js') }}"></script> {# <script href="{{ asset('build/vendors~app.js') }}"></script> #}
<script href="{{ asset('build/app.js') }}"></script> {# <script href="{{ asset('build/app.js') }}"></script> #}
{% endblock %} {# {% endblock %} #}
</body> </body>
</html> </html>

View File

@ -2,9 +2,12 @@
{% block body %} {% block body %}
<section class="home"> <section class="home">
<h1>Accueil</h1> <app-root></app-root>
<div> <script src="runtime.js" crossorigin="anonymous" defer></script>
{{ polls|length }} sondages <script src="es5-polyfills.js" crossorigin="anonymous" nomodule defer></script>
</div> <script src="other-polyfills.js" crossorigin="anonymous" defer></script>
<script src="scripts.js" crossorigin="anonymous" defer></script>
<script src="main.js" crossorigin="anonymous" defer></script>
</section> </section>
{% endblock %} {% endblock %}

View File

@ -46,11 +46,24 @@ npm run $COMMAND_BUILD
echo "######################" echo "######################"
echo " copying built files in the public folder of the symfony project " echo " copying built files in the public folder of the symfony project "
echo "######################" echo "######################"
rm -rf ../public/* cd ../public
rm ./*.js
rm ./*.css
cd ../funky-framadate-front
cp -r dist/framadate/* ../public/ cp -r dist/framadate/* ../public/
COUNT_FILES = ls -larth ../public |wc -l COUNT_FILES=$(ls -larth ../public |wc -l)
cd .. cd ..
echo " $COUNT_FILES fichiers de build copiés dans /public" echo " $COUNT_FILES fichiers de build copiés dans /public"
echo "######################" echo "##################################################################"
echo " done " echo " renaming unieque name of JS chunks to common names for templates "
cd public
mv runtime* runtime.js
mv main* main.js
mv polyfills-es5* es5-polyfills.js
mv polyfills* other-polyfills.js
mv scripts* scripts.js
mv styles* styles.css
echo "##################################################################"
echo " $(date) ------- done "
echo "######################" echo "######################"