-
Notifications
You must be signed in to change notification settings - Fork 11
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
Style calculators constructor show page #984
Style calculators constructor show page #984
Conversation
…cts/ZeroWaste into 963-view-of-the-constructors-calculator
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## calculators-constructor #984 +/- ##
===========================================================
+ Coverage 83.98% 85.31% +1.33%
===========================================================
Files 65 65
Lines 974 974
===========================================================
+ Hits 818 831 +13
+ Misses 156 143 -13 ☔ View full report in Codecov by Sentry. |
app/views/calculators/show.html.erb
Outdated
<div class="container place-items-center"> | ||
<h1 class="text-4xl font-bold">Calculator <%= @calculator.name %></h1><br> | ||
<%# TODO: Delete this and use user provided value %> | ||
<% color = "blue" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
колір має передаватися хексом
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
app/views/calculators/show.html.erb
Outdated
<% calculator_image = "scales.png" %> | ||
|
||
<div class="rounded jumbotron jumbotron-fluid position-relative"> | ||
<h1 class="pt-6 text-2xl font-semibold text-center font-sans text-<%= color %>">Calculator <%= @calculator.name %> <%= @text %></h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не гуд. додай в конфіги color: { dynamic: "var(--calculator-color)" }, щось таке, тоді тут вже будеш десь зверху сетати цю змінну: <div style="--calculator-color: <%= @calculator.color %>">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
config/tailwind.config.js
Outdated
safelist: [ | ||
{ | ||
pattern: /bg-.*/, | ||
}, | ||
{ | ||
pattern: /text-.*/, | ||
}, | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
це відповідно видалиш
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted
@@ -1,4 +1,6 @@ | |||
class Calculators::CalculationService | |||
include ApplicationHelper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не гуд
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted
if current_locale?(:en) | ||
{ label: formula.en_label, result: result, en_unit: formula.en_unit } | ||
else | ||
{ label: formula.uk_label, result: result, en_unit: formula.uk_unit } | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут ти можеш додати локальзацію додним рядком грубо кажучи:
{ label: formula.public_send("#{I18n.locale}_label") }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
та навіть прсотіше того, бо мав би бути підключений до формули концерн транслейтебел (він сам в залежності від локалі бере потрібний переклад):
{ label: formula.label }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
<div class="description-content-box"> | ||
<p data-type="description_block_html" class="description-text"> | ||
<%# TODO: Change description text and links %> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus faucibus arcu iaculis placerat euismod. Pellentesque nibh arcu, varius ac arcu a, eleifend semper leo. Aliquam ultricies lacus at mi ornare, sit amet vestibulum est fermentum. Praesent sed dapibus elit. Curabitur congue ante non metus posuere porttitor. Etiam non lacus imperdiet turpis pellentesque viverra. Nulla in velit mi. Suspendisse molestie tempor ornare. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- забери текст
- Додай умову, щоб не показувати секцію, поки нема контенту (просто if false)
- залиш тік
div
, бо контент едітора, який потім додадуть, буде містити багато інших тегів і так буде правельніше
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
має бути просто div, в який потім передадуть контент одною строкою
<div> | ||
<%# TODO: Add description partial here %> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а чому ти всі стилі видалив? ти мав залишити весь той контейнер, просто без контенту
<% color = "#088F8F" %> | ||
|
||
<%# TODO: Delete this and use user provided value%> | ||
<% formula_image = "money_to_spent_2.png" %> | ||
|
||
<div style="--calculator-color: <%= color %>" class="calculation-results rounded jumbotron jumbotron-fluid position-relative"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а навіщо тут також колір передавати? він зверху передається та й все, ну на шоу пейджі
app/views/calculators/show.html.erb
Outdated
</div> | ||
<% end %> | ||
<%= image_tag "#{calculator_image}", class: "scales_img", alt: "Scales" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а навіщо ти в стрінгу огортаєш змінну?
app/views/calculators/show.html.erb
Outdated
</div> | ||
<% end %> | ||
<%= image_tag "#{calculator_image}", class: "scales_img", alt: "Scales" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alt через I18n пиши
<%= image_tag "#{formula_image}", class: "img-margin", alt: "icon" %> | ||
<p class="dynamic-text-color"><%= result[:result] %></p> | ||
<p class="text-2xl dynamic-text-color"><%= result[:unit] %></p> | ||
<p class="diapers-font-text"><%= result[:label] %></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вирівняй
<div class="description-content-box"> | ||
<p data-type="description_block_html" class="description-text"> | ||
<%# TODO: Add description text and links %> | ||
</p> | ||
</div> | ||
<div class="description-btn-box"> | ||
<%# TODO: Add discription btn link here %> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
має бути один ендпоінт, куди буде закидатися контент, ну я ж казав про це
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
засинкайся з Сашею, вона тобі покаже, що на виході має, ви маєте законектитись
#963
Code reviewers
Summary of issue
All calculators should be in the same style as the diaper and menstrual hygiene calculator
Result
Video1.mp4
Testing approach
Tested locally
CHECK LIST