comment fixed

This commit is contained in:
Muammer Top 2020-12-15 18:15:17 +03:00
parent 734c55b54e
commit 4365c9e8c0
15 changed files with 9 additions and 234 deletions

View File

@ -12,7 +12,7 @@ $(() => {
$('#education').on('change', () => {
$.ajax({
url: '/ajax/setEducation',
url: '/api/setEducation',
data: {
info: 'education',
education: $('#education').val()
@ -31,14 +31,10 @@ $(() => {
$('#education_part').on('change', () => {
$.ajax({
url: '/ajax/setEducation',
url: '/api/setEducation',
data: {
info: 'education_part',
education: $('#education_part').val()
}, beforeSend: function (){
$('#education_part_option').html('');
}, success: function (response) {
}
})
})

View File

@ -11,19 +11,9 @@ return [
'write',
'delete',
],
'education' => [
'read',
'write',
'delete',
],
'education_part' => [
'read',
'write',
'delete',
],
'education_part_option' => [
'read',
'write',
'delete',
],
];

View File

@ -16,7 +16,5 @@ return [
'corporate' => 'Corporate',
'export' => 'Export',
'new_education' => 'New Education',
'new_education' => 'New Education',
'new_education_part' => 'New Education part',
'new_education_part_option' => 'New Education part option',
];

View File

@ -25,14 +25,6 @@ return [
'delete' => 'Can delete education?',
],
],
'education' => [
'name' => 'Education',
'option' => [
'read' => 'Can read education?',
'write' => 'Can create/edit education?',
'delete' => 'Can delete education?',
],
],
'education_part' => [
'name' => 'Education part',
'option' => [
@ -41,12 +33,4 @@ return [
'delete' => 'Can delete education part?',
],
],
'education_part_option' => [
'name' => 'Education part option',
'option' => [
'read' => 'Can read education part option?',
'write' => 'Can create/edit education part option?',
'delete' => 'Can delete education part option?',
],
],
];

View File

@ -12,13 +12,7 @@ return [
'education' => [
'title' => 'Education',
],
'education' => [
'title' => 'Education',
],
'education_part' => [
'title' => 'Education part',
],
'education_part_option' => [
'title' => 'Education part option',
],
];

View File

@ -10,13 +10,7 @@ return [
'education' => [
'name' => 'Education',
],
'education' => [
'name' => 'Education',
],
'education_part' => [
'name' => 'Education part',
],
'education_part_option' => [
'name' => 'Education part option',
],
];

View File

@ -171,7 +171,7 @@
<label class="control-label font-weight-bold">
{{ trans("visiosoft.module.profile::field.education.name") }}
</label>
{{ profileForm.fields.education.input|raw }}
{{ profileForm.fields.education.setPlaceholder(trans('visiosoft.module.profile::field.choose_an_option')).input|raw }}
</div>
</div>
<div class="col-md-12">
@ -179,7 +179,7 @@
<label class="control-label font-weight-bold">
{{ trans("visiosoft.module.profile::field.education_part.name") }}
</label>
{{ profileForm.fields.education_part.input|raw }}
{{ profileForm.fields.education_part.setPlaceholder(trans('visiosoft.module.profile::field.choose_an_option')).input|raw }}
</div>
</div>
<div class="col-md-12">

View File

@ -4,35 +4,6 @@ use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class EducationFormBuilder extends FormBuilder
{
/**
* The form fields.
*
* @var array|string
*/
protected $fields = [];
/**
* Additional validation rules.
*
* @var array|string
*/
protected $rules = [];
/**
* Fields to skip.
*
* @var array|string
*/
protected $skips = [];
/**
* The form actions.
*
* @var array|string
*/
protected $actions = [];
/**
* The form buttons.
*
@ -41,26 +12,4 @@ class EducationFormBuilder extends FormBuilder
protected $buttons = [
'cancel',
];
/**
* The form options.
*
* @var array
*/
protected $options = [];
/**
* The form sections.
*
* @var array
*/
protected $sections = [];
/**
* The form assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -4,28 +4,6 @@ use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
class EducationTableBuilder extends TableBuilder
{
/**
* The table views.
*
* @var array|string
*/
protected $views = [];
/**
* The table filters.
*
* @var array|string
*/
protected $filters = [];
/**
* The table columns.
*
* @var array|string
*/
protected $columns = [];
/**
* The table buttons.
*
@ -43,19 +21,4 @@ class EducationTableBuilder extends TableBuilder
protected $actions = [
'delete'
];
/**
* The table options.
*
* @var array
*/
protected $options = [];
/**
* The table assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -4,35 +4,6 @@ use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class EducationPartFormBuilder extends FormBuilder
{
/**
* The form fields.
*
* @var array|string
*/
protected $fields = [];
/**
* Additional validation rules.
*
* @var array|string
*/
protected $rules = [];
/**
* Fields to skip.
*
* @var array|string
*/
protected $skips = [];
/**
* The form actions.
*
* @var array|string
*/
protected $actions = [];
/**
* The form buttons.
*
@ -41,26 +12,4 @@ class EducationPartFormBuilder extends FormBuilder
protected $buttons = [
'cancel',
];
/**
* The form options.
*
* @var array
*/
protected $options = [];
/**
* The form sections.
*
* @var array
*/
protected $sections = [];
/**
* The form assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -4,28 +4,6 @@ use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
class EducationPartTableBuilder extends TableBuilder
{
/**
* The table views.
*
* @var array|string
*/
protected $views = [];
/**
* The table filters.
*
* @var array|string
*/
protected $filters = [];
/**
* The table columns.
*
* @var array|string
*/
protected $columns = [];
/**
* The table buttons.
*
@ -43,19 +21,4 @@ class EducationPartTableBuilder extends TableBuilder
protected $actions = [
'delete'
];
/**
* The table options.
*
* @var array
*/
protected $options = [];
/**
* The table assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -251,7 +251,7 @@ class MyProfileController extends PublicController
public function getEducation(Request $request)
{
$user = $this->userRepository->find(auth()->user()->getAuthIdentifier());
$user = $this->userRepository->find(auth()->id());
$education = EducationModel::all();
$educationPart = EducationPartModel::query()->where('education_id', $user->education)->get();
return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200);
@ -259,7 +259,7 @@ class MyProfileController extends PublicController
public function setEducation(Request $request)
{
$user_id = auth()->user()->getAuthIdentifier();
$user_id = auth()->id();
if ($request->info == 'education') {
$user = $this->userRepository->find($user_id)->update(['education' => $request->education]);
$education = EducationPartModel::query()->where('education_id', $request->education)->get();

View File

@ -37,7 +37,7 @@ class ProfileModule extends Module
],
'education_part' => [
'buttons' => [
'new_education',
'new_education_part',
]
],
];

View File

@ -105,6 +105,8 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
],
'profile/notification' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification',
'ajax/update-user-info' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@updateAjaxProfile',
'api/setEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@setEducation',
'api/getEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@getEducation',
// UserAuthenticator
'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt',
@ -143,8 +145,6 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
// CacheController
'ajax/get-user-info' => 'Visiosoft\ProfileModule\Http\Controller\CacheController@getUserInfo',
'ajax/setEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@setEducation',
'ajax/getEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@getEducation',
];
/**

View File

@ -144,11 +144,6 @@ class UsersFieldsSeeder extends Seeder
'slug' => 'education_part',
'type' => 'anomaly.field_type.select',
],
[
'name' => trans('visiosoft.module.profile::field.education_part_option.name'),
'slug' => 'education_part_option',
'type' => 'anomaly.field_type.select',
],
[
'name' => trans('visiosoft.module.profile::field.facebook_address.name'),
'slug' => 'facebook_address',