Skip to content
This repository has been archived by the owner on Jan 31, 2018. It is now read-only.

[bug 1110543] Add noscript section #423

Merged
merged 1 commit into from Dec 19, 2014
Merged

Conversation

aokoye
Copy link
Contributor

@aokoye aokoye commented Dec 17, 2014

Adding the section to both the generic_feedback.html and picker.html templates allows the message to stay displayed when the user picks a product without JavaScript being enabled.

@aokoye
Copy link
Contributor Author

aokoye commented Dec 17, 2014

I should probably add a trans tag to both file changes but let me know what you think. In the case of /feedback/templates/feedback/picker.html the could go right after the existing trans tag where as with /feedback/templates/feedback/generic_feedback.html it might be best to wrap {% trans %} around lines 47 and 50.
I'll wait to hear back before I change anything.

<!-- Noscript-->
<noscript>
<p>{{ _('JavaScript is required to leave feedback. Please enable JavaScript in your browser and refresh this page. Click <a href="https://support.mozilla.org/en-US/questions/967344">here</a> to learn how to enable JavasScript.') }}</p>
</noscript>
Copy link
Member

Choose a reason for hiding this comment

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

Instead of putting the url in the string to be translated, we use a {% trans %} block and make the url a variable. That way localizers don't have to worry about mistyping it plus we can change it later without having to re-translate strings.

Also, you want to nix the en-US part of the url. That'll get added when the user goes to that url, but it'll add the locale they want to see. If you hard-code the en-US part, then all users will go to en-US.

Copy link
Member

Choose a reason for hiding this comment

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

Having said all that, I really think if someone has disabled JavaScript, then they know how to re-enable it. Plus SUMO doesn't work well if the user has JavaScript disabled. I think for now I'm inclined to just leave out that instructive sentence.

Copy link
Member

Choose a reason for hiding this comment

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

Also, we probably want to figure out a way to make this note more prominent. Maybe add the "error" class.

@aokoye
Copy link
Contributor Author

aokoye commented Dec 18, 2014

I made the changes you suggested.

@@ -44,6 +44,12 @@
<div class="card" id="intro" data-title="{{ _('{product} feedback')|fe(product=product.display_name) }}">
<section>
<div class="ask">
<noscript class="error">
Copy link
Member

Choose a reason for hiding this comment

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

The noscript shouldn't be of class error. You should have the <p> outside the {% trans %} tags and that should have class error.

Generally, we don't want to put HTML in the strings that localizers translate because it means we can't change it without changing the string requiring them to re-translate and they sometimes do funny things with HTML which causes problems.

@aokoye
Copy link
Contributor Author

aokoye commented Dec 18, 2014

That's for letting me know about the {% trans %} stuff - I wasn't sure if <p> should have gone inside {% trans %} but now I know. I also fixed the class issue.

@@ -32,6 +32,13 @@
<p class="no-products">{{ _('No products available.') }}</p>
{% else %}
<div class="ask">
<p class="error">
Copy link
Member

Choose a reason for hiding this comment

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

I think this is missing the <noscript> start tag.

@aokoye
Copy link
Contributor Author

aokoye commented Dec 19, 2014

Thanks for catching that Will, I just fixed that and pushed a new commit.

@willkg
Copy link
Member

willkg commented Dec 19, 2014

Looks great! Squash these four commits into one and then we'll merge it.

@aokoye
Copy link
Contributor Author

aokoye commented Dec 19, 2014

I think I successfully squashed the 4 commits into 1

@willkg
Copy link
Member

willkg commented Dec 19, 2014

Awesome!

willkg added a commit that referenced this pull request Dec 19, 2014
[bug 1110543] Add noscript section
@willkg willkg merged commit 631242e into mozilla:master Dec 19, 2014
@willkg
Copy link
Member

willkg commented Dec 19, 2014

1fc67a3 [bug 1110543] Add noscript section

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants