mix-rails-message-board 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 866d5d9d38d64e75f66119674aba241c89d39849
4
+ data.tar.gz: e5d992486aaf738027e716b6f91315ff94c5a786
5
+ SHA512:
6
+ metadata.gz: 85854480add30917ece46bec8f45129d9e9aff8c0c4287ab02c3ac731fb53750d309f32e10dd3d97de2644300803c6fd4b4ec55fd754192423ee2f944d15789b
7
+ data.tar.gz: 7c97a72e6509fccf6633633f38d46638d1715615e7893d35d7de6fb44f13358bfe5a96af72191b65c536d7e88dad160883a56ed507d9ddf2f7b9b36b9b49ee5b
@@ -2,7 +2,7 @@ class BoardMessagesController < ApplicationController
2
2
 
3
3
  def index
4
4
  @board_message = BoardMessage.new
5
- @board_messages = BoardMessage.approved.paginate(:page => params[:page], :per_page => 12)
5
+ @board_messages = BoardMessage.approved.order('board_messages.date DESC').paginate(:page => params[:page], :per_page => 12)
6
6
  end
7
7
 
8
8
  def create
@@ -0,0 +1,8 @@
1
+ - admix_tab t('board_messages.board_message') do |t|
2
+ - t.tab_content do
3
+ = f.input :name, as: 'string', input_html: {class: 'span12'}
4
+ = f.input :email, as: 'email', input_html: {class: 'span12'}
5
+ = f.input :message, as: 'text', input_html: {class: 'span12'}
6
+ = f.input :date, as: 'datepicker', input_html: {class: 'span12'}
7
+ - content_for :form_options do
8
+ = f.input :status, input_html: {class: 'span12'}
@@ -0,0 +1,8 @@
1
+ - if obj.disapproved? or obj.status.pending?
2
+ = link_to image_tag('admix/icons/shield_go.png'), approve_admix_board_message_path(obj), method: :put, data: { confirm: t('message_board.confirms.approve') }, class: 'btn', title:'Aprovar'
3
+ - if obj.status.approved? or obj.status.pending?
4
+ = link_to image_tag('admix/icons/shield_delete.png'), disapprove_admix_board_message_path(obj), method: :put,data: { confirm: t('message_board.confirms.disapprove') }, class: 'btn', title:'Reprovar'
5
+
6
+ = link_to image_tag('admix/icons/comment_add.png'), new_admix_board_message_board_reply_path(obj), class: 'btn', title:'Adicionar comentário'
7
+
8
+ = grid_actions_for(obj, [:show, :edit, :destroy])
@@ -0,0 +1,9 @@
1
+ - grid.column name: input_label(:defaults, :name), attribute: 'name' do |obj|
2
+ - obj.name
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.approved') => 'approved', t('enumerize.status.disapproved') => 'disapproved', t('enumerize.status.pending') => 'pending'} do |obj|
8
+ - obj.status.text
9
+ - column_actions(grid)
@@ -0,0 +1,8 @@
1
+ - admix_tab t('board_messages.board_message') do |t|
2
+ - t.tab_content do
3
+ = f.input :name, as: 'string', input_html: {class: 'span12'}
4
+ = f.input :email, as: 'email', input_html: {class: 'span12'}
5
+ = f.input :message, as: 'text', input_html: {class: 'span12'}
6
+ = f.input :date, as: 'datepicker', input_html: {class: 'span12'}
7
+ - content_for :form_options do
8
+ = f.input :status, input_html: {class: 'span12'}
@@ -0,0 +1,8 @@
1
+ - if obj.disapproved? or obj.status.pending?
2
+ = link_to image_tag('admix/icons/shield_go.png'), approve_admix_board_message_path(obj), method: :put, data: { confirm: t('message_board.confirms.approve') }, class: 'btn', title:'Aprovar'
3
+ - if obj.status.approved? or obj.status.pending?
4
+ = link_to image_tag('admix/icons/shield_delete.png'), disapprove_admix_board_message_path(obj), method: :put,data: { confirm: t('message_board.confirms.disapprove') }, class: 'btn', title:'Reprovar'
5
+
6
+ = link_to image_tag('admix/icons/comment_add.png'), new_admix_board_message_board_reply_path(obj), class: 'btn', title:'Adicionar comentário'
7
+
8
+ = grid_actions_for(obj, [:show, :edit, :destroy])
@@ -0,0 +1,9 @@
1
+ - grid.column name: input_label(:defaults, :name), attribute: 'name' do |obj|
2
+ - obj.name
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.approved') => 'approved', t('enumerize.status.disapproved') => 'disapproved', t('enumerize.status.pending') => 'pending'} do |obj|
8
+ - obj.status.text
9
+ - column_actions(grid)
@@ -16,6 +16,7 @@ pt-BR:
16
16
  board_message: 'Recado'
17
17
  board_replies:
18
18
  board_replies: 'Respostas do mural'
19
+ board_reply: 'Resposta do mural'
19
20
  board_message: 'Resposta'
20
21
  simple_form:
21
22
  labels:
@@ -1,15 +1,18 @@
1
1
  module MixRailsMessageBoard
2
2
  class Engine < ::Rails::Engine
3
3
 
4
- def navigation
5
- if defined? Admix
6
- Admix::Navigation::NavBar.post_menu do
7
- Admix::Navigation::NavBar.find(:content) do |menu|
8
- menu.submenu do |submenu|
9
- submenu.key = :message_board
10
- submenu.title = I18n.t 'message_board.message_board'
11
- submenu.url = 'admix_board_messages_url'
12
- end
4
+
5
+ config.generators do |g|
6
+ g.test_framework :rspec
7
+ g.integration_tool :rspec
8
+ end
9
+
10
+ initializer "mix-rails-message-board.setup_menu", after: "admix.setup_menu" do
11
+ ActiveMenu::get('admix-nav') do |nav|
12
+ nav.get(:content) do |content|
13
+ content.child :message_board do |message_board|
14
+ message_board.text Proc.new {t('message_board.message_board')}
15
+ message_board.href Proc.new {admix_board_messages_url}
13
16
  end
