camaleon_cms 2.4.5.8 → 2.4.5.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of camaleon_cms might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/README.md +120 -106
- data/app/assets/javascripts/camaleon_cms/admin/_data.js +1 -0
- data/app/assets/stylesheets/camaleon_cms/admin/lte/_admin.css.scss +4 -4
- data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-blue.css +1 -1
- data/app/assets/stylesheets/camaleon_cms/admin/lte/skins/skin-purple.css +1 -0
- data/app/controllers/camaleon_cms/admin/media_controller.rb +11 -7
- data/app/controllers/camaleon_cms/admin/posts_controller.rb +6 -2
- data/app/decorators/camaleon_cms/post_tag_decorator.rb +6 -0
- data/app/helpers/camaleon_cms/admin/application_helper.rb +0 -13
- data/app/models/camaleon_cms/media.rb +5 -5
- data/app/uploaders/camaleon_cms_aws_uploader.rb +34 -10
- data/app/uploaders/camaleon_cms_local_uploader.rb +22 -18
- data/app/uploaders/camaleon_cms_uploader.rb +22 -2
- data/app/views/camaleon_cms/admin/plugins/_plugins_list.html.erb +3 -2
- data/app/views/layouts/camaleon_cms/admin/_footer.html.erb +1 -1
- data/app/views/layouts/camaleon_cms/admin/_sidebar.html.erb +1 -1
- data/config/locales/camaleon_cms/admin/ar.yml +683 -0
- data/config/locales/camaleon_cms/common.yml +66 -0
- data/config/locales/camaleon_cms/languages.yml +26 -1
- data/config/system.json +2 -2
- data/db/migrate/20180704211100_adjust_field_length.rb +9 -0
- data/lib/camaleon_cms/version.rb +1 -1
- data/lib/generators/camaleon_cms/theme_generator.rb +13 -18
- data/lib/generators/camaleon_cms/theme_template/{app/apps/themes/my_theme/assets → assets}/css/main.css +1 -1
- data/lib/generators/camaleon_cms/theme_template/{app/apps/themes/my_theme/assets → assets}/images/image.png +0 -0
- data/lib/generators/camaleon_cms/theme_template/{app/apps/themes/my_theme/assets → assets}/js/main.js +1 -1
- data/lib/generators/camaleon_cms/theme_template/{app/apps/themes/my_theme/config → config}/config.json +0 -0
- data/lib/generators/camaleon_cms/theme_template/{app/apps/themes/my_theme/main_helper.rb → main_helper.rb} +0 -0
- data/lib/generators/camaleon_cms/theme_template/{app/apps/themes/my_theme/views → views}/admin/settings.html.erb +0 -0
- data/lib/generators/camaleon_cms/theme_template/{app/apps/themes/my_theme/views → views}/index.html.erb +0 -0
- data/lib/generators/camaleon_cms/theme_template/{app/apps/themes/my_theme/views → views}/layouts/index.html.erb +0 -0
- data/lib/generators/camaleon_cms/theme_template/{app/apps/themes/my_theme/views → views}/partials/readme.txt +0 -0
- data/lib/plugin_routes.rb +2 -8
- data/spec/dummy/bin/bundle +1 -1
- data/spec/dummy/bin/rails +1 -1
- data/spec/dummy/bin/setup +20 -13
- data/spec/dummy/bin/update +31 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/db/schema.rb +159 -1
- data/spec/factories/post.rb +10 -10
- data/spec/factories/post_type.rb +1 -1
- data/spec/factories/site.rb +3 -3
- data/spec/factories/user.rb +6 -6
- data/spec/features/admin/plugins_spec.rb +3 -3
- data/spec/spec_helper.rb +23 -28
- data/spec/support/capybara_normalize_whitespace_patch.rb +17 -0
- data/spec/support/common.rb +4 -5
- metadata +66 -60
- data/spec/support/fixtures/rails_tmp.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9bf07b929fdbe26db480e4e15c75da77962e3f5b3e2a756d06df6c8c8d3e52b8
|
4
|
+
data.tar.gz: 459486f3e3972460710bb67fccb573cc93c5798882398ccac4a7e96b21fada25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47304ac32cccfe35a3e44aa6d5fbc64b02235173c886a773bb5449019d1475e432420088233c598b49097b3e428601d15e681ad7a69ccade3936d31f66cbea60
|
7
|
+
data.tar.gz: 19b2e90cd910cf0428b49ae7a648d24f10e3bc7ffd0e0eb2309f4c082b16caf93685af9b48e22dd104b73637839aae40a579b7cebd8fa2caa419383059dda059
|
data/README.md
CHANGED
@@ -1,46 +1,128 @@
|
|
1
|
-
|
2
|
-
![](https://img.shields.io/badge/Ruby-2.2%2B-green.svg)
|
3
|
-
![](https://img.shields.io/badge/SQLITE-100%25-green.svg)
|
4
|
-
![](https://img.shields.io/badge/Mysql-100%25-green.svg)
|
5
|
-
![](https://img.shields.io/badge/Postgres-100%25-green.svg)
|
6
|
-
![](https://img.shields.io/badge/TDD-70%25-yellowgreen.svg)
|
7
|
-
![](https://img.shields.io/badge/DOCS-60%25-yellow.svg)
|
8
|
-
![](https://img.shields.io/badge/Support-Inmediate-green.svg)
|
9
|
-
[![Build Status](https://travis-ci.org/owen2345/camaleon-cms.svg?branch=master)](https://travis-ci.org/owen2345/camaleon-cms)
|
1
|
+
# CAMALEON CMS
|
10
2
|
|
11
3
|
![](http://camaleon.tuzitio.com/media/132/logo2.png)
|
12
4
|
|
13
|
-
|
5
|
+
[![Build Status](https://travis-ci.org/owen2345/camaleon-cms.svg?branch=master)](https://travis-ci.org/owen2345/camaleon-cms)
|
6
|
+
![](https://img.shields.io/badge/Support-Immediate-green.svg)
|
7
|
+
|
14
8
|
[Website](http://camaleon.tuzitio.com/)
|
15
9
|
|
10
|
+
[Documentation](http://camaleon.tuzitio.com/docs.html)
|
11
|
+
|
16
12
|
[Demonstration](http://camaleon.tuzitio.com/plugins/demo_manage/)
|
17
13
|
|
14
|
+
## About
|
15
|
+
|
16
|
+
Camaleon CMS is a dynamic and advanced content management system based on Ruby on Rails that adapts to your needs. This CMS is an alternative to Wordpress for Ruby on Rails developers to manage advanced content easier.
|
18
17
|
|
19
|
-
|
18
|
+
Camaleon CMS is a flexible manager where you can build your custom content structure without coding anything by custom fields and custom contents type.
|
20
19
|
|
21
|
-
|
20
|
+
To download or publish themes go to Theme store:
|
21
|
+
http://camaleon.tuzitio.com/store/themes
|
22
|
+
|
23
|
+
To download or publish plugins go to Plugin store:
|
24
|
+
http://camaleon.tuzitio.com/store/plugins
|
25
|
+
|
26
|
+
![](screenshot.png)
|
22
27
|
|
23
|
-
|
24
|
-
* Rails
|
25
|
-
*
|
28
|
+
## With Camaleon you can do:
|
29
|
+
* Integrate into existing Rails projects
|
30
|
+
* Multiples sites in the same installation
|
31
|
+
* Multi-language sites
|
32
|
+
* Design and create the architecture of your project without programming by dynamic contents and fields
|
33
|
+
* Extend or customize the functionality using plugins
|
34
|
+
* Manage your content visualization using themes
|
35
|
+
* Easier administration. Camaleon CMS permits you to adapt the CMS to all your needs and not you adapt to the CMS. You can create your custom architecture with any custom attributes that you need for all content types.
|
36
|
+
|
37
|
+
## Some features
|
38
|
+
* Camaleon CMS is FREE and Open source
|
39
|
+
* Shortcodes
|
40
|
+
* Widgets
|
41
|
+
* Drag and Drop / Sortable / Multi level menus
|
42
|
+
* Templates/Layouts for pages
|
43
|
+
* Advanced User roles
|
44
|
+
* File Uploads with built in Local and Amazon S3 support
|
45
|
+
* Easy migration from Wordpress
|
46
|
+
* Security
|
47
|
+
- Remote code execution
|
48
|
+
- SQL injections
|
49
|
+
- Advanced sessions security
|
50
|
+
- Cross Site Scripting
|
51
|
+
- Control of abusive requests
|
52
|
+
- Cross-Site Request Forgery
|
53
|
+
* Site Speed
|
54
|
+
Camaleon CMS include a lot of cache strategies to optimize the site access velocity:
|
55
|
+
- Cache contents
|
56
|
+
- Cache queries
|
57
|
+
- Manifests (compress and join asset files)
|
58
|
+
- Customize your content visualization for Desktop, Mobile and Tablet
|
59
|
+
* SEO & HTML5
|
60
|
+
- Sitemap generations
|
61
|
+
- Seo configuration
|
62
|
+
- Seo for social media
|
63
|
+
- All generated content is compatible with HTML5 and Bootstrap 3
|
64
|
+
|
65
|
+
## Camaleon CMS has many useful Plugins such as:
|
66
|
+
* Content Cache (Included By Default)
|
67
|
+
* Web Attack Control (Included By Default)
|
68
|
+
* Post Visibility (Included By Default)
|
69
|
+
* Contact Forms (Included By Default) - https://github.com/owen2345/cama_contact_form
|
70
|
+
* SEO (Included By Default) - https://github.com/owen2345/camaleon-cms-seo
|
71
|
+
* E-commerce - https://github.com/owen2345/camaleon-ecommerce
|
72
|
+
* Language / Translation Editor - https://github.com/owen2345/camaleon-cms-language-editor
|
73
|
+
* Subscriber (Email Subscriptions) - https://github.com/owen2345/cama_subscriber
|
74
|
+
* Stripe Donation - https://github.com/owen2345/cama-stripe-donation
|
75
|
+
* Star Rating - https://github.com/aspirewit/camaleon_cms_rating
|
76
|
+
* Post Order - https://github.com/owen2345/camaleon-post-order-plugin
|
77
|
+
* Post Created At - https://github.com/owen2345/camaleon_post_created_at
|
78
|
+
* Post Clone - https://github.com/owen2345/camaleon-post-clone
|
79
|
+
* Sitemap Customizer - https://github.com/brian-kephart/camaleon_sitemap_customizer
|
80
|
+
* Image Optimizer - https://github.com/brian-kephart/camaleon_image_optimizer
|
81
|
+
* Import / Export - https://github.com/owen2345/camaleon_export_import
|
82
|
+
* Lightbox - https://github.com/owen2345/CamaImageLightbox
|
83
|
+
* Autocomplete - https://github.com/gaelfokou/cama_autocomplete
|
84
|
+
* Permissions for External Menus - https://github.com/owen2345/cama_external_menu
|
85
|
+
* TinyMCE Template Integration - https://github.com/owen2345/Camaleon-Tinymce-Templates
|
86
|
+
* Download Manager - https://github.com/max2320/camaleon-download
|
87
|
+
* OAuth - https://github.com/owen2345/camaleon_oauth
|
88
|
+
* Visual Editor - Paid Plugin ($) - http://camaleon.tuzitio.com/store/plugins/camaleon_editor
|
89
|
+
* Spree Commerce Integration - Paid Plugin ($) - http://camaleon.tuzitio.com/store/plugins/camaleon-spree
|
90
|
+
* Admin AJAX - Paid Plugin ($) - http://camaleon.tuzitio.com/store/plugins/admin_ajax
|
91
|
+
* **See here for a complete Gemfile**: https://github.com/owen2345/camaleon-cms/blob/master/doc/example_gemfile.rb
|
92
|
+
|
93
|
+
## Camaleon CMS has many useful frontend Themes such as:
|
94
|
+
* Default Theme (Built in)
|
95
|
+
* Clean Theme (Built in)
|
96
|
+
* Wordpress Theme (Built in)
|
97
|
+
* eCommerce - https://github.com/owen2345/cama-ecommerce-theme
|
98
|
+
* eFashion - http://camaleon.tuzitio.com/store/themes/eFashion (Github: https://github.com/mazharoddin/camaleon-cms-efashion)
|
99
|
+
* Shoppy - http://camaleon.tuzitio.com/store/themes/shoppy (Github: https://github.com/mazharoddin/camaleon-cms-shoppy)
|
100
|
+
* CV - Paid Theme ($) - http://camaleon.tuzitio.com/store/themes/cv
|
101
|
+
* Camaleon Site - Paid Them ($) - http://camaleon.tuzitio.com/store/themes/camaleon_cms
|
102
|
+
* Sky - Paid Theme ($) - http://camaleon.tuzitio.com/store/themes/sky
|
103
|
+
|
104
|
+
|
105
|
+
## Requirements
|
106
|
+
* Rails 4.2 or 5+
|
107
|
+
* PostgreSQL, MySQL 5+ or SQlite
|
26
108
|
* Ruby 2.2+
|
27
109
|
* Imagemagick
|
28
110
|
|
29
|
-
|
30
|
-
* Install Ruby on Rails
|
31
|
-
[Visit here.](http://railsapps.github.io/installing-rails.html)
|
111
|
+
## Installation
|
112
|
+
* Install Ruby on Rails
|
32
113
|
* Create your rails project
|
33
114
|
|
34
115
|
```
|
35
116
|
rails new my_project
|
36
117
|
```
|
37
|
-
* Add the gem in your Gemfile
|
118
|
+
* Add the gem in your Gemfile
|
38
119
|
|
39
120
|
```
|
40
|
-
gem "camaleon_cms", '>= 2.4.5'
|
41
|
-
#
|
42
|
-
# gem
|
43
|
-
|
121
|
+
gem "camaleon_cms", '>= 2.4.5' # (Current stable versions are 2.4.4.5, 2.4.3.10, 2.3.6, 2.2.1, 2.1.1)
|
122
|
+
# OR
|
123
|
+
# gem "camaleon_cms", github: 'owen2345/camaleon-cms' # latest development version
|
124
|
+
|
125
|
+
# gem 'draper', '~> 3' # for Rails 5+
|
44
126
|
```
|
45
127
|
|
46
128
|
* Install required Gem and dependencies
|
@@ -53,7 +135,7 @@
|
|
53
135
|
```
|
54
136
|
rails generate camaleon_cms:install
|
55
137
|
```
|
56
|
-
* (Optional) Before continue you can configure your CMS settings in (my_app/config/system.json), [here](config/system.json) you can see the full settings.
|
138
|
+
* (Optional) Before continue you can configure your CMS settings in (my_app/config/system.json), [here](config/system.json) you can see the full settings.
|
57
139
|
* Create database structure
|
58
140
|
```
|
59
141
|
rake camaleon_cms:generate_migrations
|
@@ -64,88 +146,24 @@
|
|
64
146
|
* Start your server
|
65
147
|
|
66
148
|
```
|
67
|
-
rails server
|
149
|
+
rails server
|
68
150
|
```
|
69
|
-
Previous stable version (1x): https://github.com/owen2345/camaleon-cms/tree/version_1x
|
70
|
-
|
71
|
-
|
72
|
-
# Camaleon CMS (It adapts to your needs)
|
73
|
-
|
74
|
-
Camaleon CMS is a dynamic and advanced content management system based on Ruby on Rails 4.2+ and Ruby 2.2+. This CMS is an alternative to Wordpress for Ruby on Rails developers to manage advanced contents easily.
|
75
|
-
Camaleon CMS is a flexible manager where you can build your custom content structure without coding anything by custom fields and custom contents type.
|
76
|
-
|
77
|
-
To download or publish themes go to themes store:
|
78
|
-
http://camaleon.tuzitio.com/store/themes
|
79
|
-
|
80
|
-
To download or publish plugins go to plugins store:
|
81
|
-
http://camaleon.tuzitio.com/store/plugins
|
82
151
|
|
83
|
-
|
84
|
-
It was released on July, 2015 and tested previously with more than 20 projects by 6 months and on August 22, 2015 was published as a gem.
|
152
|
+
* Go to your browser and visit http://localhost:3000/
|
85
153
|
|
86
|
-
|
87
|
-
|
88
|
-
## With Camaleon you can do:
|
89
|
-
* Multiples sites in the same installation
|
90
|
-
* Multi-language sites
|
91
|
-
* Design and create the architecture of your project without programming by dynamic contents and fields
|
92
|
-
* Extend or customize the functionalities by plugins
|
93
|
-
* Manage your content visualization by themes
|
94
|
-
* Advanced User roles
|
95
|
-
* Integrate into existent rails 4+ projects
|
96
|
-
* Other features:
|
97
|
-
- Shortcodes
|
98
|
-
- Widgets
|
99
|
-
- Drag and Drop / Sortable / Multi level menus
|
100
|
-
- Templates/Layouts for pages
|
101
|
-
- Easy migration from Wordpress
|
102
|
-
|
103
|
-
## Some features are:
|
104
|
-
* Integrate into existent Ruby on Rails Projects
|
105
|
-
* Easy administration
|
106
|
-
Camaleon CMS permits you to adapt the CMS to all your needs and not you adapt to the CMS.
|
107
|
-
I.E. you can create your custom architecture with all attributes that you need for each kind of content.
|
108
|
-
* Security
|
109
|
-
- Remote code execution
|
110
|
-
- SQL injections
|
111
|
-
- Advanced sessions security
|
112
|
-
- Cross Site Scripting
|
113
|
-
- Control of abusive requests
|
114
|
-
- Cross-Site Request Forgery
|
115
|
-
* Site Speed
|
116
|
-
Camaleon CMS include a lot of cache strategies to optimize the site access velocity:
|
117
|
-
- Cache contents
|
118
|
-
- Cache queries
|
119
|
-
- Manifests (compress and join asset files)
|
120
|
-
- Customize your content visualization for Desktop, Mobile and Tablet
|
121
|
-
* SEO & HTML5
|
122
|
-
- Sitemap generations
|
123
|
-
- Seo configuration
|
124
|
-
- Seo for social media
|
125
|
-
- All generated content is compatible with HTML5 and Bootstrap 3
|
126
|
-
|
127
|
-
## Camaleon CMS come with basic and important plugins like:
|
128
|
-
* E-commerce
|
129
|
-
* Visibility of content
|
130
|
-
* Web attack control
|
131
|
-
* Contact forms
|
132
|
-
* Content cache
|
133
|
-
* Content reorder
|
134
|
-
* many others [here.](https://github.com/owen2345/Camaleon-CMS-Sample)
|
135
|
-
|
136
|
-
## Demonstration
|
154
|
+
## Sample App / Demonstration
|
137
155
|
* [Camaleon Server (current version)](http://camaleon.tuzitio.com/plugins/demo_manage/)
|
138
|
-
* [
|
156
|
+
* [Sample App](https://github.com/owen2345/Camaleon-CMS-Sample)
|
157
|
+
* [Deploy Sample App in Heroku](https://heroku.com/deploy?template=https://github.com/owen2345/Camaleon-CMS-Sample)
|
139
158
|
|
140
159
|
## Support
|
141
160
|
If you have problems, please enter an issue [here.](https://github.com/owen2345/camaleon-cms/issues)
|
142
161
|
If you need support, need some extra functionality or need plugins, please contact us on:
|
143
|
-
*
|
162
|
+
* Gitter: https://gitter.im/camaleoncms/Lobby
|
144
163
|
* Email: owenperedo@gmail.com
|
145
164
|
* Skype: owen-2345
|
146
|
-
* Stack Overflow: Use "camaleon" as tag to ask questions related to this CMS (don't forget to include cms version + rails version).
|
147
|
-
*
|
148
|
-
|
165
|
+
* Stack Overflow: Use "camaleon" as tag to ask questions related to this CMS (don't forget to include cms version + rails version).
|
166
|
+
* Site: http://camaleon.tuzitio.com/
|
149
167
|
|
150
168
|
## Author
|
151
169
|
Owen Peredo Diaz
|
@@ -153,20 +171,13 @@ Owen Peredo Diaz
|
|
153
171
|
## License
|
154
172
|
http://camaleon.tuzitio.com/license.html
|
155
173
|
|
156
|
-
## Coming soon
|
157
|
-
* Documentation and Videos
|
158
|
-
* Create/Update Manuals
|
159
|
-
* TDD (rspec)
|
160
|
-
|
161
174
|
## Testing
|
162
175
|
* Init DB
|
163
176
|
```
|
164
177
|
RAILS_ENV=test bundle exec rake app:db:migrate
|
165
178
|
RAILS_ENV=test bundle exec rake app:db:test:prepare
|
166
179
|
```
|
167
|
-
*
|
168
|
-
|
169
|
-
* Run testing
|
180
|
+
* Run tests
|
170
181
|
```
|
171
182
|
bundle exec rspec
|
172
183
|
```
|
@@ -178,7 +189,10 @@ bundle exec rspec
|
|
178
189
|
* Push to the branch (git push origin my_feature_branch)
|
179
190
|
* Create a pull request from your branch into master (Please be sure to provide enough detail for us to understand what this change is doing)
|
180
191
|
|
181
|
-
Visit the web site for more information: http://camaleon.tuzitio.com/
|
182
|
-
|
183
192
|
## Version History
|
193
|
+
|
184
194
|
http://camaleon.tuzitio.com/version-history.html
|
195
|
+
|
196
|
+
Previous stable version (v1.x): https://github.com/owen2345/camaleon-cms/tree/version_1x
|
197
|
+
|
198
|
+
Camaleon CMS was originally released in July 2015 and tested previously with more than 20 projects by 6 months and on August 22, 2015 was published as a gem.
|
@@ -3195,8 +3195,8 @@ table.text-center th {
|
|
3195
3195
|
margin-bottom: 25px;
|
3196
3196
|
font-weight: 300;
|
3197
3197
|
img{
|
3198
|
-
|
3199
|
-
|
3198
|
+
width: 100%;
|
3199
|
+
height: 150px;
|
3200
3200
|
}
|
3201
3201
|
}
|
3202
3202
|
.login-logo a,
|
@@ -3209,8 +3209,8 @@ table.text-center th {
|
|
3209
3209
|
}
|
3210
3210
|
.login-box,
|
3211
3211
|
.register-box {
|
3212
|
-
margin-top:
|
3213
|
-
margin-bottom:
|
3212
|
+
margin-top: 20px;
|
3213
|
+
margin-bottom: 20px;
|
3214
3214
|
}
|
3215
3215
|
@media (max-width: 768px) {
|
3216
3216
|
.login-box,
|
@@ -24,12 +24,12 @@ class CamaleonCms::Admin::MediaController < CamaleonCms::AdminController
|
|
24
24
|
|
25
25
|
# download private files
|
26
26
|
def download_private_file
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
cama_uploader.enable_private_mode!
|
28
|
+
|
29
|
+
file = cama_uploader.fetch_file("private/#{params[:file]}")
|
30
|
+
|
31
|
+
send_file file, disposition: 'inline'
|
32
|
+
|
33
33
|
end
|
34
34
|
|
35
35
|
# render media for modal content
|
@@ -92,9 +92,13 @@ class CamaleonCms::Admin::MediaController < CamaleonCms::AdminController
|
|
92
92
|
end
|
93
93
|
|
94
94
|
private
|
95
|
+
|
95
96
|
# init basic media variables
|
96
97
|
def init_media_vars
|
97
|
-
@cama_uploader = CamaleonCmsLocalUploader.new({current_site: current_site, private: true})
|
98
|
+
# @cama_uploader = CamaleonCmsLocalUploader.new({current_site: current_site, private: true})
|
99
|
+
|
100
|
+
cama_uploader.enable_private_mode! if params[:private].present?
|
101
|
+
|
98
102
|
cama_uploader.clear_cache if params[:cama_media_reload] == 'clear_cache'
|
99
103
|
cama_uploader.reload if params[:cama_media_reload] == 'reload'
|
100
104
|
@media_formats = (params[:media_formats] || "").sub("media", ",video,audio").sub("all", "").split(",")
|
@@ -27,9 +27,13 @@ class CamaleonCms::Admin::PostsController < CamaleonCms::AdminController
|
|
27
27
|
|
28
28
|
if params[:q].present?
|
29
29
|
params[:q] = (params[:q] || '').downcase
|
30
|
-
posts_all = posts_all.where(
|
30
|
+
posts_all = posts_all.where(
|
31
|
+
"LOWER(#{CamaleonCms::Post.table_name}.title) LIKE ? OR LOWER(#{CamaleonCms::Post.table_name}.slug LIKE ?)",
|
32
|
+
"%#{params[:q]}%",
|
33
|
+
"%#{params[:q]}%"
|
34
|
+
)
|
31
35
|
end
|
32
|
-
|
36
|
+
|
33
37
|
posts_all = posts_all.where(user_id: cama_current_user) if cannot?(:edit_other, @post_type) # filter only own contents
|
34
38
|
|
35
39
|
@posts = posts_all
|
@@ -5,19 +5,6 @@ module CamaleonCms::Admin::ApplicationHelper
|
|
5
5
|
include CamaleonCms::Admin::CategoryHelper
|
6
6
|
include CamaleonCms::Admin::CustomFieldsHelper
|
7
7
|
|
8
|
-
# load system notification
|
9
|
-
def admin_system_notifications(args)
|
10
|
-
if Date.parse(current_site.get_option("date_notified", 2.days.ago).to_s) < Date.today
|
11
|
-
current_site.set_option("date_notified", Date.today)
|
12
|
-
url = "http://camaleon.tuzitio.com/plugins/camaleon_notification/?version=#{CamaleonCms::VERSION}&admin_locale=#{current_site.get_admin_language}&site=#{current_site.the_url}"
|
13
|
-
Thread.new do
|
14
|
-
current_site.set_meta("date_notified_message", open(url).read)
|
15
|
-
ActiveRecord::Base.connection.close #closing connection
|
16
|
-
end
|
17
|
-
end
|
18
|
-
args[:content] << current_site.get_meta("date_notified_message", "")
|
19
|
-
end
|
20
|
-
|
21
8
|
# render pagination for current items
|
22
9
|
# items is a will pagination object
|
23
10
|
# sample: <%= raw cama_do_pagination(@posts) %>
|
@@ -2,7 +2,7 @@ class CamaleonCms::Media < ActiveRecord::Base
|
|
2
2
|
self.table_name = "#{PluginRoutes.static_system_info['db_prefix']}media"
|
3
3
|
belongs_to :site, class_name: 'CamaleonCms::Site'
|
4
4
|
validates :name, uniqueness: {
|
5
|
-
scope: [:site_id, :is_folder, :folder_path],
|
5
|
+
scope: [:site_id, :is_folder, :folder_path, :is_public],
|
6
6
|
message: 'Duplicates not allowed'
|
7
7
|
}
|
8
8
|
scope :only_folder, ->{ where(is_folder: true) }
|
@@ -18,7 +18,7 @@ class CamaleonCms::Media < ActiveRecord::Base
|
|
18
18
|
where('name like ?', "%#{search_expression}%")
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
# search file or folder by key
|
23
23
|
def self.find_by_key(key)
|
24
24
|
key = key.cama_fix_media_key
|
@@ -28,13 +28,13 @@ class CamaleonCms::Media < ActiveRecord::Base
|
|
28
28
|
where(folder_path: File.dirname(key), name: File.basename(key))
|
29
29
|
end
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
# return all items of current folder
|
33
33
|
def items
|
34
34
|
coll = is_public ? site.public_media : site.private_media
|
35
35
|
coll.where(folder_path: "#{folder_path}/#{name}".cama_fix_media_key)
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
private
|
39
39
|
# recover folder or file format
|
40
40
|
def create_parent_folders
|
@@ -46,7 +46,7 @@ class CamaleonCms::Media < ActiveRecord::Base
|
|
46
46
|
_p.push(f_name)
|
47
47
|
end
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
# return all children items
|
51
51
|
def delete_folder_items
|
52
52
|
items.destroy_all if is_folder
|