diff --git a/plugins/rainlab/blog/models/Post.php b/plugins/rainlab/blog/models/Post.php
index 2f7525638..23508bb16 100644
--- a/plugins/rainlab/blog/models/Post.php
+++ b/plugins/rainlab/blog/models/Post.php
@@ -234,7 +234,7 @@ class Post extends Model
// \Log::info($fields->category_groups->value);
// \Log::info($fields->category_groupsq->value);
-
+
if (isset($this->awtor)) {
if ($this->awtor->type == 'other' && $context == "create") {
$fields->author_name->value = '';
diff --git a/plugins/tps/reklama/components/Advertisement.php b/plugins/tps/reklama/components/Advertisement.php
index 0ac950f03..6ec107396 100644
--- a/plugins/tps/reklama/components/Advertisement.php
+++ b/plugins/tps/reklama/components/Advertisement.php
@@ -117,15 +117,16 @@ class Advertisement extends ComponentBase
$statistika->increment('click');
}
- //if($data['url']){
-
+
+ // if($data['url']){
+
// $this->page['url'] = $data['url'];
- //return Redirect::to($data['url']);
+ // return Redirect::to($data['url']);
// return [
// '@#'.$this->alias => $this->renderPartial('@redirect'),
//];
-
- //}
+
+ // }
}
}
diff --git a/plugins/tps/reklama/components/advertisement/default.htm b/plugins/tps/reklama/components/advertisement/default.htm
index 87222bd24..377a61e23 100644
--- a/plugins/tps/reklama/components/advertisement/default.htm
+++ b/plugins/tps/reklama/components/advertisement/default.htm
@@ -1,16 +1,16 @@
-
+
{% if __SELF__.property('random') %}
{% put scripts %}
-
+ -->
{% endput %}
{% else %}
{% partial __SELF__ ~ "::"~ __SELF__.property('type') %}
{% endif %}
-
+
diff --git a/plugins/tps/reklama/components/advertisement/slider.htm b/plugins/tps/reklama/components/advertisement/slider.htm
index 263988748..26b27c54d 100644
--- a/plugins/tps/reklama/components/advertisement/slider.htm
+++ b/plugins/tps/reklama/components/advertisement/slider.htm
@@ -1,9 +1,10 @@
{% if __SELF__.group and __SELF__.group.adds %}
-
+
{% for reklama in __SELF__.group.adds %}
-
+
+
{% endfor %}
-
-{% if __SELF__.property('random') %}
-
-{% else %}
-{% put scripts %}
-
-{% endput %}
-{% endif %}
{% endif %}
diff --git a/plugins/tps/reklama/controllers/reklamascontroller/config_filter.yaml b/plugins/tps/reklama/controllers/reklamascontroller/config_filter.yaml
new file mode 100644
index 000000000..9d3771d75
--- /dev/null
+++ b/plugins/tps/reklama/controllers/reklamascontroller/config_filter.yaml
@@ -0,0 +1,50 @@
+# ===================================
+# Filter Scope Definitions
+# ===================================
+
+scopes:
+ title:
+ label: Title Search
+ type: text
+ modelClass: Tps\Reklama\Models\Reklama
+ scope: FilterName
+
+ category:
+
+ # Filter name
+ label: rainlab.blog::lang.posts.filter_category
+
+ # Model Class name
+ modelClass: Tps\Reklama\Models\Group
+
+ # Model attribute to display for the name
+ nameFrom: name
+
+ # Apply query scope
+ scope: FilterCategories
+
+ published:
+
+ # Filter name
+ label: rainlab.blog::lang.posts.filter_published
+
+ # Filter type
+ type: switch
+
+ # SQL Conditions
+ conditions:
+ - active <> '1'
+ - active = '1'
+
+ published_date:
+
+ # Filter name
+ label: rainlab.blog::lang.posts.filter_date
+
+ # Filter type
+ type: daterange
+
+ # SQL Conditions
+ conditions: created_at >= ':after' AND created_at <= ':before'
+
+
diff --git a/plugins/tps/reklama/controllers/reklamascontroller/config_list.yaml b/plugins/tps/reklama/controllers/reklamascontroller/config_list.yaml
index 47471683c..5815da63b 100644
--- a/plugins/tps/reklama/controllers/reklamascontroller/config_list.yaml
+++ b/plugins/tps/reklama/controllers/reklamascontroller/config_list.yaml
@@ -10,3 +10,4 @@ toolbar:
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'
+filter: config_filter.yaml
diff --git a/plugins/tps/reklama/models/Reklama.php b/plugins/tps/reklama/models/Reklama.php
index d0e385ed9..2463ad828 100644
--- a/plugins/tps/reklama/models/Reklama.php
+++ b/plugins/tps/reklama/models/Reklama.php
@@ -21,7 +21,7 @@ class Reklama extends Model
* @var string The database table used by the model.
*/
public $table = 'tps_reklama_item';
-
+
public $translatable = [
'media',
'media_mobile',
@@ -62,6 +62,18 @@ class Reklama extends Model
}
+ public function scopeFilterName($query, $name)
+ {
+ return $query->where('title', 'LIKE', '%' . $name . '%');
+ }
+
+ public function scopeFilterCategories($query, $group)
+ {
+ return $query->whereHas('group', function ($q) use ($group) {
+ $q->whereIn('id', $group);
+ });
+ }
+
public function getViewsAttribute(){
if($this->enable_stats)
return $this->stats->sum('view');
diff --git a/plugins/tps/reklama/models/reklama/columns.yaml b/plugins/tps/reklama/models/reklama/columns.yaml
index ab9623f7e..9c9f2d046 100644
--- a/plugins/tps/reklama/models/reklama/columns.yaml
+++ b/plugins/tps/reklama/models/reklama/columns.yaml
@@ -20,8 +20,8 @@ columns:
type: text
searchable: true
sortable: true
+ select: name
relation: group
- valueFrom: name
views:
label: views
type: text
diff --git a/themes/modern2/layouts/new/master.htm b/themes/modern2/layouts/new/master.htm
index 394aa4aa4..1a68045c5 100644
--- a/themes/modern2/layouts/new/master.htm
+++ b/themes/modern2/layouts/new/master.htm
@@ -53,8 +53,6 @@ random = 0
{% partial 'new/mobile-menu' %}
-
-
@@ -63,7 +61,7 @@ random = 0
{{'site.slogan'|_}}
@@ -116,9 +114,9 @@ random = 0
{% partial 'new/menu' %}
-
+
{% partial 'new/latest-news-mobile' %}
-
+
{% partial 'new/morque' %}
@@ -129,15 +127,20 @@ random = 0
{% partial 'new/footer' %}
-
+
- {% scripts %}
+ {% scripts %}
+
{% framework extras %}
+
+
+
+
@@ -151,4 +154,4 @@ random = 0