mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #885 from openclassify/muammertop
#2864 Request from walter for OC
This commit is contained in:
commit
e3b78842d8
@ -165,6 +165,7 @@ return [
|
||||
'edit' => 'Edit',
|
||||
'approve' => 'Approve',
|
||||
'passive' => "Passive",
|
||||
'sold' => 'Sold',
|
||||
'offered_by' => 'Offered By',
|
||||
'more_ads_by' => 'More Ads By',
|
||||
'click_phone' => 'Show phone number',
|
||||
|
||||
@ -29,4 +29,5 @@ return [
|
||||
'this_ad_is_not_valid_anymore' => "This ad is not valid anymore!",
|
||||
'approve_status_change' => "Your Ad's Status Has Been Set to Active!",
|
||||
'passive_status_change' => "Your Ad's Status Has Been Set to Passive!",
|
||||
'sold_status_change' => "Your Ad's Status Has Been Set to Sold!",
|
||||
];
|
||||
|
||||
@ -20,6 +20,12 @@
|
||||
{{ trans('visiosoft.module.advs::field.passive') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if adv.status != 'sold' and adv.is_get_adv != '1' %}
|
||||
<a class="dropdown-item" href="{{ route('visiosoft.module.advs::status',[adv.id,"sold"]) }}">
|
||||
<i class="fa fa-gavel"></i>
|
||||
{{ trans('visiosoft.module.advs::field.sold') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{{ asset_add("styles.css", "visiosoft.module.advs::css/dropleft-edit.css") }}
|
||||
|
||||
@ -980,9 +980,13 @@ class AdvsController extends PublicController
|
||||
|
||||
$this->adv_model->statusAds($id, $type);
|
||||
event(new ChangedStatusAd($ad));//Create Notify
|
||||
$message = $type === 'approved' ?
|
||||
trans('visiosoft.module.advs::message.approve_status_change')
|
||||
: trans('visiosoft.module.advs::message.passive_status_change');
|
||||
if ($type === 'approved') {
|
||||
$message = trans('visiosoft.module.advs::message.approve_status_change');
|
||||
} elseif ($type === 'sold') {
|
||||
$message = trans('visiosoft.module.advs::message.sold_status_change');
|
||||
} else {
|
||||
trans('visiosoft.module.advs::message.passive_status_change');
|
||||
}
|
||||
$this->messages->success($message);
|
||||
return back();
|
||||
}
|
||||
@ -1263,4 +1267,13 @@ class AdvsController extends PublicController
|
||||
$this->messages->success(trans('visiosoft.module.advs::message.extended', ['number' => $adsExtended]));
|
||||
return $this->redirect->back();
|
||||
}
|
||||
|
||||
public function sold($id, Request $request, AdvModel $advModel)
|
||||
{
|
||||
if ($request->sold == 'sold') {
|
||||
$advModel->find($id)->update(['status' => 'sold']);
|
||||
} elseif ($request->sold = 'not-sold') {
|
||||
$advModel->find($id)->update(['status' => 'approved']);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user