Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Feature/batch flashmessages #657

Merged

Conversation

silasjoisten
Copy link
Contributor

@silasjoisten silasjoisten commented Jan 17, 2019

Subject

I am targeting this branch, because this is a bc.

Closes #507

Changelog

### Added
- support for many grouped flash messages

To do

  • Update the documentation
  • Translate more in all provided languages
  • Include Css File

Look & Feel

Before

bildschirmfoto 2019-01-16 um 20 01 58

After

Collapsed (default)

bildschirmfoto 2019-01-16 um 20 47 44

Expanded

bildschirmfoto 2019-01-16 um 20 47 56

{% endfor %}

<style>
Copy link
Contributor Author

@silasjoisten silasjoisten Jan 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to move this to css file (create new one)

@SonataCI
Copy link
Collaborator

Could you please rebase your PR and fix merge conflicts?

@OskarStark
Copy link
Member

Could we add a count of the messages next to the "headline"?

Attention:

{{ app.flashes('success') }}

will clear all messages on the first consume, I think you need to use app.session.flashbag.peek(....)? 🤔 but not totally sure!

position: relative;
left: calc(50% - 1rem);
}
</style>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add newline at EOF

Copy link
Contributor

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please finish your TODO list 😛

@silasjoisten
Copy link
Contributor Author

One question: I created a new flashmessage.css file... How i implement the usage of this file?

&times;
</button>
<input type="checkbox" class="read-more-state" id="toggle-more" />
<script>$(document).ready(()=> {$('#toggle-more').iCheck('destroy')})</script>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn't nice but i need to disable iCheck for this case. shall i put this in the base.js file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is needed on every page, yes, otherwise, just create a new JS file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is needed on every page but only for #toggle-more element

@silasjoisten
Copy link
Contributor Author

silasjoisten commented Jan 18, 2019

How gets the base.js loaded i dont find any includes or links... even not in AdminBundle? Do you randomly know how?

@greg0ire
Copy link
Contributor

Sorry, I don't 😅

@silasjoisten
Copy link
Contributor Author

related to sonata-project/SonataAdminBundle#5438

@silasjoisten
Copy link
Contributor Author

So is the translation in all provided languages really necessary? Because just speak 3 of them 😄


<style>
.read-more-state ~ .read-more-trigger:before {
content: "{{ 'more'|trans({}, 'SonataCoreBundle') }} \25bc";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This style needs to stay here, otherwise this cant be translated.

@OskarStark
Copy link
Member

3 languages are enough here

{% endfor %}

<style>
.read-more-state ~ .read-more-trigger:before {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this. You could also use JavaScript for this

Copy link
Contributor Author

@silasjoisten silasjoisten Jan 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay there you go 👍 i dont use jQuery for this just plain JS. Plain JS is much faster than jquery.

@OskarStark OskarStark merged commit c5dfef1 into sonata-project:3.x Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants