FEATURE: add basic funcionality for template copies.
This commit contains only basic funcionality.
This commit is contained in:
@@ -12,12 +12,15 @@
|
||||
</div>
|
||||
|
||||
<div class="controls row">
|
||||
<a href="{{route('templates.copy', ['id' => $template->id])}}" class="button text-center primary column large-6" title="@lang('admin/templates.copy')">
|
||||
<a data-template-id="{{$template->id}}" data-template-name="{{$template->template_name}}"
|
||||
class="button primary column large-6 copy-template"
|
||||
title="@lang('admin/templates.copy')">
|
||||
<i class="fa fa-copy"></i>
|
||||
</a>
|
||||
|
||||
@if ($template->editable)
|
||||
<a href="{{route('templates.edit', ['id' => $template->id])}}" class="button text-center success column large-6" title="@lang('admin/templates.edit')">
|
||||
<a href="{{route('templates.edit', ['id' => $template->id])}}"
|
||||
class="button success column large-6" title="@lang('admin/templates.edit')">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
@endif
|
||||
@@ -28,4 +31,22 @@
|
||||
@empty
|
||||
<em>@lang('admin/templates.noTemplates')</em>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('javascripts')
|
||||
<script type="text/javascript">
|
||||
$ ('.copy-template').click (function () {
|
||||
var link = $ (this);
|
||||
var templateId = link.data ('template-id');
|
||||
var templateName = link.data ('template-name');
|
||||
|
||||
var newTemplateName = prompt ("@lang('admin/templates.newTemplateName')", templateName + "_"+"@lang('admin/templates.newTemplateNameSuffix')");
|
||||
|
||||
if (newTemplateName == null) return;
|
||||
|
||||
$.ajax({
|
||||
'url': '{{route('templates.copy')}}}'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user