-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65f823f
commit 0c0d5d7
Showing
4 changed files
with
104 additions
and
74 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,53 @@ | ||
(function() { | ||
var root; | ||
|
||
root = typeof exports !== "undefined" && exports !== null ? exports : this; | ||
|
||
root.taxon_tree_menu = function(obj, context) { | ||
var admin_base_url, edit_url, id, translation_base_path, translation_url; | ||
id = obj.attr("id"); | ||
admin_base_url = Spree.url(Spree.routes.admin_taxonomy_taxons_path); | ||
edit_url = admin_base_url.clone(); | ||
edit_url.setPath(edit_url.path() + '/' + id + "/edit"); | ||
translation_url = admin_base_url.clone(); | ||
translation_base_path = admin_base_url.path().replace(/taxons/, "translations"); | ||
translation_base_path = translation_base_path.replace(/taxonomies/, "taxons"); | ||
translation_base_path = translation_base_path.replace(/\d+/, id); | ||
translation_url.setPath(translation_base_path); | ||
return { | ||
create: { | ||
label: "<span class='icon icon-plus'></span> " + Spree.translations.add, | ||
action: function(obj) { | ||
return context.create(obj); | ||
} | ||
}, | ||
rename: { | ||
label: "<span class='icon icon-pencil'></span> " + Spree.translations.rename, | ||
action: function(obj) { | ||
return context.rename(obj); | ||
} | ||
}, | ||
remove: { | ||
label: "<span class='icon icon-trash'></span> " + Spree.translations.remove, | ||
action: function(obj) { | ||
return context.remove(obj); | ||
} | ||
}, | ||
edit: { | ||
separator_before: true, | ||
label: "<span class='icon icon-cog'></span> " + Spree.translations.edit, | ||
action: function(obj) { | ||
return window.location = edit_url.toString(); | ||
} | ||
}, | ||
translate: { | ||
separator_before: true, | ||
label: "<span class='icon icon-flag'></span> " + Spree.translations.translations, | ||
action: function(obj) { | ||
return window.location = translation_url.toString(); | ||
} | ||
} | ||
}; | ||
}; | ||
|
||
}).call(this); |
35 changes: 0 additions & 35 deletions
35
app/assets/javascripts/spree/backend/taxon_tree_menu.js.coffee
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
app/assets/javascripts/spree/backend/translations.js.coffee
This file was deleted.
Oops, something went wrong.