Corrections to proposal help text
Checklist
- [x] I have read the Contribution & Best practices Guide.
- [x] My branch is up-to-date with the upstream
masterbranch. - [x] The tests pass locally with my changes.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added necessary documentation (if appropriate).
Short description of what this resolves
Three interconnected issues related to help text on the proposal form:
-
The proposal form ignores the length requirements of event types. It always displays a hard-coded value:
Abstracts must be between 0 and 250 words.
-
The static proposal form contains unevaluated view code:
You have used = @event.abstract_word_count words.
-
#3138 introduced a JavaScript error on pages that don’t contain the proposal form:
Uncaught TypeError: text is undefined at word_count (app/assets/javascripts/osem.js:134)
Changes proposed in this pull request
-
Restore the length requirement data accidentally lost in #2914.
-
Correct the malformed Haml.
-
The purpose of the code that triggers the error is to immediately overwrite server-rendered content on the client. Ideally the server should just render the correct content in the first place. So do that, and remove the now unnecessary client side render.
How do I run this locally? What JSHint configuration is it using?
How do I run this locally?
I don't think Codacy supports this.
What JSHint configuration is it using?
The one setup in the tool. If you login there you can enabled/disabled hints. We can also carry a .jshintrc in the repo and Codacy would pick it up.