Merge pull request #1889 from rahulshukla-webkul/development

Issue #1808
This commit is contained in:
Jitendra Singh 2019-12-13 14:39:54 +05:30 committed by GitHub
commit 9f5c82068e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 77 additions and 11 deletions

View File

@ -120,6 +120,10 @@ class ConfigurationController extends Controller
{
Event::fire('core.configuration.save.before');
$this->validate(request(), [
'general.design.admin_logo.logo_image' => 'required|mimes:jpeg,bmp,png,jpg'
]);
$this->coreConfigRepository->create(request()->all());
Event::fire('core.configuration.save.after');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=62a1f3ccf04e55a10ae8",
"/css/ui.css": "/css/ui.css?id=dec1ede3219df6514109"
"/js/ui.js": "/js/ui.js?id=96cb056c865e3f06e093",
"/css/ui.css": "/css/ui.css?id=cf2acf741bc8b8928209"
}

View File

@ -142,8 +142,6 @@ abstract class DataGrid
public function __construct()
{
$this->invoker = $this;
$this->itemsPerPage = core()->getConfigData('general.general.locale_options.admin_page_limit') ?: $this->itemsPerPage;
}
/**
@ -167,6 +165,10 @@ abstract class DataGrid
unset($parsedUrl['page']);
}
$this->itemsPerPage = isset($parsedUrl['perPage']) ? $parsedUrl['perPage']['eq'] : $this->itemsPerPage;
unset($parsedUrl['perPage']);
return $parsedUrl;
}

View File

@ -16,6 +16,17 @@
position: absolute;
right: 25px;
}
.per-page {
right: 250px;
.per-page-label {
position: absolute;
right: 120px;
width: 100%;
top: 8px;
}
}
}
.filter-row-two {

View File

@ -13,6 +13,7 @@ return [
'no-records' => 'لا توجد سجلات',
'filter-fields-missing' => 'بعض الحقل المطلوب هو لاغ ، رجاء تفقد عمود ، حالة و قيمة صحيح',
'click_on_action' => 'هل تريد حقا أن تؤدي هذا العمل؟'
'click_on_action' => 'هل تريد حقا أن تؤدي هذا العمل؟',
'items-per-page' => 'Items Per Page',
]
];

View File

@ -35,6 +35,7 @@ return [
'true' => 'True / Active',
'false' => 'False / Inactive',
'between' => 'Is between',
'apply' => 'Apply'
'apply' => 'Apply',
'items-per-page' => 'Items Per Page',
]
];

View File

@ -31,6 +31,7 @@ return [
'true' => 'صحیح / فعال',
'false' => 'غلط / غیرفعال',
'between' => 'ما بین',
'apply' => 'درخواست'
'apply' => 'درخواست',
'items-per-page' => 'Items Per Page',
]
];

View File

@ -31,6 +31,7 @@ return [
'true' => 'Verdadeiro / Ativo',
'false' => 'Falso / Inativo',
'between' => 'Está entre',
'apply' => 'Aplicar'
'apply' => 'Aplicar',
'items-per-page' => 'Items Per Page',
]
];

View File

@ -130,6 +130,22 @@
</ul>
</div>
</div>
<div class="dropdown-filters per-page">
<div class="control-group">
<label class="per-page-label" for="perPage">
{{ __('ui::app.datagrid.items-per-page') }}
</label>
<select id="perPage" name="perPage" class="control" v-model="perPage" v-on:change="paginate">
<option value="10"> 10 </option>
<option value="20"> 20 </option>
<option value="30"> 30 </option>
<option value="40"> 40 </option>
<option value="50"> 50 </option>
</select>
</div>
</div>
</div>
<div class="filter-row-two">
@ -198,12 +214,21 @@
stringConditionSelect: false,
booleanConditionSelect: false,
numberConditionSelect: false,
datetimeConditionSelect: false
datetimeConditionSelect: false,
perPage: 10,
}
},
mounted: function() {
this.setParamsAndUrl();
if (this.filters.length) {
for (let i = 0; i < this.filters.length; i++) {
if (this.filters[i].column == 'perPage') {
this.perPage = this.filters[i].val;
}
}
}
},
methods: {
@ -513,6 +538,14 @@
newParams = '';
for(i = 0; i < this.filters.length; i++) {
if (this.filters[i].column == 'status') {
if (this.filters[i].val.includes("True")) {
this.filters[i].val = 1;
} else if (this.filters[i].val.includes("False")) {
this.filters[i].val = 0;
}
}
if (i == 0) {
newParams = '?' + this.filters[i].column + '[' + this.filters[i].cond + ']' + '=' + this.filters[i].val;
} else {
@ -676,6 +709,18 @@
this.allSelected = false;
this.massActionType = null;
},
paginate: function(e) {
for (let i = 0; i < this.filters.length; i++) {
if (this.filters[i].column == 'perPage') {
this.filters.splice(i, 1);
}
}
this.filters.push({"column":"perPage","cond":"eq","val": e.target.value});
this.makeURL();
}
}
});