beerify 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +11 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/fonts/beerify/glyphicons-halflings-regular.eot +0 -0
  6. data/app/assets/fonts/beerify/glyphicons-halflings-regular.svg +228 -0
  7. data/app/assets/fonts/beerify/glyphicons-halflings-regular.ttf +0 -0
  8. data/app/assets/fonts/beerify/glyphicons-halflings-regular.woff +0 -0
  9. data/app/assets/javascripts/beerify/application.js +3 -0
  10. data/app/assets/javascripts/beerify/bootstrap.js +1991 -0
  11. data/app/assets/stylesheets/beerify/application.css +3 -0
  12. data/app/assets/stylesheets/beerify/bootstrap.css +5909 -0
  13. data/app/controllers/application_controller.rb +2 -0
  14. data/app/controllers/contacts_controller.rb +21 -0
  15. data/app/helpers/application_helper.rb +2 -0
  16. data/app/helpers/contacts_helper.rb +2 -0
  17. data/app/models/ability.rb +28 -0
  18. data/app/models/catalog.rb +11 -0
  19. data/app/models/ckeditor/asset.rb +7 -0
  20. data/app/models/ckeditor/attachment_file.rb +7 -0
  21. data/app/models/ckeditor/picture.rb +7 -0
  22. data/app/models/contact.rb +8 -0
  23. data/app/models/news.rb +11 -0
  24. data/app/models/photo.rb +5 -0
  25. data/app/models/product.rb +12 -0
  26. data/app/models/settings.rb +10 -0
  27. data/app/models/user.rb +10 -0
  28. data/app/models/users/admin.rb +4 -0
  29. data/app/models/users/customer.rb +5 -0
  30. data/app/models/users/sudoer.rb +4 -0
  31. data/app/uploaders/ckeditor_attachment_file_uploader.rb +35 -0
  32. data/app/uploaders/ckeditor_picture_uploader.rb +46 -0
  33. data/app/uploaders/photo_uploader.rb +22 -0
  34. data/app/views/contacts/_form.html.slim +5 -0
  35. data/app/views/contacts/new.html.slim +2 -0
  36. data/app/views/devise/confirmations/new.html.erb +14 -0
  37. data/app/views/devise/mailer/confirmation_instructions.html.erb +3 -0
  38. data/app/views/devise/mailer/reset_password_instructions.html.erb +5 -0
  39. data/app/views/devise/mailer/unlock_instructions.html.erb +4 -0
  40. data/app/views/devise/passwords/edit.html.erb +16 -0
  41. data/app/views/devise/passwords/new.html.erb +14 -0
  42. data/app/views/devise/registrations/edit.html.erb +20 -0
  43. data/app/views/devise/registrations/new.html.erb +16 -0
  44. data/app/views/devise/sessions/new.html.erb +14 -0
  45. data/app/views/devise/shared/_links.erb +25 -0
  46. data/app/views/devise/unlocks/new.html.erb +14 -0
  47. data/app/views/layouts/beerify/application.html.erb +14 -0
  48. data/config/initializers/ckeditor.rb +21 -0
  49. data/config/initializers/devise.rb +254 -0
  50. data/config/initializers/kaminari.rb +3 -0
  51. data/config/initializers/rails_admin.rb +5 -0
  52. data/config/initializers/rails_admin/news_admin.rb +19 -0
  53. data/config/initializers/rails_admin/user_admin.rb +71 -0
  54. data/config/initializers/simple_form.rb +142 -0
  55. data/config/initializers/simple_form_bootstrap.rb +76 -0
  56. data/config/locales/attributes.en.yml +57 -0
  57. data/config/locales/attributes.fr.yml +57 -0
  58. data/config/locales/devise.en.yml +59 -0
  59. data/config/locales/devise.fr.yml +78 -0
  60. data/config/locales/devise.views.en.yml +59 -0
  61. data/config/locales/devise.views.fr.yml +51 -0
  62. data/config/locales/fr.yml +220 -0
  63. data/config/locales/main.en.yml +5 -0
  64. data/config/locales/main.fr.yml +5 -0
  65. data/config/locales/models.en.yml +30 -0
  66. data/config/locales/models.fr.yml +30 -0
  67. data/config/locales/rails_admin.fr.yml +129 -0
  68. data/config/locales/simple_form.en.yml +26 -0
  69. data/config/routes.rb +8 -0
  70. data/config/settings/beerify/development.yml +2 -0
  71. data/config/settings/beerify/production.yml +2 -0
  72. data/config/settings/beerify/settings.yml +1 -0
  73. data/db/migrate/20130805210910_create_users.rb +12 -0
  74. data/db/migrate/20130805212414_add_devise_to_users.rb +34 -0
  75. data/db/migrate/20130819142757_create_catalogs.rb +15 -0
  76. data/db/migrate/20130826095103_create_photos.rb +12 -0
  77. data/db/migrate/20130902160901_create_products.rb +16 -0
  78. data/db/migrate/20130902162315_add_photos_to_product.rb +6 -0
  79. data/db/migrate/20130903083519_create_contacts.rb +11 -0
  80. data/db/migrate/20130903130542_create_news.rb +17 -0
  81. data/db/migrate/20130904000525_create_ckeditor_assets.rb +23 -0
  82. data/db/migrate/20130918132647_add_highlight_to_products.rb +5 -0
  83. data/lib/beerify.rb +4 -0
  84. data/lib/beerify/engine.rb +28 -0
  85. data/lib/beerify/version.rb +3 -0
  86. data/lib/tasks/populate.rake +66 -0
  87. data/spec/beerify/models/catalog_spec.rb +9 -0
  88. data/spec/beerify/models/contact_spec.rb +6 -0
  89. data/spec/beerify/models/news_spec.rb +7 -0
  90. data/spec/beerify/models/photo_spec.rb +5 -0
  91. data/spec/beerify/models/product_spec.rb +8 -0
  92. data/spec/beerify/models/user_spec.rb +4 -0
  93. data/spec/beerify/models/users/admin_spec.rb +5 -0
  94. data/spec/beerify/models/users/customer_spec.rb +5 -0
  95. data/spec/dummy/README.rdoc +28 -0
  96. data/spec/dummy/Rakefile +6 -0
  97. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  98. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  99. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  100. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  101. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  102. data/spec/dummy/bin/bundle +3 -0
  103. data/spec/dummy/bin/rails +4 -0
  104. data/spec/dummy/bin/rake +4 -0
  105. data/spec/dummy/config.ru +4 -0
  106. data/spec/dummy/config/application.rb +23 -0
  107. data/spec/dummy/config/boot.rb +5 -0
  108. data/spec/dummy/config/database.yml +11 -0
  109. data/spec/dummy/config/environment.rb +5 -0
  110. data/spec/dummy/config/environments/development.rb +29 -0
  111. data/spec/dummy/config/environments/production.rb +80 -0
  112. data/spec/dummy/config/environments/test.rb +36 -0
  113. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  114. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  115. data/spec/dummy/config/initializers/inflections.rb +16 -0
  116. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  117. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  118. data/spec/dummy/config/initializers/session_store.rb +3 -0
  119. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  120. data/spec/dummy/config/locales/en.yml +23 -0
  121. data/spec/dummy/config/routes.rb +56 -0
  122. data/spec/dummy/db/migrate/20130904085929_create_users.beerify.rb +13 -0
  123. data/spec/dummy/db/migrate/20130904085930_add_devise_to_users.beerify.rb +35 -0
  124. data/spec/dummy/db/migrate/20130904085931_create_catalogs.beerify.rb +16 -0
  125. data/spec/dummy/db/migrate/20130904085932_create_photos.beerify.rb +13 -0
  126. data/spec/dummy/db/migrate/20130904085933_create_products.beerify.rb +17 -0
  127. data/spec/dummy/db/migrate/20130904085934_add_photos_to_product.beerify.rb +7 -0
  128. data/spec/dummy/db/migrate/20130904085935_create_contacts.beerify.rb +12 -0
  129. data/spec/dummy/db/migrate/20130906090417_create_news.beerify.rb +18 -0
  130. data/spec/dummy/db/migrate/20130906090418_create_ckeditor_assets.beerify.rb +24 -0
  131. data/spec/dummy/db/migrate/20130918132952_add_highlight_to_products.beerify.rb +6 -0
  132. data/spec/dummy/db/schema.rb +116 -0
  133. data/spec/dummy/public/404.html +58 -0
  134. data/spec/dummy/public/422.html +58 -0
  135. data/spec/dummy/public/500.html +57 -0
  136. data/spec/dummy/public/favicon.ico +0 -0
  137. data/spec/spec_helper.rb +19 -0
  138. metadata +641 -0
