chili_pepper 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/app/controllers/chili_pepper/sections_controller.rb +1 -1
- data/app/decorators/chili_pepper/menu_decorator.rb +1 -1
- data/app/decorators/chili_pepper/section_decorator.rb +8 -7
- data/app/models/chili_pepper/section.rb +11 -6
- data/app/views/chili_pepper/sections/_form.html.haml +2 -1
- data/app/views/chili_pepper/sections/show.html.haml +4 -3
- data/app/views/layouts/chili_pepper/menu.html.haml +1 -1
- data/db/migrate/20140811150635_add_heading_to_chili_pepper_sections.rb +5 -0
- data/db/migrate/20140811163304_change_availibility_to_text.rb +9 -0
- data/lib/chili_pepper/engine.rb +6 -1
- data/lib/chili_pepper/version.rb +1 -1
- metadata +3 -16
- data/lib/tasks/auto_annotate_models.rake +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61039b400230929e6ab13346dea4b736853c4096
|
4
|
+
data.tar.gz: aaa3d2f22996b4cb4461678bc904f39bffd9de5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6da604f13d226608e8575d905d6161f7763457315b412042c0a1c65ede2eb16de702f476a7341898cec4a1039795f88dc6b7028c2ca74b77a419492b8378fdfd
|
7
|
+
data.tar.gz: 048734f2d4ff32d7b692f082de2027825ce558cfeae9d60412799600238a0836a7a1a03cf42d1e6685fd45f98142cf037f6c9022a7064bf39c33faad582c4423
|
@@ -3,17 +3,18 @@ module ChiliPepper
|
|
3
3
|
delegate_all
|
4
4
|
decorates_association :items
|
5
5
|
|
6
|
-
def
|
7
|
-
if description?
|
8
|
-
|
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
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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,
|
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
|
@@ -17,9 +17,10 @@
|
|
17
17
|
= @menu.pdf_link
|
18
18
|
|
19
19
|
%section#menu_dishes
|
20
|
-
= @section.
|
21
|
-
|
22
|
-
|
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
|
|
data/lib/chili_pepper/engine.rb
CHANGED
@@ -14,9 +14,14 @@ module ChiliPepper
|
|
14
14
|
|
15
15
|
|
16
16
|
class << self
|
17
|
-
mattr_accessor :columns_number,
|
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
|
data/lib/chili_pepper/version.rb
CHANGED
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.
|
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
|