-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2391 from jhawthorn/simplify_image_new
Simplify "inline" new image form
- Loading branch information
Showing
5 changed files
with
24 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Spree.ready(function() { | ||
$('#new_image_link').click(function(event) { | ||
event.preventDefault(); | ||
|
||
$(this).hide(); | ||
$('#new_image').show(); | ||
}); | ||
}); |
13 changes: 0 additions & 13 deletions
13
backend/app/assets/javascripts/spree/backend/images/index.js.coffee
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<%= form_for [:admin, product, image], html: { multipart: true } do |f| %> | ||
<fieldset data-hook="new_image"> | ||
<legend align="center"><%= t('spree.new_image') %></legend> | ||
|
||
<%= render partial: 'form', locals: { f: f } %> | ||
|
||
<div class="form-buttons filter-actions actions" data-hook="buttons"> | ||
<%= button t('spree.actions.update') %> | ||
<%= link_to t('spree.actions.cancel'), admin_product_images_url(@product), id: 'cancel_link', class: 'button' %> | ||
</div> | ||
</fieldset> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1 @@ | ||
<%= form_for [:admin, @product, @image], html: { multipart: true } do |f| %> | ||
<fieldset data-hook="new_image"> | ||
<legend align="center"><%= t('spree.new_image') %></legend> | ||
|
||
<%= render partial: 'form', locals: { f: f } %> | ||
|
||
<div class="form-buttons filter-actions actions" data-hook="buttons"> | ||
<%= button t('spree.actions.update') %> | ||
<%= link_to t('spree.actions.cancel'), admin_product_images_url(@product), id: 'cancel_link', class: 'button' %> | ||
</div> | ||
</fieldset> | ||
<% end %> | ||
<%= render 'new', product: @product, image: @image %> |