e9_vendors 0.0.9 → 0.0.10

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.
@@ -11,6 +11,7 @@ class Vendor < ActiveRecord::Base
11
11
  validates :short_description, :presence => true
12
12
  validates :long_description, :presence => true
13
13
  validates :landing_page, :presence => true
14
+ validates :vendor_categories, :presence => true
14
15
 
15
16
  mount_uploader :logo, LogoUploader
16
17
 
@@ -9,11 +9,16 @@
9
9
  %fieldset.checkbox
10
10
  %legend
11
11
  = f.label :vendor_category_id, resource_class.human_attribute_name(:vendor_category), :class => :req
12
- %ul
13
- - VendorCategory.order(:name).each do |vc|
14
- %li.checkbox
15
- = check_box_tag 'vendor[vendor_category_ids][]', vc.id, resource.vendor_category_ids.member?(vc.id), :id => "vendor_category_#{vc.id}"
16
- = label_tag "vendor_category_#{vc.id}", vc.name
12
+ - unless VendorCategory.count.zero?
13
+ %ul
14
+ - VendorCategory.order(:name).each do |vc|
15
+ %li.checkbox
16
+ = check_box_tag 'vendor[vendor_category_ids][]', vc.id, resource.vendor_category_ids.member?(vc.id), :id => "vendor_category_#{vc.id}"
17
+ = label_tag "vendor_category_#{vc.id}", vc.name
18
+ - else
19
+ No categories exist yet.
20
+ = link_to("Create one?", new_vendor_category_path)
21
+
17
22
  .field
18
23
  = upload_mount_field(resource.logo, :reset_path => true, :required => true)
19
24
 
@@ -39,7 +44,7 @@
39
44
  = f.text_area :long_description
40
45
  .field
41
46
  = f.label :landing_page, nil, :class => :req
42
- = f.text_area :landing_page
47
+ = f.text_field :landing_page
43
48
 
44
49
  .actions
45
50
  = f.submit
@@ -1,5 +1,12 @@
1
1
  en:
2
2
  activerecord:
3
+ errors:
4
+ models:
5
+ vendor:
6
+ attributes:
7
+ vendor_categories:
8
+ blank: "You must select at least one category."
9
+
3
10
  # Translate model names. Used in Model.human_name().
4
11
  models:
5
12
  vendor_proxy: Vendor
@@ -1,3 +1,3 @@
1
1
  module E9Vendors
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: e9_vendors
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.9
5
+ version: 0.0.10
6
6
  platform: ruby
7
7
  authors:
8
8
  - Travis Cox