@@ -0,0 +1,2 @@
1
+ class ApplicationController < ActionController::Base
2
+ end
@@ -0,0 +1,21 @@
1
+ class ContactsController < ApplicationController
2
+ def new
3
+ @contact = Contact.new
4
+ end
5
+
6
+ def create
7
+ @contact = Contact.new(contact_params)
8
+
9
+ if @contact.save
10
+ redirect_to new_contact_path, flash: { success: I18n.t('created') }
11
+ else
12
+ render 'new'
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ def contact_params
19
+ params.require(:contact).permit(:content, :email, :name)
20
+ end
21
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module ContactsHelper
2
+ end
@@ -0,0 +1,28 @@
1
+ class Ability
2
+ include CanCan::Ability
3
+
4
+ def initialize(user)
5
+ if user && user.class.name === 'Users::Sudoer'
6
+ can :access, :ckeditor
7
+ can :access, :rails_admin
8
+ can :dashboard
9
+
10
+ can :manage, :all
11
+ end
12
+
13
+ if user && user.class.name === 'Users::Admin'
14
+ can :access, :ckeditor
15
+ can :access, :rails_admin
16
+ can :dashboard
17
+
18
+ can [:read, :create, :update, :destroy, :export], Catalog
19
+ can [:read, :create, :update, :destroy ], Ckeditor::Picture
20
+ can [:read, :export], Contact
21
+ can [:read, :create, :update, :destroy, :export], News
22
+ can [:read, :create, :update, :destroy, :export], Photo
23
+ can [:read, :create, :update, :destroy, :export], Product
24
+ can [:read, :create, :update, :destroy, :export], User
25
+ cannot :manage, Users::Sudoer
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,11 @@
1
+ class Catalog < ActiveRecord::Base
2
+ extend FriendlyId
3
+ friendly_id :title, use: :slugged
4
+
5
+ belongs_to :catalog
6
+ has_many :catalogs
7
+ has_many :products
8
+
9
+ validates :title,
10
+ presence: true
11
+ end
@@ -0,0 +1,7 @@
1
+ class Ckeditor::Asset < ActiveRecord::Base
2
+ include Ckeditor::Orm::ActiveRecord::AssetBase
3
+
4
+ delegate :url, :current_path, :content_type, to: :data
5
+
6
+ validates_presence_of :data
7
+ end
@@ -0,0 +1,7 @@
1
+ class Ckeditor::AttachmentFile < Ckeditor::Asset
2
+ mount_uploader :data, CkeditorAttachmentFileUploader, mount_on: :data_file_name
3
+
4
+ def url_thumb
5
+ @url_thumb ||= Ckeditor::Utils.filethumb(filename)
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ class Ckeditor::Picture < Ckeditor::Asset
2
+ mount_uploader :data, CkeditorPictureUploader, :mount_on => :data_file_name
3
+
4
+ def url_content
5
+ url(:content)
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ class Contact < ActiveRecord::Base
2
+ validates :content,
3
+ presence: true
4
+
5
+ validates :email,
6
+ email: true,
7
+ presence: true
8
+ end
@@ -0,0 +1,11 @@
1
+ class News < ActiveRecord::Base
2
+ extend FriendlyId
3
+ friendly_id :title, use: :slugged
4
+
5
+ mount_uploader :photo, PhotoUploader
6
+
7
+ belongs_to :user, class_name: 'Users::Admin'
8
+
9
+ validates :title,
10
+ presence: true
11
+ end
@@ -0,0 +1,5 @@
1
+ class Photo < ActiveRecord::Base
2
+ mount_uploader :attachment, PhotoUploader
3
+
4
+ belongs_to :product
5
+ end
@@ -0,0 +1,12 @@
1
+ class Product < ActiveRecord::Base
2
+ extend FriendlyId
3
+ friendly_id :title, use: :slugged
4
+
5
+ belongs_to :catalog
6
+ has_many :photos
7
+
8
+ validates :title,
9
+ presence: true
10
+
11
+ scope :highlighted, -> { where highlight: true }
12
+ end
@@ -0,0 +1,10 @@
1
+ class Settings < Settingslogic
2
+ def self.load_files
3
+ files = Dir["#{Rails.root}/config/settings/**/*.yml"] - Dir["#{Rails.root}/config/settings/beerify/**/*.yml"]
4
+
5
+ Dir["#{Rails.root}/config/settings/beerify/**/*.yml"] + files
6
+ end
7
+
8
+ source load_files
9
+ namespace Rails.env
10
+ end
@@ -0,0 +1,10 @@
1
+ class User < ActiveRecord::Base
2
+ devise :database_authenticatable,
3
+ :recoverable,
4
+ :rememberable,
5
+ :token_authenticatable,
6
+ :trackable,
7
+ :validatable
8
+
9
+ has_many :news
10
+ end
@@ -0,0 +1,4 @@
1
+ module Users
2
+ class Admin < User
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module Users
2
+ class Customer < User
3
+ devise :registerable
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module Users
2
+ class Sudoer < User
3
+ end
4
+ end
@@ -0,0 +1,35 @@
1
+ class CkeditorAttachmentFileUploader < CarrierWave::Uploader::Base
2
+ include Ckeditor::Backend::CarrierWave
3
+
4
+ # Include RMagick or ImageScience support:
5
+ # include CarrierWave::RMagick
6
+ # include CarrierWave::MiniMagick
7
+ # include CarrierWave::ImageScience
8
+
9
+ # Choose what kind of storage to use for this uploader:
10
+ storage :file
11
+
12
+ # Override the directory where uploaded files will be stored.
13
+ # This is a sensible default for uploaders that are meant to be mounted:
14
+ def store_dir
15
+ "uploads/ckeditor/attachments/#{model.id}"
16
+ end
17
+
18
+ # Provide a default URL as a default if there hasn't been a file uploaded:
19
+ # def default_url
20
+ # "/images/fallback/" + [version_name, "default.png"].compact.join('_')
21
+ # end
22
+
23
+ # Process files as they are uploaded:
24
+ # process :scale => [200, 300]
25
+ #
26
+ # def scale(width, height)
27
+ # # do something
28
+ # end
29
+
30
+ # Add a white list of extensions which are allowed to be uploaded.
31
+ # For images you might use something like this:
32
+ def extension_white_list
33
+ Ckeditor.attachment_file_types
34
+ end
35
+ end
@@ -0,0 +1,46 @@
1
+ class CkeditorPictureUploader < CarrierWave::Uploader::Base
2
+ include Ckeditor::Backend::CarrierWave
3
+
4
+ # Include RMagick or ImageScience support:
5
+ # include CarrierWave::RMagick
6
+ include CarrierWave::MiniMagick
7
+ # include CarrierWave::ImageScience
8
+
9
+ # Choose what kind of storage to use for this uploader:
10
+ storage :file
11
+
12
+ # Override the directory where uploaded files will be stored.
13
+ # This is a sensible default for uploaders that are meant to be mounted:
14
+ def store_dir
15
+ "uploads/ckeditor/pictures/#{model.id}"
16
+ end
17
+
18
+ # Provide a default URL as a default if there hasn't been a file uploaded:
19
+ # def default_url
20
+ # "/images/fallback/" + [version_name, "default.png"].compact.join('_')
21
+ # end
22
+
23
+ # Process files as they are uploaded:
24
+ # process :scale => [200, 300]
25
+ #
26
+ # def scale(width, height)
27
+ # # do something
28
+ # end
29
+
30
+ process :read_dimensions
31
+
32
+ # Create different versions of your uploaded files:
33
+ version :thumb do
34
+ process :resize_to_fill => [118, 100]
35
+ end
36
+
37
+ version :content do
38
+ process :resize_to_limit => [800, 800]
39
+ end
40
+
41
+ # Add a white list of extensions which are allowed to be uploaded.
42
+ # For images you might use something like this:
43
+ def extension_white_list
44
+ Ckeditor.image_file_types
45
+ end
46
+ end
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+
3
+ class PhotoUploader < CarrierWave::Uploader::Base
4
+ include CarrierWave::RMagick
5
+ storage :file
6
+
7
+ def store_dir
8
+ "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
9
+ end
10
+
11
+ def default_url
12
+ '/fallback/' + [version_name, 'photo_default.png'].compact.join('_')
13
+ end
14
+
15
+ version :thumb do
16
+ process :resize_to_fill => [200, 200]
17
+ end
18
+
19
+ def extension_white_list
20
+ %w(jpg jpeg gif png gif)
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ = simple_form_for(@contact) do |f|
2
+ = f.input :name
3
+ = f.input :email
4
+ = f.input :content, input_html: { rows: 7 }
5
+ = f.button :submit, 'Envoyer', class: 'btn btn-success btn-large'
@@ -0,0 +1,2 @@
1
+ h1= t('contact_us')
2
+ = render 'form'
@@ -0,0 +1,14 @@
1
+ <h2><%= t('.resend_confirmation_instructions') %></h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div class="form-inputs">
7
+ <%= f.input :email %>
8
+ </div>
9
+ <div class="form-actions">
10
+ <%= f.submit t('.resend_confirmation_instructions'), class: 'btn btn-success' %>
11
+ </div>
12
+ <% end %>
13
+
14
+ <%= render 'devise/shared/links' %>
@@ -0,0 +1,3 @@
1
+ <p><%= t('.greeting', recipient: @resource.email) %></p>
2
+ <p><%= t('.instruction') %></p>
3
+ <p><%= link_to t('.action'), confirmation_url(@resource, confirmation_token: @resource.confirmation_token), class: 'btn btn-success' %></p>
@@ -0,0 +1,5 @@
1
+ <p><%= t('.greeting', recipient: @resource.email) %></p>
2
+ <p><%= t('.instruction') %></p>
3
+ <p><%= link_to t('.action'), edit_password_url(@resource, reset_password_token: @resource.reset_password_token), class: 'btn' %></p>
4
+ <p><%= t('.instruction_2') %></p>
5
+ <p><%= t('.instruction_3') %></p>
@@ -0,0 +1,4 @@
1
+ <p><%= t('.greeting', recipient: @resource.email, default: "Hello #{@resource.email}!") %></p>
2
+ <p><%= t('.message') %></p>
3
+ <p><%= t('.instruction') %></p>
4
+ <p><%= link_to t('.action'), unlock_url(@resource, unlock_token: @resource.unlock_token), class: 'btn btn-success' %></p>
@@ -0,0 +1,16 @@
1
+ <h2><%= t('.change_your_password') %></h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+ <%= f.hidden_field :reset_password_token %>
6
+
7
+ <div class="form-inputs">
8
+ <%= f.input :password, required: true, autofocus: true %>
9
+ <%= f.input :password_confirmation, t('.confirm_new_password'), :required => true %>
10
+ </div>
11
+ <div class="form-actions">
12
+ <%= f.submit t('.change_my_password'), class: 'btn btn-success' %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render 'devise/shared/links' %>
@@ -0,0 +1,14 @@
1
+ <h2><%= t('.forgot_your_password') %></h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div class="form-inputs">
7
+ <%= f.input :email %>
8
+ </div>
9
+ <div class="form-actions">
10
+ <%= f.submit t('.send_me_reset_password_instructions'), class: 'btn btn-success' %>
11
+ </div>
12
+ <% end %>
13
+
14
+ <%= render 'devise/shared/links' %>
@@ -0,0 +1,20 @@
1
+ <h2><%= t('.title', :resource : resource_class.model_name.human) %></h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div class="form-inputs">
7
+ <%= f.input :email, required: true, autofocus: true %>
8
+ <%= f.input :password, autocomplete: "off", hint: t('.leave_blank_if_you_don_t_want_to_change_it'), required: false %>
9
+ <%= f.input :password_confirmation, :required => false %>
10
+ <%= f.input :current_password, hint: t('.we_need_your_current_password_to_confirm_your_changes'), required: true %>
11
+ </div>
12
+ <div class="form-actions">
13
+ <%= f.submit t('.update'), class: 'btn btn-success' %>
14
+ </div>
15
+ <% end %>
16
+
17
+ <h3><%= t('.cancel_my_account') %></h3>
18
+ <p><%= t('.unhappy') %>? <%= link_to t('.cancel_my_account'), registration_path(resource_name), data: { confirm: t('.are_you_sure') }, method: :delete, class: 'btn btn-danger' %>.</p>
19
+
20
+ <%= link_to t('.back'), :back, class: 'btn' %>
@@ -0,0 +1,16 @@
1
+ <h2><%= t('.sign_up') %></h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div class="form-inputs">
7
+ <%= f.input :email, required: true, autofocus: true %>
8
+ <%= f.input :password, required: true %>
9
+ <%= f.input :password_confirmation %>
10
+ </div>
11
+ <div class="form-actions">
12
+ <%= f.submit t('.sign_up'), class: 'btn btn-success' %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render 'devise/shared/links' %>
@@ -0,0 +1,14 @@
1
+ <h2><%= t('.sign_in') %></h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
4
+ <div class="form-inputs">
5
+ <%= f.input :email %>
6
+ <%= f.input :password %>
7
+ <%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
8
+ </div>
9
+ <div class="form-actions">
10
+ <%= f.submit t('.sign_in'), class: 'btn btn-success' %>
11
+ </div>
12
+ <% end -%>
13
+
14
+ <%= render 'devise/shared/links' %>
@@ -0,0 +1,25 @@
1
+ <% if controller_name != 'sessions' %>
2
+ <%= link_to t(".sign_in"), new_session_path(resource_name), class: 'btn btn-success' %><br />
3
+ <% end %>
4
+
5
+ <% if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to t(".sign_up"), new_registration_path(resource_name), class: 'btn btn-success' %><br />
7
+ <% end %>
8
+
9
+ <% if devise_mapping.recoverable? && controller_name != 'passwords' %>
10
+ <%= link_to t(".forgot_your_password"), new_password_path(resource_name), class: 'btn btn-warning' %><br />
11
+ <% end %>
12
+
13
+ <% if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name), class: 'btn btn-info' %><br />
15
+ <% end %>
16
+
17
+ <% if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
+ <%= link_to t('.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name), class: 'btn btn-info' %><br />
19
+ <% end %>
20
+
21
+ <% if devise_mapping.omniauthable? %>
22
+ <% resource_class.omniauth_providers.each do |provider| %>
23
+ <%= link_to t('.sign_in_with_provider', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider), class: 'btn btn-success' %><br />
24
+ <% end %>
25
+ <% end %>