diff --git a/Resources/config/yui.yml b/Resources/config/yui.yml index 4af0e4c4e..725160f7c 100644 --- a/Resources/config/yui.yml +++ b/Resources/config/yui.yml @@ -1238,6 +1238,7 @@ system: - 'translateactionview-ez-template' - 'ez-translator' - 'event-outside' + - 'ez-notequalhelper' path: "%ez_platformui.public_dir%/js/views/actions/ez-translateactionview.js" translateactionview-ez-template: type: 'template' @@ -1309,6 +1310,9 @@ system: ez-strictcomparisonhelper: requires: ['handlebars'] path: "%ez_platformui.public_dir%/js/helpers/ez-strictcomparisonhelper.js" + ez-notequalhelper: + requires: ['handlebars'] + path: "%ez_platformui.public_dir%/js/helpers/ez-notequalhelper.js" ez-getflagcodehelper: requires: ['handlebars'] path: "%ez_platformui.public_dir%/js/helpers/ez-getflagcodehelper.js" diff --git a/Resources/public/js/helpers/ez-notequalhelper.js b/Resources/public/js/helpers/ez-notequalhelper.js new file mode 100644 index 000000000..60e18221d --- /dev/null +++ b/Resources/public/js/helpers/ez-notequalhelper.js @@ -0,0 +1,16 @@ +/* + * Copyright (C) eZ Systems AS. All rights reserved. + * For full copyright and license information view LICENSE file distributed with this source code. + */ +YUI.add('ez-notequalhelper', function (Y) { + Y.Handlebars.registerHelper('notEqual', function (left, right, options) { + var result = left !== right; + + if (result) { + return options.fn(this); + } else { + return options.inverse(this); + } + }); + +}); diff --git a/Resources/public/templates/translateaction.hbt b/Resources/public/templates/translateaction.hbt index b1ea0829d..8f20bb708 100644 --- a/Resources/public/templates/translateaction.hbt +++ b/Resources/public/templates/translateaction.hbt @@ -26,9 +26,9 @@ {{translate 'translateaction.edit' 'bar'}} - {{#if ../canDeleteTranslations}} - - {{/if}} + {{#notEqual ../content.mainLanguageCode this }} + + {{/notEqual}} {{/each}}