mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
parent
9efeee005d
commit
0493c83b72
@ -27,6 +27,7 @@ return [
|
||||
'sub_village' => 'Sub Village',
|
||||
'general_settings' => 'General Settings',
|
||||
'save_category' => 'Save Category',
|
||||
'change_owner' => 'Change Owner',
|
||||
'update_category' => [
|
||||
'name' => 'Update Category'
|
||||
],
|
||||
|
||||
@ -29,4 +29,6 @@ return [
|
||||
'extended' => ':number ad(s) has been extended successfully.',
|
||||
'category_not_exist' => 'This category does not exist anymore!',
|
||||
'currency_converted' => 'Currency Converted Successfully.',
|
||||
'choose_user' => 'Choose a user',
|
||||
'owner_updated_successfully' => 'The Owner Has Been Updated Successfully!',
|
||||
];
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">{{ trans('module::message.choose_user') }}</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
{% include "streams::modals/filter" %}
|
||||
|
||||
{% if not users.isEmpty() %}
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
{% for user in users %}
|
||||
<li class="nav-item">
|
||||
<a href="{{ url_to('admin/advs-users/choose/' ~ advId ~ '?user_id=' ~ user.id) }}" class="nav-link">
|
||||
<strong>{{ user.first_name }} {{ user.last_name }}</strong>
|
||||
<br>
|
||||
<small>{{ user.email }}</small>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{{ trans('streams::message.no_results') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -88,6 +88,8 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@categories',
|
||||
],
|
||||
'admin/advs' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@index',
|
||||
// User choose modal
|
||||
'admin/advs-users/choose/{advId}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@choose',
|
||||
'admin/advs/create' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@create',
|
||||
'admin/advs/edit/{id}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@edit',
|
||||
'admin/advs/list' => [
|
||||
@ -213,7 +215,6 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@getCats',
|
||||
],
|
||||
|
||||
|
||||
'ajax/getAdvs' => [
|
||||
'as' => 'ajax::getAds',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@getMyAds'
|
||||
|
||||
@ -6,6 +6,7 @@ use Anomaly\Streams\Platform\Application\Application;
|
||||
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
||||
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
|
||||
use Anomaly\Streams\Platform\Model\Cats\CatsCategoryEntryModel;
|
||||
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
|
||||
use Anomaly\UsersModule\User\UserModel;
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Http\Request;
|
||||
@ -71,6 +72,11 @@ class AdvsController extends AdminController
|
||||
],
|
||||
'edit' => [
|
||||
'href' => '/advs/edit_advs/{entry.id}',
|
||||
],
|
||||
'change_owner' => [
|
||||
'data-toggle' => 'modal',
|
||||
'data-target' => '#modal',
|
||||
'href' => 'admin/advs-users/choose/{entry.id}',
|
||||
]
|
||||
]);
|
||||
|
||||
@ -167,6 +173,17 @@ class AdvsController extends AdminController
|
||||
return $table->render();
|
||||
}
|
||||
|
||||
public function choose($advId, Request $request, UserRepositoryInterface $users)
|
||||
{
|
||||
if (empty($request->all())) {
|
||||
return $this->view->make('module::admin/advs/choose', ['users' => $users->all(), 'advId' => $advId]);
|
||||
} else {
|
||||
$this->model->newQuery()->find($advId)->update(['created_by_id' => $request->user_id]);
|
||||
$this->messages->success(trans('module::message.owner_updated_successfully'));
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new entry.
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user