Merge pull request #921 from openclassify/dia

#3158 [profile-module] Profile page is not working
This commit is contained in:
Dia Shalabi 2021-01-22 09:33:43 +03:00 committed by GitHub
commit 306c04de01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 84 additions and 13 deletions

View File

@ -0,0 +1,48 @@
<?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
class VisiosoftModuleAdvsCreateStatusStream extends Migration
{
protected $delete = true;
protected $stream = [
'slug' => 'status',
'title_column' => 'slug',
'translatable' => true,
'versionable' => false,
'trashable' => true,
'searchable' => false,
'sortable' => false,
];
protected $fields = [
"is_system" => [
"type" => "anomaly.field_type.boolean",
"config" => [
"default_value" => false,
"mode" => "radio",
]
],
"user_access" => [
"type" => "anomaly.field_type.boolean",
"config" => [
"default_value" => true,
"mode" => "radio",
]
]
];
protected $assignments = [
'name' => [
'required' => true,
'translatable' => true,
],
'slug' => [
'required' => true,
'unique' => true,
],
"is_system",
"user_access"
];
}

View File

@ -0,0 +1,26 @@
<?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
class VisiosoftModuleAdvsCreateUserStatusField extends Migration
{
protected $delete = false;
protected $stream = [
'slug' => 'advs',
];
protected $fields = [
"user_status" => [
"type" => "anomaly.field_type.relationship",
"config" => [
"related" => \Visiosoft\AdvsModule\Status\StatusModel::class,
"mode" => "lookup",
]
],
];
protected $assignments = [
'user_status',
];
}

View File

@ -23,6 +23,11 @@ class AdvsModule extends Module
'type' => 'info' 'type' => 'info'
], ],
], ],
],
'status' => [
'buttons' => [
'new_status',
],
], ],
'product_options' => [ 'product_options' => [
'title' => 'visiosoft.module.advs::section.product_options.title', 'title' => 'visiosoft.module.advs::section.product_options.title',

View File

@ -21,7 +21,7 @@
background-color: transparent; background-color: transparent;
svg path { svg path {
fill: rgba(#000, 1); fill: #000;
} }
} }
@ -34,7 +34,7 @@
width: 15px; width: 15px;
path { path {
fill: rgba(#000, .4); fill: rgba(0, 0, 0, .4);
} }
} }
} }

View File

@ -2,31 +2,24 @@
use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface; use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface;
use Anomaly\Streams\Platform\Http\Controller\PublicController; use Anomaly\Streams\Platform\Http\Controller\PublicController;
use Anomaly\Streams\Platform\Model\Options\OptionsAdvertisementEntryModel;
use Anomaly\Streams\Platform\Model\Users\UsersUsersEntryModel; use Anomaly\Streams\Platform\Model\Users\UsersUsersEntryModel;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface; use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Rinvex\Subscriptions\Models\Plan; use Rinvex\Subscriptions\Models\Plan;
use Rinvex\Subscriptions\Models\PlanSubscription;
use Visiosoft\AdvsModule\Adv\AdvModel; use Visiosoft\AdvsModule\Adv\AdvModel;
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
use Visiosoft\AdvsModule\Adv\Event\ChangeStatusAd; use Visiosoft\AdvsModule\Adv\Event\ChangeStatusAd;
use Visiosoft\LocationModule\Country\CountryModel; use Visiosoft\LocationModule\Country\CountryModel;
use Visiosoft\AlgoliaModule\Search\SearchModel; use Visiosoft\AlgoliaModule\Search\SearchModel;
use Visiosoft\CloudsiteModule\CloudsiteModule; use Visiosoft\CloudsiteModule\CloudsiteModule;
use Visiosoft\CloudsiteModule\Site\SiteModel;
use Visiosoft\OrdersModule\Orderdetail\Event\AgainPuchaseOrder;
use Visiosoft\PackagesModule\Http\Controller\PackageFEController; use Visiosoft\PackagesModule\Http\Controller\PackageFEController;
use Visiosoft\MessagesModule\Message\MessageModel; use Visiosoft\MessagesModule\Message\MessageModel;
use Visiosoft\PackagesModule\Package\PackageModel; use Visiosoft\PackagesModule\Package\PackageModel;
use Visiosoft\PackagesModule\User\UserModel;
use Visiosoft\ProfileModule\Adress\AdressModel; use Visiosoft\ProfileModule\Adress\AdressModel;
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface; use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder; use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
use Visiosoft\ProfileModule\Education\EducationModel; use Visiosoft\ProfileModule\Education\EducationModel;
use Visiosoft\ProfileModule\EducationPart\EducationPartModel; use Visiosoft\ProfileModule\EducationPart\EducationPartModel;
use Visiosoft\ProfileModule\EducationPartOption\EducationPartOptionModel;
use Visiosoft\ProfileModule\Profile\Form\ProfileFormBuilder; use Visiosoft\ProfileModule\Profile\Form\ProfileFormBuilder;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
@ -51,7 +44,7 @@ class MyProfileController extends PublicController
protected $user; protected $user;
public function home(ProfileFormBuilder $form, AdvRepositoryInterface $advRepository) public function home(ProfileFormBuilder $form)
{ {
$advs_count = new AdvModel(); $advs_count = new AdvModel();
$advs_count = count($advs_count->myAdvsByUser()->get()); $advs_count = count($advs_count->myAdvsByUser()->get());

View File

@ -26,8 +26,7 @@ $(function () {
formData.append('folder', element.data('folder')); formData.append('folder', element.data('folder'));
}, },
renameFile: function (file) { renameFile: function (file) {
let newName = new Date().getTime() + '_' + file.name; return new Date().getTime() + '_' + file.name.replace(/ /g, '_');
return newName;
}, },
accept: function (file, done) { accept: function (file, done) {
$.get(REQUEST_ROOT_PATH + '/streams/singlefile-field_type/exists/' + element.data('folder'), {'file': file.name}, function (data) { $.get(REQUEST_ROOT_PATH + '/streams/singlefile-field_type/exists/' + element.data('folder'), {'file': file.name}, function (data) {