translate_inline.phtml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /** @var \Magento\Framework\View\Element\Template $block */
  8. ?>
  9. <link rel="stylesheet" type="text/css" href="<?= $block->escapeUrl($block->getViewFileUrl('prototype/windows/themes/default.css')) ?>"/>
  10. <link rel="stylesheet" type="text/css" href="<?= $block->escapeUrl($block->getViewFileUrl('Magento_Theme::prototype/magento.css')) ?>"/>
  11. <link rel="stylesheet" type="text/css" href="<?= $block->escapeUrl($block->getViewFileUrl('mage/translate-inline.css')) ?>"/>
  12. <script id="translate-inline-icon" type="text/x-magento-template">
  13. <img src="<%- data.img %>" height="16" width="16" class="translate-edit-icon">
  14. </script>
  15. <script id="translate-form-template" type="text/x-magento-template">
  16. <form id="<%- data.id %>">
  17. <% _.each(data.items, function(item, i) { %>
  18. <div class="translate-table-container">
  19. <table cellspacing="0" class="table">
  20. <% _.each(item, function(value, index) { %>
  21. <tr>
  22. <th class="label" style="text-transform: capitalize;"><%- index %>:</th>
  23. <td class="value"><%- value %></td>
  24. </tr>
  25. <% }); %>
  26. <tr>
  27. <th class="label">
  28. <label for="perstore_<%- i %>">Store View Specific:</label>
  29. </th>
  30. <td class="value">
  31. <input id="perstore_<%- i %>" name="translate[<%- i %>][perstore]" type="checkbox" value="1"/>
  32. </td>
  33. </tr>
  34. <tr>
  35. <th class="label">
  36. <label for="custom_<%- i %>">Custom:</label>
  37. </th>
  38. <td class="value">
  39. <input name="translate[<%- i %>][original]" type="hidden" value="<%- item.original %>"/>
  40. <input id="custom_<%- i %>"
  41. name="translate[<%- i %>][custom]"
  42. class="input-text"
  43. value="<%- item.translated %>" />
  44. </td>
  45. </tr>
  46. </table>
  47. </div>
  48. <% }); %>
  49. </form>
  50. <% if (data.message) { %>
  51. <p class="a-center accent"><%- data.message %></p>
  52. <% } %>
  53. </script>
  54. <div data-role="translate-dialog"
  55. data-mage-init='{"translateInline":{"ajaxUrl":"<?= $block->escapeJs($block->escapeUrl($block->getAjaxUrl())) ?>"},"loader":{}}'></div>
  56. <script type="text/x-magento-init">
  57. {
  58. "body": {
  59. "editTrigger": {
  60. "img": "<?= $block->escapeJs($block->escapeUrl($block->getViewFileUrl('Magento_Theme::fam_book_open.png'))) ?>",
  61. "alwaysShown":true,
  62. "singleElement":false
  63. },
  64. "addClass": {
  65. "class": "trnslate-inline-area"
  66. }
  67. }
  68. }
  69. </script>