innetra-easy_contacts 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/easy_contacts.gemspec +2 -2
- data/generators/easy_contacts/easy_contacts_generator.rb +2 -2
- data/generators/easy_contacts/templates/helpers/addresses_helper.rb +11 -2
- data/generators/easy_contacts/templates/helpers/instant_messengers_helper.rb +11 -3
- data/generators/easy_contacts/templates/helpers/phones_helper.rb +11 -2
- data/generators/easy_contacts/templates/helpers/web_sites_helper.rb +11 -2
- data/generators/easy_contacts/templates/tasks/{init.rake → easy_contacts.rake} +0 -0
- data/generators/easy_contacts/templates/views/addresses/_address.html.erb +1 -1
- data/generators/easy_contacts/templates/views/addresses/_addresses.html.erb +1 -1
- data/generators/easy_contacts/templates/views/instant_messengers/_instant_messenger.html.erb +1 -2
- data/generators/easy_contacts/templates/views/instant_messengers/_instant_messengers.html.erb +2 -2
- data/generators/easy_contacts/templates/views/phones/_phone.html.erb +1 -1
- data/generators/easy_contacts/templates/views/phones/_phones.html.erb +3 -3
- data/generators/easy_contacts/templates/views/web_sites/_web_site.html.erb +1 -1
- data/generators/easy_contacts/templates/views/web_sites/_web_sites.html.erb +3 -3
- metadata +3 -3
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('easy_contacts', '0.2.
|
5
|
+
Echoe.new('easy_contacts', '0.2.3') do |e|
|
6
6
|
e.description = "Easy Contacts for Ruby on Rails 2.2 (i18n)"
|
7
7
|
e.url = "http://github.com/innetra/easy_contacts"
|
8
8
|
e.author = "Ivan Torres"
|
data/easy_contacts.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{easy_contacts}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Ivan Torres"]
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = %q{Easy Contacts for Ruby on Rails 2.2 (i18n)}
|
11
11
|
s.email = %q{mexpolk@gmail.com}
|
12
12
|
s.extra_rdoc_files = ["lib/easy_contacts.rb"]
|
13
|
-
s.files = ["Manifest", "generators/easy_contacts/easy_contacts_generator.rb", "generators/easy_contacts/templates/stylesheets/contacts.css", "generators/easy_contacts/templates/stylesheets/default.css", "generators/easy_contacts/templates/helpers/emails_helper.rb", "generators/easy_contacts/templates/helpers/shadowbox_helper.rb", "generators/easy_contacts/templates/helpers/phones_helper.rb", "generators/easy_contacts/templates/helpers/web_sites_helper.rb", "generators/easy_contacts/templates/helpers/instant_messengers_helper.rb", "generators/easy_contacts/templates/helpers/addresses_helper.rb", "generators/easy_contacts/templates/helpers/form_helper.rb", "generators/easy_contacts/templates/migrations/easy_contacts.rb", "generators/easy_contacts/templates/tasks/
|
13
|
+
s.files = ["Manifest", "generators/easy_contacts/easy_contacts_generator.rb", "generators/easy_contacts/templates/stylesheets/contacts.css", "generators/easy_contacts/templates/stylesheets/default.css", "generators/easy_contacts/templates/helpers/emails_helper.rb", "generators/easy_contacts/templates/helpers/shadowbox_helper.rb", "generators/easy_contacts/templates/helpers/phones_helper.rb", "generators/easy_contacts/templates/helpers/web_sites_helper.rb", "generators/easy_contacts/templates/helpers/instant_messengers_helper.rb", "generators/easy_contacts/templates/helpers/addresses_helper.rb", "generators/easy_contacts/templates/helpers/form_helper.rb", "generators/easy_contacts/templates/migrations/easy_contacts.rb", "generators/easy_contacts/templates/tasks/easy_contacts.rake", "generators/easy_contacts/templates/views/phones/destroy.js.rjs", "generators/easy_contacts/templates/views/phones/_phones.html.erb", "generators/easy_contacts/templates/views/phones/_phone.html.erb", "generators/easy_contacts/templates/views/companies/show.html.erb", "generators/easy_contacts/templates/views/companies/edit.html.erb", "generators/easy_contacts/templates/views/companies/new.html.erb", "generators/easy_contacts/templates/views/companies/index.js.erb", "generators/easy_contacts/templates/views/companies/_form.html.erb", "generators/easy_contacts/templates/views/countries/index.js.erb", "generators/easy_contacts/templates/views/emails/destroy.js.rjs", "generators/easy_contacts/templates/views/emails/_email.html.erb", "generators/easy_contacts/templates/views/emails/_emails.html.erb", "generators/easy_contacts/templates/views/instant_messengers/destroy.js.rjs", "generators/easy_contacts/templates/views/instant_messengers/_instant_messengers.html.erb", "generators/easy_contacts/templates/views/instant_messengers/_instant_messenger.html.erb", "generators/easy_contacts/templates/views/people/show.html.erb", "generators/easy_contacts/templates/views/people/edit.html.erb", "generators/easy_contacts/templates/views/people/new.html.erb", "generators/easy_contacts/templates/views/people/index.js.erb", "generators/easy_contacts/templates/views/people/_form.html.erb", "generators/easy_contacts/templates/views/web_sites/_web_site.html.erb", "generators/easy_contacts/templates/views/web_sites/destroy.js.rjs", "generators/easy_contacts/templates/views/web_sites/_web_sites.html.erb", "generators/easy_contacts/templates/views/provinces/index.js.erb", "generators/easy_contacts/templates/views/contacts/_contact_info.html.erb", "generators/easy_contacts/templates/views/contacts/index.html.erb", "generators/easy_contacts/templates/views/contacts/_contact.html.erb", "generators/easy_contacts/templates/views/contacts/index.js.erb", "generators/easy_contacts/templates/views/cities/index.js.erb", "generators/easy_contacts/templates/views/addresses/destroy.js.rjs", "generators/easy_contacts/templates/views/addresses/_address.html.erb", "generators/easy_contacts/templates/views/addresses/_addresses.html.erb", "generators/easy_contacts/templates/models/city.rb", "generators/easy_contacts/templates/models/web_site.rb", "generators/easy_contacts/templates/models/web_site_type.rb", "generators/easy_contacts/templates/models/phone.rb", "generators/easy_contacts/templates/models/country.rb", "generators/easy_contacts/templates/models/email.rb", "generators/easy_contacts/templates/models/address.rb", "generators/easy_contacts/templates/models/company.rb", "generators/easy_contacts/templates/models/email_type.rb", "generators/easy_contacts/templates/models/instant_messenger.rb", "generators/easy_contacts/templates/models/instant_messenger_protocol.rb", "generators/easy_contacts/templates/models/province.rb", "generators/easy_contacts/templates/models/instant_messenger_type.rb", "generators/easy_contacts/templates/models/phone_type.rb", "generators/easy_contacts/templates/models/address_type.rb", "generators/easy_contacts/templates/models/person.rb", "generators/easy_contacts/templates/models/contact.rb", "generators/easy_contacts/templates/controllers/web_sites_controller.rb", "generators/easy_contacts/templates/controllers/phones_controller.rb", "generators/easy_contacts/templates/controllers/people_controller.rb", "generators/easy_contacts/templates/controllers/emails_controller.rb", "generators/easy_contacts/templates/controllers/countries_controller.rb", "generators/easy_contacts/templates/controllers/cities_controller.rb", "generators/easy_contacts/templates/controllers/contacts_controller.rb", "generators/easy_contacts/templates/controllers/addresses_controller.rb", "generators/easy_contacts/templates/controllers/provinces_controller.rb", "generators/easy_contacts/templates/controllers/instant_messengers_controller.rb", "generators/easy_contacts/templates/controllers/companies_controller.rb", "generators/easy_contacts/templates/locales/en.easy_contacts.yml", "generators/easy_contacts/templates/locales/es-MX.easy_contacts.yml", "Rakefile", "lib/easy_contacts.rb", "easy_contacts.gemspec"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://github.com/innetra/easy_contacts}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Easy_contacts"]
|
@@ -48,8 +48,8 @@ class EasyContactsGenerator < Rails::Generator::Base
|
|
48
48
|
|
49
49
|
# Rake tasks
|
50
50
|
m.directory('lib/tasks')
|
51
|
-
m.template "tasks/
|
52
|
-
"lib/tasks/
|
51
|
+
m.template "tasks/easy_contacts.rake",
|
52
|
+
"lib/tasks/easy_contacts.rake"
|
53
53
|
|
54
54
|
# Necessary Routes
|
55
55
|
unless options[:skip_routes]
|
@@ -1,5 +1,14 @@
|
|
1
1
|
module AddressesHelper
|
2
|
-
def place_address_form(
|
3
|
-
|
2
|
+
def place_address_form(record_or_name, *args)
|
3
|
+
options = {}
|
4
|
+
case record_or_name
|
5
|
+
when String, Symbol
|
6
|
+
options[:fields_prefix] = "#{record_or_name}[address_attributes][]"
|
7
|
+
owner = args.first
|
8
|
+
else
|
9
|
+
owner = record_or_name
|
10
|
+
options[:fields_prefix] = "#{dom_class(owner)}[address_attributes][]"
|
11
|
+
end
|
12
|
+
render :partial => "addresses/addresses", :locals => { :owner => owner, :options => options }
|
4
13
|
end
|
5
14
|
end
|
@@ -1,6 +1,14 @@
|
|
1
1
|
module InstantMessengersHelper
|
2
|
-
def place_instant_messenger_form(
|
3
|
-
|
4
|
-
|
2
|
+
def place_instant_messenger_form(record_or_name, *args)
|
3
|
+
options = {}
|
4
|
+
case record_or_name
|
5
|
+
when String, Symbol
|
6
|
+
options[:fields_prefix] = "#{record_or_name}[instant_messenger_attributes][]"
|
7
|
+
owner = args.first
|
8
|
+
else
|
9
|
+
owner = record_or_name
|
10
|
+
options[:fields_prefix] = "#{dom_class(owner)}[instant_messenger_attributes][]"
|
11
|
+
end
|
12
|
+
render :partial => "instant_messengers/instant_messengers", :locals => { :owner => owner, :options => options }
|
5
13
|
end
|
6
14
|
end
|
@@ -1,5 +1,14 @@
|
|
1
1
|
module PhonesHelper
|
2
|
-
def place_phone_form(
|
3
|
-
|
2
|
+
def place_phone_form(record_or_name, *args)
|
3
|
+
options = {}
|
4
|
+
case record_or_name
|
5
|
+
when String, Symbol
|
6
|
+
options[:fields_prefix] = "#{record_or_name}[phone_attributes][]"
|
7
|
+
owner = args.first
|
8
|
+
else
|
9
|
+
owner = record_or_name
|
10
|
+
options[:fields_prefix] = "#{dom_class(owner)}[phone_attributes][]"
|
11
|
+
end
|
12
|
+
render :partial => "phones/phones", :locals => { :owner => owner, :options => options }
|
4
13
|
end
|
5
14
|
end
|
@@ -1,5 +1,14 @@
|
|
1
1
|
module WebSitesHelper
|
2
|
-
def place_web_site_form(
|
3
|
-
|
2
|
+
def place_web_site_form(record_or_name, *args)
|
3
|
+
options = {}
|
4
|
+
case record_or_name
|
5
|
+
when String, Symbol
|
6
|
+
options[:fields_prefix] = "#{record_or_name}[web_site_attributes][]"
|
7
|
+
owner = args.first
|
8
|
+
else
|
9
|
+
owner = record_or_name
|
10
|
+
options[:fields_prefix] = "#{dom_class(owner)}[web_site_attributes][]"
|
11
|
+
end
|
12
|
+
render :partial => "web_sites/web_sites", :locals => { :owner => owner, :options => options }
|
4
13
|
end
|
5
14
|
end
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%% content_tag_for(:li, address) do -%>
|
2
|
-
<%% fields_for
|
2
|
+
<%% fields_for options[:fields_prefix], address do |form| -%>
|
3
3
|
<%% unless address.new_record? -%>
|
4
4
|
<%%= form.hidden_field :id, :index => nil %>
|
5
5
|
<%% end -%>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%% content_tag(:ul, :id => "addresses") do -%>
|
2
2
|
<%% for address in owner.addresses -%>
|
3
|
-
<%%= render :partial => address, :locals => { :owner => owner } %>
|
3
|
+
<%%= render :partial => address, :locals => { :owner => owner, :options => options } %>
|
4
4
|
<%% end -%>
|
5
5
|
<%% end -%>
|
data/generators/easy_contacts/templates/views/instant_messengers/_instant_messenger.html.erb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
<%% content_tag_for(:li, instant_messenger) do -%>
|
2
|
-
<%% fields_for
|
3
|
-
instant_messenger do |form| -%>
|
2
|
+
<%% fields_for options[:fields_prefix], instant_messenger do |form| -%>
|
4
3
|
<%% unless instant_messenger.new_record? -%>
|
5
4
|
<%%= form.hidden_field :id, :index => nil %>
|
6
5
|
<%% end -%>
|
data/generators/easy_contacts/templates/views/instant_messengers/_instant_messengers.html.erb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<%% content_tag(:ul, :id => "instant_messengers") do -%>
|
2
2
|
<%% for instant_messenger in owner.instant_messengers -%>
|
3
3
|
<%%= render :partial => "/instant_messengers/instant_messenger",
|
4
|
-
:object => instant_messenger, :locals => { :owner => owner } %>
|
4
|
+
:object => instant_messenger, :locals => { :owner => owner, :options => options } %>
|
5
5
|
<%% end -%>
|
6
6
|
<%% end -%>
|
7
7
|
<p>
|
@@ -9,6 +9,6 @@
|
|
9
9
|
page.insert_html :bottom, :instant_messengers,
|
10
10
|
:partial => "/instant_messengers/instant_messenger",
|
11
11
|
:object => InstantMessenger.new,
|
12
|
-
:locals => { :owner => owner }
|
12
|
+
:locals => { :owner => owner, :options => options }
|
13
13
|
end %>
|
14
14
|
</p>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%% content_tag_for(:li, phone) do -%>
|
2
|
-
<%% fields_for
|
2
|
+
<%% fields_for options[:fields_prefix], phone do |form| -%>
|
3
3
|
<%% unless phone.new_record? -%>
|
4
4
|
<%%= form.hidden_field :id, :index => nil %>
|
5
5
|
<%% end -%>
|
@@ -1,14 +1,14 @@
|
|
1
1
|
<%% content_tag(:ul, :id => "phones") do -%>
|
2
2
|
<%% for phone in owner.phones -%>
|
3
3
|
<%%= render :partial => "/phones/phone",
|
4
|
-
:object => phone, :locals => { :owner => owner } %>
|
4
|
+
:object => phone, :locals => { :owner => owner, :options => options } %>
|
5
5
|
<%% end -%>
|
6
6
|
<%% end -%>
|
7
7
|
<p>
|
8
8
|
<%%= link_to_function t("phones.add_link") do |page|
|
9
|
-
page.insert_html :bottom, :phones,
|
9
|
+
page.insert_html :bottom, :phones,
|
10
10
|
:partial => "/phones/phone",
|
11
11
|
:object => Phone.new,
|
12
|
-
:locals => { :owner => owner }
|
12
|
+
:locals => { :owner => owner, :options => options }
|
13
13
|
end %>
|
14
14
|
</p>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%% content_tag_for(:li, web_site) do -%>
|
2
|
-
<%% fields_for
|
2
|
+
<%% fields_for options[:fields_prefix], web_site do |form| -%>
|
3
3
|
<%% unless web_site.new_record? -%>
|
4
4
|
<%%= form.hidden_field :id, :index => nil %>
|
5
5
|
<%% end -%>
|
@@ -1,14 +1,14 @@
|
|
1
1
|
<%% content_tag(:ul, :id => "web_sites") do -%>
|
2
2
|
<%% for web_site in owner.web_sites -%>
|
3
3
|
<%%= render :partial => "/web_sites/web_site",
|
4
|
-
:object => web_site, :locals => { :owner => owner } %>
|
4
|
+
:object => web_site, :locals => { :owner => owner, :options => options } %>
|
5
5
|
<%% end -%>
|
6
6
|
<%% end -%>
|
7
7
|
<p>
|
8
8
|
<%%= link_to_function t("web_sites.add_link") do |page|
|
9
|
-
page.insert_html :bottom, :web_sites,
|
9
|
+
page.insert_html :bottom, :web_sites,
|
10
10
|
:partial => "/web_sites/web_site",
|
11
11
|
:object => WebSite.new,
|
12
|
-
:locals => { :owner => owner }
|
12
|
+
:locals => { :owner => owner, :options => options }
|
13
13
|
end %>
|
14
14
|
</p>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: innetra-easy_contacts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Torres
|
@@ -34,7 +34,7 @@ files:
|
|
34
34
|
- generators/easy_contacts/templates/helpers/addresses_helper.rb
|
35
35
|
- generators/easy_contacts/templates/helpers/form_helper.rb
|
36
36
|
- generators/easy_contacts/templates/migrations/easy_contacts.rb
|
37
|
-
- generators/easy_contacts/templates/tasks/
|
37
|
+
- generators/easy_contacts/templates/tasks/easy_contacts.rake
|
38
38
|
- generators/easy_contacts/templates/views/phones/destroy.js.rjs
|
39
39
|
- generators/easy_contacts/templates/views/phones/_phones.html.erb
|
40
40
|
- generators/easy_contacts/templates/views/phones/_phone.html.erb
|
@@ -97,9 +97,9 @@ files:
|
|
97
97
|
- generators/easy_contacts/templates/controllers/companies_controller.rb
|
98
98
|
- generators/easy_contacts/templates/locales/en.easy_contacts.yml
|
99
99
|
- generators/easy_contacts/templates/locales/es-MX.easy_contacts.yml
|
100
|
-
- easy_contacts.gemspec
|
101
100
|
- Rakefile
|
102
101
|
- lib/easy_contacts.rb
|
102
|
+
- easy_contacts.gemspec
|
103
103
|
has_rdoc: true
|
104
104
|
homepage: http://github.com/innetra/easy_contacts
|
105
105
|
post_install_message:
|