<% if @city.latest_weather_art&.image&.attached? %>
<%= image_tag @city.latest_weather_art.webp_image.processed, alt: @city.latest_weather_art.image_alt, class: "w-full h-full object-cover object-center" %>
<% end %>
<%= link_to cities_path, class: "inline-flex items-center btn btn-ghost gap-2 " do %> <%= t("button.back_to_cities") %> <% end %>

<%= @city.localized_name %>

<% if @city.country.present? && @city.country.region.present? %> <%= link_to cities_path(country: @city.country, region: @city.country.region), class: "badge badge-lg badge-primary hover:badge-outline transition-all duration-200" do %> <%= "#{@city.country.emoji + " " || ""}#{@city.country.localized_name}" %> <% end %> <% elsif @city.country.present? %>
<%= "#{@city&.country&.emoji + " " || ""}#{@city&.country&.localized_name}" %>
<% end %> <% if @city.country.present? && @city.state.present? && @city.country.region.present? %> <%= link_to cities_path(country: @city.country, state: @city.state, region: @city.country.region), class: "badge badge-lg badge-secondary hover:badge-outline transition-all duration-200" do %> <%= @city.state.name %> <% end %> <% elsif @city.state.present? %>
<%= @city&.state&.name %>
<% end %> <%#= "#{@city&.country&.emoji + " " || ""}#{@city&.country&.name}" %> <%#= @city&.state&.name %> <%= render "shared/wiki_data_badge", city: @city %>
<%= render partial: 'cities/stat_card', collection: [ { icon: 'temperature', title: 'Latest Weather', value: "#{@city.latest_weather_art&.temperature}°C", desc: @city.latest_weather_art&.description }, { icon: 'location', title: 'Coordinates', value: "#{@city.latitude}°N, #{@city.longitude}°E", desc: 'Geographical Location' }, { icon: 'history', title: 'Records', value: @city.weather_arts.count, desc: 'Total Weather Arts' } ], as: :stat %>
<%= render 'shared/city_ai_description', city: @city %>
<%= render 'shared/map', city: @city %>
<%= render 'shared/auto_ad' %>
<%= render 'cities/admin_panel' %>
<% # 构建更吸引人的分享标题 share_title = "🎨 #{@city.full_name}'s Weather Transformed into Art" # 构建更有描述性的分享描述 share_description = [ "Discover this stunning AI-generated weather art!", "in #{@city.full_name}.", "Visit TodayAIWeather to see more amazing weather art." ].join(" ") %> <%= render "shared/share_social", title: share_title, description: share_description, tags: "AIWeather,Art,AIart,Weather,#{format_as_tag(@city&.name)},#{format_as_tag(@city&.country&.name)},#{format_as_tag(@city&.country&.region&.name)},#{format_as_tag(@city&.country&.subregion&.name)}", image: url_for(@city&.latest_weather_art&.webp_image&.processed) %>

Weather Art History

Last Updated: <%= time_ago_in_words(@city.last_weather_fetch) if @city.last_weather_fetch %>
<%= render partial: 'weather_arts/card', collection: @arts, as: :weather_art %>