Merge pull request #374 from openclassify/vedat

currency && admin advs link
This commit is contained in:
Fatih Alp 2020-03-02 18:40:03 +03:00 committed by GitHub
commit 91c57efaec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 17 deletions

View File

@ -1,7 +1,7 @@
<div class="slider-text"> <div class="slider-text">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 offered-field offered-row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 offered-field offered-row">
<h3 class="ad-price"> <h3 class="ad-price">
<b>{{ adv.price.currency(null,'currency',false) }}</b> <b>{{ adv.price.currency(null,'currency') }}</b>
<!-- priceField with Block --> <!-- priceField with Block -->
{{ addBlock('ad-detail/priceField',{'adv':adv})|raw }} {{ addBlock('ad-detail/priceField',{'adv':adv})|raw }}
<!-- priceField with Block --> <!-- priceField with Block -->

View File

@ -20,7 +20,7 @@
<div class="col-md-3 text-left justify-content-center align-self-center"> <div class="col-md-3 text-left justify-content-center align-self-center">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<b>{{ adv.price.currency(null,'currency',false) }}</b> <b>{{ adv.price.currency(null,'currency') }}</b>
</div> </div>
{% if setting_value('visiosoft.module.location::list_page_location') %} {% if setting_value('visiosoft.module.location::list_page_location') %}
<div class="col-md-12 justify-content-center align-self-center text-truncate"> <div class="col-md-12 justify-content-center align-self-center text-truncate">

View File

@ -36,7 +36,7 @@
</div> </div>
</td> </td>
<td class="justify-content-center align-middle td-price"> <td class="justify-content-center align-middle td-price">
<b>{{ adv.price.currency(null,'currency',false) }}</b> <b>{{ adv.price.currency(null,'currency') }}</b>
</td> </td>
<td class="justify-content-center align-middle td-date"> <td class="justify-content-center align-middle td-date">
<small>{{ adv.created_at|date("d/m/Y") }}</small> <small>{{ adv.created_at|date("d/m/Y") }}</small>

View File

@ -27,6 +27,7 @@ use Illuminate\Contracts\Events\Dispatcher;
class AdvsController extends AdminController class AdvsController extends AdminController
{ {
private $model; private $model;
public function __construct(AdvModel $model) public function __construct(AdvModel $model)
{ {
$this->model = $model; $this->model = $model;
@ -84,20 +85,16 @@ class AdvsController extends AdminController
$table->setColumns([ $table->setColumns([
'cover_photo' => [ 'cover_photo' => [
'wrapper' => function (EntryInterface $entry, Request $request) { 'value' => function (EntryInterface $entry) {
if (strpos($entry->cover_photo, 'http') === 0) { return "<img width='80px' src='" . $this->model->AddAdsDefaultCoverImage($entry)->cover_photo . "' >";
$wrapper = '<img width="64" src="'.$entry->cover_photo.'">';
} else if (is_null($entry->cover_photo)) {
$wrapper = '<img width="64" src="{{ img(\'visiosoft.theme.base::images/no-image.png\').url }}">';
} else {
$wrapper = '<img width="64" src="'.$request->root().'/'.$entry->cover_photo.'">';
}
return $wrapper;
}, },
], ],
'entry.id', 'entry.id',
'name' => [ 'name' => [
'class' => 'advs-name', 'class' => 'advs-name',
'value' => function (EntryInterface $entry) {
return "<a href='" . $this->model->getAdvDetailLinkByModel($entry, 'list') . "' > " . $entry->name . "</a > ";
},
], ],
'price' => [ 'price' => [
'class' => 'advs-price', 'class' => 'advs-price',
@ -154,11 +151,11 @@ class AdvsController extends AdminController
'options' => $users, 'options' => $users,
], ],
'status' => [ 'status' => [
'filter' => 'select', 'filter' => 'select',
'query' => StatusFilterQuery::class, 'query' => StatusFilterQuery::class,
'options' => [ 'options' => [
'approved' => 'visiosoft.module.advs::field.status.option.approved', 'approved' => 'visiosoft.module.advs::field.status.option.approved',
'expired' => 'visiosoft.module.advs::field.status.option.expired', 'expired' => 'visiosoft.module.advs::field.status.option.expired',
'unpublished' => 'visiosoft.module.advs::field.status.option.unpublished', 'unpublished' => 'visiosoft.module.advs::field.status.option.unpublished',
'pending_admin' => 'visiosoft.module.advs::field.status.option.pending_admin', 'pending_admin' => 'visiosoft.module.advs::field.status.option.pending_admin',
'pending_user' => 'visiosoft.module.advs::field.status.option.pending_user', 'pending_user' => 'visiosoft.module.advs::field.status.option.pending_user',
@ -221,7 +218,7 @@ class AdvsController extends AdminController
{ {
$directory = 'assets'; $directory = 'assets';
$files->deleteDirectory($directory = $application->getAssetsPath($directory), true); $files->deleteDirectory($directory = $application->getAssetsPath($directory), true);
echo "<div class=\"bar\"></div>" . "<br>"; echo " < div class=\"bar\"></div>" . "<br>";
echo "<style> echo "<style>
.bar { .bar {
width: 30%; width: 30%;