Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #117 from MyDry/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tanacchi authored Oct 12, 2018
2 parents da04f31 + e203441 commit e174356
Show file tree
Hide file tree
Showing 16 changed files with 302 additions and 131 deletions.
216 changes: 164 additions & 52 deletions app/assets/stylesheets/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ html {
h1{
padding: 20px;
}

ul{
display: inline;
}
div .nav-item-lg{
float: right;
}

.nav-item {
width: 15%;
font-size: 30px;
Expand Down Expand Up @@ -186,9 +194,15 @@ html {
}

/************* ヘッダー ********************/
.pad{
padding-left: 100px;
padding-right: 100px;
}

.header{
width: 100%;
height: 50px;
min-width: 500px;
height: 100px;
.header-brand a{
float: left;
font-size: 60px;
Expand Down Expand Up @@ -221,55 +235,157 @@ html {
}

@media(min-width:1200px){
.hun{
.smap_header{
display:none;
}
.hamburger_header{
display: none;
}
}

/*width:1200px 以下*/
@media(max-width:1200px){
.pad{
padding: 0;
}

.smap_header{
height: 125px;
}

.hamburger_header{
display: inline;
.header_brand{
padding-left: 20px;
float: left;
a{
line-height: 100px;
color: #fff;
font-size: 60px;
padding-left: 0;
text-decoration: none;
float: left;
}
}
}
.hamburger_header_list{
float: right;
height: 100px;
display: inline;
padding-right: 20px;
.header_brand{
float: left;
a{
line-height: 100px;
color: #fff;
font-size: 60px;
padding-left: 0;
text-decoration: none;
float: left;
}
}
div{
list-style: none;
float: left;
a{
display: block;
color: white;
text-decoration: none;
line-height: 100px;
padding-left: 12px;
padding-right: 12px;
height: 100px;
float: left;
}
a:hover{
transition:all 0.5s;
background-color: #5f9ea0;
}
}
}


.header-brand{
display: none;
}
.header-list div{
display: none;
}

.smap_header_list{
float: right;
height: 125px;
display: inline;
.smap_header_brand{
float: left;
a{
line-height: 125px;
color: #fff;
font-size: 60px;
padding-left: 0;
text-decoration: none;
}
}
div{
list-style: none;
float: left;
a{
display: block;
color: white;
text-decoration: none;
line-height: 125px;
padding-left: 25px;
padding-right: 25px;
height: 125px;
font-size: 35px;
}
a:hover{
transition:all 0.5s;
background-color: #5f9ea0;
}
}
}


#nav-drawer {
position: relative;
//position: relative;
}

/*チェックボックス等は非表示に*/
/*チェックボックス等は非表示に*/
.nav-unshown {
display:none;
}

/*アイコンのスペース*/
/*アイコンのスペース*/
#nav-open {
display: inline-block;
width: 30px;
height: 22px;
width: 125px;
height: 125px;
vertical-align: middle;
float: right;
margin-top: 45px;
padding-left: 40px;
padding-top: 40px;
}

/*ハンバーガーアイコンをCSSだけで表現*/
/*ハンバーガーアイコンをCSSだけで表現*/
#nav-open span, #nav-open span:before, #nav-open span:after {
position: absolute;
height: 3px;/*線の太さ*/
width: 25px;/*長さ*/
height: 5px;/*線の太さ*/
width: 50px;/*長さ*/
border-radius: 3px;
background: #fff;
background: #fff;/*color*/
display: block;
content: '';
cursor: pointer;

}
#nav-open span:before {
bottom: -8px;
bottom: -16px;
}
#nav-open span:after {
bottom: -16px;
bottom: -32px;
}

/*閉じる用の薄黒カバー*/
/*閉じる用の薄黒カバー*/
#nav-close {
display: none;/*はじめは隠しておく*/
position: fixed;
Expand All @@ -283,56 +399,52 @@ html {
transition: .3s ease-in-out;
}

/*中身*/
/*中身*/
#nav-content {
overflow: auto;
position: fixed;
top: 0;
left: 0;
z-index: 9999;/*最前面に*/
width: 90%;/*右側に隙間を作る(閉じるカバーを表示)*/
max-width: 380px;/*最大幅(調整してください)*/
width: 90%;/*右側に隙間を作る*/
max-width: 500px;/*最大幅*/
height: 100%;
background: #006E6F;/*背景色*/
transition: .3s ease-in-out;/*滑らかに表示*/
-webkit-transform: translateX(400%);
transform: translateX(400%);/*左に隠しておく*/
background: #006e6f;/*背景色*/
transition: .2s ease-in-out;/*滑らかに表示*/
-webkit-transform: translateX(-105%);
transform: translateX(-105%);/*左に隠しておく*/
div{
list-style: none;
text-align: right;
a{
display: block;
color: white;
text-decoration: none;
line-height: 125px;
padding-left: 25px;
padding-right: 25px;
height: 125px;
font-size: 35px;
}
a:hover{
transition:all 0.5s;
background-color: #5f9ea0;
}
}
}

