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

Use <button type=submit> instead of <input> #29

Merged
merged 8 commits into from
Nov 3, 2015
Merged

Use <button type=submit> instead of <input> #29

merged 8 commits into from
Nov 3, 2015

Conversation

meshy
Copy link
Contributor

@meshy meshy commented Nov 3, 2015

No description provided.

@meshy
Copy link
Contributor Author

meshy commented Nov 3, 2015

@incuna/backend please review


inputs = BeautifulSoup(rendered_form, 'html.parser').findAll('input')

has_submit = any(filter(lambda i: i.get('type') == 'submit', inputs))
Copy link
Contributor

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')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

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. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

http://stream1.gifsoup.com/view1/1119213/crane-s-sigh-o.gif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebased -- a097492

Copy link
Contributor

Choose a reason for hiding this comment

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

https://media.giphy.com/media/mHIsuMufRtYFq/giphy.gif

@meshy
Copy link
Contributor Author

meshy commented Nov 3, 2015

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'),
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

fair :)

Copy link
Contributor

Choose a reason for hiding this comment

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

#30

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

@meshy
Copy link
Contributor Author

meshy commented Nov 3, 2015

I've refactored the tests to remove a little boilerplate -- sorry, it seems to have clobbered some comments

@adam-thomas adam-thomas mentioned this pull request Nov 3, 2015
@meshy
Copy link
Contributor Author

meshy commented Nov 3, 2015

Updated

@meshy meshy mentioned this pull request Nov 3, 2015
@adam-thomas
Copy link
Contributor

Needs master, otherwise LGTM, sorry! :)

Unreleased
----------

* Use html `buttons` instead of `inputs` for form submission.
Copy link
Contributor

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.

Copy link
Contributor Author

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 :)

meshy added a commit that referenced this pull request Nov 3, 2015
Use <button type=submit> instead of <input>
@meshy meshy merged commit 9dc781d into master Nov 3, 2015
@meshy meshy deleted the form-buttons branch November 3, 2015 11:59
@adam-thomas
Copy link
Contributor

👍

@meshy
Copy link
Contributor Author

meshy commented Nov 3, 2015

Thanks for the reviews :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants