mirror of
https://github.com/openclassify/openclassify.git
synced 2026-03-06 15:25:23 -06:00
description multi language
This commit is contained in:
parent
e063c9c63c
commit
9b9d8e1319
@ -32,7 +32,9 @@ class VisiosoftModuleAdvsCreateAdvsStream extends Migration
|
|||||||
'slug' => [
|
'slug' => [
|
||||||
'required' => true,
|
'required' => true,
|
||||||
],
|
],
|
||||||
'advs_desc',
|
'advs_desc' => [
|
||||||
|
'translatable' => true,
|
||||||
|
],
|
||||||
'cat1',
|
'cat1',
|
||||||
'cat2',
|
'cat2',
|
||||||
'cat3',
|
'cat3',
|
||||||
|
|||||||
@ -62,4 +62,94 @@ $('input[name="price"]').on('click', function () {
|
|||||||
{
|
{
|
||||||
$(this).val("");
|
$(this).val("");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(document).on('ajaxComplete ready shown.bs.tab', function () {
|
||||||
|
|
||||||
|
// Initialize WYSIWYG editors.
|
||||||
|
$('textarea[data-field="advs_desc"]:not(.hasEditor)').each(function () {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gather available buttons / plugins.
|
||||||
|
*/
|
||||||
|
let textarea = $(this);
|
||||||
|
|
||||||
|
let buttons = textarea.data('available_buttons');
|
||||||
|
let plugins = textarea.data('available_plugins');
|
||||||
|
|
||||||
|
textarea.addClass('hasEditor');
|
||||||
|
|
||||||
|
textarea.redactor({
|
||||||
|
|
||||||
|
element: $(this),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the editor icons.
|
||||||
|
*/
|
||||||
|
callbacks: {
|
||||||
|
init: function () {
|
||||||
|
|
||||||
|
let icons = {};
|
||||||
|
|
||||||
|
$.each(buttons, function (k, v) {
|
||||||
|
if (v.icon) {
|
||||||
|
icons[v.button ? v.button : k] = '<i class="' + v.icon + '"></i>';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$.each(plugins, function (k, v) {
|
||||||
|
if (v.icon) {
|
||||||
|
icons[v.button ? v.button : k] = '<i class="' + v.icon + '"></i>';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$.each(this.button.all(), $.proxy(function (i, s) {
|
||||||
|
|
||||||
|
let key = $(s).attr('rel');
|
||||||
|
|
||||||
|
if (typeof icons[key] !== 'undefined') {
|
||||||
|
let icon = icons[key];
|
||||||
|
let button = this.button.get(key);
|
||||||
|
this.button.setIcon(button, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
}, this));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Settings
|
||||||
|
*/
|
||||||
|
script: false,
|
||||||
|
structure: true,
|
||||||
|
linkTooltip: true,
|
||||||
|
cleanOnPaste: true,
|
||||||
|
toolbarFixed: false,
|
||||||
|
imagePosition: true,
|
||||||
|
imageResizable: true,
|
||||||
|
breakline: Boolean(textarea.data('breakline')),
|
||||||
|
removeNewLines: Boolean(textarea.data('remove_new_lines')),
|
||||||
|
imageFloatMargin: '20px',
|
||||||
|
removeEmpty: ['strong', 'em', 'p'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Features
|
||||||
|
*/
|
||||||
|
minHeight: textarea.data('height'),
|
||||||
|
placeholder: textarea.attr('placeholder'),
|
||||||
|
folders: textarea.data('folders').toString().split(','),
|
||||||
|
buttons: textarea.data('buttons').toString().split(','),
|
||||||
|
plugins: textarea.data('plugins').toString().split(',')
|
||||||
|
});
|
||||||
|
|
||||||
|
textarea.closest('form').on('submit', function () {
|
||||||
|
textarea.val(textarea.redactor('code.get'));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (textarea.is('[readonly]') || textarea.is('[disabled]')) {
|
||||||
|
textarea.redactor('button.disableAll');
|
||||||
|
textarea.redactor('core.editor')
|
||||||
|
.attr('contenteditable', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@ -105,7 +105,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row form-group brand-name">
|
<div class="row form-group brand-name">
|
||||||
{{ form.fields.advs_desc.input|raw }}
|
{{ descField|raw }}
|
||||||
</div>
|
</div>
|
||||||
<div class="row form-group images">
|
<div class="row form-group images">
|
||||||
{{ form.fields.files.input |raw }}
|
{{ form.fields.files.input |raw }}
|
||||||
|
|||||||
@ -557,13 +557,20 @@ class AdvsController extends PublicController
|
|||||||
AdvModel $advModel
|
AdvModel $advModel
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$nameField = HTMLDomParser::str_get_html($advFormBuilder->render($id)->getContent());
|
$Field = HTMLDomParser::str_get_html($advFormBuilder->render($id)->getContent());
|
||||||
$nameField = $nameField->find('.name', 0);
|
$nameField = $Field->find('.name', 0);
|
||||||
if ($nameField !== null) {
|
if ($nameField !== null) {
|
||||||
$nameField = $nameField->innertext();
|
$nameField = $nameField->innertext();
|
||||||
} else {
|
} else {
|
||||||
$nameField = "";
|
$nameField = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$descField = $Field->find('.advs_desc', 0);
|
||||||
|
if ($descField !== null) {
|
||||||
|
$descField = $descField->innertext();
|
||||||
|
} else {
|
||||||
|
$nameField = "";
|
||||||
|
}
|
||||||
if (!Auth::user()) {
|
if (!Auth::user()) {
|
||||||
redirect('/login?redirect=' . url()->current())->send();
|
redirect('/login?redirect=' . url()->current())->send();
|
||||||
}
|
}
|
||||||
@ -607,7 +614,7 @@ class AdvsController extends PublicController
|
|||||||
$custom_fields = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->edit($adv, $categories, $cats);
|
$custom_fields = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->edit($adv, $categories, $cats);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->view->make('visiosoft.module.advs::advs/new-create', compact('id', 'cats_d', 'request', 'Cloudinary', 'cities', 'adv', 'custom_fields', 'nameField'));
|
return $this->view->make('visiosoft.module.advs::advs/new-create', compact('id', 'cats_d', 'request', 'Cloudinary', 'cities', 'adv', 'custom_fields', 'nameField','descField'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
use Anomaly\Streams\Platform\Model\Location\LocationCitiesEntryModel;
|
|
||||||
use Anomaly\Streams\Platform\Model\Location\LocationDistrictsEntryModel;
|
|
||||||
use Visiosoft\LocationModule\Country\CountryModel;
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'home_page_location' => [
|
'home_page_location' => [
|
||||||
'type' => 'anomaly.field_type.boolean',
|
'type' => 'anomaly.field_type.boolean',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user