CodeMontageHQ/codemontage

Show Description Character Limit on Project Submission Page

Opened this issue · 9 comments

Description
On the project submission page at https://www.codemontage.com/organizations/new, there's a 255-character limit for the Description that is not reflected to the user at all.

codemontage

Ask
Enforce this length limitation on the frontend so that users get feedback if their descriptions are too long rather than triggering an unseeable database error.

To Do
There are a number of ways to go about doing this. Pick at least one of the following, and we should be good to go.

  • Set a hard html limit on the input.
  • Add a length validation on the Project model.
  • Use the ClientSideValidations gem to set a validation in the frontend.
  • Add a dynamically-updated counter (e.g. 175/255).

Hello @DBNess ,

I was wondering what exactly you were looking for. Do you want to just show the character limit, or do you want to be able to keep count of your character and compare to limit? aka: 175 / 255

Also do you want to add an html limit to the input field so that no more that 255 characters are able to be to entered in the input field?

Thanks :)

Thanks for asking, @thefenry! I'll defer to @bmartinstudio and @courte on the specifics here, but wanted to point out there's already some support for this in Zurb Foundation, which is installed, and it might make sense to check out Abide framework for mobile-friendly best practices http://foundation.zurb.com/docs/components/abide.html

Alright, I will wait for @bmartinstudio or @courte for more of the info. Thanks for the foundation link I will make use of it when I hear from them.

Hey, @thefenry, thanks for asking! Sorry for the long delay.

  • Frontend-wise, a hard html limit will get the job done, but I would love to pair that with the optimal UX of the counter you suggested (175/255).
  • On the back end, adding a validation to the project model so an error could be raised above the database level would also be a helpful way to go.

So those are three separate steps to closing this issue. I know it's been a while since your last comment, @thefenry. Let us know if there's a part of this you'd like to take on. Thank you again!

Yeah I think I can manage these tasks. I will try to get this in the next day or so.

I am sorry I have been busy at work and moving. I tried getting this done the other day and I am having a hard time modifying the simple-fields. I cannot figure out how to add a html element after the label and before the input. I read some of the documentation but none of the solutions where working for me. I managed to do it through jquery but it is not very efficient since it does not load this until it finishes loading the page. Any suggestions would be appreciated. Or If anyone would like to take over it let me know.

@thefenry - Congrats on the move! I hope you're settled in now.

I appreciate you taking this issue on. If the jQuery option is working - however inefficient - it would be great if you could submit it as a PR. If it doesn't work, then maybe just changing the placeholder would be be a clear marker. Any small step forward is really helpful to us.

Thanks again for taking the time! 😄 🎉

Hi @thefenry , I know it's been a few months so I'd like to take over if you don't mind :) 🐫🐩

@DBNess or @courte , I have a solve for the character limit by using a :maxlength attribute. As for the other aspects of the issue, they will take me a little longer (to learn the codebase and Ruby!) Should I do each of these in separate pull requests?

  • Set a hard html limit on the input. (<-- the one I have ready)
  • Add a length validation on the Project model.
  • Use the ClientSideValidations gem to set a validation in the frontend.
  • Add a dynamically-updated counter (e.g. 175/255).

@laramelniker Yeah definetly go for it. I have been busy with other projects and forgot about this one.