faalis_contacts 0.1.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.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +339 -0
  3. data/README.md +3 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/faalis_contacts/application.js +1 -0
  6. data/app/assets/javascripts/faalis_contacts/modules/contact.js +360 -0
  7. data/app/assets/javascripts/faalis_contacts/modules/contact_field.js +180 -0
  8. data/app/assets/javascripts/faalis_contacts/modules/contact_type.js +180 -0
  9. data/app/controllers/api/v1/contact_fields_controller.rb +52 -0
  10. data/app/controllers/api/v1/contact_types_controller.rb +52 -0
  11. data/app/controllers/api/v1/contacts_controller.rb +71 -0
  12. data/app/models/contact.rb +6 -0
  13. data/app/models/contact_details.rb +5 -0
  14. data/app/models/contact_field.rb +2 -0
  15. data/app/models/contact_type.rb +2 -0
  16. data/app/views/angularjs_templates/contact/details.html +36 -0
  17. data/app/views/angularjs_templates/contact/index.html +62 -0
  18. data/app/views/angularjs_templates/contact/new.html +120 -0
  19. data/app/views/angularjs_templates/contact_field/details.html +12 -0
  20. data/app/views/angularjs_templates/contact_field/index.html +9 -0
  21. data/app/views/angularjs_templates/contact_field/new.html +37 -0
  22. data/app/views/angularjs_templates/contact_type/details.html +12 -0
  23. data/app/views/angularjs_templates/contact_type/index.html +9 -0
  24. data/app/views/angularjs_templates/contact_type/new.html +37 -0
  25. data/app/views/api/v1/contact_fields/create.json.jbuilder +2 -0
  26. data/app/views/api/v1/contact_fields/destroy.json.jbuilder +1 -0
  27. data/app/views/api/v1/contact_fields/index.json.jbuilder +3 -0
  28. data/app/views/api/v1/contact_fields/show.json.jbuilder +2 -0
  29. data/app/views/api/v1/contact_fields/update.json.jbuilder +2 -0
  30. data/app/views/api/v1/contact_types/create.json.jbuilder +2 -0
  31. data/app/views/api/v1/contact_types/destroy.json.jbuilder +1 -0
  32. data/app/views/api/v1/contact_types/index.json.jbuilder +3 -0
  33. data/app/views/api/v1/contact_types/show.json.jbuilder +2 -0
  34. data/app/views/api/v1/contact_types/update.json.jbuilder +2 -0
  35. data/app/views/api/v1/contacts/create.json.jbuilder +2 -0
  36. data/app/views/api/v1/contacts/destroy.json.jbuilder +1 -0
  37. data/app/views/api/v1/contacts/index.json.jbuilder +9 -0
  38. data/app/views/api/v1/contacts/show.json.jbuilder +7 -0
  39. data/app/views/api/v1/contacts/update.json.jbuilder +2 -0
  40. data/config/routes.rb +9 -0
  41. data/db/migrate/20140109115319_create_contacts.rb +15 -0
  42. data/db/migrate/20140111082843_create_contact_details.rb +13 -0
  43. data/db/migrate/20140113071029_create_contact_fields.rb +9 -0
  44. data/db/migrate/20140113071738_create_contact_types.rb +9 -0
  45. data/db/seeds.rb +9 -0
  46. data/lib/faalis_contacts.rb +6 -0
  47. data/lib/faalis_contacts/engine.rb +17 -0
  48. data/lib/faalis_contacts/version.rb +3 -0
  49. data/lib/tasks/build.rake +18 -0
  50. data/lib/tasks/faalis_contacts_tasks.rake +4 -0
  51. metadata +193 -0
