chili_pepper 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +27 -0
  5. data/app/assets/javascripts/chili_pepper/dishes.js.coffee +9 -0
  6. data/app/assets/javascripts/chili_pepper/items.js.coffee +10 -0
  7. data/app/assets/javascripts/chili_pepper/layout.js.coffee +10 -0
  8. data/app/assets/javascripts/chili_pepper/menus.js.coffee +0 -0
  9. data/app/assets/javascripts/chili_pepper/sections.js.coffee +12 -0
  10. data/app/assets/javascripts/chili_pepper.js +15 -0
  11. data/app/assets/stylesheets/chili_pepper/application.css +13 -0
  12. data/app/assets/stylesheets/chili_pepper/dishes.css +4 -0
  13. data/app/assets/stylesheets/chili_pepper/items.css +4 -0
  14. data/app/assets/stylesheets/chili_pepper/menus.css +4 -0
  15. data/app/assets/stylesheets/chili_pepper/sections.css +4 -0
  16. data/app/controllers/chili_pepper/application_controller.rb +4 -0
  17. data/app/controllers/chili_pepper/dishes_controller.rb +82 -0
  18. data/app/controllers/chili_pepper/items_controller.rb +34 -0
  19. data/app/controllers/chili_pepper/menus_controller.rb +95 -0
  20. data/app/controllers/chili_pepper/sections_controller.rb +80 -0
  21. data/app/decorators/chili_pepper/item_decorator.rb +54 -0
  22. data/app/decorators/chili_pepper/menu_decorator.rb +97 -0
  23. data/app/decorators/chili_pepper/section_decorator.rb +19 -0
  24. data/app/helpers/chili_pepper/application_helper.rb +23 -0
  25. data/app/helpers/chili_pepper/dishes_helper.rb +4 -0
  26. data/app/helpers/chili_pepper/items_helper.rb +4 -0
  27. data/app/helpers/chili_pepper/menus_helper.rb +4 -0
  28. data/app/helpers/chili_pepper/sections_helper.rb +4 -0
  29. data/app/models/chili_pepper/admin.rb +26 -0
  30. data/app/models/chili_pepper/dish.rb +28 -0
  31. data/app/models/chili_pepper/item.rb +32 -0
  32. data/app/models/chili_pepper/menu.rb +70 -0
  33. data/app/models/chili_pepper/section.rb +29 -0
  34. data/app/views/chili_pepper/dishes/_form.html.haml +26 -0
  35. data/app/views/chili_pepper/dishes/edit.html.haml +9 -0
  36. data/app/views/chili_pepper/dishes/new.html.haml +9 -0
  37. data/app/views/chili_pepper/items/_item.html.haml +18 -0
  38. data/app/views/chili_pepper/menus/_form.html.haml +29 -0
  39. data/app/views/chili_pepper/menus/_navigation.html.haml +12 -0
  40. data/app/views/chili_pepper/menus/edit.html.haml +7 -0
  41. data/app/views/chili_pepper/menus/new.html.haml +7 -0
  42. data/app/views/chili_pepper/menus/show.html.haml +13 -0
  43. data/app/views/chili_pepper/sections/_column.html.haml +8 -0
  44. data/app/views/chili_pepper/sections/_form.html.haml +10 -0
  45. data/app/views/chili_pepper/sections/_section_nav_item.html.haml +6 -0
  46. data/app/views/chili_pepper/sections/edit.html.haml +8 -0
  47. data/app/views/chili_pepper/sections/new.html.haml +8 -0
  48. data/app/views/chili_pepper/sections/show.html.haml +25 -0
  49. data/app/views/devise/confirmations/new.html.haml +9 -0
  50. data/app/views/devise/mailer/confirmation_instructions.html.haml +4 -0
  51. data/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
  52. data/app/views/devise/mailer/unlock_instructions.html.haml +5 -0
  53. data/app/views/devise/passwords/edit.html.haml +14 -0
  54. data/app/views/devise/passwords/new.html.haml +9 -0
  55. data/app/views/devise/registrations/edit.html.haml +30 -0
  56. data/app/views/devise/registrations/new.html.haml +17 -0
  57. data/app/views/devise/sessions/new.html.haml +16 -0
  58. data/app/views/devise/shared/_links.haml +19 -0
  59. data/app/views/devise/unlocks/new.html.haml +9 -0
  60. data/app/views/layouts/chili_pepper/menu.html.haml +42 -0
  61. data/config/initializers/devise.rb +259 -0
  62. data/config/initializers/friendly_id.rb +88 -0
  63. data/config/initializers/simple_form.rb +145 -0
  64. data/config/locales/devise.en.yml +59 -0
  65. data/config/locales/simple_form.en.yml +26 -0
  66. data/config/routes.rb +21 -0
  67. data/db/migrate/20140428211712_create_chili_pepper_menus.rb +11 -0
  68. data/db/migrate/20140508093442_add_attributes_to_menus.rb +9 -0
  69. data/db/migrate/20140508094807_create_friendly_id_slugs.rb +15 -0
  70. data/db/migrate/20140514134818_create_chili_pepper_sections.rb +12 -0
  71. data/db/migrate/20140514141708_add_slug_to_chili_pepper_sections.rb +6 -0
  72. data/db/migrate/20140514143903_create_chili_pepper_dishes.rb +11 -0
  73. data/db/migrate/20140514144108_create_chili_pepper_items.rb +13 -0
  74. data/db/migrate/20140514144550_add_vegetarian_option_to_chili_pepper_dishes.rb +5 -0
  75. data/db/migrate/20140514153016_add_published_status_to_menus.rb +5 -0
  76. data/db/migrate/20140612152411_devise_create_chili_pepper_admins.rb +42 -0
  77. data/db/migrate/20140616162854_add_pictures_to_dishes.rb +5 -0
  78. data/db/migrate/20140616163025_add_attachements_to_menus.rb +6 -0
  79. data/db/migrate/20140616163238_add_attachments_to_sections.rb +5 -0
  80. data/lib/chili_pepper/configuration.rb +9 -0
  81. data/lib/chili_pepper/engine.rb +45 -0
  82. data/lib/chili_pepper/version.rb +3 -0
  83. data/lib/chili_pepper.rb +17 -0
  84. data/lib/tasks/auto_annotate_models.rake +34 -0
  85. data/lib/tasks/chili_pepper_tasks.rake +4 -0
  86. data/lib/templates/haml/scaffold/_form.html.haml +10 -0
  87. metadata +464 -0
