WIP: misc: add cell--title class to cell titles (#74048) #36

Closed
csechet wants to merge 2 commits from wip/74048-Ajouter-la-classe-cell-title-aux into main
11 changed files with 13 additions and 13 deletions

View File

@ -2,7 +2,7 @@
{% block cell-content %}
{% if cell.title %}
<h2>
<h2 class="cell--title">
<span>{{cell.title}}</span>
{% if calendar %}
<span class="calinfo">

View File

@ -1,7 +1,7 @@
{% load i18n %}
{% block cell-content %}
<h2>{{ cell.title }}</h2>
<h2 class="cell--title">{{ cell.title }}</h2>
<div>
{% if form.fields %}

View File

@ -1,5 +1,5 @@
{% load i18n %}
{% if cell.title %}<h2>{{cell.title}}</h2>{% endif %}
{% if cell.title %}<h2 class="cell--title">{{cell.title}}</h2>{% endif %}
{% if cell.chart_type == "table" or cell.chart_type == "table-inverted" %}
<div id="chart-{{cell.id}}" class="dataviz-table"></div>
<script>

View File

@ -2,7 +2,7 @@
{% block cell-content %}
{% if cell.title %}
<h2>{{ cell.title }}</h2>
<h2 class="cell--title">{{ cell.title }}</h2>
{% endif %}
<div class="gallery" id="gallery-{{cell.id}}">
{% for image in cell.image_set.all %}

View File

@ -1,7 +1,7 @@
{% load i18n %}
{% block cell-content %}
{% if cell.title %}
<h2>{{ cell.title }}</h2>
<h2 class="cell--title">{{ cell.title }}</h2>
{% endif %}
{% block search-form-pre %}

View File

@ -1,7 +1,7 @@
{% load i18n %}
{% block cell-content %}
{% if cell.title %}
<h2>{{ cell.title }}</h2>
<h2 class="cell--title">{{ cell.title }}</h2>
{% endif %}
{% include "combo/asset_picture_fragment.html" %}
<div class="feed-content">

View File

@ -1,5 +1,5 @@
{% block cell-content %}
{% if title %}<h2>{{title}}</h2>{% endif %}
{% if title %}<h2 class="cell--title">{{title}}</h2>{% endif %}
{% include "combo/asset_picture_fragment.html" %}
<!--
{{json}}

View File

@ -2,7 +2,7 @@
{% block cell-content %}
{% spaceless %}
{% block cell-header %}
{% if title %}<h2>{{ title }}</h2>{% endif %}
{% if title %}<h2 class="cell--title">{{ title }}</h2>{% endif %}
{% include "combo/asset_picture_fragment.html" %}
{% endblock cell-header %}
<div class="links-list">

View File

@ -15,7 +15,7 @@
{% with cell|extra_context:request as extra_context %}
{% if extra_context %}data-extra-context="{{ extra_context|signed|urlencode }}"{% endif %}
{% endwith %}
><div>{% render_cell cell %}</div></div>
><div class="cell--body">{% render_cell cell %}</div></div>
{% if cell.include_pagination %}
{% include "combo/pagination.html" with paginate_by=cell.limit data_cell_reference=cell.get_reference %}
{% endif %}

View File

@ -1255,7 +1255,7 @@ def test_page_extra_variables(app):
with mock.patch('combo.utils.requests.get') as requests_get:
requests_get.return_value = mock.Mock(content='{}', status_code=200)
resp = app.get('/page/')
assert '<div>XXbarYY42ZZAABBCC</div>' in resp
assert '<div class="cell--body">XXbarYY42ZZAABBCC</div>' in resp
with mock.patch('combo.utils.requests.get') as requests_get:
requests_get.return_value = mock.Mock(content='{}', status_code=200)
@ -1275,14 +1275,14 @@ def test_page_extra_variables(app):
with mock.patch('combo.utils.requests.get') as requests_get:
requests_get.return_value = mock.Mock(content='{}', status_code=200)
resp = app.get('/page/baz/')
assert '<div>XXbarYY42ZZbazAA</div>' in resp
assert '<div class="cell--body">XXbarYY42ZZbazAA</div>' in resp
page.sub_slug = '(?P<foo>[a-z]+)'
page.save()
with mock.patch('combo.utils.requests.get') as requests_get:
requests_get.return_value = mock.Mock(content='{}', status_code=200)
resp = app.get('/page/baz/')
assert '<div>XXbarYY42ZZAA</div>' in resp
assert '<div class="cell--body">XXbarYY42ZZAA</div>' in resp
def test_cell_slugs(app):

View File

@ -92,7 +92,7 @@ def test_search_cell(settings, app):
cell.title = 'Custom Title'
context = {'request': RequestFactory().get('/?q_var_name=searchme')}
resp = cell.render(context)
assert '<h2>Custom Title</h2>' in resp
assert '<h2 class="cell--title">Custom Title</h2>' in resp
assert "$input.val('searchme');" in resp
with mock.patch('combo.apps.search.models.requests.get') as requests_get: