2ecdf2b44c4cb7b73385e721fdbb9d8ac71c3f12.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php $__env->startSection('content'); ?>
  2. <div class="card">
  3. <div class="card-header row gutters-5">
  4. <div class="col text-center text-md-left">
  5. <h5 class="mb-md-0 h6"><?php echo e($language->name); ?></h5>
  6. </div>
  7. <div class="col-md-4">
  8. <form class="" id="sort_keys" action="" method="GET">
  9. <div class="input-group input-group-sm">
  10. <input type="text" class="form-control" id="search" name="search"<?php if(isset($sort_search)): ?> value="<?php echo e($sort_search); ?>" <?php endif; ?> placeholder="<?php echo e(translate('Type key & Enter')); ?>">
  11. </div>
  12. </form>
  13. </div>
  14. </div>
  15. <form class="form-horizontal" action="<?php echo e(route('languages.key_value_store')); ?>" method="POST">
  16. <?php echo csrf_field(); ?>
  17. <input type="hidden" name="id" value="<?php echo e($language->id); ?>">
  18. <div class="card-body">
  19. <table class="table table-striped table-bordered demo-dt-basic" id="tranlation-table" cellspacing="0" width="100%">
  20. <thead>
  21. <tr>
  22. <th>#</th>
  23. <th width="45%"><?php echo e(translate('Key')); ?></th>
  24. <th width="45%"><?php echo e(translate('Value')); ?></th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <?php $__currentLoopData = $lang_keys; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $translation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  29. <tr>
  30. <td><?php echo e(($key+1) + ($lang_keys->currentPage() - 1)*$lang_keys->perPage()); ?></td>
  31. <td class="key"><?php echo e($translation->lang_value); ?></td>
  32. <td>
  33. <input type="text" class="form-control value" style="width:100%" name="values[<?php echo e($translation->lang_key); ?>]" <?php if(($traslate_lang = \App\Models\Translation::where('lang', $language->code)->where('lang_key', $translation->lang_key)->latest()->first()) != null): ?>
  34. value="<?php echo e($traslate_lang->lang_value); ?>"
  35. <?php endif; ?>>
  36. </td>
  37. </tr>
  38. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  39. </tbody>
  40. </table>
  41. <div class="aiz-pagination">
  42. <?php echo e($lang_keys->appends(request()->input())->links()); ?>
  43. </div>
  44. <div class="form-group mb-0 text-right">
  45. <button type="button" class="btn btn-primary" onclick="copyTranslation()"><?php echo e(translate('Copy Translations')); ?></button>
  46. <button type="submit" class="btn btn-primary"><?php echo e(translate('Save')); ?></button>
  47. </div>
  48. </div>
  49. </form>
  50. </div>
  51. <?php $__env->stopSection(); ?>
  52. <?php $__env->startSection('script'); ?>
  53. <script type="text/javascript">
  54. //translate in one click
  55. function copyTranslation() {
  56. $('#tranlation-table > tbody > tr').each(function (index, tr) {
  57. $(tr).find('.value').val($(tr).find('.key').text());
  58. });
  59. }
  60. function sort_keys(el){
  61. $('#sort_keys').submit();
  62. }
  63. </script>
  64. <?php $__env->stopSection(); ?>
  65. <?php echo $__env->make('backend.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/shaoguo/Desktop/公司资料/小梦/商城/ebayShop/resources/views/backend/setup_configurations/languages/language_view.blade.php ENDPATH**/ ?>