radiant-people-extension 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -13,11 +13,9 @@ begin
13
13
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
14
  end
15
15
  rescue LoadError
16
- puts "Jeweler (or a dependency) not available. This is only required if you plan to package gemmy as a gem."
16
+ puts "Jeweler (or a dependency) not available. This is only required if you plan to package people as a gem."
17
17
  end
18
18
 
19
- # I think this is the one that should be moved to the extension Rakefile template
20
-
21
19
  # In rails 1.2, plugins aren't available in the path until they're loaded.
22
20
  # Check to see if the rspec plugin is installed first and require
23
21
  # it if it is. If not, use the gem version.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -1,2 +1,6 @@
1
1
  module Admin::PeopleHelper
2
+ def render_person(person, locals={})
3
+ details = locals.merge!({:person => person})
4
+ render person, details
5
+ end
2
6
  end
@@ -9,7 +9,8 @@
9
9
  = label :person, :first_name
10
10
  = text_field :person, :first_name
11
11
  = submit_tag 'Search'
12
- = link_to 'Clear results...', admin_people_path
12
+ - if params[:person]
13
+ = link_to 'Clear results...', admin_people_path
13
14
  - if params[:person]
14
15
  - form_for :merge, :url => merge_admin_people_path() do |f|
15
16
  %table.index
@@ -0,0 +1,3 @@
1
+ ---
2
+ en:
3
+ people: People
@@ -0,0 +1,6 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+ map.merge_admin_people '/admin/people/merge.:format', :controller => 'admin/people', :action => 'merge', :conditions => {:method => :post}
3
+ map.namespace :admin do |admin|
4
+ admin.resources :people, :member => { :remove => :get }
5
+ end
6
+ end
@@ -7,8 +7,10 @@ namespace :radiant do
7
7
  require 'radiant/extension_migrator'
8
8
  if ENV["VERSION"]
9
9
  PeopleExtension.migrator.migrate(ENV["VERSION"].to_i)
10
+ Rake::Task['db:schema:dump'].invoke
10
11
  else
11
12
  PeopleExtension.migrator.migrate
13
+ Rake::Task['db:schema:dump'].invoke
12
14
  end
13
15
  end
14
16
 
@@ -22,7 +24,32 @@ namespace :radiant do
22
24
  mkdir_p RAILS_ROOT + directory, :verbose => false
23
25
  cp file, RAILS_ROOT + path, :verbose => false
24
26
  end
27
+ unless PeopleExtension.root.starts_with? RAILS_ROOT # don't need to copy vendored tasks
28
+ puts "Copying rake tasks from PeopleExtension"
29
+ local_tasks_path = File.join(RAILS_ROOT, %w(lib tasks))
30
+ mkdir_p local_tasks_path, :verbose => false
31
+ Dir[File.join PeopleExtension.root, %w(lib tasks *.rake)].each do |file|
32
+ cp file, local_tasks_path, :verbose => false
33
+ end
34
+ end
25
35
  end
36
+
37
+ desc "Syncs all available translations for this ext to the English ext master"
38
+ task :sync => :environment do
39
+ # The main translation root, basically where English is kept
40
+ language_root = PeopleExtension.root + "/config/locales"
41
+ words = TranslationSupport.get_translation_keys(language_root)
42
+
43
+ Dir["#{language_root}/*.yml"].each do |filename|
44
+ next if filename.match('_available_tags')
45
+ basename = File.basename(filename, '.yml')
46
+ puts "Syncing #{basename}"
47
+ (comments, other) = TranslationSupport.read_file(filename, basename)
48
+ words.each { |k,v| other[k] ||= words[k] } # Initializing hash variable as empty if it does not exist
49
+ other.delete_if { |k,v| !words[k] } # Remove if not defined in en.yml
50
+ TranslationSupport.write_file(filename, basename, comments, other)
51
+ end
52
+ end
26
53
  end
27
54
  end
28
55
  end
@@ -10,20 +10,13 @@ class PeopleExtension < Radiant::Extension
10
10
  config.gem 'merger'
11
11
  end
12
12
 
13
- define_routes do |map|
14
- map.merge_admin_people '/admin/people/merge.:format', :controller => 'admin/people', :action => 'merge', :conditions => {:method => :post}
15
- map.namespace :admin do |admin|
16
- admin.resources :people, :member => { :remove => :get }
17
- end
18
- end
19
-
20
13
  def activate
21
14
  Radiant::AdminUI.class_eval do
22
15
  attr_accessor :people
23
16
  end
