mix-rails-writer 0.26.1 → 0.26.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36552ad9cc2bef9b83763bba099a473a2b4676bb
4
- data.tar.gz: 9068ff20614ebcc21702f8f3d9efff232405a675
3
+ metadata.gz: e821bc9565843c451dad6b6605e3490c4f5b9374
4
+ data.tar.gz: 5ca06aba2e6c07dc84f7559b7fee4a5c22c5a455
5
5
  SHA512:
6
- metadata.gz: 147014974d1dda990d0efa70e95c8670779855db800f09661b35a29787f78d06cb754b096c321c3610476854ce6f1bae6e2ee59c1516a9274a98f7751f2183ba
7
- data.tar.gz: 6e100923cad98b2abd7c46a812465f22e4c55f2e05ff8a0aeb9a49002855bf2322ca9c84d9817687894ab9966e9894eff416668d48c46eee0ce940b1acc53f9e
6
+ metadata.gz: e1b53733434b61aec38015f5185423670a84b106849e4f393c3c5f093a8e3fff264536b00f2ffe376bfecccabc742076e47f80315f0e80f982f84610e767d01c
7
+ data.tar.gz: a14f74f47759c9a2d3d0a55d25c5ca738be208db456ccf0067a28d5f3ec0384ef25595d6970f773d4d93eb87e92cfad1c75bc21abe1a35ff1cb4996200ba95f6
@@ -0,0 +1,3 @@
1
+ class BlogAuthorizer < ApplicationAuthorizer
2
+ def
3
+ end
@@ -0,0 +1,3 @@
1
+ class Admix::BlogsController < Admix::InheritedController
2
+
3
+ end
@@ -0,0 +1,20 @@
1
+ class Blog < ActiveRecord::Base
2
+ extend FriendlyId
3
+ include Authority::Abilities
4
+
5
+ resourcify
6
+
7
+ self.authorizer_name = 'BlogAuthorizer'
8
+
9
+ belongs_to :user
10
+ attr_accessible :description, :name, :slug
11
+
12
+ validates_presence_of :name, :user
13
+
14
+ friendly_id :name, use: :slugged
15
+
16
+ acts_as_taggable
17
+
18
+
19
+
20
+ end
@@ -0,0 +1,11 @@
1
+ - admix_tab t('blogs.blog') do |t|
2
+ -t.tab_content do
3
+ = f.input :name as: 'string', input_html: {class: 'span12'}
4
+ = f.input :description, as: 'ckeditor', input_html: { ckeditor: {toolbar: 'Full'} }
5
+ = f.association :user
6
+
7
+ - content_for :form_options do
8
+ = f.input :status, input_html: {class: 'span12'}
9
+
10
+
11
+
@@ -0,0 +1,4 @@
1
+ - grid.column name: input_label(:defaults, :name), attribute: 'name' do |obj|
2
+ - obj.title
3
+
4
+ - column_actions(grid)
@@ -0,0 +1,9 @@
1
+ %dl
2
+ %dt= t('posts.title')
3
+ %dd= resource.title
4
+ %dt= t('posts.date')
5
+ %dd= resource.date.strftime("%d/%m/%Y")
6
+ %dt= t('posts.content')
7
+ %dd= raw resource.content
8
+ %dt= t('posts.source')
9
+ %dd= resource.source
@@ -0,0 +1,14 @@
1
+ class CreateBlogs < ActiveRecord::Migration
2
+ def change
3
+ create_table :blogs do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.references :user
7
+ t.string :slug
8
+
9
+ t.timestamps
10
+ end
11
+ add_index :blogs, :user_id
12
+ add_index :blogs, :slug
13
+ end
14
+ end
@@ -9,10 +9,18 @@ module MixRailsWriter
9
9
  initializer "mix-rails-writer.setup_menu", after: "admix.setup_menu" do
10
10
  ActiveMenu::get('admix-nav') do |nav|
11
11
  nav.get(:content) do |content|
12
+
12
13
  content.child :news do |news|
13
14
  news.text Proc.new {t('news.news')}
14
15
  news.href Proc.new {admix_news_index_url}
15
16
  end
17
+
18
+ content.child :blogs do |blogs|
19
+ blogs.text Proc.new {t('blogs.blogs')}
20
+ blogs.href Proc.new {admix_news_index_url}
21
+ blogs.visible Proc.new {current_user.can_manage?(Blog)}
22
+ end
23
+
16
24
  end
17
25
  end
18
26
  end
@@ -2,7 +2,7 @@ module MixRailsWriter
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 26
5
- TINY = 1
5
+ TINY = 2
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mix-rails-writer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.1
4
+ version: 0.26.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadjow Leão
@@ -33,21 +33,28 @@ extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
35
  - app/uploaders/writer/image_uploader.rb
36
+ - app/authorizers/blog_authorizer.rb
37
+ - app/controllers/admix/blogs_controller.rb
36
38
  - app/controllers/admix/posts_controller.rb
37
39
  - app/controllers/admix/news_controller.rb
38
40
  - app/controllers/posts_controller.rb
39
41
  - app/controllers/news_controller.rb
40
42
  - app/assets/stylesheets/writer/posts/index.scss
41
43
  - app/models/post.rb
44
+ - app/models/blog.rb
42
45
  - app/models/news.rb
43
46
  - app/views/admix/posts/_show.html.haml
44
47
  - app/views/admix/posts/_thumb_image.html.haml
45
48
  - app/views/admix/posts/_table_actions.html.haml
46
49
  - app/views/admix/posts/_grid_columns.haml
47
50
  - app/views/admix/posts/_form_config.haml
51
+ - app/views/admix/blogs/_show.html.haml
52
+ - app/views/admix/blogs/_grid_columns.haml
53
+ - app/views/admix/blogs/_form_config.haml
48
54
  - app/views/templates/news/index.html.haml
49
55
  - config/locales/writer.pt-BR.yml
50
56
  - config/routes.rb
57
+ - db/migrate/20130313021054_create_blogs.rb
51
58
  - db/migrate/20130208042530_create_posts.rb
52
59
  - lib/tasks/writer_tasks.rake
53
60
  - lib/mix-rails-writer/version.rb