-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/core#1613 Change event registration button text based on if there are additional participants #20251
dev/core#1613 Change event registration button text based on if there are additional participants #20251
Conversation
(Standard links)
|
function additionalParticipantsChange() { | ||
toggleAdditionalParticipants(); | ||
allowParticipant(); | ||
} | ||
|
||
function toggleAdditionalParticipants() { | ||
var submit_button = cj("#crm-submit-buttons > button").html(); | ||
{/literal} | ||
var review_translated = '{ts}Review{/ts}'; | ||
var continue_translated = '{ts}Continue{/ts}'; | ||
{literal} | ||
if (cj('#additional_participants').val()) { | ||
cj("#additionalParticipantsDescription").show(); | ||
cj("#crm-submit-buttons > button").html(submit_button.replace(review_translated, continue_translated)); | ||
} else { | ||
cj("#additionalParticipantsDescription").hide(); | ||
cj("#crm-submit-buttons > button").html(submit_button.replace(continue_translated, review_translated)); | ||
} | ||
} | ||
|
||
window.onload = function() { | ||
toggleAdditionalParticipants(); | ||
}; |
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.
Not your fault, but the javascript style in this .tpl
file is horribly outdated. You don't have to clean up the existing code (although if you feel inspired to do so, by all means open another PR for that) but please use the new style for new code.
- Enclose your code with
CRM.$(function($) {...});
to avoid creating global functions. - Use
$
instead of the deprecatedcj
within the closure. - Keep the whole thing literal, only break out of literal within an actual string and use escaping, e.g. `var review_translated = '{/literal}{ts escape="js"}Review{/ts}{literal}';
- You don't need to use
window.onload
as the closure automatically waits for$(document).ready()
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.
Better late than never here, but this is now done. Thanks.
Thanks for this PR. I think it's great to solve this problem. |
ef1208e
to
5ba4725
Compare
@larssandergreen Can you please make a small fix in the text inside the description div? |
…l participants cleanup fix typo in description
5ba4725
to
f347129
Compare
@in2part Thanks for the catch, fixed. |
test this please |
@colemanw or @totten or @eileenmcnaughton can one of you merge this PR? We think it is ready to be merged. Btw. the review request has also been resolved. |
Overview
Submit buttons label for event registrations can be confusing. Discussion here. This PR simplifies the button label and switches it depending on user selection of additional participants.
Before
If additional participants are allowed or confirmation is required for an event registration, the button to go to the next page is labelled "Review your registration". This is not correct in the case where the user selected additional participants, as the next page is the additional participants page, not the review page.
After
If additional participants are allowed or confirmation is required, the button to go to the next page is simply labelled "Review". If the user selects additional participants, the button text is changed to "Continue". This is consistent with the additional participants page, where the button to go to the next page is labelled "Continue" as well.
Comments
This works, but it does seem a little hacky especially when it comes to translations. If this is just a bad idea, I'm happy to be told that!
See also the pending PR that this is added on top of.
Changes one translation string.