Skip to content
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

[JRO] Add empty partials before/after post textarea #293

Closed
wants to merge 5 commits into from

Conversation

jayroh
Copy link
Member

@jayroh jayroh commented May 11, 2016

These two partials are merely for theming/overriding/extensibility for
anyone who would like to add some functionality around the common posts
textarea form element. Use cases for this include:

Adding some sort of wysiwyg js boilerplate, adding buttons, links, or
instructions for what markdown/bbcode is supported.

NOTE: This is an initial step before implementing a more robust view
customization API for thredded.

<%= form.text_area :content, { rows: 5, required: true } %>
<%= render 'thredded/posts/after_content_field', form: form %>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would say this should be just "after_content" (not "after_content_field"), since it's not a given that a field will be rendered there, and that this should be documented, but since this is an interim solution, LGTM anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

I like your reasoning for the name - great point. And thanks for the
reminder on the documentation part. I got lost bouncing around branches
fixing rubocop stuff and forgot to take care of that part :)

On Wednesday, May 11, 2016, Gleb Mazovetskiy notifications@github.com
wrote:

In app/views/thredded/posts/_content_field.html.erb
#293 (comment):

<%= form.text_area :content, { rows: 5, required: true } %>

  • <%= render 'thredded/posts/after_content_field', form: form %>

I would say this should be just "after_content" (not
"after_content_field"), since it's not a given that a field will be
rendered there, and that this should be documented, but since this is an
interim solution, LGTM anyway.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/thredded/thredded/pull/293/files/ae6aeabaca82e4d42d68e7d24799e35adab1ecf4#r62884576

Copy link
Member Author

@jayroh jayroh May 11, 2016

Choose a reason for hiding this comment

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

@glebm thinking about this a little more. What do you think about [before|after]_textarea for these partials instead? Because [before|after]_content could be misconstrued as being, literally, before and after a post's contents.

Plus there's only one textarea across this whole codebase, I think.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe posts/form/before_content?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's sufficient - surely.

@jayroh
Copy link
Member Author

jayroh commented May 12, 2016

@glebm renamed the two new partials and moved the content field partial to the same path so that things are reliably grouped. What do you think?

@glebm
Copy link
Collaborator

glebm commented May 12, 2016

👍

These two partials are merely for theming/overriding/extensibility for
anyone who would like to add some functionality around the common posts
textarea form element. Use cases for this include:

Adding some sort of wysiwyg js boilerplate, adding buttons, links, or
instructions for what markdown/bbcode is supported.

NOTE: This is an initial step before implementing a more robust view
customization API for thredded.
If we have a before and after form content partial, shouldn't they live
alongside the actual form content partial? I would say that, yes, we
should. This commit creates the common form subdirectory and moves these
three partials in there, and renames the before and after.

Higher level view partials pointing to these three have been updated to
accommodate them.
@jayroh jayroh force-pushed the jro-textarea-before-after branch from f369d80 to 45f5ec7 Compare May 12, 2016 19:11
@jayroh jayroh closed this May 12, 2016
@jayroh jayroh deleted the jro-textarea-before-after branch May 12, 2016 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants