Skip to content

Commit 702c33e

Browse files
WIP get compatible with bootstrap5
js not working yet
1 parent 8f1996c commit 702c33e

23 files changed

+183
-184
lines changed

src/Form/SharableSearchType.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
7272
])
7373
->add('disabled', CheckboxType::class, [
7474
// phpcs:ignore Generic.Files.LineLength.TooLong
75-
'label' => new TranslatableMessage('disabled <span class="badge badge-danger"><i class="fas fa-ban"></i></span>'),
75+
'label' => new TranslatableMessage('disabled <span class="badge bg-danger"><i class="fas fa-ban"></i></span>'),
7676
'label_html' => true,
7777
'help' => 'Show disabled sharables',
7878
'required' => false,

src/Form/UserSearchType.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
5151
])
5252
->add('disabled', CheckboxType::class, [
5353
// phpcs:ignore Generic.Files.LineLength.TooLong
54-
'label' => new TranslatableMessage('disabled <span class="badge badge-danger"><i class="fas fa-ban"></i></span>'),
54+
'label' => new TranslatableMessage('disabled <span class="badge bg-danger"><i class="fas fa-ban"></i></span>'),
5555
'label_html' => true,
5656
'help' => 'Show disabled user',
5757
'required' => false,

templates/base.html.twig

+121-122
Large diffs are not rendered by default.

templates/home/index.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<div class="col">
5252
{% for manage in app.user.getUnconfirmedManages|reverse %}
5353
<div class="alert border border-primary">
54-
<a class="btn btn-primary mr-1" href="{{ path('sharable_show', {id: manage.sharable.id}) }}">
54+
<a class="btn btn-primary me-1" href="{{ path('sharable_show', {id: manage.sharable.id}) }}">
5555
<i class="fas fa-user-plus"></i>
5656
</a>
5757
{{ 'You\'ve been invited to manage'|trans }} {{ sharableMacro.render(manage.sharable) }}.

templates/macros/contact_method.html.twig

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{% macro render(method) %}
22

33
{% if method == 1 %}
4-
<span class="badge badge-secondary" title="No need to contact">
4+
<span class="badge bg-secondary" title="No need to contact">
55
<i class="fas fa-lock-open"></i>
66
</span>
77
{% elseif method == 2 %}
8-
<span class="badge badge-secondary" title="Automatic contact exchange">
8+
<span class="badge bg-secondary" title="Automatic contact exchange">
99
<i class="fas fa-bolt"></i>
1010
</span>
1111
{% elseif method == 3 %}
12-
<span class="badge badge-secondary" title="Manual contact exchange">
12+
<span class="badge bg-secondary" title="Manual contact exchange">
1313
<i class="fas fa-stamp"></i>
1414
</span>
1515
{% elseif method == 4 %}
16-
<span class="badge badge-secondary" title="Only managers can access your contact infos">
16+
<span class="badge bg-secondary" title="Only managers can access your contact infos">
1717
<i class="fas fa-lock"></i>
1818
</span>
1919
{% else %}

templates/macros/requirement.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<li class="list-group-item{{ filled ? ' list-group-item-success' : ' text-danger' }}">
55
{{ filled ? '<i class="far fa-check-square"></i>' : '<i class="far fa-square"></i>' }}
6-
{{ 'share score'|trans|capitalize }} : <span class="badge badge-light">{{ userClass.shareScoreReq }}</span>
6+
{{ 'share score'|trans|capitalize }} : <span class="badge bg-light">{{ userClass.shareScoreReq }}</span>
77
</li>
88

99
{% endmacro %}

templates/macros/sharable.html.twig

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
{{ contact_method.render(sharable.interestedMethod) }}
99

1010
{% if sharable.disabled or not sharable.isAccessible %}
11-
<span class="badge badge-danger" title="This sharable is disabled">
11+
<span class="badge bg-danger" title="This sharable is disabled">
1212
<i class="fas fa-ban"></i>
1313
</span>
1414
{% endif %}
1515
{% if sharable.interesteds|length > 0 %}
16-
<span title="{{ sharable.interesteds|length }} users are insterested in this sharable" class="badge badge-warning">
16+
<span title="{{ sharable.interesteds|length }} users are insterested in this sharable" class="badge bg-warning">
1717
{{ sharable.interesteds|length }}
1818
<i class="fas fa-question-circle"></i>
1919
</span>
2020
{% endif %}
2121
{% if sharable.validations|length > 0 %}
22-
<span title="{{ sharable.validations|length }} users have validated this sharable" class="badge badge-success">
22+
<span title="{{ sharable.validations|length }} users have validated this sharable" class="badge bg-success">
2323
{{ sharable.validations|length }}
2424
<i class="fas fa-check-circle"></i></span>
2525
{% endif %}

templates/macros/user.html.twig

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
{{ user.username }}
99
</a>
1010
{% if size >= 2 %}
11-
<a class="badge badge-primary" href="{{ path('userclass_show', {id: user.userClass.id}) }}">
11+
<a class="badge bg-primary" href="{{ path('userclass_show', {id: user.userClass.id}) }}">
1212
{{ user.userClass.name }}
1313
</a>
14-
<span class="badge badge-light">{{ user.shareScore }}</span>
14+
<span class="badge bg-light">{{ user.shareScore }}</span>
1515
{% if user.isDisabled %}
16-
<span class="badge badge-danger" title="This user is disabled"><i class="fas fa-ban"></i></span>
16+
<span class="badge bg-danger" title="This user is disabled"><i class="fas fa-ban"></i></span>
1717
{% endif %}
1818
{% endif %}
1919
{% else %}

templates/manage/index.html.twig

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@
5050

5151
{{ userMacro.render(manage.user) }}
5252
{% if not manage.confirmed %}
53-
<span class="badge badge-warning">{{ 'invited'|trans }}</span>
53+
<span class="badge bg-warning">{{ 'invited'|trans }}</span>
5454
{% endif %}
5555
{% if manage.anonymous %}
56-
<span class="badge badge-dark border">
56+
<span class="badge bg-dark border">
5757
<i class="fas fa-mask"></i>
5858
{{ 'anonymous'|trans }}
5959
</span>
6060
{% endif %}
61-
<span class="ml-auto"><small>{{ 'added'|trans }} {{ manage.createdAt|ago }}</small></span>
61+
<span class="ms-auto"><small>{{ 'added'|trans }} {{ manage.createdAt|ago }}</small></span>
6262

6363
</li>
6464
{% endfor %}

templates/question/index.html.twig

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747
{% if is_granted('answer', question) %}
4848
<a href="{{ path('question_show', {id: question.id}) }}" class="btn btn-primary">
4949
{{ 'answer it'|trans }} !
50-
<span class="badge badge-secondary">
50+
<span class="badge bg-secondary">
5151
{{ question.answers|length }}
5252
</span>
5353
</a>
5454
{% else %}
5555
<a href="{{ path('question_show', {id: question.id}) }}" class="btn btn-light">
5656
{{ 'answers'|trans }}
57-
<span class="badge badge-secondary">
57+
<span class="badge bg-secondary">
5858
{{ question.answers|length }}
5959
</span>
6060
</a>

templates/security/login.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</div>
1515
{% endif %}
1616

17-
<h1 class="h3 mb-3 font-weight-normal">{{ 'please sign in'|trans|capitalize }}</h1>
17+
<h1 class="h3 mb-3 fw-normal">{{ 'please sign in'|trans|capitalize }}</h1>
1818
<label for="inputUsername">{{ 'username'|trans|capitalize }}</label>
1919
<input type="text" value="{{ last_username }}" name="username" id="inputUsername" class="form-control" required autofocus>
2020
<label for="inputPassword">{{ 'password'|trans|capitalize }}</label>

templates/sharable/contact.html.twig

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@
9898
{% if is_granted('edit', sharable) %}
9999
<span>
100100
{% if manage.contactable and not manage.user.disabled %}
101-
<span class="badge badge-success" >
101+
<span class="badge bg-success" >
102102
<i class="fas fa-eye"></i>
103103
{{ 'visible'|trans }}
104104
</span>
105105
{% else %}
106-
<span class="badge badge-danger" >
106+
<span class="badge bg-danger" >
107107
<i class="fas fa-eye-slash"></i>
108108
{{ 'hidden'|trans }}
109109
</span>
@@ -134,7 +134,7 @@
134134
<li>
135135
{{ content_by_type.render(userContact.type, userContact.content) }}
136136
{% if userContact.info %}
137-
<span class="badge badge-light">{{ 'info'|trans }}</span>
137+
<span class="badge bg-light">{{ 'info'|trans }}</span>
138138
{% endif %}
139139
</li>
140140
{% endfor %}

templates/sharable/form.html.twig

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
<p>
2424
{{ 'By default, sharables are visible by those user classes:'|trans }}
2525
{% for userClass in canAccessUserClass %}
26-
<span class="badge badge-primary">{{ userClass.name }}</span>
26+
<span class="badge bg-primary">{{ userClass.name }}</span>
2727
{% endfor %}
2828
</p>
2929
{% if not app.user.userClass.canSetVisibleBy %}
3030
<div class="alert alert-secondary">
31-
{{ 'Beccause of your user class'|trans }} <span class="badge badge-primary">{{ app.user.userClass.name }}</span>,
31+
{{ 'Beccause of your user class'|trans }} <span class="badge bg-primary">{{ app.user.userClass.name }}</span>,
3232
{{ 'you cannot change this setting'|trans }}.
3333
</div>
3434
{% endif %}

templates/sharable/index.html.twig

+9-9
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@
6363
{{ 'that interest'|trans }} {{ userMacro.render(search.interestedBy, 1) }}
6464
{% endif %}
6565
{% if search.visibleBy %}
66-
{{ 'visible by'|trans }} <a href="{{ path('userclass_show', {id: search.visibleBy.id}) }}" class="badge badge-primary">{{ search.visibleBy }}</a>
66+
{{ 'visible by'|trans }} <a href="{{ path('userclass_show', {id: search.visibleBy.id}) }}" class="badge bg-primary">{{ search.visibleBy }}</a>
6767
{% endif %}
6868
{% if search.disabled %}
69-
{{ 'including'|trans }} <span class="badge badge-danger"><i class="fas fa-ban"></i> {{ 'disabled'|trans }}</span>
69+
{{ 'including'|trans }} <span class="badge bg-danger"><i class="fas fa-ban"></i> {{ 'disabled'|trans }}</span>
7070
{% endif %}
7171
</div>
7272

7373
{% if not app.user.userclass.access %}
7474
<div class="alert alert-warning">
7575
{{ 'Your user class:'|trans }}
76-
<a class="badge badge-primary" href="{{ path('userclass_show', {id: app.user.userClass.id}) }}">
76+
<a class="badge bg-primary" href="{{ path('userclass_show', {id: app.user.userClass.id}) }}">
7777
{{ app.user.userClass.name }}
7878
</a>
7979
{{ 'cannot access sharable'|trans }}.
@@ -128,29 +128,29 @@
128128
{{ contact_method.render(sharable.interestedMethod) }}
129129

130130
{% if sharable.interesteds|length > 0 %}
131-
<span title="{{ sharable.interesteds|length }} user(s) are insterested in this sharable" class="badge badge-warning">
131+
<span title="{{ sharable.interesteds|length }} user(s) are insterested in this sharable" class="badge bg-warning">
132132
{{ sharable.interesteds|length }}
133133
<i class="fas fa-question-circle"></i>
134134
</span>
135135
{% endif %}
136136
{% if sharable.validations|length > 0 %}
137-
<span title="{{ sharable.validations|length }} user(s) have validated this sharable" class="badge badge-success">
137+
<span title="{{ sharable.validations|length }} user(s) have validated this sharable" class="badge bg-success">
138138
{{ sharable.validations|length }}
139139
<i class="fas fa-check-circle"></i></span>
140140
{% endif %}
141141
{% if sharable.questions|length > 0 %}
142-
<span class="badge badge-light">
142+
<span class="badge bg-light">
143143
{{ sharable.questions|length }}
144144
<i class="fas fa-comment"></i>
145145
</span>
146146
{% endif %}
147147
{% if sharable.visibleBy %}
148-
<span title="accessible from {{ sharable.visibleBy.name }}" class="badge badge-primary">
148+
<span title="accessible from {{ sharable.visibleBy.name }}" class="badge bg-primary">
149149
≥ {{ sharable.visibleBy.name }}
150150
</span>
151151
{% endif %}
152152
{% if sharable.disabled or not sharable.isAccessible %}
153-
<span class="badge badge-danger" title="This sharable is disabled"><i class="fas fa-ban"></i></span>
153+
<span class="badge bg-danger" title="This sharable is disabled"><i class="fas fa-ban"></i></span>
154154
{% endif %}
155155
{% if sharable.reports|length > 0 and is_granted('view_reports', sharable) %}
156156
<span
@@ -225,7 +225,7 @@
225225
{{ sharable.description }}
226226
</span>
227227
{% for tag in sharable.tags %}
228-
<a class="badge badge-pill badge-secondary" href="{{ path('sharable', {'tags[]': tag.id}) }}">{{ tag.name }}</a>
228+
<a class="badge rounded-pill bg-secondary" href="{{ path('sharable', {'tags[]': tag.id}) }}">{{ tag.name }}</a>
229229
{% endfor %}
230230
</br>
231231
{{ 'managed by'|trans|capitalize }}

templates/sharable/show.html.twig

+9-9
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,21 @@
9595
<i class="fas fa-bookmark"></i>
9696
{{ 'unbookmark'|trans }}
9797
{% endif %}
98-
<span class="badge badge-secondary">
98+
<span class="badge bg-secondary">
9999
{{ sharable.bookmarks|length }}
100100
</span>
101101
</a>
102102
</h1>
103103

104104
{% for tag in sharable.tags %}
105-
<a class="badge badge-pill badge-secondary" href="{{ path('sharable', {'tags[]': tag.id}) }}">{{ tag.name }}</a>
105+
<a class="badge rounded-pill bg-secondary" href="{{ path('sharable', {'tags[]': tag.id}) }}">{{ tag.name }}</a>
106106
{% endfor %}
107107

108108
<p class="text-break">{{ sharable.description }}</p>
109109

110110
{% if not manage %}
111111
<div>
112-
<div class="btn-group mr-3">
112+
<div class="btn-group me-3">
113113
{% if not is_granted('interest', sharable) %}
114114
<span tabindex="0" data-toggle="tooltip" title="
115115
{% if interested %}
@@ -131,7 +131,7 @@
131131
>
132132
<i class="{{ interested ? 'fas' : 'far' }} fa-question-circle"></i>
133133
{{ 'I\'m interested'|trans|capitalize }}
134-
<span class="badge badge-secondary">
134+
<span class="badge bg-secondary">
135135
{{ sharable.interesteds|length }}
136136
</span>
137137
</a>
@@ -173,7 +173,7 @@
173173
>
174174
<i class="{{ validated ? 'fas' : 'far' }} fa-check-circle"></i>
175175
{{ 'validate'|trans }}
176-
<span class="badge badge-secondary">
176+
<span class="badge bg-secondary">
177177
{{ sharable.validations|length }}
178178
</span>
179179
</a>
@@ -189,7 +189,7 @@
189189
{% if is_granted('view_reports', sharable) %}
190190
<a class="btn btn-primary" href="{{ path('sharable_report_index', {id: sharable.id}) }}">
191191
reports
192-
<span class="badge badge-secondary">{{ sharable.reports|length }}</span>
192+
<span class="badge bg-secondary">{{ sharable.reports|length }}</span>
193193
</a>
194194
{% endif %}
195195
</div>
@@ -254,7 +254,7 @@
254254
>
255255
<i class="fas fa-eye"></i>
256256
{{ 'view interested'|trans }}
257-
<span class="badge badge-secondary">
257+
<span class="badge bg-secondary">
258258
{{ sharable.interesteds|length }}
259259
</span>
260260
</a>
@@ -265,7 +265,7 @@
265265
<li class="list-group-item">
266266
<i class="fas fa-eye"></i>
267267
{{ 'visible by'|trans|capitalize }}
268-
<a href="{{ path('userclass_show', {id: sharable.visibleBy.id}) }}" class="badge badge-primary">
268+
<a href="{{ path('userclass_show', {id: sharable.visibleBy.id}) }}" class="badge bg-primary">
269269
{{ sharable.visibleBy.name }}
270270
</a>
271271
</li>
@@ -518,7 +518,7 @@
518518

519519
<p>
520520
{% if validation.picture %}
521-
<img class="rounded float-left m-2" src="{{ asset(validation.getPicturePath)|imagine_filter('validation_250') }}" alt="">
521+
<img class="rounded float-start m-2" src="{{ asset(validation.getPicturePath)|imagine_filter('validation_250') }}" alt="">
522522
{% endif %}
523523

524524
{{ validation.message }}

templates/tag/index.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{% for tag in tags %}
2727
<tr>
2828
<td>
29-
<a class="badge badge-pill badge-secondary" href="{{ path('sharable', {'tags[]': tag.id}) }}">{{ tag.name }}</a>
29+
<a class="badge rounded-pill bg-secondary" href="{{ path('sharable', {'tags[]': tag.id}) }}">{{ tag.name }}</a>
3030
</td>
3131
<td class="text-muted">
3232
{{ 'created'|trans }} {{ tag.createdAt|ago }}

templates/user/edit.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<div class="alert alert-secondary">
2828
{{ 'Maximum paranoïa level is defined by your current user class:'|trans }}
29-
<span class="badge badge-primary">{{ app.user.userClass.name }}</span>
29+
<span class="badge bg-primary">{{ app.user.userClass.name }}</span>
3030
</div>
3131

3232

0 commit comments

Comments
 (0)