Skip to content

Commit

Permalink
Merge branch 'master' into aws-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
shinichiro-motoike committed Mar 2, 2020
2 parents ca7e130 + 3a13f4b commit 69e64b0
Show file tree
Hide file tree
Showing 54 changed files with 542 additions and 247 deletions.
Binary file added .DS_Store
Binary file not shown.
167 changes: 167 additions & 0 deletions app/assets/stylesheets/_users.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
@mixin User-links {
height: 100px;
text-align: center;
padding-top: 40px;
display: flex;
justify-content: space-between;
&__root {
width: 200px;
font-size: 30px;
display: block;
text-decoration: none;
margin: 0 auto;
}
}

@mixin User-button-base {
margin: 0 auto;
font-size: 14px;
line-height: 50px;
height: 50px;
width: 370px;
margin-top: 15px;
border: 1px solid transparent;
position: relative;
i {
font-size: 26px;
position: absolute;
top: 10px;
left: 16px;
}
}

.User-Account-page {
background-color: #eee;
&__header {
@include User-links;
&__user-manage, &__login-out {
@include User-links;
float: right;
}
}
&__content {
display: block;
background-color: #eeeeee;
.User-contents {
height: 100vh;
width: 700px;
background-color: #f8f8f8;
margin: 0 auto;
&__head {
font-size: 15px;
font-weight: bold;
text-align: center;
padding: 40px 65px;
border-bottom: solid 1px #eeeeee;
&__comment {
margin-bottom: 10px;
}
&__create {
display: block;
margin: 0 auto;
width: 370px;
border: solid 1px #0099e8;
background-color: #0099e8;
line-height: 40px;
text-decoration: none;
color: #fff;
}
}
&__inner {
padding: 40px 65px;
display: grid;
&__facebook {
@include User-button-base;
background-color: #385185;
color: #fff;
}
&__google {
@include User-button-base;
background-color: #fff;
color: #222222;
border: solid 1px #222222;
}
}
}
}
}

form {
padding: 25px 165px 35px;
.User-field {
margin-bottom: 10px;
&__label {
padding: 10px 0;
letter-spacing: 1px;
font-size: 14px;
font-weight: 200;
display: contents;
}
span {
background-color: #ea352d;
color: #f8f8f8;
margin: 0 0 0 4px;
padding: 2px 4px;
font-size: 15px;
}
&__input {
input {
width: 100%;
margin: 25px 0;
padding: 10px;
letter-spacing: 1px;
margin-top: 8px;
}
}
}
.User-actions {
margin: 24px 0;
display: grid;
&__btn {
display: inline-block;
background-color: #3ccace;
color: #fff;
height: 50px;
padding: 0 30px;
line-height: 50px;
letter-spacing: 1px;
text-align: center;
border-radius: 2px;
}
}
.User-pw__missing {
display: block;
margin: 40px 0 0;
a {
text-decoration: none;
color: #0099e8;
}
a:hover {
text-decoration: underline;
}
}
}
.User-page-footer {
width: 460px;
height: 220px;
margin: 0 auto;
&__bar {
display: flex;
padding: 20px 0 30px 0;
margin: 0 auto;
li {
margin: 0 0 0 50px;
font-size: 10px;
list-style: none;
}
}
&__root {
height: 60px;
display: block;
margin: 0 auto;
}
&__logo {
text-align: center;
padding: 20px 0 0 0;
}
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
@import 'font-awesome';
@import 'reset';
@import 'details';
@import './users';
3 changes: 0 additions & 3 deletions app/assets/stylesheets/users.scss

This file was deleted.

16 changes: 15 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
class ApplicationController < ActionController::Base
end
before_action :basic_auth, if: :production?
protect_from_forgery with: :exception

private

def production?
Rails.env.production?
end

def basic_auth
authenticate_or_request_with_http_basic do |username, password|
username == ENV["BASIC_AUTH_USER"] && password == ENV["BASIC_AUTH_PASSWORD"]
end
end
end
2 changes: 2 additions & 0 deletions app/models/delivery.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Delivery < ApplicationRecord
end
2 changes: 2 additions & 0 deletions app/models/image.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Image < ApplicationRecord
end
2 changes: 2 additions & 0 deletions app/models/item.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Item < ApplicationRecord
end
2 changes: 2 additions & 0 deletions app/models/order.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Order < ApplicationRecord
end
16 changes: 0 additions & 16 deletions app/views/devise/confirmations/new.html.erb

This file was deleted.

10 changes: 10 additions & 0 deletions app/views/devise/confirmations/new.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%h2 Resend confirmation instructions
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
= render "devise/shared/error_messages", resource: resource
.field
= f.label :email
%br/
= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email)
.actions
= f.submit "Resend confirmation instructions"
= render "devise/shared/links"
5 changes: 0 additions & 5 deletions app/views/devise/mailer/confirmation_instructions.html.erb

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/devise/mailer/confirmation_instructions.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%p
Welcome #{@email}!
%p You can confirm your account email through the link below:
%p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token)
7 changes: 0 additions & 7 deletions app/views/devise/mailer/email_changed.html.erb

This file was deleted.

8 changes: 8 additions & 0 deletions app/views/devise/mailer/email_changed.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%p
Hello #{@email}!
- if @resource.try(:unconfirmed_email?)
%p
We're contacting you to notify you that your email is being changed to #{@resource.unconfirmed_email}.
- else
%p
We're contacting you to notify you that your email has been changed to #{@resource.email}.
3 changes: 0 additions & 3 deletions app/views/devise/mailer/password_change.html.erb

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/devise/mailer/password_change.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
%p
Hello #{@resource.email}!
%p We're contacting you to notify you that your password has been changed.
8 changes: 0 additions & 8 deletions app/views/devise/mailer/reset_password_instructions.html.erb

This file was deleted.

6 changes: 6 additions & 0 deletions app/views/devise/mailer/reset_password_instructions.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
%p
Hello #{@resource.email}!
%p Someone has requested a link to change your password. You can do this through the link below.
%p= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token)
%p If you didn't request this, please ignore this email.
%p Your password won't change until you access the link above and create a new one.
7 changes: 0 additions & 7 deletions app/views/devise/mailer/unlock_instructions.html.erb

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/devise/mailer/unlock_instructions.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
%p
Hello #{@resource.email}!
%p Your account has been locked due to an excessive number of unsuccessful sign in attempts.
%p Click the link below to unlock your account:
%p= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token)
25 changes: 0 additions & 25 deletions app/views/devise/passwords/edit.html.erb

This file was deleted.

19 changes: 19 additions & 0 deletions app/views/devise/passwords/edit.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
%h2 Change your password
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
= render "devise/shared/error_messages", resource: resource
= f.hidden_field :reset_password_token
.field
= f.label :password, "New password"
%br/
- if @minimum_password_length
%em
(#{@minimum_password_length} characters minimum)
%br/
= f.password_field :password, autofocus: true, autocomplete: "new-password"
.field
= f.label :password_confirmation, "Confirm new password"
%br/
= f.password_field :password_confirmation, autocomplete: "new-password"
.actions
= f.submit "Change my password"
= render "devise/shared/links"
16 changes: 0 additions & 16 deletions app/views/devise/passwords/new.html.erb

This file was deleted.

10 changes: 10 additions & 0 deletions app/views/devise/passwords/new.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%h2 Forgot your password?
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
= render "devise/shared/error_messages", resource: resource
.field
= f.label :email
%br/
= f.email_field :email, autofocus: true, autocomplete: "email"
.actions
= f.submit "Send me reset password instructions"
= render "devise/shared/links"
Loading

0 comments on commit 69e64b0

Please sign in to comment.