jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

[Feature request] cookieconsent2 plugin to the EU Cookie Law #2320

Closed davizalpe closed 8 years ago

davizalpe commented 8 years ago

Hi,

Perhaps it might be interesting to include alert users about the use of cookies on the jhipster website according to the EU Cookie Law.

I just added cookieconsent2 plugin in this branch: https://github.com/dalbelap/generator-jhipster/tree/feature-cookieconsent2

The plugin was configures below the google javascript code:

<!-- Begin Cookie Consent plugin -->
<script>
       var pagecookiepolicy = "/#/cookiepolicy";
       var message = "This website uses cookies to ensure you get the best experience on our website";
       var gotit = "Got it!";
       var learnMore = "More info";
       window.cookieconsent_options = {"message": message,
            "dismiss": gotit, "learnMore": learnMore, "link": pagecookiepolicy, "theme": "light-floating"};
</script>
<!-- End Cookie Consent plugin -->

Also it was created a new page in scripts/app/cookiepolicy/ and cookiepolicy.json for the i18n in all languages (only English, French, Galician and Spanish translated).

gzsombor commented 8 years ago

Good idea !

deepu105 commented 8 years ago

does it have an angular js version? or atleast a bower managed version? else it will be better to do this as a simple popover using ui-bootstrap we already have

atomfrede commented 8 years ago

@dalbelap Is this correct, that the message (that is not on the seperate page) is not translated?

davizalpe commented 8 years ago

@atomfrede yes, the javascript code inside index.html is not translated. @deepu105 It could be done with ui-angular boostrap modal, but I used this plugin because it is made for the cookie alerts.

In addition, coockiconsent2 is a customizable script that lets you have implicit or explicit acceptance, manage IPs that are not European and lots of other things. There is a good article (in Spanish) talking about the Cookie Law (as a developer viewpoint) here

deepu105 commented 8 years ago

@dalbelap my only concerns are below if those are addressed im ok with the plugin

  1. it needs to be bower manageable
  2. it should be bootstrap compatible
  3. it should be atleast compatible with angular without too much tweaks
  4. it should be i18n supported or compatible with angular-translate

From your sample it looks easy to write a wrapper directive to make it work with angular translate, so that leaves point 1 and 2 from above

deepu105 commented 8 years ago

@dalbelap since this is just an addition to index.html and may not be worth adding as a new option in generator(I dont think we can have it on by default as everyone might not want it) why dont you submit it as a tip in our documentation project

davizalpe commented 8 years ago

@deepu105 you are right, it's better explain this as a tip. I close this feature and will create a PR for the documentation project in the next days. Thanks a lot!

cicoub13 commented 8 years ago

Any documentation or integration in jHipster ? I couldn't find it.

deepu105 commented 8 years ago

Nothing added yet. You can add a tip or module if required

atomfrede commented 8 years ago

I looks like the perfect thing for a module. I'll see if I create one.