innetra-easy_contacts 0.0.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/easy_contacts.gemspec +4 -4
- data/generators/easy_contacts/easy_contacts_generator.rb +11 -6
- data/generators/easy_contacts/templates/controllers/companies_controller.rb +17 -12
- data/generators/easy_contacts/templates/controllers/contacts_controller.rb +8 -2
- data/generators/easy_contacts/templates/controllers/people_controller.rb +1 -10
- data/generators/easy_contacts/templates/helpers/emails_helper.rb +11 -2
- data/generators/easy_contacts/templates/locales/es-MX.easy_contacts.yml +9 -13
- data/generators/easy_contacts/templates/stylesheets/contacts.css +14 -0
- data/{tasks → generators/easy_contacts/templates/tasks}/init.rake +0 -0
- data/generators/easy_contacts/templates/views/companies/_form.html.erb +6 -0
- data/generators/easy_contacts/templates/views/companies/edit.html.erb +10 -3
- data/generators/easy_contacts/templates/views/companies/new.html.erb +11 -3
- data/generators/easy_contacts/templates/views/companies/show.html.erb +16 -9
- data/generators/easy_contacts/templates/views/contacts/index.html.erb +11 -6
- data/generators/easy_contacts/templates/views/contacts/index.js.erb +9 -0
- data/generators/easy_contacts/templates/views/emails/_email.html.erb +1 -1
- data/generators/easy_contacts/templates/views/emails/_emails.html.erb +2 -2
- data/generators/easy_contacts/templates/views/people/_form.html.erb +35 -0
- data/generators/easy_contacts/templates/views/people/edit.html.erb +9 -4
- data/generators/easy_contacts/templates/views/people/index.js.erb +5 -0
- data/generators/easy_contacts/templates/views/people/new.html.erb +10 -5
- data/generators/easy_contacts/templates/views/people/show.html.erb +6 -2
- data/lib/easy_contacts.rb +0 -0
- metadata +10 -10
- data/generators/easy_contacts/templates/stylesheets/companies.css +0 -4
- data/generators/easy_contacts/templates/stylesheets/people.css +0 -13
- data/generators/easy_contacts/templates/views/companies/_company.html.erb +0 -17
- data/generators/easy_contacts/templates/views/companies/index.html.erb +0 -21
- data/generators/easy_contacts/templates/views/people/_person.html.erb +0 -44
- data/generators/easy_contacts/templates/views/people/index.html.erb +0 -21
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.0
|
5
|
+
Echoe.new('easy_contacts', '0.2.0') 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"
|
@@ -11,4 +11,4 @@ Echoe.new('easy_contacts', '0.0.1') do |e|
|
|
11
11
|
e.development_dependencies = []
|
12
12
|
end
|
13
13
|
|
14
|
-
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].each { |f| load f }
|
14
|
+
#Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].each { |f| load f }
|
data/easy_contacts.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{easy_contacts}
|
5
|
-
s.version = "0.0
|
5
|
+
s.version = "0.2.0"
|
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"]
|
9
|
-
s.date = %q{2009-01-
|
9
|
+
s.date = %q{2009-01-23}
|
10
10
|
s.description = %q{Easy Contacts for Ruby on Rails 2.2 (i18n)}
|
11
11
|
s.email = %q{mexpolk@gmail.com}
|
12
|
-
s.extra_rdoc_files = ["
|
13
|
-
s.files = ["Manifest", "
|
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/init.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"]
|
@@ -46,6 +46,11 @@ class EasyContactsGenerator < Rails::Generator::Base
|
|
46
46
|
m.template "locales/es-MX.easy_contacts.yml",
|
47
47
|
"config/locales/es-MX.easy_contacts.yml"
|
48
48
|
|
49
|
+
# Rake tasks
|
50
|
+
m.directory('lib/tasks')
|
51
|
+
m.template "tasks/init.rake",
|
52
|
+
"lib/tasks/init.rake"
|
53
|
+
|
49
54
|
# Necessary Routes
|
50
55
|
unless options[:skip_routes]
|
51
56
|
generate_routes
|
@@ -76,8 +81,7 @@ class EasyContactsGenerator < Rails::Generator::Base
|
|
76
81
|
addresses/_addresses.html.erb
|
77
82
|
addresses/destroy.js.rjs
|
78
83
|
cities/index.js.erb
|
79
|
-
companies/
|
80
|
-
companies/index.html.erb
|
84
|
+
companies/_form.html.erb
|
81
85
|
companies/index.js.erb
|
82
86
|
companies/edit.html.erb
|
83
87
|
companies/new.html.erb
|
@@ -85,6 +89,7 @@ class EasyContactsGenerator < Rails::Generator::Base
|
|
85
89
|
contacts/_contact.html.erb
|
86
90
|
contacts/_contact_info.html.erb
|
87
91
|
contacts/index.html.erb
|
92
|
+
contacts/index.js.erb
|
88
93
|
countries/index.js.erb
|
89
94
|
emails/destroy.js.rjs
|
90
95
|
emails/_email.html.erb
|
@@ -92,10 +97,10 @@ class EasyContactsGenerator < Rails::Generator::Base
|
|
92
97
|
instant_messengers/destroy.js.rjs
|
93
98
|
instant_messengers/_instant_messenger.html.erb
|
94
99
|
instant_messengers/_instant_messengers.html.erb
|
95
|
-
people/
|
100
|
+
people/_form.html.erb
|
96
101
|
people/edit.html.erb
|
102
|
+
people/index.js.erb
|
97
103
|
people/new.html.erb
|
98
|
-
people/_person.html.erb
|
99
104
|
people/show.html.erb
|
100
105
|
phones/destroy.js.rjs
|
101
106
|
phones/_phone.html.erb
|
@@ -107,7 +112,7 @@ class EasyContactsGenerator < Rails::Generator::Base
|
|
107
112
|
end
|
108
113
|
|
109
114
|
def stylesheets
|
110
|
-
%w[ default
|
115
|
+
%w[ default contacts ]
|
111
116
|
end
|
112
117
|
|
113
118
|
def models
|
@@ -144,7 +149,7 @@ class EasyContactsGenerator < Rails::Generator::Base
|
|
144
149
|
# Easy Contacts
|
145
150
|
map.resources :addresses, :only => :destroy
|
146
151
|
map.resources :cities, :only => :index
|
147
|
-
map.resources :companies
|
152
|
+
map.resources :companies, :has_many => :people
|
148
153
|
map.resources :contacts, :only => :index
|
149
154
|
map.resources :countries, :only => :index
|
150
155
|
map.resources :emails, :only => :destroy
|
@@ -1,23 +1,16 @@
|
|
1
1
|
class CompaniesController < ApplicationController
|
2
2
|
|
3
3
|
def index
|
4
|
-
|
5
|
-
@companies = Company.all(:conditions => ["name LIKE ?", "%#{params[:search]}%"] )
|
6
|
-
else
|
7
|
-
@companies = Company.all
|
8
|
-
end
|
9
|
-
|
10
|
-
respond_to do |format|
|
11
|
-
format.html # index.html.erb
|
12
|
-
format.js
|
13
|
-
format.xml { render :xml => @companies }
|
14
|
-
end
|
4
|
+
@companies = Company.all(:conditions => ["name LIKE ?", "%#{params[:search]}%"] )
|
15
5
|
end
|
16
6
|
|
17
7
|
def new
|
18
8
|
@company = Company.new
|
19
|
-
|
9
|
+
# Build Person contact fields
|
10
|
+
@company.phones.build
|
11
|
+
@company.phones.build(:phone_type_id => 2)
|
20
12
|
@company.emails.build
|
13
|
+
@company.emails.build(:email_type_id => 2)
|
21
14
|
@company.instant_messengers.build
|
22
15
|
@company.web_sites.build
|
23
16
|
@company.addresses.build
|
@@ -54,6 +47,18 @@ class CompaniesController < ApplicationController
|
|
54
47
|
|
55
48
|
def edit
|
56
49
|
@company = Company.find_by_id(params[:id])
|
50
|
+
# Build Company contact fields if blank
|
51
|
+
if @company.phones.blank?
|
52
|
+
@company.phones.build
|
53
|
+
@company.phones.build(:phone_type_id => 2)
|
54
|
+
end
|
55
|
+
if @company.emails.blank?
|
56
|
+
@company.emails.build
|
57
|
+
@company.emails.build(:email_type_id => 2)
|
58
|
+
end
|
59
|
+
@company.instant_messengers.build if @company.instant_messengers.blank?
|
60
|
+
@company.web_sites.build if @company.web_sites.blank?
|
61
|
+
@company.addresses.build if @company.addresses.blank?
|
57
62
|
end
|
58
63
|
|
59
64
|
def update
|
@@ -1,10 +1,16 @@
|
|
1
1
|
class ContactsController < ApplicationController
|
2
2
|
def index
|
3
|
-
|
3
|
+
if params.has_key?(:search)
|
4
|
+
@contacts = Contact.all(:conditions => ["name LIKE ? OR last_name LIKE ?", "%#{params[:search]}%", "%#{params[:search]}%"],
|
5
|
+
:order => "name, last_name")
|
6
|
+
else
|
7
|
+
@contacts = Contact.all(:order => "name, last_name")
|
8
|
+
end
|
4
9
|
|
5
10
|
respond_to do |format|
|
6
11
|
format.html # index.html.erb
|
7
|
-
format.
|
12
|
+
format.js
|
13
|
+
format.xml { render :xml => @contacts }
|
8
14
|
end
|
9
15
|
end
|
10
16
|
end
|
@@ -1,12 +1,7 @@
|
|
1
1
|
class PeopleController < ApplicationController
|
2
2
|
|
3
3
|
def index
|
4
|
-
@people = Person.all
|
5
|
-
|
6
|
-
respond_to do |format|
|
7
|
-
format.html # index.html.erb
|
8
|
-
format.xml { render :xml => @people }
|
9
|
-
end
|
4
|
+
@people = Person.all(:conditions => ["name LIKE ? OR last_name LIKE ?", "%#{params[:search]}%", "%#{params[:search]}%"] )
|
10
5
|
end
|
11
6
|
|
12
7
|
def new
|
@@ -53,22 +48,18 @@ class PeopleController < ApplicationController
|
|
53
48
|
|
54
49
|
def edit
|
55
50
|
@person = Person.find_by_id(params[:id])
|
56
|
-
|
57
51
|
# Build Person contact fields if blank
|
58
52
|
if @person.phones.blank?
|
59
53
|
@person.phones.build
|
60
54
|
@person.phones.build(:phone_type_id => 2)
|
61
55
|
end
|
62
|
-
|
63
56
|
if @person.emails.blank?
|
64
57
|
@person.emails.build
|
65
58
|
@person.emails.build(:email_type_id => 2)
|
66
59
|
end
|
67
|
-
|
68
60
|
@person.instant_messengers.build if @person.instant_messengers.blank?
|
69
61
|
@person.web_sites.build if @person.web_sites.blank?
|
70
62
|
@person.addresses.build if @person.addresses.blank?
|
71
|
-
|
72
63
|
end
|
73
64
|
|
74
65
|
def update
|
@@ -1,5 +1,14 @@
|
|
1
1
|
module EmailsHelper
|
2
|
-
def place_email_form(
|
3
|
-
|
2
|
+
def place_email_form(record_or_name, *args)
|
3
|
+
options = {}
|
4
|
+
case record_or_name
|
5
|
+
when String, Symbol
|
6
|
+
options[:fields_prefix] = "#{record_or_name}[email_attributes][]"
|
7
|
+
owner = args.first
|
8
|
+
else
|
9
|
+
owner = record_or_name
|
10
|
+
options[:fields_prefix] = "#{dom_class(owner)}[email_attributes][]"
|
11
|
+
end
|
12
|
+
render :partial => "emails/emails", :locals => { :owner => owner, :options => options }
|
4
13
|
end
|
5
14
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
"es-MX":
|
2
2
|
activerecord:
|
3
|
-
|
4
3
|
models:
|
5
4
|
contact: "Contacto"
|
6
5
|
person: "Contacto"
|
@@ -8,7 +7,6 @@
|
|
8
7
|
phone: "Teléfono"
|
9
8
|
email: "Correo Electrónico"
|
10
9
|
address: "Domicilio"
|
11
|
-
|
12
10
|
attributes:
|
13
11
|
address:
|
14
12
|
address: "Domicilio"
|
@@ -33,10 +31,11 @@
|
|
33
31
|
delete: "Eliminar"
|
34
32
|
|
35
33
|
forms:
|
36
|
-
save: "Guardar"
|
37
34
|
cancel: "Cancelar"
|
38
|
-
update: "Actualizar"
|
39
35
|
optional_fields: "Datos Opcionales"
|
36
|
+
or: "ó"
|
37
|
+
update: "Actualizar"
|
38
|
+
save: "Guardar"
|
40
39
|
|
41
40
|
addresses:
|
42
41
|
title: "Domicilio"
|
@@ -45,24 +44,24 @@
|
|
45
44
|
flash:
|
46
45
|
create: "Compañía creada."
|
47
46
|
update: "Compañía actualizada."
|
48
|
-
index:
|
49
|
-
title: "Compañías"
|
50
|
-
new_company_link: "Registrar nueva compañía"
|
51
47
|
new:
|
52
48
|
title: "Registrar Nueva Compañía"
|
53
49
|
cancel: "Cancelar"
|
54
50
|
edit:
|
55
51
|
title: "Editar compañía \"{{name}}\""
|
56
52
|
show:
|
53
|
+
back_link: "Contactos"
|
54
|
+
new_person_link: "Agregar nuevo contacto"
|
57
55
|
people_in_this_company: "Contactos"
|
58
56
|
contacts:
|
59
57
|
info:
|
60
58
|
title: "Contacto {{name}}"
|
61
59
|
index:
|
62
|
-
|
60
|
+
add_link: "Agregar"
|
63
61
|
new_person_link: "Registrar nuevo contacto"
|
64
62
|
new_company_link: "Registrar nueva companía"
|
65
|
-
|
63
|
+
people_count: "{{people_count}} personas"
|
64
|
+
title: "Contactos"
|
66
65
|
emails:
|
67
66
|
title: "Correo Electrónico"
|
68
67
|
add_link: "Agregar"
|
@@ -73,9 +72,6 @@
|
|
73
72
|
flash:
|
74
73
|
create: "Usuario creado."
|
75
74
|
update: "Usuario actualizado."
|
76
|
-
index:
|
77
|
-
title: "Contactos"
|
78
|
-
new_person_link: "Registrar nuevo contacto"
|
79
75
|
new:
|
80
76
|
title: "Registrar Nuevo Contacto"
|
81
77
|
cancel: "Cancelar"
|
@@ -83,7 +79,7 @@
|
|
83
79
|
title: "Editar contacto \"{{full_name}}\""
|
84
80
|
show:
|
85
81
|
title_description: "{{title}} en {{company}}"
|
86
|
-
|
82
|
+
back_link: "Contactos"
|
87
83
|
phones:
|
88
84
|
title: "Teléfonos"
|
89
85
|
add_link: "Agregar"
|
File without changes
|
@@ -2,12 +2,19 @@
|
|
2
2
|
<%%= stylesheet_link_tag "easy_contacts/default", :media => :all %>
|
3
3
|
<%%= stylesheet_link_tag "easy_contacts/companies", :media => :all %>
|
4
4
|
<%% end -%>
|
5
|
-
|
6
5
|
<h1>
|
7
6
|
<div class="title_actions">
|
8
7
|
<%%= link_to t("forms.cancel"), @company %>
|
9
8
|
</div>
|
10
9
|
<%%= t("companies.edit.title", :name => @company.name) %>
|
11
10
|
</h1>
|
12
|
-
|
13
|
-
<%%= render :partial =>
|
11
|
+
<%% form_for @company do |form| %>
|
12
|
+
<%%= render :partial => form %>
|
13
|
+
<hr />
|
14
|
+
<%%= render :partial => "contacts/contact", :object => @company %>
|
15
|
+
<hr />
|
16
|
+
<p>
|
17
|
+
<%%= submit_tag t("forms.save") %> <%%= t("forms.or") %>
|
18
|
+
<%%= link_to t("forms.cancel"), @company, :class => :red %>
|
19
|
+
</p>
|
20
|
+
<%% end %>
|
@@ -5,9 +5,17 @@
|
|
5
5
|
|
6
6
|
<h1>
|
7
7
|
<div class="title_actions">
|
8
|
-
<%%= link_to t("companies.new.cancel"),
|
8
|
+
<%%= link_to t("companies.new.cancel"), contacts_url %>
|
9
9
|
</div>
|
10
10
|
<%%= t "companies.new.title" %>
|
11
11
|
</h1>
|
12
|
-
|
13
|
-
<%%= render :partial =>
|
12
|
+
<%% form_for @company do |form| %>
|
13
|
+
<%%= render :partial => form %>
|
14
|
+
<hr />
|
15
|
+
<%%= render :partial => "contacts/contact", :object => @company %>
|
16
|
+
<hr />
|
17
|
+
<p>
|
18
|
+
<%%= submit_tag t("forms.save") %> <%%= t("forms.or") %>
|
19
|
+
<%%= link_to t("forms.cancel"), companies_url, :class => :red %>
|
20
|
+
</p>
|
21
|
+
<%% end %>
|
@@ -2,18 +2,25 @@
|
|
2
2
|
<%%= render :partial => "contacts/contact_info", :object => @company %>
|
3
3
|
|
4
4
|
<%% shadowbox "people_in_this_company", :class => "sidebar_section" do %>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<%%
|
9
|
-
|
10
|
-
|
5
|
+
<%% unless @company.people.blank? -%>
|
6
|
+
<h1><%%= t("companies.show.people_in_this_company") %></h1>
|
7
|
+
<ul>
|
8
|
+
<%% for person in @company.people -%>
|
9
|
+
<%% content_tag_for(:li, person) do -%>
|
10
|
+
<%%= link_to person.full_name, person %><br />
|
11
|
+
<span class="comment"><%%= person.title %></span>
|
12
|
+
<%% end -%>
|
11
13
|
<%% end -%>
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
</ul>
|
15
|
+
<%% else -%>
|
16
|
+
<%%= link_to t("companies.show.new_person_link"), new_company_person_url(@company) %>
|
17
|
+
<%% end -%>
|
15
18
|
<%% end %>
|
19
|
+
|
16
20
|
<%% end -%>
|
17
21
|
<h1>
|
22
|
+
<div class="title_actions">
|
23
|
+
<%%= link_to t("companies.show.back_link"), contacts_url %>
|
24
|
+
</div>
|
18
25
|
<%%= @company.name %>
|
19
26
|
</h1>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<%% content_for :header do -%>
|
2
|
+
<%%= stylesheet_link_tag "easy_contacts/default", :media => :all %>
|
2
3
|
<%%= stylesheet_link_tag "easy_contacts/contacts", :media => :all %>
|
3
4
|
<%% end -%>
|
4
5
|
|
@@ -10,12 +11,16 @@
|
|
10
11
|
<%% end -%>
|
11
12
|
<h1><%%= t("contacts.index.title") %></h1>
|
12
13
|
|
13
|
-
<ul>
|
14
|
-
<%% for
|
15
|
-
<%% content_tag_for(:li,
|
16
|
-
|
17
|
-
:class => "
|
18
|
-
|
14
|
+
<ul id="contact_list">
|
15
|
+
<%% for contact in @contacts -%>
|
16
|
+
<%% content_tag_for(:li, contact) do %>
|
17
|
+
<%% if contact.is_a?Person -%>
|
18
|
+
<%%= link_to contact.full_name, contact, :class => "important" %><br />
|
19
|
+
<%%= contact.title_description %>
|
20
|
+
<%% else -%>
|
21
|
+
<%%= link_to contact.name, contact, :class => "important" %><br />
|
22
|
+
<%%= t("contacts.index.people_count", :people_count => contact.people.count) %>
|
23
|
+
<%% end -%>
|
19
24
|
<%% end %>
|
20
25
|
<%% end -%>
|
21
26
|
</ul>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%% content_tag_for(:li, email) do -%>
|
2
|
-
<%% fields_for
|
2
|
+
<%% fields_for options[:fields_prefix], email do |form| -%>
|
3
3
|
<%% unless email.new_record? -%>
|
4
4
|
<%%= form.hidden_field :id, :index => nil %>
|
5
5
|
<%% end -%>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%% content_tag(:ul, :id => "emails") do -%>
|
2
2
|
<%% for email in owner.emails -%>
|
3
|
-
<%%= render :partial => email, :locals => { :owner => owner } %>
|
3
|
+
<%%= render :partial => email, :locals => { :owner => owner, :options => options } %>
|
4
4
|
<%% end -%>
|
5
5
|
<%% end -%>
|
6
6
|
<p>
|
@@ -8,6 +8,6 @@
|
|
8
8
|
page.insert_html :bottom, :emails,
|
9
9
|
:partial => "/emails/email",
|
10
10
|
:object => Email.new,
|
11
|
-
:locals => { :owner => owner }
|
11
|
+
:locals => { :owner => owner, :options => options }
|
12
12
|
end %>
|
13
13
|
</p>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<%%= error_messages_for :user %>
|
2
|
+
<table>
|
3
|
+
<tr>
|
4
|
+
<td>
|
5
|
+
<%%= form.label :name %>
|
6
|
+
<%%= required_field %><br />
|
7
|
+
<%%= form.text_field :name %>
|
8
|
+
</td>
|
9
|
+
<td>
|
10
|
+
<%%= form.label :last_name %>
|
11
|
+
<%%= required_field %><br />
|
12
|
+
<%%= form.text_field :last_name %>
|
13
|
+
</td>
|
14
|
+
</tr>
|
15
|
+
</table>
|
16
|
+
<p>
|
17
|
+
<%%= form.label :title %><br />
|
18
|
+
<%%= form.text_field :title, :size => "40" %>
|
19
|
+
</p>
|
20
|
+
<%% fields_for "person[company_attributes]", @person.company do |form| -%>
|
21
|
+
<p>
|
22
|
+
<%%= form.label :name, t("activerecord.attributes.company.name") %><br />
|
23
|
+
<%%= form.text_field :name, :size => "40", :autocomplete => :off %>
|
24
|
+
</p>
|
25
|
+
<div id="person_company_attributes_name_auto_complete" class="auto_complete" style="display: none;"></div>
|
26
|
+
<script type="text/javascript">
|
27
|
+
//<![CDATA[
|
28
|
+
var person_company_attributes_name_auto_completer = new Ajax.Autocompleter('person_company_attributes_name',
|
29
|
+
'person_company_attributes_name_auto_complete',
|
30
|
+
'<%%= formatted_companies_url(:js) -%>',
|
31
|
+
{callback:function(element, value) { return 'search=' + element.value }, method:'get'})
|
32
|
+
//]]>
|
33
|
+
</script>
|
34
|
+
<%% end -%>
|
35
|
+
<%%= render :partial => "contacts/contact", :object => @person %>
|
@@ -1,13 +1,18 @@
|
|
1
1
|
<%% content_for :header do -%>
|
2
2
|
<%%= stylesheet_link_tag "easy_contacts/default", :media => :all %>
|
3
|
-
<%%= stylesheet_link_tag "easy_contacts/
|
3
|
+
<%%= stylesheet_link_tag "easy_contacts/contacts", :media => :all %>
|
4
4
|
<%% end -%>
|
5
|
-
|
6
5
|
<h1>
|
7
6
|
<div class="title_actions">
|
8
7
|
<%%= link_to t("forms.cancel"), @person %>
|
9
8
|
</div>
|
10
9
|
<%%= t("people.edit.title", :full_name => @person.full_name) %>
|
11
10
|
</h1>
|
12
|
-
|
13
|
-
<%%= render :partial =>
|
11
|
+
<%% form_for @person do |form| %>
|
12
|
+
<%%= render :partial => form %>
|
13
|
+
<hr />
|
14
|
+
<p>
|
15
|
+
<%%= submit_tag t("forms.save") %> <%= t("forms.or") %>
|
16
|
+
<%%= link_to t("forms.cancel"), @person, :class => :red %>
|
17
|
+
</p>
|
18
|
+
<%% end -%>
|
@@ -1,13 +1,18 @@
|
|
1
1
|
<%% content_for :header do -%>
|
2
2
|
<%%= stylesheet_link_tag "easy_contacts/default", :media => :all %>
|
3
|
-
<%%= stylesheet_link_tag "easy_contacts/
|
3
|
+
<%%= stylesheet_link_tag "easy_contacts/contacts", :media => :all %>
|
4
4
|
<%% end -%>
|
5
|
-
|
6
5
|
<h1>
|
7
6
|
<div class="title_actions">
|
8
|
-
<%%= link_to t("people.new.cancel"),
|
7
|
+
<%%= link_to t("people.new.cancel"), contacts_url %>
|
9
8
|
</div>
|
10
9
|
<%%= t "people.new.title" %>
|
11
10
|
</h1>
|
12
|
-
|
13
|
-
<%%= render :partial =>
|
11
|
+
<%% form_for @person do |form| %>
|
12
|
+
<%%= render :partial => form %>
|
13
|
+
<hr />
|
14
|
+
<p>
|
15
|
+
<%%= submit_tag t("forms.save") %> <%%= t("forms.or") %>
|
16
|
+
<%%= link_to t("forms.cancel"), contacts_url, :class => :red %>
|
17
|
+
</p>
|
18
|
+
<%% end -%>
|
@@ -2,12 +2,16 @@
|
|
2
2
|
<%%= stylesheet_link_tag "easy_contacts/default", :media => :all %>
|
3
3
|
<%%= stylesheet_link_tag "easy_contacts/people", :media => :all %>
|
4
4
|
<%% end -%>
|
5
|
-
|
6
5
|
<%% content_for :sidebar do -%>
|
7
6
|
<%%= render :partial => "contacts/contact_info", :object => @person %>
|
7
|
+
<%% unless @person.company.blank? -%>
|
8
|
+
<%%= render :partial => "contacts/contact_info", :object => @person.company %>
|
9
|
+
<%% end -%>
|
8
10
|
<%% end -%>
|
9
|
-
|
10
11
|
<h1>
|
12
|
+
<div class="title_actions">
|
13
|
+
<%%= link_to t("people.show.back_link"), contacts_url %>
|
14
|
+
</div>
|
11
15
|
<%%= @person.full_name %><br />
|
12
16
|
<span class="comment"><%%= @person.title_description %></span>
|
13
17
|
</h1>
|
File without changes
|
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.0
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Torres
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-23 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -20,13 +20,11 @@ executables: []
|
|
20
20
|
extensions: []
|
21
21
|
|
22
22
|
extra_rdoc_files:
|
23
|
-
-
|
23
|
+
- lib/easy_contacts.rb
|
24
24
|
files:
|
25
25
|
- Manifest
|
26
|
-
- tasks/init.rake
|
27
26
|
- generators/easy_contacts/easy_contacts_generator.rb
|
28
|
-
- generators/easy_contacts/templates/stylesheets/
|
29
|
-
- generators/easy_contacts/templates/stylesheets/companies.css
|
27
|
+
- generators/easy_contacts/templates/stylesheets/contacts.css
|
30
28
|
- generators/easy_contacts/templates/stylesheets/default.css
|
31
29
|
- generators/easy_contacts/templates/helpers/emails_helper.rb
|
32
30
|
- generators/easy_contacts/templates/helpers/shadowbox_helper.rb
|
@@ -36,15 +34,15 @@ files:
|
|
36
34
|
- generators/easy_contacts/templates/helpers/addresses_helper.rb
|
37
35
|
- generators/easy_contacts/templates/helpers/form_helper.rb
|
38
36
|
- generators/easy_contacts/templates/migrations/easy_contacts.rb
|
37
|
+
- generators/easy_contacts/templates/tasks/init.rake
|
39
38
|
- generators/easy_contacts/templates/views/phones/destroy.js.rjs
|
40
39
|
- generators/easy_contacts/templates/views/phones/_phones.html.erb
|
41
40
|
- generators/easy_contacts/templates/views/phones/_phone.html.erb
|
42
|
-
- generators/easy_contacts/templates/views/companies/index.html.erb
|
43
41
|
- generators/easy_contacts/templates/views/companies/show.html.erb
|
44
42
|
- generators/easy_contacts/templates/views/companies/edit.html.erb
|
45
43
|
- generators/easy_contacts/templates/views/companies/new.html.erb
|
46
44
|
- generators/easy_contacts/templates/views/companies/index.js.erb
|
47
|
-
- generators/easy_contacts/templates/views/companies/
|
45
|
+
- generators/easy_contacts/templates/views/companies/_form.html.erb
|
48
46
|
- generators/easy_contacts/templates/views/countries/index.js.erb
|
49
47
|
- generators/easy_contacts/templates/views/emails/destroy.js.rjs
|
50
48
|
- generators/easy_contacts/templates/views/emails/_email.html.erb
|
@@ -52,11 +50,11 @@ files:
|
|
52
50
|
- generators/easy_contacts/templates/views/instant_messengers/destroy.js.rjs
|
53
51
|
- generators/easy_contacts/templates/views/instant_messengers/_instant_messengers.html.erb
|
54
52
|
- generators/easy_contacts/templates/views/instant_messengers/_instant_messenger.html.erb
|
55
|
-
- generators/easy_contacts/templates/views/people/index.html.erb
|
56
53
|
- generators/easy_contacts/templates/views/people/show.html.erb
|
57
54
|
- generators/easy_contacts/templates/views/people/edit.html.erb
|
58
55
|
- generators/easy_contacts/templates/views/people/new.html.erb
|
59
|
-
- generators/easy_contacts/templates/views/people/
|
56
|
+
- generators/easy_contacts/templates/views/people/index.js.erb
|
57
|
+
- generators/easy_contacts/templates/views/people/_form.html.erb
|
60
58
|
- generators/easy_contacts/templates/views/web_sites/_web_site.html.erb
|
61
59
|
- generators/easy_contacts/templates/views/web_sites/destroy.js.rjs
|
62
60
|
- generators/easy_contacts/templates/views/web_sites/_web_sites.html.erb
|
@@ -64,6 +62,7 @@ files:
|
|
64
62
|
- generators/easy_contacts/templates/views/contacts/_contact_info.html.erb
|
65
63
|
- generators/easy_contacts/templates/views/contacts/index.html.erb
|
66
64
|
- generators/easy_contacts/templates/views/contacts/_contact.html.erb
|
65
|
+
- generators/easy_contacts/templates/views/contacts/index.js.erb
|
67
66
|
- generators/easy_contacts/templates/views/cities/index.js.erb
|
68
67
|
- generators/easy_contacts/templates/views/addresses/destroy.js.rjs
|
69
68
|
- generators/easy_contacts/templates/views/addresses/_address.html.erb
|
@@ -99,6 +98,7 @@ files:
|
|
99
98
|
- generators/easy_contacts/templates/locales/en.easy_contacts.yml
|
100
99
|
- generators/easy_contacts/templates/locales/es-MX.easy_contacts.yml
|
101
100
|
- Rakefile
|
101
|
+
- lib/easy_contacts.rb
|
102
102
|
- easy_contacts.gemspec
|
103
103
|
has_rdoc: true
|
104
104
|
homepage: http://github.com/innetra/easy_contacts
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<%% form_for company do |form| %>
|
2
|
-
<%%= error_messages_for :company %>
|
3
|
-
<p>
|
4
|
-
<%%= form.label :name %>
|
5
|
-
<%%= required_field %><br />
|
6
|
-
<%%= form.text_field :name, :size => 60 %>
|
7
|
-
</p>
|
8
|
-
<hr />
|
9
|
-
|
10
|
-
<%%= render :partial => "contacts/contact", :object => company %>
|
11
|
-
|
12
|
-
<hr />
|
13
|
-
<p>
|
14
|
-
<%%= submit_tag t("forms.save") %> ó
|
15
|
-
<%%= link_to t("forms.cancel"), companies_url, :class => :red %>
|
16
|
-
</p>
|
17
|
-
<%% end %>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<%% content_for :header do -%>
|
2
|
-
<%%= stylesheet_link_tag "easy_contacts/default", :media => :all %>
|
3
|
-
<%%= stylesheet_link_tag "easy_contacts/companies", :media => :all %>
|
4
|
-
<%% end -%>
|
5
|
-
|
6
|
-
<%% content_for :sidebar do -%>
|
7
|
-
<%% shadowbox "options_section", :class => "sidebar_section" do %>
|
8
|
-
<%%= link_to t("companies.index.new_company_link"), new_company_url %><br />
|
9
|
-
<%% end %>
|
10
|
-
<%% end -%>
|
11
|
-
|
12
|
-
<h1><%%= t("companies.index.title") %></h1>
|
13
|
-
|
14
|
-
<ul>
|
15
|
-
<%% for company in @companies -%>
|
16
|
-
<%% content_tag_for(:li, company) do %>
|
17
|
-
<%%= link_to company.name, company,
|
18
|
-
:class => "name important" %>
|
19
|
-
<%% end %>
|
20
|
-
<%% end -%>
|
21
|
-
</ul>
|
@@ -1,44 +0,0 @@
|
|
1
|
-
<%% form_for person do |form| %>
|
2
|
-
<%%= error_messages_for :user %>
|
3
|
-
<table>
|
4
|
-
<tr>
|
5
|
-
<td>
|
6
|
-
<%%= form.label :name %>
|
7
|
-
<%%= required_field %><br />
|
8
|
-
<%%= form.text_field :name %>
|
9
|
-
</td>
|
10
|
-
<td>
|
11
|
-
<%%= form.label :last_name %>
|
12
|
-
<%%= required_field %><br />
|
13
|
-
<%%= form.text_field :last_name %>
|
14
|
-
</td>
|
15
|
-
</tr>
|
16
|
-
</table>
|
17
|
-
<p>
|
18
|
-
<%%= form.label :title %><br />
|
19
|
-
<%%= form.text_field :title, :size => "40" %>
|
20
|
-
</p>
|
21
|
-
<%% fields_for "person[company_attributes]", @person.company do |form| -%>
|
22
|
-
<p>
|
23
|
-
<%%= form.label :name, t("activerecord.attributes.company.name") %><br />
|
24
|
-
<%%= form.text_field :name, :size => "40", :autocomplete => :off %>
|
25
|
-
</p>
|
26
|
-
<div id="person_company_attributes_name_auto_complete" class="auto_complete" style="display: none;"></div>
|
27
|
-
<script type="text/javascript">
|
28
|
-
//<![CDATA[
|
29
|
-
var person_company_attributes_name_auto_completer = new Ajax.Autocompleter('person_company_attributes_name',
|
30
|
-
'person_company_attributes_name_auto_complete',
|
31
|
-
'<%%= formatted_companies_url(:js) -%>',
|
32
|
-
{callback:function(element, value) { return 'search=' + element.value }, method:'get'})
|
33
|
-
//]]>
|
34
|
-
</script>
|
35
|
-
<%% end -%>
|
36
|
-
|
37
|
-
<%%= render :partial => "contacts/contact", :object => @person %>
|
38
|
-
|
39
|
-
<hr />
|
40
|
-
<p>
|
41
|
-
<%%= submit_tag t("forms.save") %> ó
|
42
|
-
<%%= link_to t("forms.cancel"), people_url, :class => :red %>
|
43
|
-
</p>
|
44
|
-
<%% end %>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<%% content_for :header do -%>
|
2
|
-
<%%= stylesheet_link_tag "easy_contacts/default", :media => :all %>
|
3
|
-
<%%= stylesheet_link_tag "easy_contacts/people", :media => :all %>
|
4
|
-
<%% end -%>
|
5
|
-
|
6
|
-
<%% content_for :sidebar do -%>
|
7
|
-
<%% shadowbox "options_section", :class => "sidebar_section" do %>
|
8
|
-
<%%= link_to t("people.index.new_person_link"), new_person_url %><br />
|
9
|
-
<%% end %>
|
10
|
-
<%% end -%>
|
11
|
-
<h1><%%= t("people.index.title") %></h1>
|
12
|
-
|
13
|
-
<ul>
|
14
|
-
<%% for person in @people -%>
|
15
|
-
<%% content_tag_for(:li, person) do %>
|
16
|
-
<%%= link_to person.full_name, person,
|
17
|
-
:class => "full_name important" %><br />
|
18
|
-
<%%= person.title_description %>
|
19
|
-
<%% end %>
|
20
|
-
<%% end -%>
|
21
|
-
</ul>
|