has_vcards 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,14 @@
1
+ class PhoneNumbersController < ApplicationController
2
+ # User inherited resources logic
3
+ inherit_resources
4
+ respond_to :html, :js
5
+
6
+ # Relations
7
+ optional_belongs_to :vcard
8
+
9
+ # Optionally support in place editing
10
+ if respond_to? :in_place_edit_for
11
+ in_place_edit_for :phone_number, :phone_number_type
12
+ in_place_edit_for :phone_number, :number
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ #phone_number_form
2
+ = form_for [@vcard, @phone_number], :remote => true do |phone_number|
3
+ = phone_number.select :phone_number_type, ['Tel. privat', 'Tel. geschäft', 'Handy', 'Fax', 'E-Mail']
4
+ = phone_number.text_field :number, :size => 12, :autocomplete => 'off'
5
+ = phone_number.submit "Speichern"
@@ -0,0 +1,9 @@
1
+ - phone_numbers ||= @vcard.contacts
2
+
3
+ %table#phone_numbers_list.list
4
+ %tr
5
+ %th= t_attr :phone_number_type, PhoneNumber
6
+ %th= t_attr :number, PhoneNumber
7
+ %th.action-links
8
+
9
+ = render phone_numbers
@@ -0,0 +1,3 @@
1
+ = vcard.fields_for :phone_number do |phone_number|
2
+ = phone_number.select :phone_number_type, ['Tel. privat', 'Tel. geschäft', 'Handy', 'Fax', 'E-Mail']
3
+ = phone_number.text_field :number, :size => 12, :autocomplete => 'off'
@@ -0,0 +1,6 @@
1
+ %tr[phone_number]
2
+ %td= phone_number.phone_number_type
3
+ %td= link_to phone_number.number, phone_number, {'data-href-container' => 'tr'}
4
+ %td.action-links
5
+ = list_link_for(:edit, phone_number, :remote => true)
6
+ = list_link_for(:delete, phone_number, :remote => true)
@@ -4,6 +4,11 @@ de:
4
4
  to_s: %{street_address}, %{postal_code} #{locality}
5
5
 
6
6
  activerecord:
7
+ models:
8
+ vcard: VCard
9
+ address: Adresse
10
+ phone_number: Kontakt
11
+
7
12
  attributes:
8
13
  vcard:
9
14
  full_name: Name
data/config/routes.rb ADDED
@@ -0,0 +1,10 @@
1
+ # Routes
2
+ Rails.application.routes.draw do
3
+ # Phone Numbers
4
+ resources :phone_numbers
5
+
6
+ # Vcards
7
+ resources :vcards do
8
+ resources :phone_numbers
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module HasVcards
2
- VERSION = '0.9.0'
2
+ VERSION = '0.10.0'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_vcards
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 9
8
+ - 10
9
9
  - 0
10
- version: 0.9.0
10
+ version: 0.10.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Simon H\xC3\xBCrlimann (CyT)"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-15 00:00:00 +02:00
18
+ date: 2011-10-13 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -28,14 +28,20 @@ extensions: []
28
28
  extra_rdoc_files:
29
29
  - README.markdown
30
30
  files:
31
+ - app/controllers/phone_numbers_controller.rb
31
32
  - app/helpers/has_vcards_helper.rb
32
33
  - app/models/address.rb
33
34
  - app/models/phone_number.rb
34
35
  - app/models/vcard.rb
36
+ - app/views/phone_numbers/_form.html.haml
37
+ - app/views/phone_numbers/_list.html.haml
38
+ - app/views/phone_numbers/_nested_form.html.haml
39
+ - app/views/phone_numbers/_phone_number.html.haml
35
40
  - app/views/vcards/_address.html.haml
36
41
  - app/views/vcards/_form.html.haml
37
42
  - app/views/vcards/_show.html.haml
38
43
  - config/locales/has_vcards.de.yml
44
+ - config/routes.rb
39
45
  - lib/generators/has_vcards/migration_generator.rb
40
46
  - lib/generators/has_vcards/templates/migration.rb
41
47
  - lib/has_vcards.rb