-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Upgrade bootswatch to version 4 #1183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
{% block form_errors -%} | ||
{% if errors|length > 0 -%} | ||
{% if form is not rootform %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %} | ||
<ul class="list-unstyled"> | ||
{%- for error in errors -%} | ||
{# use font-awesome icon library #} | ||
{# use font-awesome icon library # } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to rollback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the test testAdminNewDuplicatedPost
method is failing because we no longer have form-group.has-error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was commenting to rollback the extra space on the precise line i commented on
from
{# use font-awesome icon library #}
to
{# use font-awesome icon library # }
sorry if it was unclear :s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry.
The reason why I added that extra space is when I don't do so the code after that line will not be commented
templates/base.html.twig
Outdated
@@ -3,6 +3,9 @@ | |||
common elements and decorates all the other templates. | |||
See https://symfony.com/doc/current/templates.html#template-inheritance-and-layouts | |||
#} | |||
|
|||
{% set route = app.request.get('_route') %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% set route = app.request.get('_route') %} | |
{% set _route = app.request.get('_route') %} |
what about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice one :)
Hi @noniagriconomie, I updated my code but the datetime picker initialization is still missing. |
@bechir i think i am not the person who will decide if or not to replace this lib, |
OK thanks you again. |
@bechir thanks a lot for contributing this! The proposed changes look fantastic to me! About flatpicker, yes let's use it. I'd prefer to use the browser native datetime-local input widget, but that doesn't work in Firefox yet, so let's use flatpicker. Thanks! |
templates/form/fields.html.twig
Outdated
<span class="fa fa-calendar" aria-hidden="true"></span> | ||
</span> | ||
<div class="input-group-append"> | ||
<button class="btn btn-outline-secondary"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a button without an explicit type
is a very bad idea: this makes it a submit button. and this is even worse here because this is indeed inside a form...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I replaced the button
by a span
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using a button was the right thing to do from an accessibility point of view. But it needs an explicit type=button
so that it is not a submit button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I understand. Thanks.
Thanks for your feedbacks @javiereguiluz and @stof! The problem is the date is not parsed correctly in $('[data-toggle="datetimepicker"]').flatpickr({
enableTime: true,
dateFormat: $('#post_publishedAt').data('date-format'),
allowInput: true,
parseDate: (datestr, format) => {
return moment(datestr, format, true).toDate();
},
formatDate: (date, format, locale) => {
return moment(date).format(format);
}
}); The calendar widget is shown but when I select a date nothing happen. |
@see 4a1d48b#diff-38752f070c2739871db0d206c9862337269e4d635f2e63e37e53c5a248c791bd for a resolution without moment.js which is deprecated |
Hi,
After comparing changes before and after in #1030 I said to myself It's maybe better to create remake the job with new newly updated
Symfony 5.2
(andbootswtach v5.4.3
).I know @javiereguiluz wanted to resolve the conflicts himself but you can still see the work I did here
Comparaison home
Before
After
Comparaison blog
Before
After
Comparaison show code
Before
After
Comparaison pagination
Before
After
Comparaison login
Before
After
Comparaison admin
Before
After
Comparaison edit post
Before
After
Comparaison show post
Before
After
Comparaison edit post (tags)
Before
After
Comparaison post with errors
Before
After
CHANGELOG
In packages.json
eonasdan-bootstrap-datetimepicker
dependency (This is not compatible with bootstrap 4)In scss files
$icon-font-path
we no longer need this_variables.scss
file containg our custom variablesIn javascript files
submit()
bytrigger('submit')
In twig files
well
class byjumbotron
with some changes in the default paddingslabel label-*
bybadge badge-*
pull-right
byfloat-right
I d'ont kown if it's the same but we have the same resultactive
Tests
App\Tests\Controller\Admin\BlogControllerTest::testAdminNewPost
I didn't added
datetimepicker
yet because the tempusdominus/bootstrap-4 project is getting rolled back into the orginal repo, but it's still in progress.This lib is for bootstrap 4 and it's based on the Eonasdan's Bootstrap 3 date/time picker.
But flatpickr is more powerful with zero dependencies
I didn't added it yet, I'm juste waiting for feedbacks.
Thanks for your time!