Projet

Général

Profil

0002-manager-mention-on-home-page-if-a-page-is-in-menu-51.patch

Lauréline Guérin, 01 mars 2021 15:12

Télécharger (2,56 ko)

Voir les différences:

Subject: [PATCH 2/2] manager: mention on home page if a page is in menu
 (#51477)

 combo/manager/static/css/combo.manager.css      |  6 ++++++
 combo/manager/templates/combo/manager_home.html |  1 +
 tests/test_manager.py                           | 13 +++++++++++++
 3 files changed, 20 insertions(+)
combo/manager/static/css/combo.manager.css
105 105
ul.list-of-links span.invalid,
106 106
div.cell h3 span.visibility-summary,
107 107
div.page span.additional-label,
108
div.page span.in-menu,
108 109
div.page span.visibility-summary {
109 110
	font-size: 80%;
110 111
	padding-left: 1em;
......
135 136
	max-width: 30%;
136 137
}
137 138

  
139
div.page span.in-menu::before {
140
	content: "\f0c9"; /* fa-bars */
141
	font-family: FontAwesome;
142
}
143

  
138 144
div.cell h3 span.invalid,
139 145
ul.list-of-links span.invalid {
140 146
    color: #df2240;
combo/manager/templates/combo/manager_home.html
45 45
    </span>
46 46
    {% endif %}
47 47
    {% if page.redirect_url %}<span class="additional-label">({% trans "redirection" %})</span>{% endif %}
48
    {% if not page.exclude_from_navigation %}<span class="in-menu" title="{% trans "Included in menu" %}"></span>{% endif %}
48 49
    {% if collapse_pages %}<span class="togglable"></span>{% endif %}
49 50
 </div>
50 51
 {% endfor %}
tests/test_manager.py
99 99
    assert '(redirection)' in resp
100 100

  
101 101

  
102
def test_pages_in_menu(app, admin_user):
103
    page = Page.objects.create(title='One', slug='one')
104

  
105
    app = login(app)
106
    resp = app.get('/manage/')
107
    assert 'in-menu' not in resp
108

  
109
    page.exclude_from_navigation = False
110
    page.save()
111
    resp = app.get('/manage/')
112
    assert 'in-menu' in resp
113

  
114

  
102 115
def test_add_page(app, admin_user):
103 116
    app = login(app)
104 117
    resp = app.get('/manage/', status=200)
105
-