Skip to content

Commit

Permalink
Some more refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jdreesen committed Oct 2, 2024
1 parent 805314c commit 2615697
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 56 deletions.
38 changes: 16 additions & 22 deletions public/css/admin-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
width: auto;
}

#neusta_areabrick_config .strike-through {
text-decoration: line-through;
}

#neusta_areabrick_config tbody {
display: block;
height: 100%;
Expand All @@ -40,7 +36,7 @@
#neusta_areabrick_config tbody tr {
display: table;
width: 100%;
table-layout: fixed; /* Verhindert, dass Spalten unterschiedlich breit werden */
table-layout: fixed; /* Prevents columns of different widths */
}

#neusta_areabrick_config tbody tr:nth-child(odd) {
Expand All @@ -51,22 +47,19 @@
background-color: #d9d9d9;
}

#neusta_areabrick_config li {
list-style-type: none;
}

#neusta_areabrick_config a {
color: #0096f3;
text-decoration: none;
}

#neusta_areabrick_config a:hover {
text-decoration: underline;
cursor: pointer;
}

/*Additional properties*/
#neusta_areabrick_config .highlight-tag,
#neusta_areabrick_config .highlight-group {
/* Additional Properties */
#neusta_areabrick_config ul.additional-properties li {
list-style-type: none;
margin-left: 5px;
width: 150px;
padding: 2px 4px;
Expand All @@ -75,16 +68,16 @@
color: #ffffff;
}

#neusta_areabrick_config .highlight-tag {
#neusta_areabrick_config ul.additional-properties li.tag {
background-color: #2a6f9c;
}

#neusta_areabrick_config .highlight-group {
#neusta_areabrick_config ul.additional-properties li.group {
background-color: #194567;
}

/* Accordion css*/
#neusta_areabrick_config .accordion {
/* Accordion */
#neusta_areabrick_config .accordion button {
background-color: #efefef;
color: #444;
cursor: pointer;
Expand All @@ -97,18 +90,19 @@
margin-bottom: 3px;
}

#neusta_areabrick_config .accordion.active,
#neusta_areabrick_config .accordion:hover {
#neusta_areabrick_config .accordion button.active,
#neusta_areabrick_config .accordion button:hover {
background-color: #ccc;
}

#neusta_areabrick_config .panel {
#neusta_areabrick_config .accordion ul {
padding: 0 18px;
display: none;
background-color: white;
overflow: hidden;
overflow-x: hidden;
overflow-y: auto;
max-height: 500px;
}

#neusta_areabrick_config .panel.active {
#neusta_areabrick_config .accordion ul.active {
display: block;
}
3 changes: 1 addition & 2 deletions public/js/areabrick-overview-unpublished-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ document.addEventListener('DOMContentLoaded', function () {
const el = event.target.closest('#neusta_areabrick_config .accordion');

if (el) {
el.classList.toggle('active');
el.nextElementSibling.classList.toggle('active');
el.querySelectorAll('button, ul').forEach(el => el.classList.toggle('active'));
}
});
}, { once: true });
56 changes: 26 additions & 30 deletions templates/bricks/overview.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<th>{{ 'neusta_pimcore_areabrick_config.areabricks.overview.table.col_headers.version'|trans }}</th>
<th>{{ 'neusta_pimcore_areabrick_config.areabricks.overview.table.col_headers.description'|trans }}</th>
<th>{{ 'neusta_pimcore_areabrick_config.areabricks.overview.table.col_headers.template'|trans }}</th>
<th>{{ 'neusta_pimcore_areabrick_config.areabricks.overview.table.col_headers.pages'|trans|raw }}</th>
<th>{{ 'neusta_pimcore_areabrick_config.areabricks.overview.table.col_headers.pages'|trans }}</th>
{% if hasAdditionalProperties %}
<th>{{ 'neusta_pimcore_areabrick_config.areabricks.overview.table.col_headers.additional_properties'|trans }}</th>
{% endif %}
Expand All @@ -27,46 +27,42 @@

{% if published_pages is not empty %}
<!-- Published Pages Accordion -->
<div>
<button class="accordion">Published Pages</button>
<div class="panel">
<ul>
{% for page in published_pages %}
<li>
<a href="#" data-page-id="{{ page.id }}" data-page-type="{{ page.type }}">
{{ page.url }}
</a>
(<a href="{{ page.url }}">Frontend</a>)
</li>
{% endfor %}
</ul>
</div>
<div class="accordion">
<button>{{ 'neusta_pimcore_areabrick_config.areabricks.overview.table.published_pages'|trans }}</button>
<ul>
{% for page in published_pages %}
<li>
<a data-page-id="{{ page.id }}" data-page-type="{{ page.type }}">
{{ page.url }}
</a>
(<a href="{{ page.url }}">Frontend</a>)
</li>
{% endfor %}
</ul>
</div>
{% endif %}

{% if unpublished_pages is not empty %}
<!-- Unpublished Pages Accordion -->
<div>
<button class="accordion">Unpublished Pages</button>
<div class="panel">
<ul>
{% for page in unpublished_pages %}
<li class="strike-through">
<a href="#" data-page-id="{{ page.id }}" data-page-type="{{ page.type }}">
{{ page.url }}
</a>
</li>
{% endfor %}
</ul>
</div>
<div class="accordion">
<button>{{ 'neusta_pimcore_areabrick_config.areabricks.overview.table.unpublished_pages'|trans }}</button>
<ul>
{% for page in unpublished_pages %}
<li>
<a data-page-id="{{ page.id }}" data-page-type="{{ page.type }}">
{{ page.url }}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</td>
{% if hasAdditionalProperties %}
<td>
<ul>
<ul class="additional-properties">
{% for additionalProperty in brick.additionalProperties %}
<li class="{% if additionalProperty.name == 'tags' %}highlight-tag{% elseif additionalProperty.name == 'groups' %}highlight-group{% endif %}">
<li class="{% if additionalProperty.name == 'tags' %}tag{% elseif additionalProperty.name == 'groups' %}group{% endif %}">
{{ additionalProperty.name }}: {{ additionalProperty.value }}
</li>
{% else %}
Expand Down
4 changes: 3 additions & 1 deletion translations/messages.de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ neusta_pimcore_areabrick_config:
version: Version
description: Beschreibung
template: Twig Template
pages: <strike>unveröffentlichte</strike> Seiten (mit Brick)
pages: Seiten (mit Brick)
additional_properties: zusätzliche Eigenschaften
no_additional_properties: Keine zusätzlichen Eigenschaften
published_pages: Veröffentlichte Seiten
unpublished_pages: Unveröffentlichte Seiten
4 changes: 3 additions & 1 deletion translations/messages.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ neusta_pimcore_areabrick_config:
version: version
description: description
template: twig template
pages: <strike>unpublished</strike> pages (using brick)
pages: pages (using brick)
additional_properties: additional properties
no_additional_properties: No additional properties
published_pages: Published Pages
unpublished_pages: Unpublished Pages

0 comments on commit 2615697

Please sign in to comment.