wcs: fix cards list css class (#56029)
This commit is contained in:
parent
7c1821ce35
commit
fe64a49258
|
@ -843,6 +843,9 @@ class WcsCardsCell(CardMixin, WcsBlurpMixin, CellBase):
|
|||
|
||||
populate_cache()
|
||||
|
||||
def card_slug(self):
|
||||
return self.carddef_reference.split(':')[1]
|
||||
|
||||
def is_visible(self, **kwargs):
|
||||
user = kwargs.get('user')
|
||||
if self.only_for_user and (not user or user.is_anonymous):
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% if cards %}
|
||||
<div class="links-list cards-{{ slug }} list-of-cards">
|
||||
<div class="links-list cards-{{ cell.card_slug }} list-of-cards">
|
||||
<ul>
|
||||
{% for data in cards %}
|
||||
<li>
|
||||
|
|
|
@ -1394,9 +1394,11 @@ def test_cards_cell_render(mock_send, context):
|
|||
result = cell.render(context)
|
||||
|
||||
context['synchronous'] = True # to get fresh content
|
||||
context['cell'] = cell
|
||||
|
||||
result = cell.render(context)
|
||||
assert '<h2>Card Model 1</h2>' in result
|
||||
assert 'cards-card_model_1' in result
|
||||
assert (
|
||||
'<a href="http://127.0.0.1:8999/backoffice/data/card_model_1/11/"><span class="card-title">aa</span></a>'
|
||||
in result
|
||||
|
|
Loading…
Reference in New Issue