djangocms-frontend
djangocms-frontend copied to clipboard
feat: Make frontend plugins re-usable components
When designing frontends it is key to avoid repeating template/HTML code. This PR makes djangocms-frontend components like alerts, cards, buttons or links, etc.
This PR provides a simple way to re-use djangocms-frontend plugins in templates:
{% load frontend %}
{% url "some-name" as link_target %}
{% plugin "link" external_link=link_target link_type="btn" link_context="primary" link_outline=False %}
Click me!
{% endplugin %}
or
{% load frontend %}
{% plugin "card" card_alignment="center" card_outline="info" card_text_color="primary" card_full_height=True %}
{% plugin "cardinner" inner_type="card-header" text_alignment="start" %}
<h4>Card title</h4>
{% endplugin %}
{% plugin "cardinner" inner_type="card-body" text_alignment="center" %}
Some quick example text to build on the card title and make up the
bulk of the card's content.
{% endplugin %}
{% plugin "listgroupitem" %}An item{% endplugin %}
{% plugin "listgroupitem" %}A second item{% endplugin %}
{% plugin "listgroupitem" %}A third item{% endplugin %}
{% endplugin %}
These plugins are not created in the database. They work with djangocms-frontend plugins and most other django CMS plugins.
Codecov Report
Attention: Patch coverage is 80.83004% with 97 lines in your changes missing coverage. Please review.
Project coverage is 86.70%. Comparing base (
f11feee) to head (effbde2). Report is 51 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #220 +/- ##
==========================================
- Coverage 86.93% 86.70% -0.23%
==========================================
Files 120 124 +4
Lines 3107 3422 +315
Branches 330 404 +74
==========================================
+ Hits 2701 2967 +266
- Misses 304 333 +29
- Partials 102 122 +20
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.