/*チェックが入ったらもろもろ表示*/
/*チェックが入ったらもろもろ表示*/
#nav-input:checked ~ #nav-close {
display: block;/*カバーを表示*/
opacity: .5;
}

#nav-input:checked ~ #nav-content {
-webkit-transform: translateX(100vw);
transform: translateX(65vw);/*中身を表示(右へスライド)*/
-webkit-transform: translateX(0%);
transform: translateX(0%);/*中身を表示*/
box-shadow: 6px 0 25px rgba(0,0,0,.15);
}

#nav-content{
ul{
padding-left: 0;
margin-left: 0;
}
div{
list-style: none;
a{
display:block;
text-decoration: none;
color: white;
height: 50px;
line-height: 50px;
padding-left: 15px;
border-bottom: thin solid #fff;
}
a:hover{
transition:all 0.5s;
background-color: #5f9ea0;
}
}
}
}

/************* フッター ********************/
Expand All @@ -342,7 +454,7 @@ html {
border-top: solid 2px #eaeaea;
color: #777;
margin-left: 15px;
a {
a{
color: red;
&:hover {
color: blue;
Expand All @@ -360,10 +472,10 @@ html {
/************* パーシャル ********************/

.detail {
font-size: 28px;
word-wrap: break-word;
font-size: 28px;
word-wrap: break-word;
}

.list {
font-size: 16px;
font-size: 16px;
}
20 changes: 20 additions & 0 deletions app/assets/stylesheets/users.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,24 @@
width: 33%;
font-size: 25px;
}
}
.mobile{
input[type="text"] {
width: 500px;
height: 80px;
}

input[type="password"] {
width: 500px;
height: 80px;
}
font-size: 25px;
white-space: nowrap;
.btn {
padding: 14px 24px;
border: 0 none;
font-weight: 700;
letter-spacing: 1px;
text-transform: uppercase;
}
}
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def edit
end

def update
if @user.update(user_params)
if @user.update_attributes(user_params)
flash[:success] = "更新しました"
redirect_to @user
else
Expand Down
14 changes: 7 additions & 7 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def format_datetime(datetime, type = :datetime)
datetime.strftime(format)
end

def inform_validation_errors(obj)
content_tag(:p) do
obj.errors.full_messages.each do |message|
concat content_tag(:div, class: 'alert alert-danger') do
concat content_tag(:a, 'x', data: { dismiss: 'alert' })
message
end
def inform_validation_errror(obj)
html_text = ''
obj.errors.full_messages.each do |message|
html_text += content_tag(:div, class: 'alert alert-danger') do
content_tag(:a, 'x', data: { dismiss: 'alert' })
message
end
end
raw(html_text)
end
end
5 changes: 3 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ class User < ApplicationRecord
#validates :email, {presence: true, uniqueness: true}
validates :password,
confirmation: true,
presence: { message: 'を入力してください'}

presence: { message: 'を入力してください'},
allow_nil: true

has_many :ideas, dependent: :destroy
has_many :topics, dependent: :destroy
has_many :likes, dependent: :destroy
Expand Down
4 changes: 3 additions & 1 deletion app/views/ideas/_form_field.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<%= inform_validation_errors(idea) %>
<p>
<%= inform_validation_errror(idea) %>
</p>
<div class="container">
<div class="form-group col-xs-4">
<%= form_for(idea, url: next_path) do |f| %>
Expand Down
4 changes: 1 addition & 3 deletions app/views/ideas/_simple.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
</div>
</div>
<div class="panel-body">
<div class="b-item5" style="color: gray; width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 1vw;">
<span title="詳細ページへ"><%= link_to idea.body, idea_path(id: idea), style: 'width: 100%; text-align: left;' %></span>
</div>
<div class="well"><p class="normal"><%= link_to simple_format(idea.body), idea_path(id: idea)%></p></div>
</div>
</div>
</div>
Loading

0 comments on commit e174356

Please sign in to comment.