ecm_cms 0.0.1.pre → 0.0.2.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -57,6 +57,10 @@ class Ecm::Cms::NavigationItem < ActiveRecord::Base
57
57
  end
58
58
  end
59
59
 
60
+ def to_s
61
+ "#{ecm_cms_navigation}: #{name}"
62
+ end
63
+
60
64
  def update_navigation_from_parent!
61
65
  self.update_navigation_from_parent
62
66
  self.save!
@@ -33,7 +33,7 @@ ActiveAdmin.register Ecm::Cms::NavigationItem do
33
33
  column :url
34
34
  column :ecm_cms_page do |ni|
35
35
  if ni.ecm_cms_page.blank?
36
- link_to(I18n.t('active_admin.new'), new_admin_ecm_cms_page_path({:ecm_cms_page => ni.params_for_new_page}))
36
+ link_to(I18n.t('active_admin.create_model', :model => Ecm::Cms::Page.model_name.human), new_admin_ecm_cms_page_path({:ecm_cms_page => ni.params_for_new_page}))
37
37
  else
38
38
  link_to(ni.ecm_cms_page.title, [:admin, ni.ecm_cms_page])
39
39
  end
@@ -6,7 +6,7 @@ ActiveAdmin.register Ecm::Cms::Navigation do
6
6
  filter :name
7
7
 
8
8
  # Menu
9
- menu :parent => Proc.new { I18n.t('ecm.cms.active_admin.menu') }.call
9
+ menu :parent => Proc.new { I18n.t('ecm.cms.active_admin.menu') }.call
10
10
 
11
11
  form do |f|
12
12
  f.inputs do
@@ -20,7 +20,7 @@ ActiveAdmin.register Ecm::Cms::Navigation do
20
20
  index do
21
21
  selectable_column
22
22
  column :name
23
- column :locale
23
+ column :locale
24
24
  default_actions
25
25
  end
26
26
 
@@ -32,7 +32,7 @@ ActiveAdmin.register Ecm::Cms::Navigation do
32
32
  column :url
33
33
  column :ecm_cms_page do |ni|
34
34
  if ni.ecm_cms_page.blank?
35
- link_to(I18n.t('active_admin.new'), new_admin_ecm_cms_page_path({:ecm_cms_page => ni.params_for_new_page}))
35
+ link_to(I18n.t('active_admin.create_model', :model => Ecm::Cms::Page.model_name.human), new_admin_ecm_cms_page_path({:ecm_cms_page => ni.params_for_new_page}))
36
36
  else
37
37
  link_to(ni.ecm_cms_page.title, [:admin, ni.ecm_cms_page])
38
38
  end
@@ -41,7 +41,7 @@ ActiveAdmin.register Ecm::Cms::Navigation do
41
41
  column :updated_at
42
42
 
43
43
  column do |ni|
44
- link_to(I18n.t('active_admin.view'), [:admin, ni], :class => "member_link view_link") +
44
+ link_to(I18n.t('active_admin.view'), [:admin, ni], :class => "member_link view_link") +
45
45
  link_to(I18n.t('active_admin.edit'), [:edit, :admin, ni], :class => "member_link edit_link")
46
46
  end
47
47
  end
@@ -23,7 +23,7 @@ ActiveAdmin.register Ecm::Cms::Page do
23
23
 
24
24
  I18n.available_locales.each do |locale|
25
25
  Ecm::Cms::Navigation.where(:locale => locale).all.each do |navigation|
26
- f.inputs do
26
+ f.inputs navigation.to_s do
27
27
  f.input :ecm_cms_navigation_items,
28
28
  :as => :check_boxes,
29
29
  :collection => navigation.ecm_cms_navigation_items.joins(:ecm_cms_navigation).where(:ecm_cms_navigations => { :locale => locale }),
@@ -42,7 +42,13 @@ ActiveAdmin.register Ecm::Cms::Page do
42
42
  column :title
43
43
  column :home_page?
44
44
  column :layout
45
- column :ecm_cms_navigation_items
45
+ column(:ecm_cms_navigation_items) do |page|
46
+ output = ""
47
+ page.ecm_cms_navigation_items.each do |navigation_item|
48
+ output << link_to(navigation_item, [:admin, navigation_item])
49
+ end
50
+ output.html_safe
51
+ end
46
52
  column :created_at
47
53
  column :updated_at
48
54
  default_actions
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Cms
3
- VERSION = "0.0.1.pre"
3
+ VERSION = "0.0.2.pre"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_cms
3
3
  version: !ruby/object:Gem::Version
4
- hash: 961915968
4
+ hash: 961915980
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
9
+ - 2
10
10
  - pre
11
- version: 0.0.1.pre
11
+ version: 0.0.2.pre
12
12
  platform: ruby
13
13
  authors:
14
14
  - Roberto Vasquez Angel
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-10-25 00:00:00 Z
19
+ date: 2012-11-15 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails