Depreciation 0.1.0 → 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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +23 -0
  3. data/Gemfile +54 -0
  4. data/Gemfile.lock +237 -0
  5. data/README.md +24 -0
  6. data/Rakefile +6 -0
  7. data/app/assets/config/manifest.js +3 -0
  8. data/app/assets/images/.keep +0 -0
  9. data/app/assets/javascripts/application.js +17 -0
  10. data/app/assets/javascripts/brands.coffee +3 -0
  11. data/app/assets/javascripts/cable.js +13 -0
  12. data/app/assets/javascripts/channels/.keep +0 -0
  13. data/app/assets/stylesheets/application.css.scss +17 -0
  14. data/app/assets/stylesheets/brands.scss +3 -0
  15. data/app/channels/application_cable/channel.rb +4 -0
  16. data/app/channels/application_cable/connection.rb +4 -0
  17. data/app/controllers/application_controller.rb +3 -0
  18. data/app/controllers/brands_controller.rb +43 -0
  19. data/app/controllers/concerns/.keep +0 -0
  20. data/app/helpers/application_helper.rb +2 -0
  21. data/app/helpers/brands_helper.rb +2 -0
  22. data/app/jobs/application_job.rb +2 -0
  23. data/app/mailers/application_mailer.rb +4 -0
  24. data/app/models/application_record.rb +3 -0
  25. data/app/models/brand.rb +5 -0
  26. data/app/models/concerns/.keep +0 -0
  27. data/app/models/user.rb +6 -0
  28. data/app/models/variant.rb +3 -0
  29. data/app/views/brands/_form.html.erb +4 -0
  30. data/app/views/brands/edit.html.erb +3 -0
  31. data/app/views/brands/index.html.erb +5 -0
  32. data/app/views/brands/new.html.erb +2 -0
  33. data/app/views/brands/show.html.erb +36 -0
  34. data/app/views/devise/confirmations/new.html.erb +16 -0
  35. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  36. data/app/views/devise/mailer/email_changed.html.erb +7 -0
  37. data/app/views/devise/mailer/password_change.html.erb +3 -0
  38. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  39. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  40. data/app/views/devise/passwords/edit.html.erb +19 -0
  41. data/app/views/devise/passwords/new.html.erb +15 -0
  42. data/app/views/devise/registrations/edit.html.erb +27 -0
  43. data/app/views/devise/registrations/new.html.erb +78 -0
  44. data/app/views/devise/sessions/new.html.erb +36 -0
  45. data/app/views/devise/shared/_links.html.erb +25 -0
  46. data/app/views/devise/unlocks/new.html.erb +16 -0
  47. data/app/views/layouts/application.html.erb +34 -0
  48. data/app/views/layouts/mailer.html.erb +13 -0
  49. data/app/views/layouts/mailer.text.erb +1 -0
  50. data/bin/bundle +3 -0
  51. data/bin/rails +4 -0
  52. data/bin/rake +4 -0
  53. data/bin/setup +38 -0
  54. data/bin/update +29 -0
  55. data/bin/yarn +11 -0
  56. data/config.ru +5 -0
  57. data/config/application.rb +18 -0
  58. data/config/boot.rb +3 -0
  59. data/config/cable.yml +10 -0
  60. data/config/database.yml +25 -0
  61. data/config/environment.rb +5 -0
  62. data/config/environments/development.rb +56 -0
  63. data/config/environments/production.rb +91 -0
  64. data/config/environments/test.rb +42 -0
  65. data/config/initializers/application_controller_renderer.rb +8 -0
  66. data/config/initializers/assets.rb +14 -0
  67. data/config/initializers/backtrace_silencers.rb +7 -0
  68. data/config/initializers/cookies_serializer.rb +5 -0
  69. data/config/initializers/devise.rb +283 -0
  70. data/config/initializers/filter_parameter_logging.rb +4 -0
  71. data/config/initializers/inflections.rb +16 -0
  72. data/config/initializers/mime_types.rb +4 -0
  73. data/config/initializers/simple_form.rb +170 -0
  74. data/config/initializers/simple_form_bootstrap.rb +155 -0
  75. data/config/initializers/wrap_parameters.rb +14 -0
  76. data/config/locales/devise.en.yml +64 -0
  77. data/config/locales/en.yml +33 -0
  78. data/config/locales/simple_form.en.yml +31 -0
  79. data/config/puma.rb +56 -0
  80. data/config/routes.rb +8 -0
  81. data/config/secrets.yml +32 -0
  82. data/db/migrate/20180405123506_create_brands.rb +9 -0
  83. data/db/migrate/20180405124007_create_variants.rb +18 -0
  84. data/db/migrate/20180405142003_devise_create_users.rb +44 -0
  85. data/db/schema.rb +83 -0
  86. data/db/seeds.rb +22 -0
  87. data/lib/assets/.keep +0 -0
  88. data/lib/tasks/.keep +0 -0
  89. data/lib/templates/erb/scaffold/_form.html.erb +14 -0
  90. data/log/.keep +0 -0
  91. data/package.json +7 -0
  92. data/public/404.html +67 -0
  93. data/public/422.html +67 -0
  94. data/public/500.html +66 -0
  95. data/public/apple-touch-icon-precomposed.png +0 -0
  96. data/public/apple-touch-icon.png +0 -0
  97. data/public/favicon.ico +0 -0
  98. data/public/robots.txt +1 -0
  99. data/test/application_system_test_case.rb +5 -0
  100. data/test/controllers/.keep +0 -0
  101. data/test/controllers/brands_controller_test.rb +7 -0
  102. data/test/fixtures/.keep +0 -0
  103. data/test/fixtures/brands.yml +7 -0
  104. data/test/fixtures/files/.keep +0 -0
  105. data/test/fixtures/users.yml +11 -0
  106. data/test/fixtures/variants.yml +23 -0
  107. data/test/helpers/.keep +0 -0
  108. data/test/integration/.keep +0 -0
  109. data/test/mailers/.keep +0 -0
  110. data/test/models/.keep +0 -0
  111. data/test/models/brand_test.rb +7 -0
  112. data/test/models/user_test.rb +7 -0
  113. data/test/models/variant_test.rb +7 -0
  114. data/test/system/.keep +0 -0
  115. data/test/test_helper.rb +10 -0
  116. data/tmp/.keep +0 -0
  117. data/vendor/.keep +0 -0
  118. metadata +120 -4
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
@@ -0,0 +1,43 @@
1
+ class BrandsController < ApplicationController
2
+ before_action :find_brand, only: [:show, :edit, :update, :destroy]
3
+ def index
4
+ @brands = Brand.all.order("created_at DESC")
5
+ end
6
+ def show
7
+ end
8
+ def new
9
+ @brand = Brand.new
10
+ end
11
+ def create
12
+ @brand = Brand.new(brand_params)
13
+ if @brand.save
14
+ redirect_to root_path
15
+ else
16
+ render 'new'
17
+ end
18
+ end
19
+ def edit
20
+ end
21
+
22
+ def update
23
+ if @brand.update(brand_params)
24
+ redirect_to brand_path(@brand)
25
+ else
26
+ render 'edit'
27
+ end
28
+ end
29
+
30
+ def destroy
31
+ @brand.destroy
32
+ redirect_to root_path
33
+ end
34
+
35
+ private
36
+ def brand_params
37
+ params.require(:brand).permit(:name)
38
+ end
39
+
40
+ def find_brand
41
+ @brand = Brand.find(params[:id])
42
+ end
43
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module BrandsHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -0,0 +1,5 @@
1
+ class Brand < ApplicationRecord
2
+ has_many :variants
3
+ class User < ActiveRecord::Base
4
+ end
5
+ end
File without changes
@@ -0,0 +1,6 @@
1
+ class User < ApplicationRecord
2
+ # Include default devise modules. Others available are:
3
+ # :confirmable, :lockable, :timeoutable and :omniauthable
4
+ devise :database_authenticatable, :registerable,
5
+ :recoverable, :rememberable, :trackable, :validatable
6
+ end
@@ -0,0 +1,3 @@
1
+ class Variant < ApplicationRecord
2
+ belongs_to :brands
3
+ end
@@ -0,0 +1,4 @@
1
+ <%= simple_form_for @brand do |f| %>
2
+ <%= f.input :name, label: "Brand Name" %>
3
+ <%= f.button :submit %>
4
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <h1> Edit Brand </h1>
2
+
3
+ <%= render 'form'%>
@@ -0,0 +1,5 @@
1
+ <%= @brands.each do |brand| %>
2
+ <h2><%= link_to brand.name, brand_path(brand)%></h2>
3
+ <% end %>
4
+ <br>
5
+ <%= link_to "Add Brand", new_brand_path %>
@@ -0,0 +1,2 @@
1
+ <h1> New Brand</h1>
2
+ <%= render 'form' %>
@@ -0,0 +1,36 @@
1
+ <h2> <%= @brand.name%></h2>
2
+ <%= link_to "Back", root_path%>
3
+ <%= link_to "Edit", edit_brand_path(@brand) %>
4
+ <%= link_to "Delete", brand_path(@brand), method: :delete, data: {confirm: "Are you sure you want to delete?"} %>
5
+ <div class="container">
6
+ <div class="row">
7
+ <div class="col-md-12">
8
+ <a href="#">
9
+ <div class="clearfix">
10
+ <div class="col-md-3">
11
+ <div>
12
+ <img class="img-responsive" src="https://c0.carsie.ie/d43864c90df075c94489ddbe4ca5ffe96dca63bdd8aff2c9bd1be45cb398fc52.jpg">
13
+ </div>
14
+ </div>
15
+ <div class="col-md-7">
16
+ <div>
17
+ <div>
18
+ <h3>BMW 320 series</h3>
19
+ </div>
20
+ <div>
21
+ <ul class="list-inline">
22
+ <li>BMW 318 318CI AUTO</li>
23
+ </ul>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ <div class="col-md-2">
28
+ <div class="margin-t-50"></div>
29
+ <button type="button"class="btn btn-primary btn-block">Call Now</button>
30
+ <button type="button"class="btn btn-primary btn-block">Booking</button>
31
+ </div>
32
+ </div>
33
+ </a>
34
+ </div>
35
+ </div>
36
+ </div>
@@ -0,0 +1,16 @@
1
+ <h2>Resend confirmation instructions</h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= f.error_notification %>
5
+ <%= f.full_error :confirmation_token %>
6
+
7
+ <div class="form-inputs">
8
+ <%= f.input :email, required: true, autofocus: true %>
9
+ </div>
10
+
11
+ <div class="form-actions">
12
+ <%= f.button :submit, "Resend confirmation instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,5 @@
1
+ <p>Welcome <%= @email %>!</p>
2
+
3
+ <p>You can confirm your account email through the link below:</p>
4
+
5
+ <p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @email %>!</p>
2
+
3
+ <% if @resource.try(:unconfirmed_email?) %>
4
+ <p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
5
+ <% else %>
6
+ <p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
7
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>We're contacting you to notify you that your password has been changed.</p>
@@ -0,0 +1,8 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Someone has requested a link to change your password. You can do this through the link below.</p>
4
+
5
+ <p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
6
+
7
+ <p>If you didn't request this, please ignore this email.</p>
8
+ <p>Your password won't change until you access the link above and create a new one.</p>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
4
+
5
+ <p>Click the link below to unlock your account:</p>
6
+
7
+ <p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
@@ -0,0 +1,19 @@
1
+ <h2>Change your password</h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4
+ <%= f.error_notification %>
5
+
6
+ <%= f.input :reset_password_token, as: :hidden %>
7
+ <%= f.full_error :reset_password_token %>
8
+
9
+ <div class="form-inputs">
10
+ <%= f.input :password, label: "New password", required: true, autofocus: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %>
11
+ <%= f.input :password_confirmation, label: "Confirm your new password", required: true %>
12
+ </div>
13
+
14
+ <div class="form-actions">
15
+ <%= f.button :submit, "Change my password" %>
16
+ </div>
17
+ <% end %>
18
+
19
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,15 @@
1
+ <h2>Forgot your password?</h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= f.error_notification %>
5
+
6
+ <div class="form-inputs">
7
+ <%= f.input :email, required: true, autofocus: true %>
8
+ </div>
9
+
10
+ <div class="form-actions">
11
+ <%= f.button :submit, "Send me reset password instructions" %>
12
+ </div>
13
+ <% end %>
14
+
15
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,27 @@
1
+ <h2>Edit <%= resource_name.to_s.humanize %></h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
4
+ <%= f.error_notification %>
5
+
6
+ <div class="form-inputs">
7
+ <%= f.input :email, required: true, autofocus: true %>
8
+
9
+ <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
10
+ <p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
11
+ <% end %>
12
+
13
+ <%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
14
+ <%= f.input :password_confirmation, required: false %>
15
+ <%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
16
+ </div>
17
+
18
+ <div class="form-actions">
19
+ <%= f.button :submit, "Update" %>
20
+ </div>
21
+ <% end %>
22
+
23
+ <h3>Cancel my account</h3>
24
+
25
+ <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
26
+
27
+ <%= link_to "Back", :back %>
@@ -0,0 +1,78 @@
1
+ <div class="container col-xs-12 col-sm-offset-2 col-sm-8 col-md-offset-3 col-md-6 col-lg-offset-4 col-lg-4">
2
+ <br />
3
+ <div class="panel panel-default">
4
+ <div class="panel-heading">
5
+ <h2>Sign up</h2>
6
+ </div>
7
+ <div class="panel-body">
8
+ <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
9
+ <%= f.error_notification %>
10
+ <div class="form-group">
11
+ <div class="input-group">
12
+ <span class="input-group-addon">
13
+ <i class="glyphicon glyphicon-user" style="width: auto"></i>
14
+ </span>
15
+ <%= f.email_field :email, class: "form-control", placeholder: 'Email Id' %>
16
+ </div>
17
+ </div>
18
+ <div class="form-group">
19
+ <div class="input-group">
20
+ <span class="input-group-addon">
21
+ <i class="glyphicon glyphicon-lock" style="width: auto"></i>
22
+ </span>
23
+ <%= f.password_field :password, class: "form-control", autocomplete: "off" ,placeholder: 'Password',hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %>
24
+ </div>
25
+ </div>
26
+ <div class="form-group">
27
+ <div class="input-group">
28
+ <span class="input-group-addon">
29
+ <i class="glyphicon glyphicon-lock" style="width: auto"></i>
30
+ </span>
31
+ <%= f.password_field :password_confirmation, class: "form-control", autocomplete: "off" ,placeholder: 'Confirm Password',hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %>
32
+ </div>
33
+ </div>
34
+ <button id="btnLogin" runat="server" class="btn btn-default" style="width: 100%">
35
+ <i class="glyphicon glyphicon-log-in"></i>
36
+ <%= f.submit "Sign Up", class: "btn btn-default btn-orange" %>
37
+ </button>
38
+ </div>
39
+ <% end %>
40
+ </div>
41
+ </div>
42
+
43
+
44
+ <%= render "devise/shared/links" %>
45
+
46
+
47
+ <div class="ccontainer col-lg-offset-4 col-lg-4">
48
+ <div class="panel panel-default">
49
+ <div class="panel-heading">
50
+ <h2 class="text-center" style="color: #f0ad4e;"> <strong> Login </strong></h2>
51
+ </div>
52
+ <div class="panel-body">
53
+ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
54
+ <div class="form-group">
55
+ <div class="input-group">
56
+ <span class="input-group-addon">
57
+ <i class="glyphicon glyphicon-user" style="width: auto"></i>
58
+ </span>
59
+ <%= f.email_field :email, class: "form-control", placeholder: 'Username or Email Id' %>
60
+ </div>
61
+ </div>
62
+ <div class="form-group">
63
+ <div class="input-group">
64
+ <span class="input-group-addon">
65
+ <i class="glyphicon glyphicon-lock" style="width: auto"></i>
66
+ </span>
67
+ <%= f.password_field :password, class: "form-control", autocomplete: "off" ,placeholder: 'Password' %>
68
+ </div>
69
+ </div>
70
+ <div class="col-xs-12 col-sm-12 col-md-12">
71
+ <div class="form-group" style="width: auto">
72
+ <%= f.submit "Log In", class: "btn btn-lg btn-block btn-warning" %>
73
+ </div>
74
+ </div>
75
+ <% end %>
76
+ </div>
77
+ </div>
78
+ </div>
@@ -0,0 +1,36 @@
1
+
2
+ <div class="ccontainer col-lg-offset-4 col-lg-4">
3
+ <div class="panel panel-default">
4
+ <div class="panel-heading">
5
+ <h2 class="text-center" style="color: #f0ad4e;"> <strong> Login </strong></h2>
6
+ </div>
7
+ <div class="panel-body">
8
+ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
9
+ <div class="form-group">
10
+ <div class="input-group">
11
+ <span class="input-group-addon">
12
+ <i class="glyphicon glyphicon-user" style="width: auto"></i>
13
+ </span>
14
+ <%= f.email_field :email, class: "form-control", placeholder: 'Username or Email Id' %>
15
+ </div>
16
+ </div>
17
+ <div class="form-group">
18
+ <div class="input-group">
19
+ <span class="input-group-addon">
20
+ <i class="glyphicon glyphicon-lock" style="width: auto"></i>
21
+ </span>
22
+ <%= f.password_field :password, class: "form-control", autocomplete: "off" ,placeholder: 'Password' %>
23
+ </div>
24
+ </div>
25
+ <div class="col-xs-12 col-sm-12 col-md-12">
26
+ <div class="form-group" style="width: auto">
27
+ <%= f.submit "Log In", class: "btn btn-lg btn-block btn-warning" %>
28
+ </div>
29
+ </div>
30
+ <% end %>
31
+ </div>
32
+ </div>
33
+ </div>
34
+
35
+
36
+
@@ -0,0 +1,25 @@
1
+ <%- if controller_name != 'sessions' %>
2
+ <%= link_to "Log in", new_session_path(resource_name) %><br />
3
+ <% end -%>
4
+
5
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
+ <% end -%>
8
+
9
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
+ <% end -%>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
+ <% end -%>
16
+
17
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
+ <% end -%>
20
+
21
+ <%- if devise_mapping.omniauthable? %>
22
+ <%- resource_class.omniauth_providers.each do |provider| %>
23
+ <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
24
+ <% end -%>
25
+ <% end -%>
@@ -0,0 +1,16 @@
1
+ <h2>Resend unlock instructions</h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= f.error_notification %>
5
+ <%= f.full_error :unlock_token %>
6
+
7
+ <div class="form-inputs">
8
+ <%= f.input :email, required: true, autofocus: true %>
9
+ </div>
10
+
11
+ <div class="form-actions">
12
+ <%= f.button :submit, "Resend unlock instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "devise/shared/links" %>