Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1022 Homepage view #1026

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/stylesheets/pages/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ a {
/* home-page */
.homepage_title {
text-align: center;
margin-top: 200px;
margin-top: 100px;
color: $color;
}

Expand Down
18 changes: 15 additions & 3 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
<main class="container">
<h1 class="homepage_title"><%= t '.homepage_title' %></h1>
<p><%= t '.description' %></p>

<%= link_to_external(text: t('.visit_website'), url: t(".link"), class: 'main-btn btn-outline-gray justify-center btn-space') %>
<%= link_to t('.calculate'), calculator_path, class: "main-btn btn-outline-green" %>
<div class="flex flex-col md:flex-row gap-6">
<div class="w-full md:w-1/2">
<h2 class="homepage_title"><%= t '.diaper_calculator_title' %></h2>
<p><%= t '.diaper_calculator_description' %></p>
<%= link_to t('.calculate'), calculator_path, class: "main-btn btn-outline-green" %>
</div>

<div class="w-full md:w-1/2">
<h2 class="homepage_title"><%= t '.mhc_calculator_title' %></h2>
<p><%= t '.mhc_calculator_description' %></p>
<%= link_to t('.calculate'), mhc_calculator_path, class: "main-btn btn-outline-green" %>
</div>
</div>

<%= link_to_external(text: t('.visit_website'), url: t(".link"), class: 'main-btn btn-outline-gray justify-center btn-space mt-6') %>
</main>
7 changes: 5 additions & 2 deletions config/locales/en/layouts.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
en:
home:
index:
homepage_title: "Welcome to the diaper calculator"
description: "The calculator tells you how many disposable diapers your baby has already used and will use in the future before switching to regular underwear. And also how much money you have already spent on diapers and how much money you have yet to spend."
homepage_title: "Welcome to the ZeroWaste calculator"
diaper_calculator_description: "The calculator tells you how many disposable diapers your baby has already used and will use in the future before switching to regular underwear. And also how much money you have already spent on diapers and how much money you have yet to spend."
diaper_calculator_title: "Diaper calculator"
mhc_calculator_title: "MHC Calculator"
mhc_calculator_description: " BUT IST MHC. The calculator tells you how many disposable diapers your baby has already used and will use in the future before switching to regular underwear. And also how much money you have already spent on diapers and how much money you have yet to spend."
calculate: "Let's go"
visit_website: "Visit WebSite"
link: "https://zerowastelviv.org.ua/en"
Expand Down
7 changes: 5 additions & 2 deletions config/locales/uk/layouts.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
uk:
home:
index:
homepage_title: "Вас вітає калькулятор підгузків"
description: "Цей калькулятор дає змогу порахувати, скільки одноразових підгузків ваша дитина вже використала та ще використає до того часу, як перейде на звичайну білизну. А також визначити вартість уже куплених підгузків та суму, яку ви витратите на них у майбутньому."
homepage_title: "Вас вітає ZeroWaste калькулятор"
diaper_calculator_title: "Калькулятор підгузків"
mhc_calculator_title: "Калькулятор Менструальних засобів"
diaper_calculator_description: "Цей калькулятор дає змогу порахувати, скільки одноразових підгузків ваша дитина вже використала та ще використає до того часу, як перейде на звичайну білизну. А також визначити вартість уже куплених підгузків та суму, яку ви витратите на них у майбутньому."
mhc_calculator_description: "ЦЕ ТИПУ КАЛЬКУЛЯТОР МЕНСТРУАЛЬНИХ ЗАСОБІВ Цей калькулятор дає змогу порахувати, скільки одноразових підгузків ваша дитина вже використала та ще використає до того часу, як перейде на звичайну білизну. А також визначити вартість уже куплених підгузків та суму, яку ви витратите на них у майбутньому."
calculate: "Почати"
visit_website: "Наш сайт"
link: "https://zerowastelviv.org.ua/"
Expand Down
6 changes: 3 additions & 3 deletions spec/requests/home_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
get root_path

expect(root_path).to eq("/en")
expect(response.body).to include("Welcome to the diaper calculator")
expect(response.body).to include("Welcome to the ZeroWaste calculator")
expect(response).to render_template(:index)
expect(response).to be_successful
end
Expand All @@ -35,12 +35,12 @@
get root_path(locale: :uk)

expect(root_path).to eq("/uk")
expect(response.body).to include("Вас вітає калькулятор підгузків")
expect(response.body).to include("Вас вітає ZeroWaste калькулятор")

get root_path(locale: :en)

expect(root_path).to eq("/en")
expect(response.body).to include("Welcome to the diaper calculator")
expect(response.body).to include("Welcome to the ZeroWaste calculator")
expect(response).to render_template(:index)
expect(response).to be_successful
end
Expand Down
Loading