@@ -0,0 +1 @@
1
+ json.msg _("Items removed successfully.")
@@ -0,0 +1,3 @@
1
+ json.array! @contact_fields do |contact_field|
2
+ json.extract! contact_field, :id, :name
3
+ end
@@ -0,0 +1,2 @@
1
+ json.extract! @contact_field, :id, :name
2
+
@@ -0,0 +1,2 @@
1
+ json.extract! @contact_field, :id, :name
2
+
@@ -0,0 +1,2 @@
1
+ json.extract! @contact_type, :id, :name
2
+
@@ -0,0 +1 @@
1
+ json.msg _("Items removed successfully.")
@@ -0,0 +1,3 @@
1
+ json.array! @contact_types do |contact_type|
2
+ json.extract! contact_type, :id, :name
3
+ end
@@ -0,0 +1,2 @@
1
+ json.extract! @contact_type, :id, :name
2
+
@@ -0,0 +1,2 @@
1
+ json.extract! @contact_type, :id, :name
2
+
@@ -0,0 +1,2 @@
1
+ json.extract! @contact, :id, :prefix, :first_name, :middle_name, :last_name, :suffix, :organization, :is_organization
2
+
@@ -0,0 +1 @@
1
+ json.msg _("Items removed successfully.")
@@ -0,0 +1,9 @@
1
+ json.array! @contacts do |contact|
2
+ json.extract! contact, :id, :prefix, :first_name, :middle_name, :last_name, :suffix, :organization, :is_organization
3
+ json.details contact.details do |detail|
4
+ json.id detail.id
5
+ json.type detail.detail_type
6
+ json.field detail.detail_field
7
+ json.value detail.detail_value
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ json.extract! @contact, :id, :prefix, :first_name, :middle_name, :last_name, :suffix, :organization, :is_organization
2
+ json.details @contact.details do |detail|
3
+ json.id detail.id
4
+ json.type detail.detail_type
5
+ json.field detail.detail_field
6
+ json.value detail.detail_value
7
+ end
@@ -0,0 +1,2 @@
1
+ json.extract! @contact, :id, :prefix, :first_name, :middle_name, :last_name, :suffix, :organization, :is_organization
2
+
data/config/routes.rb ADDED
@@ -0,0 +1,9 @@
1
+ Rails.application.routes.draw do
2
+ namespace :api, :defaults => {:format => :json} do
3
+ namespace :v1 do
4
+ resources :contacts, :except => [:new]
5
+ resources :contact_types, :except => [:new]
6
+ resources :contact_fields, :except => [:new]
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ class CreateContacts < ActiveRecord::Migration
2
+ def change
3
+ create_table :contacts do |t|
4
+ t.string :prefix
5
+ t.string :first_name
6
+ t.string :middle_name
7
+ t.string :last_name
8
+ t.string :suffix
9
+ t.string :organization
10
+ t.boolean :is_organization
11
+
12
+ t.timestamps
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ class CreateContactDetails < ActiveRecord::Migration
2
+ def change
3
+ create_table :contact_details do |t|
4
+ t.string :detail_field
5
+ t.string :detail_type
6
+ t.string :detail_value
7
+
8
+ t.integer :contact_id
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ class CreateContactFields < ActiveRecord::Migration
2
+ def change
3
+ create_table :contact_fields do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class CreateContactTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :contact_types do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,9 @@
1
+ ContactField.create(name: "Phone")
2
+ ContactField.create(name: "Email")
3
+ ContactField.create(name: "IM")
4
+ ContactField.create(name: "Address")
5
+ ContactField.create(name: "Zip Code")
6
+
7
+
8
+ ContactType.create(name: "Home")
9
+ ContactType.create(name: "Office")
@@ -0,0 +1,6 @@
1
+ require "faalis"
2
+
3
+ module FaalisContacts
4
+ end
5
+
6
+ require 'faalis_contacts/engine'
@@ -0,0 +1,17 @@
1
+ if File.exists?([File.expand_path("../../../", __FILE__),
2
+ ".development"].join("/"))
3
+ $LOAD_PATH << File.expand_path('../../../../Faalis/lib', __FILE__)
4
+ end
5
+
6
+ require "faalis"
7
+
8
+ module FaalisContacts
9
+ class Engine < ::Rails::Engine
10
+ engine_name "faalis_contacts"
11
+
12
+ ::Faalis::Engine.setup do |config|
13
+ config.models_with_permission = []
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ module FaalisContacts
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,18 @@
1
+ namespace :build do
2
+
3
+ desc "Create the contact scaffold"
4
+ task :contact do
5
+ system "rails g faalis:js_scaffold contact prefix:string first_name:string middle_name:string last_name:string suffix:string organization:string is_organization:boolean --bulk_fields organization,is_organization --tabs General:__all__,Extra,Avatar"
6
+ end
7
+
8
+ desc "Create contact fields scaffold"
9
+ task :fields do
10
+ system "rails g faalis:js_scaffold contact_field name:string --no-bulk --required name"
11
+ end
12
+
13
+ desc "Create contact type scaffold"
14
+ task :types do
15
+ system "rails g faalis:js_scaffold contact_type name:string --no-bulk --required name"
16
+ end
17
+
18
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :faalis_contacts do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,193 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: faalis_contacts
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sameer Rahmani
8
+ - Behnam Ahmad Khan Beigi
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-01-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: 4.0.2
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: 4.0.2
28
+ - !ruby/object:Gem::Dependency
29
+ name: sqlite3
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: jquery-rails
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: uglifier
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: 1.3.0
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: 1.3.0
70
+ - !ruby/object:Gem::Dependency
71
+ name: sass-rails
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: 4.0.0
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ~>
82
+ - !ruby/object:Gem::Version
83
+ version: 4.0.0
84
+ - !ruby/object:Gem::Dependency
85
+ name: jbuilder
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ~>
89
+ - !ruby/object:Gem::Version
90
+ version: '1.2'
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ~>
96
+ - !ruby/object:Gem::Version
97
+ version: '1.2'
98
+ - !ruby/object:Gem::Dependency
99
+ name: globalize
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - '>='
103
+ - !ruby/object:Gem::Version
104
+ version: 4.0.0.alpha.2
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '>='
110
+ - !ruby/object:Gem::Version
111
+ version: 4.0.0.alpha.2
112
+ description: Contacts plugin for Faalis. Provide very complete contacts application.
113
+ email:
114
+ - lxsameer@gnu.org
115
+ - yottanami@gnu.org
116
+ executables: []
117
+ extensions: []
118
+ extra_rdoc_files: []
119
+ files:
120
+ - app/models/contact_type.rb
121
+ - app/models/contact_field.rb
122
+ - app/models/contact_details.rb
123
+ - app/models/contact.rb
124
+ - app/views/angularjs_templates/contact_type/new.html
125
+ - app/views/angularjs_templates/contact_type/index.html
126
+ - app/views/angularjs_templates/contact_type/details.html
127
+ - app/views/angularjs_templates/contact/new.html
128
+ - app/views/angularjs_templates/contact/index.html
129
+ - app/views/angularjs_templates/contact/details.html
130
+ - app/views/angularjs_templates/contact_field/new.html
131
+ - app/views/angularjs_templates/contact_field/index.html
132
+ - app/views/angularjs_templates/contact_field/details.html
133
+ - app/views/api/v1/contact_fields/show.json.jbuilder
134
+ - app/views/api/v1/contact_fields/destroy.json.jbuilder
135
+ - app/views/api/v1/contact_fields/create.json.jbuilder
136
+ - app/views/api/v1/contact_fields/update.json.jbuilder
137
+ - app/views/api/v1/contact_fields/index.json.jbuilder
138
+ - app/views/api/v1/contact_types/show.json.jbuilder
139
+ - app/views/api/v1/contact_types/destroy.json.jbuilder
140
+ - app/views/api/v1/contact_types/create.json.jbuilder
141
+ - app/views/api/v1/contact_types/update.json.jbuilder
142
+ - app/views/api/v1/contact_types/index.json.jbuilder
143
+ - app/views/api/v1/contacts/show.json.jbuilder
144
+ - app/views/api/v1/contacts/destroy.json.jbuilder
145
+ - app/views/api/v1/contacts/create.json.jbuilder
146
+ - app/views/api/v1/contacts/update.json.jbuilder
147
+ - app/views/api/v1/contacts/index.json.jbuilder
148
+ - app/assets/javascripts/faalis_contacts/application.js
149
+ - app/assets/javascripts/faalis_contacts/modules/contact.js
150
+ - app/assets/javascripts/faalis_contacts/modules/contact_type.js
151
+ - app/assets/javascripts/faalis_contacts/modules/contact_field.js
152
+ - app/controllers/api/v1/contact_fields_controller.rb
153
+ - app/controllers/api/v1/contact_types_controller.rb
154
+ - app/controllers/api/v1/contacts_controller.rb
155
+ - config/routes.rb
156
+ - db/migrate/20140113071029_create_contact_fields.rb
157
+ - db/migrate/20140109115319_create_contacts.rb
158
+ - db/migrate/20140111082843_create_contact_details.rb
159
+ - db/migrate/20140113071738_create_contact_types.rb
160
+ - db/seeds.rb
161
+ - lib/faalis_contacts/version.rb
162
+ - lib/faalis_contacts/engine.rb
163
+ - lib/faalis_contacts.rb
164
+ - lib/tasks/faalis_contacts_tasks.rake
165
+ - lib/tasks/build.rake
166
+ - LICENSE
167
+ - Rakefile
168
+ - README.md
169
+ homepage: https://github.com/Yellowen/faalis_contacts
170
+ licenses:
171
+ - GPL-2
172
+ metadata: {}
173
+ post_install_message:
174
+ rdoc_options: []
175
+ require_paths:
176
+ - lib
177
+ required_ruby_version: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ required_rubygems_version: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - '>='
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ requirements: []
188
+ rubyforge_project:
189
+ rubygems_version: 2.0.3
190
+ signing_key:
191
+ specification_version: 4
192
+ summary: Contacts plugin for Faalis.
193
+ test_files: []