- Implement locale extraction and fallback mechanism - Add translation files for English and Chinese - Update views to use translated strings for various UI elements This commit introduces support for multiple languages in the application, enhancing accessibility for users. It includes a fallback mechanism for locales and updates to the user interface to display translated content.
29 lines
1.2 KiB
Plaintext
29 lines
1.2 KiB
Plaintext
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
|
<% arts.each do |art| %>
|
|
<div class="card bg-base-100 shadow-xl hover:shadow-2xl transition-shadow duration-300">
|
|
<figure class="relative aspect-[4/3] overflow-hidden">
|
|
<% if art.image.attached? %>
|
|
<%= image_tag art.preview_image.processed, class: "w-full h-full object-cover transform hover:scale-105 transition-transform duration-500" %>
|
|
<% end %>
|
|
</figure>
|
|
<div class="card-body">
|
|
<div class="flex justify-between items-start">
|
|
<div>
|
|
<h3 class="card-title font-display"><%= art.city.name %></h3>
|
|
<p class="text-base-content/70">
|
|
<%= art.formatted_time(:date) %>
|
|
</p>
|
|
</div>
|
|
<div class="text-right">
|
|
<div class="text-2xl font-bold"><%= art.temperature %>°C</div>
|
|
<div class="text-sm text-base-content/70"><%= art.description %></div>
|
|
</div>
|
|
</div>
|
|
<div class="card-actions justify-end mt-4">
|
|
<%= link_to t("button.view_detail"), city_weather_art_path(art.city, art),
|
|
class: "btn btn-primary btn-outline" %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div> |