-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use <button type=submit> instead of <input> #29
Conversation
This allows the submit buttons to be styled with icons as well as text.
@incuna/backend please review |
|
||
inputs = BeautifulSoup(rendered_form, 'html.parser').findAll('input') | ||
|
||
has_submit = any(filter(lambda i: i.get('type') == 'submit', inputs)) |
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.
I think I prefer:
has_submit = any(i for i in inputs if i.get('type') == 'submit')
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.
👍
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.
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.
There's multiple tests you have the same expression in. 😉
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.
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.
Rebased -- a097492
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.
You know -- I'm probably going a little whitespace-crazy on this. I'm going to go cull a load of them. |
@@ -22,7 +22,7 @@ def build_helper(self): | |||
helper.layout = Layout( | |||
'body', | |||
FormActions( | |||
Submit('comment-submit', 'Post comment'), | |||
StrictButton('Post comment', type='submit'), |
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.
Should 'Post comment'
be translatable?
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.
^ This, same with the other strings in this file.
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.
Yes it should -- but that's one for another PR, I think, as there will surely be other places that need fixing too
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.
fair :)
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.
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.
Thanks!
I've refactored the tests to remove a little boilerplate -- sorry, it seems to have clobbered some comments |
Updated |
Needs master, otherwise LGTM, sorry! :) |
Unreleased | ||
---------- | ||
|
||
* Use html `buttons` instead of `inputs` for form submission. |
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.
It occurs to me that this might be a v2.0.0
on release, since it might be backwards-incompatible for some CSS styling setups.
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.
I was thinking the same thing :)
Use <button type=submit> instead of <input>
👍 |
Thanks for the reviews |
No description provided.