rcms 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -8
- data/app/assets/stylesheets/rcms/news.scss +79 -2
- data/config/locales/rcms.ru.yml +10 -11
- data/lib/generators/{rcms_news_generator.rb → rcms_tidings_generator.rb} +10 -10
- data/lib/generators/templates/app/models/rcms/meta_page.rb +1 -1
- data/lib/generators/templates/app/models/rcms/meta_tag.rb +1 -1
- data/lib/generators/templates/app/models/rcms/page.rb +22 -1
- data/lib/generators/templates/app/views/rcms/pages/show.html.slim +4 -7
- data/lib/generators/templates/migration.rb +2 -1
- data/lib/generators/{templates_news/app/admin/rcms/news.rb → templates_tidings/app/admin/rcms/tiding.rb} +5 -5
- data/lib/generators/templates_tidings/app/controllers/rcms/tidings_controller.rb +16 -0
- data/lib/generators/{templates_news/app/models/rcms/news.rb → templates_tidings/app/models/rcms/tiding.rb} +8 -4
- data/lib/generators/{templates_news/app/uploaders/rcms/news_image_uploader.rb → templates_tidings/app/uploaders/rcms/tiding_image_uploader.rb} +1 -1
- data/lib/generators/templates_tidings/app/views/rcms/tidings/_preview.html.slim +17 -0
- data/lib/generators/templates_tidings/app/views/rcms/tidings/index.html.slim +29 -0
- data/lib/generators/templates_tidings/app/views/rcms/tidings/show.html.slim +19 -0
- data/lib/generators/{templates_news → templates_tidings}/migration.rb +4 -4
- data/lib/rcms/application_controller.rb +6 -6
- data/lib/rcms/version.rb +1 -1
- metadata +11 -11
- data/lib/generators/templates_news/app/controllers/rcms/news_controller.rb +0 -16
- data/lib/generators/templates_news/app/views/rcms/news/_menu.html.slim +0 -0
- data/lib/generators/templates_news/app/views/rcms/news/index.html.slim +0 -0
- data/lib/generators/templates_news/app/views/rcms/news/show.html.slim +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c1faee7a58a67d00cb8058690f7dce50f2d066d
|
4
|
+
data.tar.gz: 7770258d669fcae8e71581c86b1dcafe8459ce4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ee19950c196ae9ffe416b3479d2eabcbdadedf48d0bdc7429328e1e9fa36a4b4f5b5cccfe50aca472eb64a4683e093481b06962faebfd96e684c61b65b1a8f4
|
7
|
+
data.tar.gz: 260e27a2adf277ab92a2137828ba297fd723e92454a430435b95c8fdd6315e920329e1e84e57a41e92713adbd1e1cd902419eefd2576ed7b052ac9b07fbef0d1
|
data/README.md
CHANGED
@@ -25,13 +25,11 @@ Currently Rcms designed to work with:
|
|
25
25
|
|
26
26
|
## Installation
|
27
27
|
|
28
|
-
```
|
28
|
+
```bash
|
29
29
|
gem 'rcms', '0.1.3'
|
30
30
|
```
|
31
|
-
|
32
31
|
or
|
33
|
-
|
34
|
-
```ruby
|
32
|
+
```bash
|
35
33
|
gem 'rcms', github: 'r1dd1ck777/rcms'
|
36
34
|
```
|
37
35
|
|
@@ -59,22 +57,25 @@ apply_meta_tags rcms_page
|
|
59
57
|
|
60
58
|
### News
|
61
59
|
News feature: allows you to manage news from admin panel and show them on frontend
|
62
|
-
|
60
|
+
```bash
|
63
61
|
$ rails g rcms_news
|
64
62
|
$ rake db:migrate
|
65
|
-
|
63
|
+
```
|
64
|
+
Will generate models, activeadmin resources, controllers, uploaders, views and patch routes.rb
|
66
65
|
|
67
66
|
### Mentions
|
68
67
|
Mentions feature: guest users can add their mention, and you can manage it at admin panel
|
69
|
-
|
68
|
+
```bash
|
70
69
|
$ rails g rcms_mentions
|
71
70
|
$ rake db:migrate
|
71
|
+
```
|
72
72
|
Will generate models, activeadmin resources, controllers, views and patch routes.rb
|
73
73
|
|
74
74
|
### Feedbacks
|
75
75
|
Feedbacks feature: allows users to send feedbacks to admins by emails
|
76
|
-
|
76
|
+
```bash
|
77
77
|
$ rails g rcms_feedbacks
|
78
|
+
```
|
78
79
|
Will generate controllers, views and patch routes.rb
|
79
80
|
|
80
81
|
## Backlog
|
@@ -1,5 +1,5 @@
|
|
1
|
-
.
|
2
|
-
.
|
1
|
+
.rcms-tidings-preview-list{
|
2
|
+
.tiding-item{
|
3
3
|
&:last-of-type .list-group-item-text{
|
4
4
|
border-bottom: none;
|
5
5
|
padding-bottom: 0;
|
@@ -23,4 +23,81 @@
|
|
23
23
|
font-size: 18px;
|
24
24
|
line-height: 22px;
|
25
25
|
}
|
26
|
+
|
27
|
+
.row-picture{
|
28
|
+
width: 50px;
|
29
|
+
margin: 0 7px 7px 0;
|
30
|
+
float: left;
|
31
|
+
|
32
|
+
img{
|
33
|
+
width: 100%;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
.row-content{
|
38
|
+
width: calc(100% - 57px);
|
39
|
+
float: left;
|
40
|
+
|
41
|
+
h3{
|
42
|
+
margin-top: 3px;
|
43
|
+
font-size: 16px;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
.rcms-tidings-list{
|
49
|
+
.tiding-item{
|
50
|
+
&:last-of-type .list-group-item-text{
|
51
|
+
border-bottom: none;
|
52
|
+
padding-bottom: 0;
|
53
|
+
margin-bottom: 0;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
.list-group-item-text{
|
58
|
+
padding-bottom: 15px;
|
59
|
+
margin-bottom: 15px;
|
60
|
+
}
|
61
|
+
|
62
|
+
.list-group-item-heading {
|
63
|
+
margin-top: 8px;
|
64
|
+
margin-bottom: 5px;
|
65
|
+
}
|
66
|
+
|
67
|
+
&.list-group .list-group-item .list-group-item-heading {
|
68
|
+
color: rgba(0, 0, 0, 0.77);
|
69
|
+
font-size: 18px;
|
70
|
+
line-height: 22px;
|
71
|
+
}
|
72
|
+
|
73
|
+
.row-picture{
|
74
|
+
width: 100px;
|
75
|
+
margin: 0 7px 7px 0;
|
76
|
+
float: left;
|
77
|
+
|
78
|
+
img{
|
79
|
+
width: 100%;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
.row-content{
|
84
|
+
width: calc(100% - 107px);
|
85
|
+
float: left;
|
86
|
+
|
87
|
+
h3{
|
88
|
+
margin-top: 3px;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
time{
|
93
|
+
color: #6e6e6e;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
.rcms-tidings-show-content{
|
98
|
+
padding-bottom: 15px;
|
99
|
+
|
100
|
+
.image-row{
|
101
|
+
margin-top: 15px;
|
102
|
+
}
|
26
103
|
}
|
data/config/locales/rcms.ru.yml
CHANGED
@@ -6,7 +6,7 @@ ru:
|
|
6
6
|
feedback:
|
7
7
|
subject: "Обратная связь для %{contact}"
|
8
8
|
created: "Запрос отправлен"
|
9
|
-
|
9
|
+
tiding:
|
10
10
|
index_title: Новости
|
11
11
|
mentions:
|
12
12
|
created: Спасибо за Ваш отзыв
|
@@ -16,25 +16,25 @@ ru:
|
|
16
16
|
models:
|
17
17
|
rcms/page:
|
18
18
|
one: Страницу
|
19
|
-
few:
|
19
|
+
few: Страницы
|
20
20
|
many: Страниц
|
21
21
|
other: Страницы
|
22
22
|
|
23
23
|
rcms/mention:
|
24
24
|
one: Отзыв
|
25
|
-
few:
|
26
|
-
many:
|
25
|
+
few: Отзыва
|
26
|
+
many: Отзывов
|
27
27
|
other: Отзывы
|
28
28
|
|
29
29
|
rcms/partial:
|
30
30
|
one: Текст
|
31
|
-
few:
|
31
|
+
few: Текста
|
32
32
|
many: Текстов
|
33
33
|
other: Тексты
|
34
34
|
|
35
35
|
rcms/meta_page:
|
36
36
|
one: Мета страницу
|
37
|
-
few: Мета
|
37
|
+
few: Мета страницы
|
38
38
|
many: Мета страниц
|
39
39
|
other: Мета страницы
|
40
40
|
rcms/meta_tag:
|
@@ -43,10 +43,10 @@ ru:
|
|
43
43
|
many: Мета тегов
|
44
44
|
other: Мета теги
|
45
45
|
|
46
|
-
rcms/
|
46
|
+
rcms/tiding:
|
47
47
|
one: Новость
|
48
|
-
few:
|
49
|
-
many:
|
48
|
+
few: Новости
|
49
|
+
many: Новостей
|
50
50
|
other: Новости
|
51
51
|
|
52
52
|
attributes:
|
@@ -58,8 +58,7 @@ ru:
|
|
58
58
|
email: E-mail
|
59
59
|
is_published: Опубликован
|
60
60
|
|
61
|
-
|
62
|
-
rcms/news:
|
61
|
+
rcms/tiding:
|
63
62
|
title: Заголовок
|
64
63
|
image: Файл изображения
|
65
64
|
remote_image_url: URL изображения
|
@@ -1,5 +1,5 @@
|
|
1
|
-
class
|
2
|
-
source_root File.expand_path("../
|
1
|
+
class RcmsTidingsGenerator < Rails::Generators::Base
|
2
|
+
source_root File.expand_path("../templates_tidings", __FILE__)
|
3
3
|
include Rails::Generators::Migration
|
4
4
|
|
5
5
|
def self.next_migration_number(dirname)
|
@@ -7,34 +7,34 @@ class RcmsNewsGenerator < Rails::Generators::Base
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def create_cmshelper_migration
|
10
|
-
migration_template "migration.rb", File.join('db/migrate', "
|
10
|
+
migration_template "migration.rb", File.join('db/migrate', "create_rcms_tidings_tables.rb")
|
11
11
|
end
|
12
12
|
|
13
13
|
def create_all_files
|
14
14
|
Rails.cache.clear
|
15
15
|
|
16
|
-
%w(
|
16
|
+
%w(tiding.rb).each do |name|
|
17
17
|
copy_file "app/admin/rcms/#{name}"
|
18
18
|
end
|
19
19
|
|
20
|
-
%w(
|
20
|
+
%w(tidings_controller.rb).each do |name|
|
21
21
|
copy_file "app/controllers/rcms/#{name}"
|
22
22
|
end
|
23
23
|
|
24
|
-
%w(
|
24
|
+
%w(tiding.rb).each do |name|
|
25
25
|
copy_file "app/models/rcms/#{name}"
|
26
26
|
end
|
27
27
|
|
28
|
-
%w(
|
28
|
+
%w(tiding_image_uploader.rb).each do |name|
|
29
29
|
copy_file "app/uploaders/rcms/#{name}"
|
30
30
|
end
|
31
31
|
|
32
|
-
%w(
|
33
|
-
copy_file "app/views/rcms/
|
32
|
+
%w(_preview.html.slim index.html.slim show.html.slim).each do |name|
|
33
|
+
copy_file "app/views/rcms/tidings/#{name}"
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
def patch_routes
|
38
|
-
insert_into_file "config/routes.rb", " get 'news' => 'rcms/
|
38
|
+
insert_into_file "config/routes.rb", " get 'news' => 'rcms/tidings#index', as: :rcms_tidings\n get 'news-:slug' => 'rcms/tidings#show', as: :rcms_tiding\n", :after => "Rails.application.routes.draw do\n"
|
39
39
|
end
|
40
40
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Rcms::MetaPage < ActiveRecord::Base
|
2
2
|
self.table_name = 'rcms_meta_pages'
|
3
3
|
|
4
|
-
has_many :meta_tags, as: :
|
4
|
+
has_many :meta_tags, as: :target, :dependent => :destroy, class_name: Rcms::MetaTag
|
5
5
|
accepts_nested_attributes_for :meta_tags
|
6
6
|
|
7
7
|
after_initialize :create_meta_tags
|
@@ -1,10 +1,31 @@
|
|
1
1
|
class Rcms::Page < ActiveRecord::Base
|
2
2
|
self.table_name = 'rcms_pages'
|
3
|
-
|
4
3
|
extend FriendlyId
|
5
4
|
friendly_id :title, use: [:slugged, :finders]
|
6
5
|
|
6
|
+
# if you want extended SEO manipulations
|
7
|
+
# has_many :meta_tags, as: :target, class_name: Rcms::MetaTag
|
8
|
+
# accepts_nested_attributes_for :meta_tags, reject_if: :all_blank, allow_destroy: true
|
9
|
+
# after_initialize :init_default_meta_tags
|
10
|
+
|
11
|
+
validates :title, presence: true
|
12
|
+
|
13
|
+
scope :frontend, ->{ where( is_active: true ) }
|
14
|
+
|
15
|
+
def self.find_or_init slug_or_id
|
16
|
+
page = Rcms::Page.find_by(slug: slug_or_id)
|
17
|
+
page = new title: "#{slug_or_id}", text: "<a href=\"/admin/rcms/pages/new?slug=#{slug_or_id}\">Создайте страницу</a>" unless page
|
18
|
+
page
|
19
|
+
end
|
20
|
+
|
7
21
|
protected
|
22
|
+
# def init_default_meta_tags
|
23
|
+
# if !persisted? && self.meta_tags.empty?
|
24
|
+
# self.meta_tags.new(key: :title)
|
25
|
+
# self.meta_tags.new(key: :description)
|
26
|
+
# self.meta_tags.new(key: :keywords)
|
27
|
+
# end
|
28
|
+
# end
|
8
29
|
|
9
30
|
def should_generate_new_friendly_id?
|
10
31
|
!slug.present?
|
@@ -13,7 +13,7 @@ class CreateRcmsTables < ActiveRecord::Migration
|
|
13
13
|
t.string :key
|
14
14
|
t.text :text
|
15
15
|
t.string :value
|
16
|
-
t.references :
|
16
|
+
t.references :target, polymorphic: true
|
17
17
|
|
18
18
|
t.timestamps
|
19
19
|
end
|
@@ -29,6 +29,7 @@ class CreateRcmsTables < ActiveRecord::Migration
|
|
29
29
|
t.string :slug
|
30
30
|
t.string :title
|
31
31
|
t.text :text
|
32
|
+
t.boolean :is_active
|
32
33
|
|
33
34
|
t.timestamps
|
34
35
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
ActiveAdmin.register Rcms::
|
1
|
+
ActiveAdmin.register Rcms::Tiding do
|
2
2
|
# include AdminRedirects
|
3
3
|
|
4
4
|
permit_params :slug, :title, :text, :image, :image_cache, :remote_image_url, :is_published, :description
|
@@ -7,15 +7,15 @@ ActiveAdmin.register Rcms::News do
|
|
7
7
|
f.inputs do
|
8
8
|
f.input :title
|
9
9
|
|
10
|
-
f.input :remote_image_url, as: :string, hint: t("activerecord.attributes.rcms/
|
10
|
+
f.input :remote_image_url, as: :string, hint: t("activerecord.attributes.rcms/tiding.remote_image_url_hint")
|
11
11
|
f.input :image, as: :file, :hint => f.object.image.default? ? '' : "<img src='#{f.object.image.url(:list)}' />".html_safe
|
12
12
|
|
13
13
|
f.input :image_cache, as: :hidden
|
14
14
|
f.input :is_published
|
15
15
|
|
16
|
-
f.input :slug, hint: f.object.persisted? ? (t("activerecord.attributes.rcms/
|
17
|
-
f.input :description, hint: t("activerecord.attributes.rcms/
|
18
|
-
f.inputs t("activerecord.attributes.rcms/
|
16
|
+
f.input :slug, hint: f.object.persisted? ? (t("activerecord.attributes.rcms/tiding.slug_hint", path: rcms_tiding_path(f.object))) : nil
|
17
|
+
f.input :description, hint: t("activerecord.attributes.rcms/tiding.description_hint")
|
18
|
+
f.inputs t("activerecord.attributes.rcms/tiding.text") do
|
19
19
|
f.cktext_area :text
|
20
20
|
end
|
21
21
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Rcms::TidingsController < ApplicationController
|
2
|
+
def index
|
3
|
+
@resources = Rcms::Tiding.frontend.page(params[:page]).per(10)
|
4
|
+
apply_meta_tags title: t('rcms.tiding.index_title')
|
5
|
+
end
|
6
|
+
|
7
|
+
def show
|
8
|
+
@resource = retrieve params[:id]
|
9
|
+
apply_meta_tags @resource
|
10
|
+
end
|
11
|
+
|
12
|
+
def retrieve slug_or_id
|
13
|
+
Rcms::Tiding.find slug_or_id
|
14
|
+
rescue
|
15
|
+
end
|
16
|
+
end
|
@@ -1,12 +1,16 @@
|
|
1
|
-
class Rcms::
|
2
|
-
self.table_name = '
|
1
|
+
class Rcms::Tiding < ActiveRecord::Base
|
2
|
+
self.table_name = 'rcms_tidings'
|
3
3
|
extend FriendlyId
|
4
4
|
friendly_id :title, use: [:slugged, :finders]
|
5
5
|
|
6
|
-
mount_uploader :image, Rcms::
|
6
|
+
mount_uploader :image, Rcms::TidingImageUploader
|
7
|
+
|
8
|
+
# if you want extended SEO manipulations
|
9
|
+
# has_many :meta_tags, as: :target, class_name: Rcms::MetaTag
|
10
|
+
# accepts_nested_attributes_for :meta_tags, reject_if: :all_blank, allow_destroy: true
|
7
11
|
|
8
12
|
scope :frontend, -> {where(is_published: true).order('id desc')}
|
9
|
-
scope :
|
13
|
+
scope :preview, -> {frontend.limit(3)}
|
10
14
|
|
11
15
|
def get_short_desc l = 110
|
12
16
|
description.present? ? truncate(description, l) : truncate(text, l)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.rcms-tidings-preview-list.list-group
|
2
|
+
- resources.each do |resource|
|
3
|
+
.tiding-item
|
4
|
+
.row-picture
|
5
|
+
a href=rcms_tiding_path(resource) rel="nofollow"
|
6
|
+
img.circle src=resource.image.url(:preview) alt=resource.title
|
7
|
+
.row-content
|
8
|
+
a href=rcms_tiding_path(resource)
|
9
|
+
h3.list-group-item-heading
|
10
|
+
= resource.title
|
11
|
+
.clearfix
|
12
|
+
.list-group-item-text
|
13
|
+
= resource.get_short_desc
|
14
|
+
a.pull-right href=rcms_tidings_path Все новости
|
15
|
+
- if resources.public_methods.include?(:total_pages)
|
16
|
+
.text-center
|
17
|
+
= paginate resources, :theme => 'twitter-bootstrap-3'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
.paper-panel
|
2
|
+
h2 Новости
|
3
|
+
|
4
|
+
- resources = @resources
|
5
|
+
.rcms-tidings-list.list-group
|
6
|
+
- resources.each do |resource|
|
7
|
+
.tiding-item
|
8
|
+
.row-picture
|
9
|
+
a href=rcms_tiding_path(resource) rel="nofollow"
|
10
|
+
img.circle src=resource.image.url(:list) alt=resource.title
|
11
|
+
|
12
|
+
.row-content
|
13
|
+
a.pull-left href=rcms_tiding_path(resource)
|
14
|
+
h3.list-group-item-heading
|
15
|
+
= resource.title
|
16
|
+
time.pull-right
|
17
|
+
small #{l(resource.created_at, format: :short)}
|
18
|
+
.clearfix
|
19
|
+
.list-group-item-text
|
20
|
+
= resource.get_short_desc
|
21
|
+
.clearfix
|
22
|
+
a.pull-right rel="nofollow" href=href=rcms_tiding_path(resource)
|
23
|
+
| читать подробнее
|
24
|
+
i.fa.fa-caret-right.r
|
25
|
+
.clearfix
|
26
|
+
|
27
|
+
- if resources.public_methods.include?(:total_pages)
|
28
|
+
.text-center
|
29
|
+
= paginate resources, :theme => 'twitter-bootstrap-3'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
.paper-panel.rcms-tidings-show-content
|
2
|
+
a href=rcms_tidings_path
|
3
|
+
i.fa.fa-caret-left.l
|
4
|
+
| все новости
|
5
|
+
.clearfix
|
6
|
+
.row
|
7
|
+
.col-sm-3
|
8
|
+
.image-row
|
9
|
+
img.img-responsive src=@resource.image.url
|
10
|
+
.col-sm-9
|
11
|
+
h2.t-only.pull-left
|
12
|
+
= @resource.title
|
13
|
+
time.pull-right
|
14
|
+
small
|
15
|
+
= l(@resource.created_at, format: :short)
|
16
|
+
.clearfix
|
17
|
+
div
|
18
|
+
== @resource.text
|
19
|
+
.clearfix
|
@@ -1,6 +1,6 @@
|
|
1
|
-
class
|
1
|
+
class CreateRcmsTidingsTables < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
-
create_table :
|
3
|
+
create_table :rcms_tidings do |t|
|
4
4
|
t.string :image
|
5
5
|
t.string :title
|
6
6
|
t.string :description
|
@@ -10,10 +10,10 @@ class CreateRcmsNewsTables < ActiveRecord::Migration
|
|
10
10
|
|
11
11
|
t.timestamps
|
12
12
|
end
|
13
|
-
add_index :
|
13
|
+
add_index :rcms_tidings, :slug, unique: true
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.down
|
17
|
-
drop_table :
|
17
|
+
drop_table :rcms_tidings
|
18
18
|
end
|
19
19
|
end
|
@@ -11,12 +11,12 @@ module Rcms
|
|
11
11
|
end
|
12
12
|
|
13
13
|
module InstanceMethods
|
14
|
-
def rcms_menu key,
|
15
|
-
@rcms_menu = "#{
|
14
|
+
def rcms_menu key, options
|
15
|
+
@rcms_menu = "#{options[:scope]}#{key}"
|
16
16
|
end
|
17
17
|
|
18
|
-
def rcms_menu_class key,
|
19
|
-
@rcms_menu == "#{
|
18
|
+
def rcms_menu_class key, options
|
19
|
+
@rcms_menu == "#{options[:scope]}#{key}" ? 'active' : ''
|
20
20
|
end
|
21
21
|
|
22
22
|
def apply_meta_tags object
|
@@ -33,14 +33,14 @@ module Rcms
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
protected
|
37
|
-
|
38
36
|
def render *args
|
39
37
|
run_callbacks :render do
|
40
38
|
super
|
41
39
|
end
|
42
40
|
end
|
43
41
|
|
42
|
+
protected
|
43
|
+
|
44
44
|
def use_meta_page
|
45
45
|
if request.fullpath != '/'
|
46
46
|
path = request.fullpath.scan(/(\/[^#\?]+)/)[0][0]
|
data/lib/rcms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ruslan.palagin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -65,7 +65,7 @@ files:
|
|
65
65
|
- lib/generators/rcms_feedback_generator.rb
|
66
66
|
- lib/generators/rcms_generator.rb
|
67
67
|
- lib/generators/rcms_mentions_generator.rb
|
68
|
-
- lib/generators/
|
68
|
+
- lib/generators/rcms_tidings_generator.rb
|
69
69
|
- lib/generators/templates/app/admin/rcms/meta_page.rb
|
70
70
|
- lib/generators/templates/app/admin/rcms/page.rb
|
71
71
|
- lib/generators/templates/app/admin/rcms/partial.rb
|
@@ -89,14 +89,14 @@ files:
|
|
89
89
|
- lib/generators/templates_mentions/app/views/rcms/mentions/_dialog.html.slim
|
90
90
|
- lib/generators/templates_mentions/app/views/rcms/mentions/_preview.html.slim
|
91
91
|
- lib/generators/templates_mentions/migration.rb
|
92
|
-
- lib/generators/
|
93
|
-
- lib/generators/
|
94
|
-
- lib/generators/
|
95
|
-
- lib/generators/
|
96
|
-
- lib/generators/
|
97
|
-
- lib/generators/
|
98
|
-
- lib/generators/
|
99
|
-
- lib/generators/
|
92
|
+
- lib/generators/templates_tidings/app/admin/rcms/tiding.rb
|
93
|
+
- lib/generators/templates_tidings/app/controllers/rcms/tidings_controller.rb
|
94
|
+
- lib/generators/templates_tidings/app/models/rcms/tiding.rb
|
95
|
+
- lib/generators/templates_tidings/app/uploaders/rcms/tiding_image_uploader.rb
|
96
|
+
- lib/generators/templates_tidings/app/views/rcms/tidings/_preview.html.slim
|
97
|
+
- lib/generators/templates_tidings/app/views/rcms/tidings/index.html.slim
|
98
|
+
- lib/generators/templates_tidings/app/views/rcms/tidings/show.html.slim
|
99
|
+
- lib/generators/templates_tidings/migration.rb
|
100
100
|
- lib/rcms.rb
|
101
101
|
- lib/rcms/application_controller.rb
|
102
102
|
- lib/rcms/router.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class Rcms::NewsController < ApplicationController
|
2
|
-
def index
|
3
|
-
@news = Rcms::News.all.page(params[:page]).per(10)
|
4
|
-
apply_meta_tags title: t('rcms.news.index_title')
|
5
|
-
end
|
6
|
-
|
7
|
-
def show
|
8
|
-
@news_article = retrieve params[:slug]
|
9
|
-
apply_meta_tags @news_article
|
10
|
-
end
|
11
|
-
|
12
|
-
def retrieve slug_or_id
|
13
|
-
Rcms::News.find slug_or_id
|
14
|
-
rescue
|
15
|
-
end
|
16
|
-
end
|
File without changes
|
File without changes
|
File without changes
|