mix-rails-writer 0.23.1 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/app/controllers/news_controller.rb +1 -1
- data/app/models/post.rb +1 -1
- data/app/views/admix/posts/_form_config.haml +15 -0
- data/app/views/admix/posts/_grid_columns.haml +9 -0
- data/config/locales/writer.pt-BR.yml +2 -0
- data/lib/mix-rails-writer/engine.rb +6 -9
- data/lib/mix-rails-writer/version.rb +2 -2
- metadata +9 -19
- data/app/models/admix/news_datagrid.rb +0 -34
- data/app/views/admix/posts/_form_fields.html.haml +0 -6
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ca55ae5e042d6cfc12c89597ae995fa19598c3e5
|
4
|
+
data.tar.gz: 962ca3113eca604f2b213fc97d65068b98917928
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 09193688bad7c7de78b06f82f509828600119e43b9eb6d7a6265e234fb2545c29da8ae77e7014779ec125fc27d82826233fe8552f08783c2b941f3705b347c0c
|
7
|
+
data.tar.gz: 193b3659d7cc4e57b3920454b34b19e46d43eebf85561c1850f44b0f14d80851161b31eaaba0372773f07dce250b06bf726de635114844d73d49b50fe8b48751
|
@@ -7,7 +7,7 @@ class NewsController < PostsController
|
|
7
7
|
|
8
8
|
def show
|
9
9
|
@news = News.find(params[:id])
|
10
|
-
@other_news = News.published.
|
10
|
+
@other_news = News.published.where("id != ?", @news.id).order('date DESC').limit(3)
|
11
11
|
end
|
12
12
|
|
13
13
|
end
|
data/app/models/post.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
- admix_tab t('news.new') do |t|
|
2
|
+
-t.tab_content do
|
3
|
+
= f.input :title, as: 'string', input_html: {class: 'span12'}
|
4
|
+
= f.input :content, as: 'ckeditor', input_html: { ckeditor: {toolbar: 'Full'} }
|
5
|
+
= f.input :date, as: 'datepicker', input_html: {class: 'span12'}
|
6
|
+
= f.input :source, as: 'string', input_html: {class: 'span12'}
|
7
|
+
- admix_tab t('tabs.images') do |t|
|
8
|
+
-t.tab_content do
|
9
|
+
= f.input :image, as: 'file', input_html: {class: 'span12'}
|
10
|
+
|
11
|
+
- content_for :form_options do
|
12
|
+
= f.input :status, input_html: {class: 'span12'}
|
13
|
+
|
14
|
+
|
15
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
- grid.column name: input_label(:defaults, :title), attribute: 'title' do |obj|
|
2
|
+
- obj.title
|
3
|
+
- grid.column name: input_label(:defaults, :date), attribute: 'date' do |obj|
|
4
|
+
- obj.date
|
5
|
+
|
6
|
+
- grid.column name: input_label(:defaults, :status), attribute: 'status',
|
7
|
+
custom_filter: {t('enumerize.status.published') => 'published', t('enumerize.status.unpublished') => 'unpublished'} do |obj|
|
8
|
+
- obj.status.text
|
9
|
+
- column_actions(grid)
|
@@ -6,15 +6,12 @@ module MixRailsWriter
|
|
6
6
|
g.integration_tool :rspec
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
submenu.title = I18n.t 'news.news'
|
16
|
-
submenu.url = 'admix_news_index_url'
|
17
|
-
end
|
9
|
+
initializer "mix-rails-writer.setup_menu", after: "admix.setup_menu" do
|
10
|
+
ActiveMenu::get('admix-nav') do |nav|
|
11
|
+
nav.get(:content) do |content|
|
12
|
+
content.child :news do |news|
|
13
|
+
news.text Proc.new {t('news.news')}
|
14
|
+
news.href Proc.new {admix_news_index_url}
|
18
15
|
end
|
19
16
|
end
|
20
17
|
end
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mix-rails-writer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.24.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Sadjow Leão
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-03-12 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -41,13 +38,13 @@ files:
|
|
41
38
|
- app/controllers/posts_controller.rb
|
42
39
|
- app/controllers/news_controller.rb
|
43
40
|
- app/assets/stylesheets/writer/posts/index.scss
|
44
|
-
- app/models/admix/news_datagrid.rb
|
45
41
|
- app/models/post.rb
|
46
42
|
- app/models/news.rb
|
47
43
|
- app/views/admix/posts/_show.html.haml
|
48
44
|
- app/views/admix/posts/_thumb_image.html.haml
|
49
45
|
- app/views/admix/posts/_table_actions.html.haml
|
50
|
-
- app/views/admix/posts/
|
46
|
+
- app/views/admix/posts/_grid_columns.haml
|
47
|
+
- app/views/admix/posts/_form_config.haml
|
51
48
|
- app/views/templates/news/index.html.haml
|
52
49
|
- config/locales/writer.pt-BR.yml
|
53
50
|
- config/routes.rb
|
@@ -61,33 +58,26 @@ files:
|
|
61
58
|
- README.rdoc
|
62
59
|
homepage: https://github.com/mixinternet/mix-writer
|
63
60
|
licenses: []
|
61
|
+
metadata: {}
|
64
62
|
post_install_message:
|
65
63
|
rdoc_options: []
|
66
64
|
require_paths:
|
67
65
|
- lib
|
68
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
-
none: false
|
70
67
|
requirements:
|
71
|
-
- -
|
68
|
+
- - '>='
|
72
69
|
- !ruby/object:Gem::Version
|
73
70
|
version: '0'
|
74
|
-
segments:
|
75
|
-
- 0
|
76
|
-
hash: 2499471636538136986
|
77
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
-
none: false
|
79
72
|
requirements:
|
80
|
-
- -
|
73
|
+
- - '>='
|
81
74
|
- !ruby/object:Gem::Version
|
82
75
|
version: '0'
|
83
|
-
segments:
|
84
|
-
- 0
|
85
|
-
hash: 2499471636538136986
|
86
76
|
requirements: []
|
87
77
|
rubyforge_project:
|
88
|
-
rubygems_version:
|
78
|
+
rubygems_version: 2.0.0
|
89
79
|
signing_key:
|
90
|
-
specification_version:
|
80
|
+
specification_version: 4
|
91
81
|
summary: Mix Writer is a group of models, views, controllers for rails applications
|
92
82
|
that added News, Blogs, Articles funcionality.
|
93
83
|
test_files: []
|
@@ -1,34 +0,0 @@
|
|
1
|
-
class Admix::NewsDatagrid
|
2
|
-
|
3
|
-
include Datagrid
|
4
|
-
|
5
|
-
|
6
|
-
scope do
|
7
|
-
News.order('id DESC')
|
8
|
-
end
|
9
|
-
|
10
|
-
filter :date do |value|
|
11
|
-
value.to_s(:created_at)
|
12
|
-
end
|
13
|
-
|
14
|
-
column :title, header: I18n.t('posts.title')
|
15
|
-
column :date, header: I18n.t('posts.date') do |post|
|
16
|
-
post.date.strftime("%d/%m/%Y") #post.date.to_s(:created_at)
|
17
|
-
end
|
18
|
-
|
19
|
-
column :image, header: I18n.t('posts.image'), html: true do |post|
|
20
|
-
if post.image?
|
21
|
-
image_tag post.image.url(:small_thumb)
|
22
|
-
else
|
23
|
-
"--"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
column :status, header: I18n.t('posts.status') do |post|
|
28
|
-
post.status.text
|
29
|
-
end
|
30
|
-
|
31
|
-
|
32
|
-
include Admix::TableActions
|
33
|
-
|
34
|
-
end
|