@@ -0,0 +1,4 @@
1
+ module ChiliPepper
2
+ module SectionsHelper
3
+ end
4
+ end
@@ -0,0 +1,26 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: chili_pepper_admins
4
+ #
5
+ # id :integer not null, primary key
6
+ # email :string(255) default(""), not null
7
+ # encrypted_password :string(255) default(""), not null
8
+ # reset_password_token :string(255)
9
+ # reset_password_sent_at :datetime
10
+ # remember_created_at :datetime
11
+ # sign_in_count :integer default(0), not null
12
+ # current_sign_in_at :datetime
13
+ # last_sign_in_at :datetime
14
+ # current_sign_in_ip :string(255)
15
+ # last_sign_in_ip :string(255)
16
+ # created_at :datetime
17
+ # updated_at :datetime
18
+ #
19
+
20
+ module ChiliPepper
21
+ class Admin < ActiveRecord::Base
22
+ # Include default devise modules. Others available are:
23
+ # :confirmable, :lockable, :timeoutable and :omniauthable
24
+ devise :database_authenticatable, :trackable, :validatable
25
+ end
26
+ end
@@ -0,0 +1,28 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: chili_pepper_dishes
4
+ #
5
+ # id :integer not null, primary key
6
+ # name :string(255)
7
+ # description :string(255)
8
+ # coeliac :integer
9
+ # created_at :datetime
10
+ # updated_at :datetime
11
+ # vegetarian :boolean
12
+ # picture_file_name :string(255)
13
+ # picture_content_type :string(255)
14
+ # picture_file_size :integer
15
+ # picture_updated_at :datetime
16
+ #
17
+
18
+ module ChiliPepper
19
+ class Dish < ActiveRecord::Base
20
+ enum coeliac: [:coeliac_friendly, :not_coeliac_friendly, :coeliac_option_available]
21
+ has_many :items, class_name: 'ChiliPepper::Item', dependent: :destroy
22
+ accepts_nested_attributes_for :items, :allow_destroy => true
23
+ has_many :sections, :through => :items
24
+ validates_presence_of :name
25
+ has_attached_file :picture, :styles => { :medium => "1200x720>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png"
26
+
27
+ end
28
+ end
@@ -0,0 +1,32 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: chili_pepper_items
4
+ #
5
+ # id :integer not null, primary key
6
+ # section_id :integer
7
+ # dish_id :integer
8
+ # position :integer
9
+ # price :decimal(5, 2)
10
+ # column :integer
11
+ # created_at :datetime
12
+ # updated_at :datetime
13
+ #
14
+
15
+ module ChiliPepper
16
+ class Item < ActiveRecord::Base
17
+ belongs_to :dish, class_name: 'ChiliPepper::Dish'
18
+ belongs_to :section, class_name: 'ChiliPepper::Section'
19
+ validates :section, presence: true
20
+ acts_as_list scope: :section
21
+ after_destroy :check_dish_relevance
22
+
23
+ private
24
+
25
+ def check_dish_relevance
26
+ if dish.items.count == 0
27
+ dish.destroy
28
+ end
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,70 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: chili_pepper_menus
4
+ #
5
+ # id :integer not null, primary key
6
+ # name :string(255)
7
+ # position :integer
8
+ # description :string(255)
9
+ # created_at :datetime
10
+ # updated_at :datetime
11
+ # slug :string(255)
12
+ # menu_type :integer
13
+ # availability :string(255)
14
+ # price :decimal(5, 2)
15
+ # published :boolean
16
+ # downloadable_pdf_file_name :string(255)
17
+ # downloadable_pdf_content_type :string(255)
18
+ # downloadable_pdf_file_size :integer
19
+ # downloadable_pdf_updated_at :datetime
20
+ # image_file_name :string(255)
21
+ # image_content_type :string(255)
22
+ # image_file_size :integer
23
+ # image_updated_at :datetime
24
+ #
25
+
26
+ module ChiliPepper
27
+ class Menu < ActiveRecord::Base
28
+ validates_presence_of :name
29
+ enum menu_type: [:food, :drinks]
30
+ acts_as_list
31
+ has_many :sections, class_name: 'ChiliPepper::Section', dependent: :destroy
32
+ extend FriendlyId
33
+ friendly_id :name, use: :slugged
34
+
35
+ has_attached_file :image,
36
+ styles: {
37
+ medium: ChiliPepper.menu_medium_image,
38
+ thumb: '100x100>'
39
+ },
40
+ default_url: '/images/:style/missing.png'
41
+
42
+ validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
43
+
44
+ has_attached_file :downloadable_pdf
45
+ validates_attachment_content_type :downloadable_pdf,
46
+ content_type: ['application/pdf']
47
+
48
+ def self.published
49
+ where published: true
50
+ end
51
+
52
+ def self.food_menus
53
+ where menu_type: menu_types[:food]
54
+ end
55
+
56
+ def self.drinks_menus
57
+ where menu_type: menu_types[:drinks]
58
+ end
59
+
60
+ def self.same_type_menus(menu_type)
61
+ where(menu_type: menu_types[menu_type])
62
+ .select('id, name, slug, position, menu_type, published')
63
+ .order('position')
64
+ end
65
+
66
+ def food_menu?
67
+ menu_type == 'food'
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,29 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: chili_pepper_sections
4
+ #
5
+ # id :integer not null, primary key
6
+ # menu_id :integer
7
+ # description :text
8
+ # name :string(255)
9
+ # position :integer
10
+ # created_at :datetime
11
+ # updated_at :datetime
12
+ # slug :string(255)
13
+ # image_file_name :string(255)
14
+ # image_content_type :string(255)
15
+ # image_file_size :integer
16
+ # image_updated_at :datetime
17
+ #
18
+
19
+ module ChiliPepper
20
+ class Section < ActiveRecord::Base
21
+ belongs_to :menu, class_name: "ChiliPepper::Menu"
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
+ friendly_id :name, use: :slugged
27
+ has_attached_file :image, :styles => { :medium => "1200x720>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png"
28
+ end
29
+ end
@@ -0,0 +1,26 @@
1
+ = simple_form_for(@dish) do |f|
2
+ %ul#dish_attributes_list{:data => {'engine_root' => chili_pepper.dishes_path}}
3
+ / - if @section.menu.menu_type == 'food'
4
+ / = f.input :name #, :url => autocomplete_dish_name_dishes_path, :as => :autocomplete
5
+ /- else
6
+ = f.input :name, :url => chili_pepper.autocomplete_dish_name_dishes_path, :as => :autocomplete
7
+ = f.input :description, :as => :text
8
+ / - if @section.menu.menu_type == 'food'
9
+ %fieldset
10
+ = f.input :coeliac, :collection => ChiliPepper::Dish.coeliacs, :label_method => lambda {|x| x[0].humanize}, :value_method => lambda {|x| x[0]}
11
+ = f.input :vegetarian
12
+ / %fieldset
13
+ -# = admin_show_dish_img(@dish)
14
+ -# = f.input :picture
15
+
16
+ = f.simple_fields_for :items, @item do |item_form|
17
+ %fieldset
18
+ = item_form.input :price, :label => "Price as featured in #{@section.menu.name}"
19
+ %fieldset
20
+ = item_form.input :section_id, :as => :hidden, :input_html => { :value => @item.section_id}
21
+ = item_form.input :column, :as => :hidden, :input_html => { :value => @item.column}
22
+ / = item_form.association :menu_annotation, :collection => @section.menu.menu_annotations, :value_method => lambda {|x| x.id}, :label_method => lambda {|x| x.description}
23
+ = hidden_field_tag 'section_id', @section.id
24
+ - if @item.present?
25
+ = hidden_field_tag 'item_id', @item.id
26
+ = f.submit :class =>'submit'
@@ -0,0 +1,9 @@
1
+ .admin_form
2
+ %h1
3
+ Edit
4
+ %span
5
+ = @dish.name
6
+
7
+ = render 'form'
8
+
9
+
@@ -0,0 +1,9 @@
1
+ .admin_form
2
+ %h1
3
+ New
4
+ %span
5
+ Dish
6
+
7
+ = render 'form'
8
+
9
+
@@ -0,0 +1,18 @@
1
+ - cache_or_admin item do
2
+ = content_tag_for(:li, item) do
3
+ / = show_item_photograph(item)
4
+
5
+ = item.show_extra_informations
6
+ %h4.dish_name
7
+ = item.dish.name
8
+ = item.show_price
9
+ / = item.show_annotation
10
+
11
+ - if admin_signed_in?
12
+ = link_to "Edit Dish", edit_dish_path(item.dish, section_id: item.section_id, item_id: item.id), class: "admin edit"
13
+ = link_to "Delete Dish", item, :method => :delete, :class => "admin delete"
14
+ %span.item_handle.admin.move
15
+ Move
16
+
17
+ = item.show_description
18
+
@@ -0,0 +1,29 @@
1
+ = simple_form_for(@menu) do |f|
2
+ %ul
3
+ = f.input :name
4
+ = f.input :published
5
+ = f.input :availability
6
+ = f.input :description
7
+ = f.input :price
8
+
9
+ %fieldset
10
+ = f.input :downloadable_pdf #, :label => admin_pdf_label(@menu)
11
+ %fieldset
12
+ / = admin_show_img(@menu)
13
+ = f.input :image
14
+
15
+
16
+ / %fieldset.menu_notes
17
+ / %p.form_tag
18
+ / Menu Notes
19
+ / %ul
20
+ / = f.simple_fields_for :menu_annotations do |note_builder|
21
+ / = render 'menu_annotation_fields', f: note_builder
22
+ / %li.add_annotation
23
+ / = link_to_add_fields "Add note", f, :menu_annotations
24
+
25
+
26
+
27
+ = f.input :menu_type, :as => :hidden, :input_html => { :value => @menu.menu_type}
28
+ -# hidden_field_tag 'origin_section', @origin_section
29
+ = f.submit :class =>'submit'
@@ -0,0 +1,12 @@
1
+ %nav#menu_nav{itemscope: '', itemtype: "http://schema.org/Restaurant"}
2
+ %ul.regular{data: {'update-url' => sort_menus_url}}
3
+ - @similar_menus.each_with_index do |m,i|
4
+ = content_tag_for :li, m, class: "menu_link_#{i+1}#{' current' if @menu.id == m.id}#{' unpublished' if m.published == false}" do
5
+ - if @menu.id != m.id
6
+ = link_to(m.name, m, data: {'link-section-id' => "menu_id_#{m.id}", 'link-section-class' => "menu_#{m.position} menu #{@menu.menu_type}"}, itemprop: 'menu')
7
+ - else
8
+ = m.name
9
+
10
+ - if admin_signed_in?
11
+ %li
12
+ = link_to "New Menu", new_menu_path(menu_type: @menu.menu_type), class: 'admin new'
@@ -0,0 +1,7 @@
1
+ .admin_form
2
+ %h1
3
+ Edit
4
+ %span
5
+ = @menu.name
6
+
7
+ = render 'form'
@@ -0,0 +1,7 @@
1
+ .admin_form
2
+ %h1
3
+ New
4
+ %span
5
+ Menu
6
+
7
+ = render 'form'
@@ -0,0 +1,13 @@
1
+ - content_for :menu_content do
2
+
3
+ %section#side_information
4
+ %h2
5
+ = @menu.name
6
+
7
+ %ul#sections_nav{:data => {'update-url' => sort_menu_sections_url(:menu_id => @menu.id)}}
8
+ %li
9
+ - if admin_signed_in?
10
+ = link_to raw("#{content_tag(:span, 'Add', :class => 'admin-controls-create_under')} New Section"), new_menu_section_path(:menu_id => @menu.id), :class => 'new_section'
11
+
12
+ %section#menu_content
13
+
@@ -0,0 +1,8 @@
1
+ %ul.column{:id => "column_#{col_num+1}", :data => {'update-url' => sort_items_url, 'column-number' => col_num+1}}
2
+ - if item_group.present?
3
+ - item_group.each_with_index do |item,ind|
4
+ = render :partial => 'chili_pepper/items/item', :object => item, :locals => {:ind => ind, :i => col_num}, :as => :item
5
+
6
+ - if admin_signed_in?
7
+ %li
8
+ = link_to raw("#{content_tag(:span, 'Add', :class => 'admin-controls-smaller_green_add')} New Dish"), new_dish_path(:section_id => section_id, column: col_num), :class => 'admin new'
@@ -0,0 +1,10 @@
1
+ = simple_form_for([@menu, @section]) do |f|
2
+ %ul
3
+ = f.input :name
4
+ = f.input :description
5
+ %fieldset
6
+ -# admin_show_section_img(@section)
7
+ = f.input :image
8
+ = f.input :menu_id, :as => :hidden
9
+ -# hidden_field_tag 'origin_section', @origin_section
10
+ = f.submit :class =>'submit'
@@ -0,0 +1,6 @@
1
+ = content_tag_for :li, section, :class => "section_link_#{(section_counter+1)%7}#{' current' if current_page? menu_section_path(@menu, section)}#{' first' if section_counter == 0}" do
2
+ = link_to_unless_current section.name, menu_section_path(@menu, section), :class => "section_link", :data => {'link-section-id' => "menu_id_#{@menu.id}", 'link-section-class' => "menu_#{@menu.position} menu food"}
3
+
4
+ - if admin_signed_in?
5
+ = link_to "Edit Section", edit_menu_section_path(@menu, section, :origin_section => @section.id), :class => "edit admin"
6
+ = link_to "Delete Section", menu_section_path(@menu, section), :method => :delete, :class => "delete admin"
@@ -0,0 +1,8 @@
1
+ .admin_form
2
+ %h1
3
+ Edit
4
+ %span
5
+ = @section.name
6
+
7
+ = render 'form'
8
+
@@ -0,0 +1,8 @@
1
+ .admin_form
2
+ %h1
3
+ New
4
+ %span
5
+ Menu Section
6
+
7
+ = render 'form'
8
+
@@ -0,0 +1,25 @@
1
+ - @title = "#{@menu.name}, #{@section.name} | #{ChiliPepper.restaurant_name}"
2
+ - @section_id, @section_class = "menu_id_#{@menu.id}", "menu_#{@menu.position} menu #{@menu.menu_type}"
3
+
4
+ - content_for :menu_content do
5
+
6
+ %section#side_information
7
+ %h2
8
+ = @menu.name
9
+ %span
10
+ Menu
11
+
12
+ %ul#sections_nav{:data => {'update-url' => sort_menu_sections_url}}
13
+ = render :partial => 'section_nav_item', :collection => @all_menu_sections, :as => :section
14
+ - if admin_signed_in?
15
+ %li
16
+ = link_to raw("#{content_tag(:span, 'Add', :class => 'admin-controls-create_under')} New Section"), new_menu_section_path(:menu_id => @menu.id), :class => 'new admin'
17
+ = @menu.pdf_link
18
+
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}
23
+ = @menu.footnotes
24
+
25
+
@@ -0,0 +1,9 @@
1
+ %h2 Resend confirmation instructions
2
+ = form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
3
+ = devise_error_messages!
4
+ %div
5
+ = f.label :email
6
+ %br/
7
+ = f.email_field :email, autofocus: true
8
+ %div= f.submit "Resend confirmation instructions"
9
+ = render "devise/shared/links"
@@ -0,0 +1,4 @@
1
+ %p
2
+ Welcome #{@email}!
3
+ %p You can confirm your account email through the link below:
4
+ %p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token)
@@ -0,0 +1,6 @@
1
+ %p
2
+ Hello #{@resource.email}!
3
+ %p Someone has requested a link to change your password. You can do this through the link below.
4
+ %p= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token)
5
+ %p If you didn't request this, please ignore this email.
6
+ %p Your password won't change until you access the link above and create a new one.
@@ -0,0 +1,5 @@
1
+ %p
2
+ Hello #{@resource.email}!
3
+ %p Your account has been locked due to an excessive number of unsuccessful sign in attempts.
4
+ %p Click the link below to unlock your account:
5
+ %p= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token)
@@ -0,0 +1,14 @@
1
+ %h2 Change your password
2
+ = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
3
+ = devise_error_messages!
4
+ = f.hidden_field :reset_password_token
5
+ %div
6
+ = f.label :password, "New password"
7
+ %br/
8
+ = f.password_field :password, autofocus: true, autocomplete: "off"
9
+ %div
10
+ = f.label :password_confirmation, "Confirm new password"
11
+ %br/
12
+ = f.password_field :password_confirmation, autocomplete: "off"
13
+ %div= f.submit "Change my password"
14
+ = render "devise/shared/links"
@@ -0,0 +1,9 @@
1
+ %h2 Forgot your password?
2
+ = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
3
+ = devise_error_messages!
4
+ %div
5
+ = f.label :email
6
+ %br/
7
+ = f.email_field :email, autofocus: true
8
+ %div= f.submit "Send me reset password instructions"
9
+ = render "devise/shared/links"
@@ -0,0 +1,30 @@
1
+ %h2
2
+ Edit #{resource_name.to_s.humanize}
3
+ = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
4
+ = devise_error_messages!
5
+ %div
6
+ = f.label :email
7
+ %br/
8
+ = f.email_field :email, autofocus: true
9
+ - if devise_mapping.confirmable? && resource.pending_reconfirmation?
10
+ %div
11
+ Currently waiting confirmation for: #{resource.unconfirmed_email}
12
+ %div
13
+ = f.label :password
14
+ %i (leave blank if you don't want to change it)
15
+ %br/
16
+ = f.password_field :password, autocomplete: "off"
17
+ %div
18
+ = f.label :password_confirmation
19
+ %br/
20
+ = f.password_field :password_confirmation, autocomplete: "off"
21
+ %div
22
+ = f.label :current_password
23
+ %i (we need your current password to confirm your changes)
24
+ %br/
25
+ = f.password_field :current_password, autocomplete: "off"
26
+ %div= f.submit "Update"
27
+ %h3 Cancel my account
28
+ %p
29
+ Unhappy? #{button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete}
30
+ = link_to "Back", :back
@@ -0,0 +1,17 @@
1
+ %h2 Sign up
2
+ = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
3
+ = devise_error_messages!
4
+ %div
5
+ = f.label :email
6
+ %br/
7
+ = f.email_field :email, autofocus: true
8
+ %div
9
+ = f.label :password
10
+ %br/
11
+ = f.password_field :password, autocomplete: "off"
12
+ %div
13
+ = f.label :password_confirmation
14
+ %br/
15
+ = f.password_field :password_confirmation, autocomplete: "off"
16
+ %div= f.submit "Sign up"
17
+ = render "devise/shared/links"
@@ -0,0 +1,16 @@
1
+ .admin_form
2
+ %h1 Sign in
3
+ = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
4
+ %ul
5
+ %li
6
+ = f.label :email
7
+ = f.email_field :email, autofocus: true
8
+ %li
9
+ = f.label :password
10
+ = f.password_field :password, autocomplete: "off"
11
+ - if devise_mapping.rememberable?
12
+ %li
13
+ = f.check_box :remember_me
14
+ = f.label :remember_me
15
+ %div= f.submit "Sign in"
16
+ = render "devise/shared/links"
@@ -0,0 +1,19 @@
1
+ - if controller_name != 'sessions'
2
+ = link_to "Sign in", new_session_path(resource_name)
3
+ %br/
4
+ - if devise_mapping.registerable? && controller_name != 'registrations'
5
+ = link_to "Sign up", new_registration_path(resource_name)
6
+ %br/
7
+ - if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
8
+ = link_to "Forgot your password?", new_password_path(resource_name)
9
+ %br/
10
+ - if devise_mapping.confirmable? && controller_name != 'confirmations'
11
+ = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
12
+ %br/
13
+ - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
14
+ = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
15
+ %br/
16
+ - if devise_mapping.omniauthable?
17
+ - resource_class.omniauth_providers.each do |provider|
18
+ = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider)
19
+ %br/
@@ -0,0 +1,9 @@
1
+ %h2 Resend unlock instructions
2
+ = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
3
+ = devise_error_messages!
4
+ %div
5
+ = f.label :email
6
+ %br/
7
+ = f.email_field :email, autofocus: true
8
+ %div= f.submit "Resend unlock instructions"
9
+ = render "devise/shared/links"
@@ -0,0 +1,42 @@
1
+ - content_for :content do
2
+
3
+ - cache_or_admin [@menu, @section] do
4
+ = render :partial => 'chili_pepper/menus/navigation'
5
+
6
+ %section#menu_container{:class => "#{'chili_pepper_admin' if admin_signed_in?}"}
7
+
8
+ %section#menu_header{:class => "#{'price_featured' if @menu.price?}"}
9
+ %section#menu_main_header
10
+ %hgroup
11
+ = @menu.display_price
12
+ #menu_main_info
13
+ %h1
14
+ = @menu.name
15
+ %span
16
+ menu
17
+ - if admin_signed_in?
18
+ = link_to "Edit Menu", edit_menu_path(@menu, section: @section), :class => "edit admin"
19
+ = link_to "Delete Menu", menu_path(@menu), :method => :delete, :class => "delete admin"
20
+
21
+ = @menu.display_availability
22
+ -# @menu.display_description
23
+
24
+
25
+ - if @menu.image?
26
+ %section#menu_image
27
+ = image_tag @menu.image.url(:medium)
28
+
29
+
30
+ %section#menu_content
31
+
32
+ = yield(:menu_content) or yield
33
+ / = @menu.footnotes
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+ = render :file => 'layouts/application'