Merge pull request #885 from openclassify/muammertop

#2864 Request from walter for OC
This commit is contained in:
Fatih Alp 2020-12-28 19:27:58 +03:00 committed by GitHub
commit e3b78842d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 3 deletions

View File

@ -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',

View File

@ -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!",
];

View File

@ -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") }}

View File

@ -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']);
}
}
}