- Introduce a new partial for displaying weather statistics in a consistent card format. - Refactor the city show page to utilize the new statistics card partial, simplifying the code structure. - Update layout and styling for improved UX and maintainability. These changes enhance the maintainability of the codebase by promoting reuse of the statistics card component and improving the overall presentation of weather data for cities.
14 lines
584 B
Plaintext
14 lines
584 B
Plaintext
<!-- app/views/cities/_stat_card.html.erb -->
|
|
<div class="stat bg-base-100 shadow-lg rounded-box hover:bg-base-300 transition-all duration-300">
|
|
<div class="flex items-center gap-2 mb-2">
|
|
<%= weather_stat_icon(stat[:icon]) %>
|
|
<div class="stat-title font-medium"><%= stat[:title] %></div>
|
|
</div>
|
|
<div class="stat-value text-base overflow-x-auto whitespace-nowrap scrollbar-thin scrollbar-thumb-base-300 scrollbar-track-base-100">
|
|
<div class="min-w-min pr-2">
|
|
<%= stat[:value] %>
|
|
</div>
|
|
</div>
|
|
<div class="stat-desc mt-1"><%= stat[:desc] %></div>
|
|
</div>
|