chili_pepper 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17d892da3db9a37bb1e379e8412cbe838f810497
4
- data.tar.gz: 5ed59d1cf3bf770c9b696546ea73a88e6e9497ac
3
+ metadata.gz: 61039b400230929e6ab13346dea4b736853c4096
4
+ data.tar.gz: aaa3d2f22996b4cb4461678bc904f39bffd9de5e
5
5
  SHA512:
6
- metadata.gz: e82e2b9ea961e987b4033e00ff4d552af928bda75a0553f273881fb3e0abe2ec6f7a57a8e57c4e348cdbe69812aac5f8f54189cd97e46935116cf3688711b997
7
- data.tar.gz: b3d619fcdc3d21b8d2421b490cad8d24036c30c3b0266c1e0cd2bc2fa3007b957caab2231e0a6ad2db744150e8aee9228b1a1620db0dfea61ce27cb9568672a0
6
+ metadata.gz: 6da604f13d226608e8575d905d6161f7763457315b412042c0a1c65ede2eb16de702f476a7341898cec4a1039795f88dc6b7028c2ca74b77a419492b8378fdfd
7
+ data.tar.gz: 048734f2d4ff32d7b692f082de2027825ce558cfeae9d60412799600238a0836a7a1a03cf42d1e6685fd45f98142cf037f6c9022a7064bf39c33faad582c4423
@@ -74,7 +74,7 @@ module ChiliPepper
74
74
  end
75
75
 
76
76
  def section_params
77
- params.require(:section).permit(:name, :description, :image, :menu_id)
77
+ params.require(:section).permit(:name, :description, :image, :menu_id, :heading)
78
78
  end
79
79
  end
80
80
  end
@@ -14,7 +14,7 @@ module ChiliPepper
14
14
 
15
15
  def display_availability
16
16
  if availability?
17
- h.content_tag(:h2, availability, class: 'menu_availibilities')
17
+ h.content_tag(:h2, h.markdown(availability), class: 'menu_availibilities')
18
18
  end
19
19
  end
20
20
 
@@ -3,17 +3,18 @@ module ChiliPepper
3
3
  delegate_all
4
4
  decorates_association :items
5
5
 
6
- def show_section_description
7
- if description?
8
- h.content_tag(:p, h.markdown(description), :class => 'menu_section_description')
6
+ def show_section_header
7
+ if description? || heading?
8
+ header_content = ''
9
+ header_content += h.content_tag(:h1, h.markdown(heading), class: 'menu_section_heading') if heading?
10
+ header_content += h.image_tag(image.url(:medium), class: 'menu_section_image') if image?
11
+ header_content += (h.content_tag :p, h.markdown(description), class: 'menu_section_description') if description?
12
+ h.content_tag :section, h.raw(header_content), class: 'section_header'
9
13
  end
10
14
  end
11
15
 
12
16
  def admin_show_section_img
13
- if section_image?
14
- h.image_tag image.url(:thumb), :class => 'menu_img_thumb'
15
- end
17
+ h.image_tag(image.url(:thumb), class: 'menu_img_thumb') if section_image?
16
18
  end
17
-
18
19
  end
19
20
  end
@@ -18,12 +18,17 @@
18
18
 
19
19
  module ChiliPepper
20
20
  class Section < ActiveRecord::Base
21
- belongs_to :menu, class_name: "ChiliPepper::Menu", touch: true
22
- validates :menu, :name, presence: true
23
- has_many :items, class_name: "ChiliPepper::Item", dependent: :destroy
24
- acts_as_list scope: :menu
25
- extend FriendlyId
21
+ belongs_to :menu, class_name: "ChiliPepper::Menu", touch: true
22
+ validates :menu, :name, presence: true
23
+ has_many :items, class_name: "ChiliPepper::Item", dependent: :destroy
24
+ acts_as_list scope: :menu
25
+ extend FriendlyId
26
26
  friendly_id :name, use: :slugged