24
17
  admin.people = load_default_people_regions
25
- tab "People" do
26
- add_item 'All People', "/admin/people"
18
+ tab "Contacts" do
19
+ add_item 'People', "/admin/people"
27
20
  end
28
21
  end
29
22
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-people-extension}
8
- s.version = "1.0.0"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jim Gay"]
12
- s.date = %q{2010-01-19}
12
+ s.date = %q{2010-07-25}
13
13
  s.description = %q{A generic and extendable way to manage people in Radiant CMS}
14
14
  s.email = %q{jim@saturnflyer.com}
15
15
  s.extra_rdoc_files = [
@@ -28,6 +28,8 @@ Gem::Specification.new do |s|
28
28
  "app/views/admin/people/edit.html.haml",
29
29
  "app/views/admin/people/index.html.haml",
30
30
  "app/views/admin/people/new.html.haml",
31
+ "config/locales/en.yml",
32
+ "config/routes.rb",
31
33
  "cucumber.yml",
32
34
  "db/migrate/20090905004948_create_people.rb",
33
35
  "features/support/env.rb",
@@ -44,7 +46,7 @@ Gem::Specification.new do |s|
44
46
  s.homepage = %q{http://github.com/saturnflyer/radiant-people-extension}
45
47
  s.rdoc_options = ["--charset=UTF-8"]
46
48
  s.require_paths = ["lib"]
47
- s.rubygems_version = %q{1.3.5}
49
+ s.rubygems_version = %q{1.3.7}
48
50
  s.summary = %q{Manage People in Radiant CMS}
49
51
  s.test_files = [
50
52
  "spec/controllers/admin/people_controller_spec.rb",
@@ -57,7 +59,7 @@ Gem::Specification.new do |s|
57
59
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
58
60
  s.specification_version = 3
59
61
 
60
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
62
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
61
63
  s.add_runtime_dependency(%q<will_paginate>, [">= 0"])
62
64
  s.add_runtime_dependency(%q<searchlogic>, [">= 0"])
63
65
  s.add_runtime_dependency(%q<merger>, [">= 0"])
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-people-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ hash: 19
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 0
10
+ version: 1.1.0
5
11
  platform: ruby
6
12
  authors:
7
13
  - Jim Gay
@@ -9,39 +15,51 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-01-19 00:00:00 -05:00
18
+ date: 2010-07-25 00:00:00 -04:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: will_paginate
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
23
32
  version: "0"
24
- version:
33
+ type: :runtime
34
+ version_requirements: *id001
25
35
  - !ruby/object:Gem::Dependency
26
36
  name: searchlogic
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
30
40
  requirements:
31
41
  - - ">="
32
42
  - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
33
46
  version: "0"
34
- version:
47
+ type: :runtime
48
+ version_requirements: *id002
35
49
  - !ruby/object:Gem::Dependency
36
50
  name: merger
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
40
54
  requirements:
41
55
  - - ">="
42
56
  - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
43
60
  version: "0"
44
- version:
61
+ type: :runtime
62
+ version_requirements: *id003
45
63
  description: A generic and extendable way to manage people in Radiant CMS
46
64
  email: jim@saturnflyer.com
47
65
  executables: []
@@ -63,6 +81,8 @@ files:
63
81
  - app/views/admin/people/edit.html.haml
64
82
  - app/views/admin/people/index.html.haml
65
83
  - app/views/admin/people/new.html.haml
84
+ - config/locales/en.yml
85
+ - config/routes.rb
66
86
  - cucumber.yml
67
87
  - db/migrate/20090905004948_create_people.rb
68
88
  - features/support/env.rb
@@ -85,21 +105,27 @@ rdoc_options:
85
105
  require_paths:
86
106
  - lib
87
107
  required_ruby_version: !ruby/object:Gem::Requirement
108
+ none: false
88
109
  requirements:
89
110
  - - ">="
90
111
  - !ruby/object:Gem::Version
112
+ hash: 3
113
+ segments:
114
+ - 0
91
115
  version: "0"
92
- version:
93
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
+ none: false
94
118
  requirements:
95
119
  - - ">="
96
120
  - !ruby/object:Gem::Version
121
+ hash: 3
122
+ segments:
123
+ - 0
97
124
  version: "0"
98
- version:
99
125
  requirements: []
100
126
 
101
127
  rubyforge_project:
102
- rubygems_version: 1.3.5
128
+ rubygems_version: 1.3.7
103
129
  signing_key:
104
130
  specification_version: 3
105
131
  summary: Manage People in Radiant CMS