Skip to content

Commit

Permalink
Merge pull request #9 from nashikotokyo/feature/08_my_posts
Browse files Browse the repository at this point in the history
Feature/08 my posts
  • Loading branch information
nashikotokyo committed Apr 3, 2022
2 parents 2fcbd03 + 8c3879b commit ca57fab
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
20 changes: 20 additions & 0 deletions app/assets/stylesheets/application.scss
Expand Up @@ -103,4 +103,24 @@ img {

.pagination {
justify-content: center;
}

.thumbs {
width: 100%;
position: relative;
display: block;

&::before {
content: "";
display: block;
padding-top: 100%;
}

img {
width: 100%;
height: 100%;
position: absolute;
top: 0;
object-fit: cover;
}
}
3 changes: 3 additions & 0 deletions app/views/posts/_thumbnail_post.html.slim
@@ -0,0 +1,3 @@
.col-md-4.mb-3
= link_to post_path(thumbnail_post), class: 'thumbs' do
= image_tag thumbnail_post.images.first.url
2 changes: 1 addition & 1 deletion app/views/shared/_header.html.slim
Expand Up @@ -12,7 +12,7 @@ nav.navbar.navbar-expand-lg.navbar-light.bg-white
a.nav-link href="#"
= icon 'far', 'heart', class: 'fa-lg'
li.nav-item
a.nav-link href="#"
= link_to user_path(current_user), class: 'nav-link' do
= icon 'far', 'user', class: 'fa-lg'
li.nav-item
= link_to 'ログアウト', logout_path, class: 'nav-link', method: :delete
7 changes: 5 additions & 2 deletions app/views/users/show.html.slim
@@ -1,11 +1,14 @@
.container
.row
.col-md-6.offset-md-3
.col-md-10.offset-md-1
.card
.card-body
.text-center.mb-3
= image_tag 'profile-placeholder.png', size: '100x100', class: 'rounded-circle mr-1'
.profile.text-center.mb-3
= @user.username
.text-center
= render 'follow_area', user: @user
= render 'follow_area', user: @user
hr
.row
= render partial: 'posts/thumbnail_post', collection: @user.posts

0 comments on commit ca57fab

Please sign in to comment.