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

Edit new_resource partial #4742

Merged
merged 5 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions app/views/spree/admin/shared/_new_resource_links.html.erb

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/spree/admin/shared/_new_resource_links.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.form-buttons.filter-actions.actions
= button t(:create), 'icon-ok'
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the code now, to fix the issue, all you needed would be to change the translation calls from Spree.t to t. because spree.actions.create and spree.actions.cancel are not there in the en.yml file but both are under actions.create (Spree.t is similar to t. but adds spree in the namespace).

Here you are moving to root level :create and :cancel. I think it's ok, I would prefer to keep these under the actions namespace, so I'd use t('actions.create') and t('actions.cancel') instead of t(:create) and t(:cancel).
The OR can stay as t(:or).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you very much - that makes complete sense. We went ahead and updated with the change.

%span.or= t(:or)
= button_link_to t(:cancel), collection_url, icon: 'icon-remove'
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why the change from link_to_with_icon to button_link_to. What is the differrence between these two methods? Will the user notice any difference?

Copy link
Contributor

Choose a reason for hiding this comment

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

The only difference is purely aesthetic - whether or not it looks like a button, as far as I could tell, but maybe I am mistaken.