14
17
  end
15
18
  end
@@ -1,8 +1,8 @@
1
1
  module MixRailsMessageBoard
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 23
5
- TINY = 1
4
+ MINOR = 24
5
+ TINY = 0
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mix-rails-message-board
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.1
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-02-18 00:00:00.000000000 Z
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
@@ -39,17 +36,19 @@ files:
39
36
  - app/controllers/admix/board_replies_controller.rb
40
37
  - app/controllers/board_messages_controller.rb
41
38
  - app/mailers/message_board_mailer.rb
42
- - app/models/admix/board_messages_datagrid.rb
43
- - app/models/admix/board_replies_datagrid.rb
44
39
  - app/models/board_message.rb
45
40
  - app/models/board_reply.rb
46
41
  - app/views/admix/dashboard/index.html.haml
47
42
  - app/views/admix/board_messages/_show.html.haml
48
43
  - app/views/admix/board_messages/_table_actions.html.haml
49
- - app/views/admix/board_messages/_form_fields.html.haml
44
+ - app/views/admix/board_messages/_grid_actions.haml
45
+ - app/views/admix/board_messages/_grid_columns.haml
46
+ - app/views/admix/board_messages/_form_config.haml
50
47
  - app/views/admix/board_replies/_show.html.haml
51
48
  - app/views/admix/board_replies/_table_actions.html.haml
52
- - app/views/admix/board_replies/_form_fields.html.haml
49
+ - app/views/admix/board_replies/_grid_actions.haml
50
+ - app/views/admix/board_replies/_grid_columns.haml
51
+ - app/views/admix/board_replies/_form_config.haml
53
52
  - app/views/board_messages/_board_message.html.haml
54
53
  - app/views/board_messages/index.html.haml
55
54
  - app/views/board_messages/show.html.haml
@@ -67,32 +66,25 @@ files:
67
66
  - README.rdoc
68
67
  homepage: https://github.com/mixinternet/mix-rails
69
68
  licenses: []
69
+ metadata: {}
70
70
  post_install_message:
71
71
  rdoc_options: []
72
72
  require_paths:
73
73
  - lib
74
74
  required_ruby_version: !ruby/object:Gem::Requirement
75
- none: false
76
75
  requirements:
77
- - - ! '>='
76
+ - - '>='
78
77
  - !ruby/object:Gem::Version
79
78
  version: '0'
80
- segments:
81
- - 0
82
- hash: -1600769935301887627
83
79
  required_rubygems_version: !ruby/object:Gem::Requirement
84
- none: false
85
80
  requirements:
86
- - - ! '>='
81
+ - - '>='
87
82
  - !ruby/object:Gem::Version
88
83
  version: '0'
89
- segments:
90
- - 0
91
- hash: -1600769935301887627
92
84
  requirements: []
93
85
  rubyforge_project:
94
- rubygems_version: 1.8.24
86
+ rubygems_version: 2.0.0
95
87
  signing_key:
96
- specification_version: 3
88
+ specification_version: 4
97
89
  summary: MessageBoard is a module from mix-rails
98
90
  test_files: []
@@ -1,31 +0,0 @@
1
- class Admix::BoardMessagesDatagrid
2
-
3
- include Datagrid
4
- extend AdmixHelper
5
-
6
- scope do
7
- BoardMessage.order('date DESC')
8
- end
9
-
10
- filter :date do |value|
11
- value.to_s(:created_at)
12
- end
13
-
14
- column :name, header: input_label(:board_message, :name)
15
- column :email, header: input_label(:board_message, :email)
16
- column :message, header: input_label(:board_message, :message)
17
- column :date, header: input_label(:board_message, :date) do |board_message|
18
- board_message.date.strftime("%d/%m/%Y")
19
- end
20
-
21
- column :replies_count, header: input_label(:board_message, :replies_count) do |board_message|
22
- board_message.board_replies.count
23
- end
24
-
25
- column :status, header: input_label(:board_message, :status) do |board_message|
26
- board_message.status.text
27
- end
28
-
29
- include Admix::TableActions
30
-
31
- end
@@ -1,29 +0,0 @@
1
- class Admix::BoardRepliesDatagrid
2
-
3
- include Datagrid
4
-
5
- extend AdmixHelper
6
-
7
-
8
- scope do
9
- BoardReply.order('date DESC')
10
- end
11
-
12
- filter :date do |value|
13
- value.to_s(:created_at)
14
- end
15
-
16
- column :name, header: input_label(:board_reply, :name)
17
- column :email, header: input_label(:board_reply, :email)
18
- column :message, header: input_label(:board_reply, :message)
19
- column :date, header: input_label(:board_reply, :date) do |board_reply|
20
- board_reply.date.strftime("%d/%m/%Y")
21
- end
22
-
23
- column :status, header: input_label(:board_reply, :status) do |board_reply|
24
- board_reply.status.text
25
- end
26
-
27
- include Admix::TableActions
28
-
29
- end
@@ -1,5 +0,0 @@
1
- = f.input :name, as: 'string'
2
- = f.input :email, as: 'email'
3
- = f.input :message, as: 'text'
4
- = f.input :date, as: 'datepicker'
5
- = f.input :status
@@ -1,5 +0,0 @@
1
- = f.input :name, as: 'string'
2
- = f.input :email, as: 'email'
3
- = f.input :message, as: 'text'
4
- = f.input :date, as: 'datepicker'
5
- = f.input :status