27
- has_attached_file :image, :styles => { :medium => "1200x720>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png"
27
+ has_attached_file :image,
28
+ styles: {
29
+ medium: ChiliPepper.section_medium_image,
30
+ thumb: '100x100>'
31
+ }
32
+ validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
28
33
  end
29
34
  end
@@ -1,8 +1,9 @@
1
1
  = simple_form_for([@menu, @section]) do |f|
2
2
  %ul
3
3
  = f.input :name
4
- = f.input :description
5
4
  %fieldset
5
+ = f.input :heading
6
+ = f.input :description
6
7
  -# admin_show_section_img(@section)
7
8
  = f.input :image
8
9
  = f.input :menu_id, :as => :hidden
@@ -17,9 +17,10 @@
17
17
  = @menu.pdf_link
18
18
 
19
19
  %section#menu_dishes
20
- = @section.show_section_description
21
- - @columns_number.times do |i|
22
- = render :partial => 'column', :locals => {:col_num => i, :item_group => @item_groups[i], :section_id => @section.id}
20
+ = @section.show_section_header
21
+ %section#dishes_list
22
+ - @columns_number.times do |i|
23
+ = render :partial => 'column', :locals => {:col_num => i, :item_group => @item_groups[i], :section_id => @section.id}
23
24
  = @menu.footnotes
24
25
 
25
26
 
@@ -20,7 +20,7 @@
20
20
  = link_to "Delete Menu", menu_path(@menu), :method => :delete, :class => "delete admin"
21
21
 
22
22
  = @menu.display_availability
23
- -# @menu.display_description
23
+ = @menu.display_description
24
24
 
25
25
 
26
26
  - if @menu.image?
@@ -0,0 +1,5 @@
1
+ class AddHeadingToChiliPepperSections < ActiveRecord::Migration
2
+ def change
3
+ add_column :chili_pepper_sections, :heading, :string
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class ChangeAvailibilityToText < ActiveRecord::Migration
2
+ def up
3
+ change_column :chili_pepper_menus, :availability, :text
4
+ end
5
+
6
+ def down
7
+ change_column :chili_pepper_menus, :availability, :string
8
+ end
9
+ end
@@ -14,9 +14,14 @@ module ChiliPepper
14
14
 
15
15
 
16
16
  class << self
17
- mattr_accessor :columns_number, :menu_medium_image, :restaurant_name
17
+ mattr_accessor :columns_number,
18
+ :menu_medium_image,
19
+ :restaurant_name,
20
+ :section_medium_image
21
+
18
22
  self.columns_number = 2
19
23
  self.menu_medium_image = '430x184>'
24
+ self.section_medium_image = '530x230>'
20
25
  self.restaurant_name = 'Restaurant'
21
26
 
22
27
  # add default values of more config vars here
@@ -1,3 +1,3 @@
1
1
  module ChiliPepper
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chili_pepper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loic Seigland
@@ -332,20 +332,6 @@ dependencies:
332
332
  - - ">="
333
333
  - !ruby/object:Gem::Version
334
334
  version: '0'
335
- - !ruby/object:Gem::Dependency
336
- name: annotate
337
- requirement: !ruby/object:Gem::Requirement
338
- requirements:
339
- - - ">="
340
- - !ruby/object:Gem::Version
341
- version: 2.6.0
342
- type: :development
343
- prerelease: false
344
- version_requirements: !ruby/object:Gem::Requirement
345
- requirements:
346
- - - ">="
347
- - !ruby/object:Gem::Version
348
- version: 2.6.0
349
335
  description: Using in-place editing etc.
350
336
  email:
351
337
  - loic@loicseigland.ie
@@ -435,11 +421,12 @@ files:
435
421
  - db/migrate/20140616163238_add_attachments_to_sections.rb
436
422
  - db/migrate/20140810170249_create_chili_pepper_annotations.rb
437
423
  - db/migrate/20140810170608_add_annotation_id_to_items.rb
424
+ - db/migrate/20140811150635_add_heading_to_chili_pepper_sections.rb
425
+ - db/migrate/20140811163304_change_availibility_to_text.rb
438
426
  - lib/chili_pepper.rb
439
427
  - lib/chili_pepper/configuration.rb
440
428
  - lib/chili_pepper/engine.rb
441
429
  - lib/chili_pepper/version.rb
442
- - lib/tasks/auto_annotate_models.rake
443
430
  - lib/tasks/chili_pepper_tasks.rake
444
431
  - lib/templates/haml/scaffold/_form.html.haml
445
432
  homepage: ''
@@ -1,34 +0,0 @@
1
- # NOTE: only doing this in development as some production environments (Heroku)
2
- # NOTE: are sensitive to local FS writes, and besides -- it's just not proper
3
- # NOTE: to have a dev-mode tool do its thing in production.
4
- if Rails.env.development?
5
- task :set_annotation_options do
6
- # You can override any of these by setting an environment variable of the
7
- # same name.
8
- Annotate.set_defaults({
9
- 'position_in_routes' => "before",
10
- 'position_in_class' => "before",
11
- 'position_in_test' => "before",
12
- 'position_in_fixture' => "before",
13
- 'position_in_factory' => "before",
14
- 'show_indexes' => "true",
15
- 'simple_indexes' => "false",
16
- 'model_dir' => "app/models",
17
- 'include_version' => "false",
18
- 'require' => "",
19
- 'exclude_tests' => "false",
20
- 'exclude_fixtures' => "false",
21
- 'exclude_factories' => "false",
22
- 'ignore_model_sub_dir' => "false",
23
- 'skip_on_db_migrate' => "false",
24
- 'format_bare' => "true",
25
- 'format_rdoc' => "false",
26
- 'format_markdown' => "false",
27
- 'sort' => "false",
28
- 'force' => "false",
29
- 'trace' => "false",
30
- })
31
- end
32
-
33
- Annotate.load_tasks
34
- end