mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
commit
6237355bc0
@ -56,4 +56,20 @@ $(document).ready( function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#metaPageReport').DataTable({
|
||||||
|
ajax: '/admin/api/classified/report/page',
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
data: 'name',
|
||||||
|
render: function ( data, type, row, meta ) {
|
||||||
|
return `
|
||||||
|
<a href="/admin/pages/edit/${row.id}" class="text-info">
|
||||||
|
${data ?? productsReportTrans.undefined_page}
|
||||||
|
</a>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
} );
|
} );
|
||||||
|
|||||||
@ -392,4 +392,7 @@ return [
|
|||||||
'product' => 'Product',
|
'product' => 'Product',
|
||||||
'count' => 'Count',
|
'count' => 'Count',
|
||||||
'undefined_product' => 'Undefined Product',
|
'undefined_product' => 'Undefined Product',
|
||||||
|
'pages_without_meta_information_report' => 'Pages Without Meta Information Report',
|
||||||
|
'page' => 'Page',
|
||||||
|
'undefined_page' => 'Undefined Page',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -30,6 +30,13 @@
|
|||||||
trans('visiosoft.module.advs::field.product'),
|
trans('visiosoft.module.advs::field.product'),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'title': trans('visiosoft.module.advs::field.pages_without_meta_information_report'),
|
||||||
|
'id': 'metaPageReport',
|
||||||
|
'columns': [
|
||||||
|
trans('visiosoft.module.advs::field.page'),
|
||||||
|
],
|
||||||
|
},
|
||||||
] %}
|
] %}
|
||||||
|
|
||||||
{% for report in reports %}
|
{% for report in reports %}
|
||||||
@ -58,6 +65,7 @@
|
|||||||
<script>
|
<script>
|
||||||
const productsReportTrans = {
|
const productsReportTrans = {
|
||||||
undefined_product: `{{ trans('visiosoft.module.advs::field.undefined_product') }}`,
|
undefined_product: `{{ trans('visiosoft.module.advs::field.undefined_product') }}`,
|
||||||
|
undefined_page: `{{ trans('visiosoft.module.advs::field.undefined_page') }}`,
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\Adv\Event;
|
<?php namespace Visiosoft\AdvsModule\Adv\Event;
|
||||||
|
|
||||||
|
|
||||||
class PriceChange
|
class PriceChange
|
||||||
{
|
{
|
||||||
public function __construct($request)
|
public function __construct($request)
|
||||||
|
|||||||
@ -254,6 +254,7 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
|||||||
'admin/api/classified/report/status' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@status',
|
'admin/api/classified/report/status' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@status',
|
||||||
'admin/api/classified/report/unexplained' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@unexplained',
|
'admin/api/classified/report/unexplained' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@unexplained',
|
||||||
'admin/api/classified/report/no-image' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@noImage',
|
'admin/api/classified/report/no-image' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@noImage',
|
||||||
|
'admin/api/classified/report/page' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@page',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $middleware = [
|
protected $middleware = [
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\Http\Controller\Admin;
|
<?php namespace Visiosoft\AdvsModule\Http\Controller\Admin;
|
||||||
|
|
||||||
|
use Anomaly\PagesModule\Page\Contract\PageRepositoryInterface;
|
||||||
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
||||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||||
|
|
||||||
@ -52,4 +53,23 @@ class ReportController extends AdminController
|
|||||||
'data' => $this->advRepository->getNoImageClassifiedsReport()
|
'data' => $this->advRepository->getNoImageClassifiedsReport()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function page(PageRepositoryInterface $pageRepository)
|
||||||
|
{
|
||||||
|
$pages = $pageRepository->newQuery()
|
||||||
|
->select('title as name', 'pages_pages.id')
|
||||||
|
->where(function ($q) {
|
||||||
|
$q->whereNull('meta_title')
|
||||||
|
->orWhereNull('meta_description');
|
||||||
|
})
|
||||||
|
->leftJoin('pages_pages_translations as pages_trans', function ($join) {
|
||||||
|
$join->on('pages_pages.id', '=', 'pages_trans.entry_id');
|
||||||
|
$join->whereIn('locale', [config('app.locale'), setting_value('streams::default_locale'), 'en']);
|
||||||
|
})
|
||||||
|
->get();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'data' => $pages
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
$(document).ready( function () {
|
||||||
|
$('#metaCategoryReport').DataTable({
|
||||||
|
ajax: {
|
||||||
|
url: '/admin/api/cats/report/category',
|
||||||
|
dataSrc( json ) {
|
||||||
|
json.recordsTotal = json.total;
|
||||||
|
json.recordsFiltered = json.total;
|
||||||
|
|
||||||
|
return json.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
processing: true,
|
||||||
|
serverSide: true,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
data: 'name',
|
||||||
|
render: function ( data, type, row, meta ) {
|
||||||
|
return `
|
||||||
|
<a href="/admin/cats/edit/${row.id}" class="text-info">
|
||||||
|
${data ? data : categoryReportTrans.undefined_category}
|
||||||
|
</a>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
} );
|
||||||
@ -37,5 +37,10 @@ return [
|
|||||||
'please_wait' => 'Please wait.Deleting Sub Categories',
|
'please_wait' => 'Please wait.Deleting Sub Categories',
|
||||||
'category_selection' => 'Category Selection',
|
'category_selection' => 'Category Selection',
|
||||||
'go_to_parent' => 'Go To Parent',
|
'go_to_parent' => 'Go To Parent',
|
||||||
'preview' => 'Preview'
|
'preview' => 'Preview',
|
||||||
|
|
||||||
|
// Report
|
||||||
|
'undefined_category' => 'Undefined Category',
|
||||||
|
'categories_with_no_meta_report' => 'Categories with No Meta Report',
|
||||||
|
'category' => 'Category',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
<div class="row">
|
||||||
|
{% set reports = [
|
||||||
|
{
|
||||||
|
'title': trans('visiosoft.module.cats::field.categories_with_no_meta_report'),
|
||||||
|
'id': 'metaCategoryReport',
|
||||||
|
'columns': [
|
||||||
|
trans('visiosoft.module.cats::field.category'),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
] %}
|
||||||
|
|
||||||
|
{% for report in reports %}
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header bg-danger">
|
||||||
|
<h5 class="card-title text-white">{{ report.title }}</h5>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-block">
|
||||||
|
<table id="{{ report.id }}" class="display">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{% for column in report.columns %}
|
||||||
|
<th>{{ column }}</th>
|
||||||
|
{% endfor %}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const categoryReportTrans = {
|
||||||
|
undefined_category: `{{ trans('visiosoft.module.cats::field.undefined_category') }}`,
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{{ asset_add('scripts.js', 'visiosoft.module.cats::js/admin/dashboard/report.js') }}
|
||||||
@ -184,4 +184,34 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn
|
|||||||
$cats->maincats = $catsDB->unique('id');
|
$cats->maincats = $catsDB->unique('id');
|
||||||
return $cats;
|
return $cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function noMetaReport()
|
||||||
|
{
|
||||||
|
$categories = $this->newQuery()
|
||||||
|
->select('name as category', 'cats_category.id')
|
||||||
|
->where(function ($q) {
|
||||||
|
$q->whereNull('seo_keyword')
|
||||||
|
->orWhereNull('seo_description');
|
||||||
|
})
|
||||||
|
->leftJoin('cats_category_translations as cats_trans', function ($join) {
|
||||||
|
$join->on('cats_category.id', '=', 'cats_trans.entry_id');
|
||||||
|
$join->whereIn('locale', [config('app.locale'), setting_value('streams::default_locale'), 'en']);
|
||||||
|
});
|
||||||
|
|
||||||
|
if ($search = request('search.value')) {
|
||||||
|
$categories = $categories->where('name', 'LIKE', "%$search%");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($orderDir = request('order.0.dir')) {
|
||||||
|
$categories = $categories->orderBy('category', $orderDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
$start = request('start');
|
||||||
|
$limit = request('length') ?: 10;
|
||||||
|
$page = $start ? $start / $limit + 1 : 1;
|
||||||
|
|
||||||
|
$categories = $categories->paginate($limit, ['*'], 'page', $page);
|
||||||
|
|
||||||
|
return $categories;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,4 +23,6 @@ interface CategoryRepositoryInterface extends EntryRepositoryInterface
|
|||||||
public function getDeletedCategories();
|
public function getDeletedCategories();
|
||||||
|
|
||||||
public function getMainAndSubCats();
|
public function getMainAndSubCats();
|
||||||
|
|
||||||
|
public function noMetaReport();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,6 +49,9 @@ class CatsModuleServiceProvider extends AddonServiceProvider
|
|||||||
'uses' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@all',
|
'uses' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@all',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// Admin ReportController
|
||||||
|
'admin/api/cats/report/category' => 'Visiosoft\CatsModule\Http\Controller\Admin\ReportController@category',
|
||||||
|
|
||||||
// Sitemap
|
// Sitemap
|
||||||
'sitemap.xml' => 'Visiosoft\CatsModule\Http\Controller\SitemapController@index',
|
'sitemap.xml' => 'Visiosoft\CatsModule\Http\Controller\SitemapController@index',
|
||||||
'sitemap.xml/categories' => 'Visiosoft\CatsModule\Http\Controller\SitemapController@categories',
|
'sitemap.xml/categories' => 'Visiosoft\CatsModule\Http\Controller\SitemapController@categories',
|
||||||
|
|||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?php namespace Visiosoft\CatsModule\Http\Controller\Admin;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
||||||
|
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
|
||||||
|
|
||||||
|
class ReportController extends AdminController
|
||||||
|
{
|
||||||
|
public function category(CategoryRepositoryInterface $categoryRepository)
|
||||||
|
{
|
||||||
|
return $categoryRepository->noMetaReport();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user