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
* @package App\Controller
* @Route("/page",name="api_")
* @Route("/",name="home_")
*/
class DefaultController extends FramadateController {
/**
* @Get(path ="/",
* name = "page_home")
* name = "sweet_home")
*/
public function indexAction() {
$polls = $this->getDoctrine()->getRepository( Poll::class )->findAll();
return $this->render( 'pages/home.html.twig',[
'polls' => $polls,
]);
return $this->render( 'pages/home.html.twig',[ ]);
}

View File

@ -2,11 +2,18 @@
<html>
<head>
<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>
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('build/vendors~app.css') }}">
<link rel="stylesheet" href="{{ asset('build/app.css') }}">
{% endblock %}
{# {% block stylesheets %}#}
{# <link rel="stylesheet" href="{{ asset('build/vendors~app.css') }}">#}
{# <link rel="stylesheet" href="{{ asset('build/app.css') }}">#}
{# {% endblock %}#}
</head>
<body>
{% include 'split/header.html.twig' %}
@ -14,14 +21,15 @@
{% block outerBody %}
<div class="container">
{% block body %}{% endblock %}
{% block body %}
{% endblock %}
</div>
{% endblock %}
{% include 'split/footer.html.twig' %}
{% block javascripts %}
<script href="{{ asset('build/vendors~app.js') }}"></script>
<script href="{{ asset('build/app.js') }}"></script>
{% endblock %}
{# {% block javascripts %} #}
{# <script href="{{ asset('build/vendors~app.js') }}"></script> #}
{# <script href="{{ asset('build/app.js') }}"></script> #}
{# {% endblock %} #}
</body>
</html>

View File

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

View File

@ -46,11 +46,24 @@ npm run $COMMAND_BUILD
echo "######################"
echo " copying built files in the public folder of the symfony project "
echo "######################"
rm -rf ../public/*
cd ../public
rm ./*.js
rm ./*.css
cd ../funky-framadate-front
cp -r dist/framadate/* ../public/
COUNT_FILES = ls -larth ../public |wc -l
COUNT_FILES=$(ls -larth ../public |wc -l)
cd ..
echo " $COUNT_FILES fichiers de build copiés dans /public"
echo "######################"
echo " done "
echo "##################################################################"
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 "######################"