Merge pull request #36 from openclassify/vedatakd

#35 Can't delete categories fix
This commit is contained in:
Fatih Alp 2019-07-11 12:23:40 +03:00 committed by GitHub
commit 6e6bacb09a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 699 additions and 25 deletions

View File

@ -2,9 +2,10 @@
return [
'name' => [
'name' => 'Title'
'name' => 'Title',
],
'order' => [
'name' => 'Order'
'name' => 'Order',
],
'please_wait' => 'Please wait.Deleting Sub Categories',
];

View File

@ -9,5 +9,6 @@
"name" =>"Sipariş",
],
'please_wait' => 'Lütfen Bekleyiniz.Alt Kategoriler Siliniyor.',
];
];

View File

@ -16,17 +16,11 @@ class CategoryCollection extends EntryCollection
{
$counter = 0;
echo "<div style='background-image:url(/addons/default/visiosoft/default-theme/resources/images/loading-animation.gif);
background-repeat:no-repeat;
width:248px;
height:248px;
padding-left: 20px;'></div>";
for ($i = 0; $i <= $counter; $i++) {
$data = CategoryModel::query()
->where('parent_category_id', $id)
->where('deleted_at', null)
->select('id', 'parent_category_id')
->where('cats_category.parent_category_id', $id)
->where('cats_category.deleted_at', null)
->select('cats_category.id', 'cats_category.parent_category_id')
->first();
if ($data != "") {
$id = $data['id'];

View File

@ -1,5 +1,6 @@
<?php namespace Visiosoft\CatsModule\Http\Controller\Admin;
use Anomaly\Streams\Platform\Image\Command\MakeImageInstance;
use Anomaly\Streams\Platform\Model\Cats\CatsCategoryEntryModel;
use Illuminate\Http\Request;
use Sunra\PhpSimple\HtmlDomParser;
@ -13,18 +14,17 @@ class CategoryController extends AdminController
{
public function index(CategoryTableBuilder $table, Request $request)
{
if($this->request->action == "delete") {
if ($this->request->action == "delete") {
$CategoriesModel = new CategoryModel();
foreach ($this->request->id as $item)
{
foreach ($this->request->id as $item) {
$CategoriesModel->deleteSubCategories($item);
}
}
$categories = 1;
if(!isset($request->cat) || $request->cat==""){
if (!isset($request->cat) || $request->cat == "") {
$categories = CategoryModel::query()->where('parent_category_id', '')->orWhereNull('parent_category_id')->get();
$categories = $categories->where('deleted_at', null);
}else{
} else {
$categories = CategoryModel::query()->where('parent_category_id', $request->cat)->whereNull('deleted_at')->get();
}
if (count($categories) == 0) {
@ -42,14 +42,14 @@ class CategoryController extends AdminController
* @param CategoryFormBuilder $form
* @return \Symfony\Component\HttpFoundation\Response
*/
public function create(CategoryFormBuilder $form,Request $request)
public function create(CategoryFormBuilder $form, Request $request)
{
if($this->request->action == "save") {
if ($this->request->action == "save") {
$all = $this->request->all();
$id = $all['parent_category'];
$k = 1;
for($i=0; $i<$k; $i++) {
$cat1 = CategoryModel::query()->where('cats_category.id', $id)->first();
for ($i = 0; $i < $k; $i++) {
$cat1 = CategoryModel::query()->where('cats_category.id', $id)->first();
if ($cat1 != null) {
$id = $cat1->parent_category_id;
$k++;
@ -80,7 +80,7 @@ class CategoryController extends AdminController
}
return $this->view->make('visiosoft.module.cats::cats/admin-cat', compact('nameField','formBuilder'));
return $this->view->make('visiosoft.module.cats::cats/admin-cat', compact('nameField', 'formBuilder'));
}
/**
@ -90,7 +90,7 @@ class CategoryController extends AdminController
* @param $id
* @return \Symfony\Component\HttpFoundation\Response
*/
public function edit(CategoryFormBuilder $form,Request $request, $id)
public function edit(CategoryFormBuilder $form, Request $request, $id)
{
if ($request->action == "update") {
$form->make($id);
@ -113,11 +113,18 @@ class CategoryController extends AdminController
public function delete($id)
{
echo "<div style='background-image:url(" . $this->dispatch(new MakeImageInstance('visiosoft.theme.default::images/loading_anim.gif', 'img'))->url() . ");
background-repeat:no-repeat;
background-size: 300px;
background-position:center;
text-align:center;
width:98%;
height:100%;
padding-left: 20px;'><h3>" . trans('visiosoft.module.cats::field.please_wait') . "</h3></div>";
$Find_Categories = CategoryModel::query()
->where('deleted_at', null)
->find($id);
if($Find_Categories != "")
{
if ($Find_Categories != "") {
$delete = new CategoryCollection();
$delete = $delete->subCatDelete($id);
header("Refresh:0");

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,671 @@
.navbar-inverse {
background-color: #3f475f;
}
@font-face{font-family:"LucidaGrande";src:url('https://s0.shbdn.com/assets/blob/LucidaGrande:00351442acc65cff9586baf06437dcd6.woff');}
@font-face{font-family:"LucidaGrande";font-weight:bold;src:url('https://s0.shbdn.com/assets/blob/LucidaGrande-Bold:fb045a5535379e5c9818873ee5c7a9b0.woff');}
.navbar-inverse {
padding-top: 3.5px;
padding-bottom: 3.5px;
}
#post-new-classified {
display: inline-block;
padding: 9px 22px;
margin-bottom: 0;
font-family: 'Lucida Grande','LucidaGrande',Arial,sans-serif;
font-size: 14px;
font-weight: bold;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: 1px solid #437db9;
border-radius: 2px;
color: #fff;
background-color: #437db9;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top,#6198d3,#437db9);
background-image: -ms-linear-gradient(top,#6198d3,#437db9);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#6198d3),color-stop(100%,#437db9));
background-image: -webkit-linear-gradient(top,#6198d3,#437db9);
background-image: -o-linear-gradient(top,#6198d3,#437db9);
background-image: linear-gradient(top,#6198d3,#437db9);
text-shadow: 1px 1px 0 #29619b;
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 2px 2px -1px rgba(0,0,0,0.15);
line-height: 1.3em;
outline: 0;
background: #489af1;
border: 0;
color: #fff;
padding: 4px 12px 5px;
font-size: 11px;
line-height: 1.4em;
padding: 10px 19px 8px 19px !important;
margin-left: 11px;
font-size: 12px;
}
.navbar-inverse .navbar-nav > li > a {
padding: 0px !important;
}
.navbar-nav > li {
padding: 5px 10px 5px 10px !important;
margin-top: 12px;
}
.register-text {
border-left: 1px solid #404349;
-webkit-box-shadow: inset 1px 0 0 0 #60656e;
box-shadow: inset 1px 0 0 0 #60656e;
}
.navbar-inverse .navbar-nav > li > a {
display: block;
color: #ebebeb;
font-size: 11px;
text-shadow: 1px 1px 0 #2f3339;
text-align: right;
}
#post-new-classified:hover {
background: rgb(51, 136, 227);
}
.search-navigation-input {
font-size: 11px;
background: rgb(47, 53, 70);
border-width: 0px;
border-style: initial;
width: 85% !important;
z-index: 0 !important;
border-color: initial;
border-image: initial;
border-radius: 3px !important;
outline: 0px;
}
.search-navigation-input:focus {
background: rgb(255, 255, 255);
outline: 0 none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.btn-search-navigation {
border-width: 0px;
border-style: initial;
border-color: initial;
border-image: initial;
padding: 7px 14px;
color: #979aa2;
margin-left: -40px !important;
background: 0px center;
outline: 0px;
border-radius: 0px 3px 3px 0px;
}
.btn-search-navigation:hover {
color: #979aa2;
background-color: transparent;
border-color: transparent;
}
.navbar-form input:focus+button {
background: #448cd6 !important;
position: relative;
color: white;
}
.navbar-form .section-searchbar {
width: 100%;
}
.new-classified {
height: 28px;
margin-top: 5px !important;
}
.navbar-brand b {
background-color: #ffe800;
padding: 7px;
color: black;
}
.gallery_product {
padding: 5px;
}
#main {
padding: 8rem 0 5rem !important;
}
html,
body,
img,
figure {
max-width: 100%
}
html,
body {
overflow-x: hidden;
color: #000;
-ms-overflow-style: scrollbar;
-webkit-font-smoothing: antialiased
}
a,
a:hover,
a:focus,
a:active {
text-decoration: none;
color: inherit
}
a {
-webkit-transition: all .25s ease-in-out;
transition: all .25s ease-in-out
}
.ct-u-paddingTop10 {
padding-top: 10px !important
}
.ct-footer {
border-top: 1px solid #dfdfdf;
background: #f9f9f9;
margin-top: 20px;
position: relative;
}
.ct-footer-pre {
width: 100%;
padding-bottom: 55px;
border-bottom: 1px solid #555;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
@media (min-width:1200px) {
.ct-footer-pre {
display: table
}
.ct-footer-pre > .inner {
display: table-cell;
vertical-align: middle
}
}
@media (max-width:1199px) {
.ct-footer-pre .form-group {
padding-top: 15px
}
}
.ct-footer-pre span {
font-family: 'Open Sans Condensed', sans-serif;
color: #ebebeb;
font-size: 30px
}
.ct-footer-pre .form-group {
position: relative;
margin: 0;
}
.ct-footer-pre .form-group:before,
.ct-footer-pre .form-group:after {
content: '';
display: table
}
.ct-footer-pre .form-group:after {
clear: both
}
.ct-footer-pre .form-group input {
border: 1px solid #00bff3;
background-color: #333;
color: #fff;
height: 50px;
padding: 0 30px;
margin: 0 5px;
border-radius: 0 !important;
}
@media (min-width:480px) {
.ct-footer-pre .form-group input {
width: 331px
}
}
.ct-footer-pre .form-group button {
height: 50px;
position: relative;
width: 80px;
padding: 0
}
@media (min-width:480px) {
.ct-footer-pre .form-group button {
top: -1px
}
}
@media (max-width:479px) {
.ct-footer-pre .form-group input {
float: left;
width: 70%;
margin: 0
}
.ct-footer-pre .form-group button {
float: left;
width: 30%
}
}
.ct-footer-list {
padding: 25px 0;
list-style: none;
padding-left: 0;
display: table;
width: 100%;
border-bottom: 1px solid #555;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
@media (max-width:479px) {
.ct-footer-list {
padding: 20px 0
}
}
@media (min-width:1200px) {
.ct-footer-list > li {
width: 20%;
display: table-cell;
vertical-align: top
}
.ct-footer-list > li:last-child {
width: 7%
}
}
@media (min-width:768px) and (max-width:1199px) {
.ct-footer-list > li {
width: 33.3333%
}
}
@media (min-width:480px) and (max-width:767px) {
.ct-footer-list > li {
width: 50%
}
}
@media (max-width:479px) {
.ct-footer-list > li {
width: 100%;
text-align: center
}
}
@media (max-width:1199px) {
.ct-footer-list > li {
display: inline-block;
float: left
}
}
.ct-footer-list > li .ct-footer-list-header {
font-size: 14px;
font-weight: bold;
color: #555;
}
.ct-footer-list > li ul {
list-style: none;
padding-left: 0;
}
.ct-footer-list > li ul li a {
color: #888;
}
.ct-footer-list > li ul li a:hover {
text-decoration: underline
}
.ct-footer-post {
background: #000;
padding: 30px 0;
}
.ct-footer-post .inner-left,
.ct-footer-post .inner-right {
padding: 20px 0
}
.ct-footer-post ul {
list-style: none;
padding-left: 0;
margin: 0 -20px;
}
.ct-footer-post ul li {
display: inline-block;
margin: 0 20px
}
.ct-footer-post a {
color: #fff;
}
.ct-footer-post a:hover {
text-decoration: underline
}
.ct-footer-post p {
color: #fff;
}
@media (min-width:768px) {
.ct-footer-post p {
display: inline-block
}
.ct-footer-post p + p {
padding-left: 50px
}
}
@media (min-width:992px) {
.ct-footer-post .inner-left {
float: left
}
.ct-footer-post .inner-right {
float: right
}
}
@media (max-width:991px) {
.ct-footer-post {
text-align: center
}
}
.ct-footer-meta {
padding-top: 30px;
}
.ct-footer-meta .ct-socials {
padding: 20px 0;
}
.ct-footer-meta .ct-socials li {
padding: 0 3px
}
.ct-footer--with-button {
padding-top: 150px
}
address {
color: #fff;
display: inline-block;
}
address span {
font-weight: 600
}
address a {
color: #fff;
}
address a:hover {
text-decoration: underline
}
@media (max-width:767px) {
address {
padding-top: 30px
}
}
.btn.btn-motive {
background-color: #00bff3;
-webkit-transition: all .25s ease;
transition: all .25s ease;
}
.btn.btn-motive:hover {
background-color: #00bff3;
}
.btn.btn-motive:hover:active {
background-color: #00bff3
}
.btn.btn-violet {
color: #fff;
background-color: #4f4f99;
-webkit-transition: all .25s ease;
transition: all .25s ease;
}
.btn.btn-violet:hover {
background-color: #37376b;
}
.btn.btn-violet:hover:active {
background-color: #2f2f5b
}
.btn.btn-green {
color: #fff;
background-color: #43670f;
-webkit-transition: all .25s ease;
transition: all .25s ease;
}
.btn.btn-green:hover {
background-color: #36520c;
}
.btn.btn-green:hover:active {
background-color: #314a0b
}
.btn.btn-red {
color: #fff;
background-color: #da2229;
-webkit-transition: all .25s ease;
transition: all .25s ease;
}
.btn.btn-red:hover {
background-color: #ae1b21;
}
.btn.btn-red:hover:active {
background-color: #9d181e
}
.btn.btn-white {
background-color: #fff;
-webkit-transition: all .25s ease;
transition: all .25s ease;
}
.btn.btn-white:hover {
background-color: #d9d9d9;
}
.btn.btn-white:hover:active {
background-color: #c9c9c9
}
.btn.btn-large {
padding: 20px 50px;
font-size: 30px;
white-space: normal;
}
@media (max-width:479px) {
.btn.btn-large {
padding: 20px 10px;
line-height: .9;
font-size: 26px;
letter-spacing: -.2px
}
}
.ct-mediaSection {
background-attachment: fixed
}
.ct-section_header--type1 {
font-family: 'Open Sans Condensed', sans-serif;
color: #000;
font-size: 115px;
text-transform: uppercase;
}
@media (max-width:479px) {
.ct-section_header--type1 {
font-size: 60px;
line-height: .8
}
}
.ct-section_header--type2 small {
font-family: 'coquette', fantasy;
font-size: 58px;
line-height: .7;
display: block;
font-weight: 700;
position: relative;
left: -12px
}
.ct-section_header--type2 span {
font-family: 'Bebas Neue';
font-size: 115px;
line-height: .8
}
.ct-section_header--type2 img {
display: inline-block;
float: left;
position: relative;
top: 15px;
padding-right: 3px
}
.ct-section_header--type3 {
text-align: center;
}
.ct-section_header--type3 small {
font-family: 'coquette', fantasy;
font-size: 50px;
padding: 15px 0;
font-weight: 700;
color: #fff;
background-image: url("/core/fileparse.php/16/urlt/../images/ribbon.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
display: block
}
.ct-section_header--type3 span {
font-family: 'Bebas Neue';
font-size: 150px;
font-weight: 400;
text-transform: uppercase;
line-height: .85
}
@media (max-width:479px) {
.ct-section_header--type3 small {
font-size: 25px
}
.ct-section_header--type3 span {
font-size: 90px
}
}
.ct-section_header--type4 {
text-align: center;
}
.ct-section_header--type4:before,
.ct-section_header--type4:after {
content: '';
display: table
}
.ct-section_header--type4:after {
clear: both
}
.ct-section_header--type4 small {
font-family: 'coquette', fantasy;
font-size: 50px;
color: inherit;
font-weight: 700;
display: block
}
.ct-section_header--type4 span {
font-family: 'nimbus-sans-condensed', sans-serif;
font-weight: 400;
font-weight: bold;
font-size: 150px;
text-transform: uppercase;
display: block;
line-height: .7
}
@media (max-width:479px) {
.ct-section_header--type4 small {
font-size: 40px
}
.ct-section_header--type4 span {
font-size: 80px
}
}
.ct-section_header + p {
font-size: 30px;
font-weight: 700;
letter-spacing: -1.5px;
text-align: center;
}
@media (max-width:479px) {
.ct-section_header + p {
font-size: 22px
}
}
.ct-section_header--type4 + p {
font-family: 'nimbus-sans-condensed', sans-serif;
font-weight: 400;
font-size: 40px;
font-weight: 700;
line-height: 1;
}
@media (max-width:479px) {
.ct-section_header--type4 + p {
font-size: 28px
}
}
.footer-appStore, .footer-googlePlay {
width: 96px;
height: 30px;
}
.mobile-app-footer {
margin-right: 10px;
}