74 lines
3.0 KiB
PHP
74 lines
3.0 KiB
PHP
@extends('admin.layouts.master')
|
|
@section('pageTitle', 'Edit Translation')
|
|
@section('content')
|
|
|
|
|
|
<div class="page-header">
|
|
<h1 class="page-title">Manage Translations</h1>
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="{{ route('dashboard') }}">Dashboard</a></li>
|
|
<li class="breadcrumb-item active">Edit Translation</li>
|
|
</ol>
|
|
<div class="page-header-actions">
|
|
<a class="btn btn-dark" href="{{ route('translations') }}">
|
|
<i class="icon wb-arrow-left" aria-hidden="true"></i>
|
|
<span class="hidden-sm-down">Back To Listing</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$("#add-form").validationEngine();
|
|
});
|
|
</script>
|
|
<div class="page-content container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="translation-background card card-shadow">
|
|
<div class="card-header card-header-transparent p-20">
|
|
<h4 class="card-title mb-0">Edit Translation</h4>
|
|
</div>
|
|
<div class="card-block">
|
|
@if($errors->any())
|
|
<div class="alert alert-danger">
|
|
@foreach($errors->all() as $error)
|
|
<p>{{ $error }}</p>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
<form method="post" action="{{ route('update-translation', base64_encode($translation->id)) }}" id="add-form" autocomplete="off" enctype="multipart/form-data">
|
|
@csrf
|
|
<div class="row">
|
|
<div class="form-group col-md-6">
|
|
<label class="form-control-label" for="primary_text">Primary Text ({{ $default_language->short_name }})</label>
|
|
<input type="text" class="form-control validate[required]" id="primary_text" name="primary_text" placeholder="Primary Text" autocomplete="off" tabindex = "1" value="{{ old('primary_text') ? old('primary_text') : $translation->primary_text }}"/>
|
|
</div>
|
|
@php
|
|
$translation_texts = json_decode($translation->translation_text, true);
|
|
@endphp
|
|
@if(isset($languages) && !empty($languages))
|
|
@foreach($languages as $language)
|
|
@php
|
|
$field_name = 'translation_text_'.$language->short_name;
|
|
@endphp
|
|
<div class="form-group col-md-6">
|
|
<label class="form-control-label" for="{{ $field_name }}">{{ $language->name }} {{ __('Text') }} ({{ strtoupper($language->short_name) }})</label>
|
|
<input type="text" class="form-control validate[required]" id="{{ $field_name }}" name="{{ $field_name }}" placeholder="{{ $language->name }} {{ __('Text') }}" autocomplete="off" tabindex = "2" value="{{ old($field_name) ? old($field_name) : $translation_texts[$language->short_name] }}"/>
|
|
</div>
|
|
@endforeach
|
|
@endif
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit" tabindex = "12" class="btn btn-success"><i class="icon wb-check" aria-hidden="true"></i> UPDATE</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|