Skip to content

Commit

Permalink
Merge pull request #328 from liz4chernyshova/add_stub
Browse files Browse the repository at this point in the history
add stub for empty reviews and blogposts
  • Loading branch information
richpeach-bot committed Dec 9, 2022
2 parents ee9f627 + 72f596a commit 71d61c0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
20 changes: 11 additions & 9 deletions app/views/web/blog_posts/index.html.slim
Expand Up @@ -2,12 +2,14 @@
.row.justify-content-center
.col-12.col-md-10.col-lg-8
h1.mb-5 = t('.header')

- @blog_posts.each do |post|
.card.border-0.mb-5
- if post.cover.attached?
= link_to blog_post_path(post.slug) do
= image_tag post.cover.variant(:list), class: 'card-img-top image-fluid'
.card-body
h2.card-title = link_to post, blog_post_path(post.slug)
.card-text.lead = truncate post.body
- if @blog_posts.any?
- @blog_posts.each do |post|
.card.border-0.mb-5
- if post.cover.attached?
= link_to blog_post_path(post.slug) do
= image_tag post.cover.variant(:list), class: 'card-img-top image-fluid'
.card-body
h2.card-title = link_to post, blog_post_path(post.slug)
.card-text.lead = truncate post.body
- else
p = t('.empty')
12 changes: 7 additions & 5 deletions app/views/web/reviews/index.html.slim
Expand Up @@ -2,8 +2,10 @@
.row.justify-content-center
.col-12.col-md-10.col-lg-8
h1.mb-5 = t('.header')

- @reviews.each do |review|
.mb-5
h2 = link_to review, review_path(review)
.lead = truncate review.body, length: 180
- if @reviews.any?
- @reviews.each do |review|
.mb-5
h2 = link_to review, review_path(review)
.lead = truncate review.body, length: 180
- else
p = t('.empty')
2 changes: 2 additions & 0 deletions config/locales/en.views.yml
Expand Up @@ -3,6 +3,7 @@ en:
reviews:
index:
header: Reviews
empty: Looks like there is noting yet
admin:
blog_posts:
index:
Expand Down Expand Up @@ -88,6 +89,7 @@ en:
blog_posts:
index:
header: Blog
empty: Looks like there is noting yet
languages:
show:
blog_posts: Blog Posts
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ru.views.yml
Expand Up @@ -3,6 +3,7 @@ ru:
reviews:
index:
header: Отзывы
empty: Похоже, что тут пока ничего нет
admin:
title: Админка Code-Basics
languages:
Expand Down Expand Up @@ -83,6 +84,7 @@ ru:
blog_posts:
index:
header: Блог
empty: Похоже, что тут пока ничего нет
languages:
show:
breadcrumbs: Хлебные крошки
Expand Down

0 comments on commit 71d61c0

Please sign in to comment.