mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-06 05:16:05 -06:00
commit for comment in pull req
This commit is contained in:
parent
d2665a951a
commit
28b67a2f49
@ -1,6 +1,6 @@
|
|||||||
$(() => {
|
$(() => {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/ajax/getEducation',
|
url: '/api/getEducation',
|
||||||
success: ((res)=>{
|
success: ((res)=>{
|
||||||
$.each(res['education-part'], function (key, value) {
|
$.each(res['education-part'], function (key, value) {
|
||||||
var selected = ""
|
var selected = ""
|
||||||
@ -12,14 +12,14 @@ $(() => {
|
|||||||
|
|
||||||
$('#education').on('change', () => {
|
$('#education').on('change', () => {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/api/setEducation',
|
url: '/api/changeEducation',
|
||||||
data: {
|
data: {
|
||||||
info: 'education',
|
info: 'education',
|
||||||
education: $('#education').val()
|
education: $('#education').val()
|
||||||
},beforeSend: function (){
|
},beforeSend: function (){
|
||||||
$('#education_part').html('');
|
$('#education_part').html('');
|
||||||
},success: function (response) {
|
},success: function (response) {
|
||||||
$('#education_part').html('<option>'+ choose_an_option +'</option>')
|
$('#education_part').html('<option value="">'+ choose_an_option +'</option>')
|
||||||
$.each(response.data, function (key, value) {
|
$.each(response.data, function (key, value) {
|
||||||
$('#education_part').append(
|
$('#education_part').append(
|
||||||
'<option value="'+ value.id +'">'+ value.name +'</option>'
|
'<option value="'+ value.id +'">'+ value.name +'</option>'
|
||||||
@ -28,14 +28,4 @@ $(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#education_part').on('change', () => {
|
|
||||||
$.ajax({
|
|
||||||
url: '/api/setEducation',
|
|
||||||
data: {
|
|
||||||
info: 'education_part',
|
|
||||||
education: $('#education_part').val()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
<?php namespace Visiosoft\ProfileModule\Http\Controller\Admin;
|
||||||
|
|
||||||
|
use Visiosoft\ProfileModule\Education\Form\EducationFormBuilder;
|
||||||
|
use Visiosoft\ProfileModule\Education\Table\EducationTableBuilder;
|
||||||
|
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
||||||
|
|
||||||
|
class EducationController extends AdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display an index of existing entries.
|
||||||
|
*
|
||||||
|
* @param EducationTableBuilder $table
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function index(EducationTableBuilder $table)
|
||||||
|
{
|
||||||
|
return $table->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new entry.
|
||||||
|
*
|
||||||
|
* @param EducationFormBuilder $form
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function create(EducationFormBuilder $form)
|
||||||
|
{
|
||||||
|
return $form->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit an existing entry.
|
||||||
|
*
|
||||||
|
* @param EducationFormBuilder $form
|
||||||
|
* @param $id
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function edit(EducationFormBuilder $form, $id)
|
||||||
|
{
|
||||||
|
return $form->render($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
<?php namespace Visiosoft\ProfileModule\Http\Controller\Admin;
|
||||||
|
|
||||||
|
use Visiosoft\ProfileModule\EducationPart\Form\EducationPartFormBuilder;
|
||||||
|
use Visiosoft\ProfileModule\EducationPart\Table\EducationPartTableBuilder;
|
||||||
|
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
||||||
|
|
||||||
|
class EducationPartController extends AdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display an index of existing entries.
|
||||||
|
*
|
||||||
|
* @param EducationPartTableBuilder $table
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function index(EducationPartTableBuilder $table)
|
||||||
|
{
|
||||||
|
return $table->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new entry.
|
||||||
|
*
|
||||||
|
* @param EducationPartFormBuilder $form
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function create(EducationPartFormBuilder $form)
|
||||||
|
{
|
||||||
|
return $form->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit an existing entry.
|
||||||
|
*
|
||||||
|
* @param EducationPartFormBuilder $form
|
||||||
|
* @param $id
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function edit(EducationPartFormBuilder $form, $id)
|
||||||
|
{
|
||||||
|
return $form->render($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -257,16 +257,11 @@ class MyProfileController extends PublicController
|
|||||||
return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200);
|
return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setEducation(Request $request)
|
public function changeEducation(Request $request)
|
||||||
{
|
{
|
||||||
$user_id = auth()->id();
|
|
||||||
if ($request->info == 'education') {
|
if ($request->info == 'education') {
|
||||||
$user = $this->userRepository->find($user_id)->update(['education' => $request->education]);
|
|
||||||
$education = EducationPartModel::query()->where('education_id', $request->education)->get();
|
$education = EducationPartModel::query()->where('education_id', $request->education)->get();
|
||||||
} elseif ($request->info == 'education_part') {
|
|
||||||
$user = $this->userRepository->find($user_id)->update(['education_part' => $request->education]);
|
|
||||||
$education = EducationPartOptionModel::query()->where('education_part_id', $request->education)->get();
|
|
||||||
}
|
}
|
||||||
return response()->json(['messages' => $user, 'data' => $education], 200);
|
return response()->json(['data' => $education], 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,7 @@ class ProfileFormHandler
|
|||||||
if (setting_value('visiosoft.module.profile::show_education_profession')) {
|
if (setting_value('visiosoft.module.profile::show_education_profession')) {
|
||||||
$parameters = array_merge($parameters, [
|
$parameters = array_merge($parameters, [
|
||||||
'education' => $builder->getPostValue('education'),
|
'education' => $builder->getPostValue('education'),
|
||||||
|
'education_part' => $builder->getPostValue('education_part'),
|
||||||
'state_of_education' => $builder->getPostValue('state_of_education'),
|
'state_of_education' => $builder->getPostValue('state_of_education'),
|
||||||
'profession' => $builder->getPostValue('profession'),
|
'profession' => $builder->getPostValue('profession'),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
|||||||
],
|
],
|
||||||
'profile/notification' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification',
|
'profile/notification' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification',
|
||||||
'ajax/update-user-info' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@updateAjaxProfile',
|
'ajax/update-user-info' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@updateAjaxProfile',
|
||||||
'api/setEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@setEducation',
|
'api/changeEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@changeEducation',
|
||||||
'api/getEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@getEducation',
|
'api/getEducation' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@getEducation',
|
||||||
|
|
||||||
// UserAuthenticator
|
// UserAuthenticator
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user