From 67948f7f3ad16863ccabfecad5205a69d93eb873 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 1 Mar 2022 14:00:14 +0100 Subject: [PATCH] styles in scss with webpack --- .../public/{pages => page}/chillbudget.scss | 11 ++- .../Resources/public/{pages => page}/index.js | 0 .../Resources/views/Household/index.html.twig | 54 ------------- .../Resources/views/Person/index.html.twig | 76 +++---------------- .../ChillBudgetBundle/chill.webpack.config.js | 6 +- 5 files changed, 24 insertions(+), 123 deletions(-) rename src/Bundle/ChillBudgetBundle/Resources/public/{pages => page}/chillbudget.scss (70%) rename src/Bundle/ChillBudgetBundle/Resources/public/{pages => page}/index.js (100%) diff --git a/src/Bundle/ChillBudgetBundle/Resources/public/pages/chillbudget.scss b/src/Bundle/ChillBudgetBundle/Resources/public/page/chillbudget.scss similarity index 70% rename from src/Bundle/ChillBudgetBundle/Resources/public/pages/chillbudget.scss rename to src/Bundle/ChillBudgetBundle/Resources/public/page/chillbudget.scss index 079e40e06..2be4cff6f 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/public/pages/chillbudget.scss +++ b/src/Bundle/ChillBudgetBundle/Resources/public/page/chillbudget.scss @@ -41,4 +41,13 @@ .total { margin-top: 1rem; border-top: 1px dashed black; -} \ No newline at end of file +} + +.accordion-item { + margin-bottom: 1rem; +} + +button[aria-expanded="true"] > span.folded, +button[aria-expanded="false"] > span.unfolded { display: none; } +button[aria-expanded="false"] > span.folded, +button[aria-expanded="true"] > span.unfolded { display: inline; } \ No newline at end of file diff --git a/src/Bundle/ChillBudgetBundle/Resources/public/pages/index.js b/src/Bundle/ChillBudgetBundle/Resources/public/page/index.js similarity index 100% rename from src/Bundle/ChillBudgetBundle/Resources/public/pages/index.js rename to src/Bundle/ChillBudgetBundle/Resources/public/page/index.js diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Household/index.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Household/index.html.twig index 5fccfece6..03e5dd0ea 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Household/index.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Household/index.html.twig @@ -6,60 +6,6 @@ {% set title = 'Budget for household %household%'|trans({ '%household%' : household.id } ) %} {% block title title %} -{% block css %} - -{% endblock %} - {% block content %}

{{ title }}

diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Person/index.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Person/index.html.twig index fa8e5ef5a..306b7dafc 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Person/index.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Person/index.html.twig @@ -4,59 +4,6 @@ {% set title = 'Budget for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %} {% block title title %} -{% block css %} - -{% endblock %} - {% block content %}

{{ title }}

@@ -66,18 +13,17 @@ 'person': person } %} -{# {% if (resources|length + charges|length) == 0 or futureCharges|length > 0 or futureResources|length > 0 or pastCharges|length > 0 or pastResources|length > 0 %} #} - {% if is_granted('CHILL_BUDGET_ELEMENT_CREATE', person) %} - - {% endif %} -{# {% endif %} #} +{% if is_granted('CHILL_BUDGET_ELEMENT_CREATE', person) %} + +{% endif %} + {% endblock %} diff --git a/src/Bundle/ChillBudgetBundle/chill.webpack.config.js b/src/Bundle/ChillBudgetBundle/chill.webpack.config.js index b6cc8e66e..f7346dfcf 100644 --- a/src/Bundle/ChillBudgetBundle/chill.webpack.config.js +++ b/src/Bundle/ChillBudgetBundle/chill.webpack.config.js @@ -1,9 +1,9 @@ -// this file loads all assets from the Chill person bundle +// this file loads all assets from the Chill budget bundle module.exports = function(encore, entries) { - entries.push(__dirname + '/Resources/public/pages/index.js'); - encore.addAliases({ ChillBudgetAssets: __dirname + '/Resources/public' }); + + encore.addEntry('page_budget', __dirname + '/Resources/public/page/index.js'); };