mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #857 from openclassify/muammertop
#2819 minor fix (google & facebook address bonus)
This commit is contained in:
commit
b14c70f2ab
@ -23,6 +23,7 @@ return [
|
||||
'latest-limit',
|
||||
'popular_ads_limit',
|
||||
'default_view_type',
|
||||
'price_area_hidden',
|
||||
'hide_listing_standard_price',
|
||||
'hide_zero_price',
|
||||
'auto_approve',
|
||||
|
||||
@ -153,6 +153,12 @@ return [
|
||||
'mode' => 'checkbox'
|
||||
]
|
||||
],
|
||||
'price_area_hidden' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => false,
|
||||
]
|
||||
],
|
||||
'enabled_currencies' => [
|
||||
'bind' => 'streams::currencies.enabled',
|
||||
'env' => 'ADV_ENABLED_CURRENCIES',
|
||||
|
||||
@ -126,7 +126,9 @@ return [
|
||||
'market_place' => [
|
||||
'name' => 'Market Place',
|
||||
],
|
||||
|
||||
'price_area_hidden' => [
|
||||
'name' => 'Price Area Hidden',
|
||||
],
|
||||
'hide_price_filter' => [
|
||||
'name' => 'Hide Price Filter',
|
||||
],
|
||||
|
||||
@ -90,7 +90,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group select-price">
|
||||
<div class="row form-group select-price
|
||||
{{ setting_value('visiosoft.module.advs::price_area_hidden') ? 'hidden' }}">
|
||||
|
||||
<label class="col-sm-2 col-xs-12">
|
||||
{{ form.fields.price.label|raw }}
|
||||
<span class="required">*</span>
|
||||
|
||||
@ -1,15 +1,20 @@
|
||||
{% set folders = entries('files','folders').whereIn('slug',field_type.configGet('folders')).get() %}
|
||||
{% set allowed_types = {} %}
|
||||
{% for mimes in folders.pluck('allowed_types.value').all() %}
|
||||
{% set allowed_types = allowed_types|merge(mimes) %}
|
||||
{% endfor %}
|
||||
<div class="modal-body">
|
||||
<div class="dropzone"
|
||||
data-folder="1"
|
||||
data-icon="{{ icon('upload')|escape }}"
|
||||
data-max-size="{{ max_upload_size() }}"
|
||||
data-message="{{ trans('visiosoft.field_type.media::message.upload') }}"
|
||||
data-loading="{{ trans('visiosoft.field_type.media::message.loading') }}"
|
||||
data-uploading="{{ trans('visiosoft.field_type.media::message.uploading') }}"
|
||||
data-overwrite="{{ trans('anomaly.field_type.file::message.overwrite') }}"
|
||||
data-max-parallel="{{ setting_value('anomaly.module.files::max_parallel_uploads', 3) }}"
|
||||
data-allowed="{{ folder.allowed_types.value ? '.' ~ folder.allowed_types.value|join(',.') }}"></div>
|
||||
<div class="dropzone"
|
||||
data-folder="1"
|
||||
data-icon="{{ icon('upload')|escape }}"
|
||||
data-max-size="{{ max_upload_size() }}"
|
||||
data-message="{{ trans('visiosoft.field_type.media::message.upload') }}"
|
||||
data-loading="{{ trans('visiosoft.field_type.media::message.loading') }}"
|
||||
data-uploading="{{ trans('visiosoft.field_type.media::message.uploading') }}"
|
||||
data-overwrite="{{ trans('anomaly.field_type.file::message.overwrite') }}"
|
||||
data-max-parallel="{{ setting_value('anomaly.module.files::max_parallel_uploads', 3) }}"
|
||||
data-allowed="{{ (count(allowed_types)) ?'.'~allowed_types|join(',.'):'' }}"></div>
|
||||
|
||||
<div class="uploads"></div>
|
||||
<div class="uploads"></div>
|
||||
|
||||
</div>
|
||||
@ -58,6 +58,12 @@ return [
|
||||
'birthday' => [
|
||||
'name' => 'Birthday'
|
||||
],
|
||||
'facebook_address' => [
|
||||
'name' => 'Facebook Address'
|
||||
],
|
||||
'google_address' => [
|
||||
'name' => 'Google Address'
|
||||
],
|
||||
'education' => [
|
||||
'name' => 'Education'
|
||||
],
|
||||
|
||||
@ -149,7 +149,22 @@
|
||||
{{ profileForm.fields.birthday.configSet('date_format','Y-m-d').setPlaceholder(now|date('Y-m-d')).input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group facebook_address-field">
|
||||
<label class="control-label font-weight-bold">
|
||||
{{ trans("visiosoft.module.profile::field.facebook_address.name") }}
|
||||
</label>
|
||||
{{ profileForm.fields.facebook_address.input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group google_address-field">
|
||||
<label class="control-label font-weight-bold">
|
||||
{{ trans("visiosoft.module.profile::field.google_address.name") }}
|
||||
</label>
|
||||
{{ profileForm.fields.google_address.input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% if setting_value('visiosoft.module.profile::show_education_profession') %}
|
||||
<div class="col-md-12">
|
||||
<div class="form-group education-field">
|
||||
|
||||
@ -17,7 +17,9 @@ class ProfileFormBuilder extends FormBuilder
|
||||
'state_of_education',
|
||||
'profession',
|
||||
'birthday',
|
||||
'register_type'
|
||||
'register_type',
|
||||
'facebook_address',
|
||||
'google_address',
|
||||
];
|
||||
|
||||
protected $actions = [
|
||||
|
||||
@ -23,6 +23,8 @@ class ProfileFormHandler
|
||||
'identification_number' => $builder->getPostValue('identification_number'),
|
||||
'birthday' => $builder->getPostValue('birthday'),
|
||||
'register_type' => $builder->getPostValue('register_type'),
|
||||
'facebook_address' => $builder->getPostValue('facebook_address'),
|
||||
'google_address' => $builder->getPostValue('google_address'),
|
||||
];
|
||||
|
||||
if (setting_value('visiosoft.module.profile::show_education_profession')) {
|
||||
|
||||
@ -139,6 +139,16 @@ class UsersFieldsSeeder extends Seeder
|
||||
'slug' => 'profession',
|
||||
'type' => 'anomaly.field_type.text',
|
||||
],
|
||||
[
|
||||
'name' => trans('visiosoft.module.profile::field.facebook_address.name'),
|
||||
'slug' => 'facebook_address',
|
||||
'type' => 'anomaly.field_type.text',
|
||||
],
|
||||
[
|
||||
'name' => trans('visiosoft.module.profile::field.google_address.name'),
|
||||
'slug' => 'google_address',
|
||||
'type' => 'anomaly.field_type.text',
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($customFields as $customField) {
|
||||
|
||||
@ -18,135 +18,143 @@ use Illuminate\Support\Facades\DB;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
protected $widgets;
|
||||
protected $menus;
|
||||
protected $users;
|
||||
protected $roles;
|
||||
protected $activator;
|
||||
protected $disks;
|
||||
protected $folders;
|
||||
protected $widgets;
|
||||
protected $menus;
|
||||
protected $users;
|
||||
protected $roles;
|
||||
protected $activator;
|
||||
protected $disks;
|
||||
protected $folders;
|
||||
|
||||
public function __construct(
|
||||
WidgetRepositoryInterface $widgets,
|
||||
MenuRepositoryInterface $menus,
|
||||
UserRepositoryInterface $users,
|
||||
DiskRepositoryInterface $disks,
|
||||
FolderRepositoryInterface $folders,
|
||||
RoleRepositoryInterface $roles,
|
||||
UserActivator $activator
|
||||
)
|
||||
{
|
||||
$this->widgets = $widgets;
|
||||
$this->menus = $menus;
|
||||
$this->users = $users;
|
||||
$this->roles = $roles;
|
||||
$this->activator = $activator;
|
||||
$this->disks = $disks;
|
||||
$this->folders = $folders;
|
||||
}
|
||||
public function __construct(
|
||||
WidgetRepositoryInterface $widgets,
|
||||
MenuRepositoryInterface $menus,
|
||||
UserRepositoryInterface $users,
|
||||
DiskRepositoryInterface $disks,
|
||||
FolderRepositoryInterface $folders,
|
||||
RoleRepositoryInterface $roles,
|
||||
UserActivator $activator
|
||||
)
|
||||
{
|
||||
$this->widgets = $widgets;
|
||||
$this->menus = $menus;
|
||||
$this->users = $users;
|
||||
$this->roles = $roles;
|
||||
$this->activator = $activator;
|
||||
$this->disks = $disks;
|
||||
$this->folders = $folders;
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
|
||||
|
||||
$admin = $this->roles->findBySlug('admin');
|
||||
$admin = $this->roles->findBySlug('admin');
|
||||
|
||||
$this->users->unguard();
|
||||
$this->users->newQuery()->where('email', "info@openclassify.com")->forceDelete();
|
||||
$visiosoft_administrator = $this->users->create(
|
||||
[
|
||||
'display_name' => 'openclassify',
|
||||
'email' => "info@openclassify.com",
|
||||
'username' => "openclassify",
|
||||
'password' => "openclassify",
|
||||
]
|
||||
);
|
||||
$this->users->unguard();
|
||||
$this->users->newQuery()->where('email', "info@openclassify.com")->forceDelete();
|
||||
$visiosoft_administrator = $this->users->create(
|
||||
[
|
||||
'display_name' => 'openclassify',
|
||||
'email' => "info@openclassify.com",
|
||||
'username' => "openclassify",
|
||||
'password' => "openclassify",
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$visiosoft_administrator->roles()->sync([$admin->getId()]);
|
||||
$visiosoft_administrator->roles()->sync([$admin->getId()]);
|
||||
|
||||
$this->activator->force($visiosoft_administrator);
|
||||
$this->activator->force($visiosoft_administrator);
|
||||
|
||||
|
||||
//Footer Link
|
||||
LinkModel::query()->forceDelete();
|
||||
$repository = new EntryRepository();
|
||||
$repository->setModel(new UrlLinkTypeModel());
|
||||
$menu = $this->menus->findBySlug('footer');
|
||||
//Footer Link
|
||||
LinkModel::query()->forceDelete();
|
||||
$repository = new EntryRepository();
|
||||
$repository->setModel(new UrlLinkTypeModel());
|
||||
$menu = $this->menus->findBySlug('footer');
|
||||
|
||||
|
||||
$openclassify = $repository->create(
|
||||
[
|
||||
'en' => [
|
||||
'title' => 'OpenClassify.com',
|
||||
],
|
||||
'url' => 'https://openclassify.com/',
|
||||
]
|
||||
);
|
||||
$visiosoft = $repository->create(
|
||||
[
|
||||
'en' => [
|
||||
'title' => 'Visiosoft Inc.',
|
||||
],
|
||||
'url' => 'https://visiosoft.com.tr/',
|
||||
]
|
||||
);
|
||||
$openclassify = $repository->create(
|
||||
[
|
||||
'en' => [
|
||||
'title' => 'OpenClassify.com',
|
||||
],
|
||||
'url' => 'https://openclassify.com/',
|
||||
]
|
||||
);
|
||||
$visiosoft = $repository->create(
|
||||
[
|
||||
'en' => [
|
||||
'title' => 'Visiosoft Inc.',
|
||||
],
|
||||
'url' => 'https://visiosoft.com.tr/',
|
||||
]
|
||||
);
|
||||
|
||||
LinkModel::query()->create(
|
||||
[
|
||||
'menu' => $menu,
|
||||
'target' => '_blank',
|
||||
'entry' => $openclassify,
|
||||
'type' => 'anomaly.extension.url_link_type',
|
||||
]
|
||||
);
|
||||
LinkModel::query()->create(
|
||||
[
|
||||
'menu' => $menu,
|
||||
'target' => '_blank',
|
||||
'entry' => $visiosoft,
|
||||
'type' => 'anomaly.extension.url_link_type',
|
||||
]
|
||||
);
|
||||
LinkModel::query()->create(
|
||||
[
|
||||
'menu' => $menu,
|
||||
'target' => '_blank',
|
||||
'entry' => $openclassify,
|
||||
'type' => 'anomaly.extension.url_link_type',
|
||||
]
|
||||
);
|
||||
LinkModel::query()->create(
|
||||
[
|
||||
'menu' => $menu,
|
||||
'target' => '_blank',
|
||||
'entry' => $visiosoft,
|
||||
'type' => 'anomaly.extension.url_link_type',
|
||||
]
|
||||
);
|
||||
|
||||
DB::table('files_files')->truncate();
|
||||
DB::table('files_files')->truncate();
|
||||
|
||||
$repository = "https://raw.githubusercontent.com/openclassify/Openclassify-Demo-Data/master/";
|
||||
file_put_contents(storage_path('advs.sql'), fopen($repository . "advs.sql", 'r'));
|
||||
file_put_contents(storage_path('settings.sql'), fopen($repository . "settings.sql", 'r'));
|
||||
file_put_contents(storage_path('categories.sql'), fopen($repository . "categories.sql", 'r'));
|
||||
file_put_contents(storage_path('images.zip'), fopen($repository . "images.zip", "r"));
|
||||
file_put_contents(storage_path('cats.zip'), fopen($repository . "cats.zip", "r"));
|
||||
$repository = "https://raw.githubusercontent.com/openclassify/Openclassify-Demo-Data/master/";
|
||||
file_put_contents(storage_path('advs.sql'), fopen($repository . "advs.sql", 'r'));
|
||||
file_put_contents(storage_path('settings.sql'), fopen($repository . "settings.sql", 'r'));
|
||||
file_put_contents(storage_path('categories.sql'), fopen($repository . "categories.sql", 'r'));
|
||||
file_put_contents(storage_path('images.zip'), fopen($repository . "images.zip", "r"));
|
||||
file_put_contents(storage_path('cats.zip'), fopen($repository . "cats.zip", "r"));
|
||||
|
||||
Model::unguard();
|
||||
DB::unprepared(file_get_contents(storage_path('advs.sql')));
|
||||
DB::unprepared(file_get_contents(storage_path('categories.sql')));
|
||||
DB::unprepared(file_get_contents(storage_path('settings.sql')));
|
||||
Model::reguard();
|
||||
Model::unguard();
|
||||
DB::unprepared(file_get_contents(storage_path('advs.sql')));
|
||||
DB::unprepared(file_get_contents(storage_path('categories.sql')));
|
||||
DB::unprepared(file_get_contents(storage_path('settings.sql')));
|
||||
Model::reguard();
|
||||
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$zip->open(storage_path('images.zip'), ZipArchive::CREATE);
|
||||
$zip->extractTo(storage_path('streams/default/files-module/local/images/'));
|
||||
$zip->open(storage_path('cats.zip'), ZipArchive::CREATE);
|
||||
$zip->extractTo(storage_path('streams/default/files-module/local/images/'));
|
||||
$zip->close();
|
||||
$zip = new ZipArchive();
|
||||
$zip->open(storage_path('images.zip'), ZipArchive::CREATE);
|
||||
$zip->extractTo(storage_path('streams/default/files-module/local/images/'));
|
||||
$zip->open(storage_path('cats.zip'), ZipArchive::CREATE);
|
||||
$zip->extractTo(storage_path('streams/default/files-module/local/images/'));
|
||||
$zip->close();
|
||||
|
||||
$this->call(widgetSeeder::class);
|
||||
$this->call(widgetSeeder::class);
|
||||
|
||||
|
||||
//Create Store Icon Folder
|
||||
if (!$this->folders->findBySlug('ads_excel')) {
|
||||
$disk = $this->disks->findBySlug('local');
|
||||
//Create Store Icon Folder
|
||||
if (!$this->folders->findBySlug('ads_excel')) {
|
||||
$disk = $this->disks->findBySlug('local');
|
||||
|
||||
$this->folders->create([
|
||||
'en' => [
|
||||
'name' => 'Ads Excel',
|
||||
'description' => 'A folder for Ads Excel.',
|
||||
],
|
||||
'slug' => 'ads_excel',
|
||||
'disk' => $disk
|
||||
]);
|
||||
};
|
||||
}
|
||||
$this->folders->create([
|
||||
'en' => [
|
||||
'name' => 'Ads Excel',
|
||||
'description' => 'A folder for Ads Excel.',
|
||||
],
|
||||
'slug' => 'ads_excel',
|
||||
'disk' => $disk
|
||||
]);
|
||||
};
|
||||
|
||||
if ($images_folder = $this->folders->findBySlug('images')) {
|
||||
$images_folder->update([
|
||||
'allowed_types' => [
|
||||
'jpg', 'jpeg','png'
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user