Skip to content

Conversation

@garinm90
Copy link

Are you sure?-Prompts #280

Add are you sure jQuery plugin.
Load this plugin on form pages. Add classes to inputs that dynamically create new forms to be monitored.

@coveralls
Copy link

coveralls commented Mar 11, 2021

Coverage Status

Coverage increased (+0.2%) to 88.542% when pulling abcb27b on garinm90:280-areyousure into 7d04d32 on ephios-dev:main.

Copy link
Member

@felixrindt felixrindt left a comment

Choose a reason for hiding this comment

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

Welcome to the project :)

Copy link
Member

@felixrindt felixrindt left a comment

Choose a reason for hiding this comment

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

@garinm90 Nice! Using the plugin is was very simple! Only thing on my mind now is internationalization. How do we get an e.g. german translation into the alert?

}).on("formAdded", "div", function (event) {
handleForms($(event.target));
});
$('form').trigger('reinitialize.areYouSure');
Copy link
Member

Choose a reason for hiding this comment

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

I moved this line up here, as this function is used for all dynamically added inputs and it now also fully works in the shift edit view when changing the signup method (which was done using a select and some view-specific JS).

@jeriox jeriox linked an issue Mar 14, 2021 that may be closed by this pull request
@garinm90
Copy link
Author

@garinm90 Nice! Using the plugin is was very simple! Only thing on my mind now is internationalization. How do we get an e.g. german translation into the alert?

After doing some digging looks like Django offers a solution for this.
https://docs.djangoproject.com/en/3.1/topics/i18n/translation/#internationalization-in-javascript-code

I'll look into adding this so future JavaScript modules will also have access to these translations!

@felixrindt
Copy link
Member

By the way, we are already using jsi18n...

@felixrindt felixrindt added the [C] feature New feature or request label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[C] feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Are you sure?-Prompts

3 participants