- Renamed `app/views/cities/_map.html.erb` to `app/views/shared/_map.html.erb` - Updated references to the map partial in `cities/show.html.erb` and `weather_arts/show.html.erb` - Adjusted the layout in `cities/show.html.erb` and `weather_arts/show.html.erb` for visual consistency. This refactoring improves code reusability and maintainability by centralizing the map component. It also improves the visual presentation of the application.
16 lines
864 B
Plaintext
16 lines
864 B
Plaintext
<!-- 插入到 "主要统计信息" 的下方 -->
|
|
<div class="container mx-auto px-2 py-2">
|
|
<div class="max-w-7xl mx-auto bg-base-100 rounded-2xl shadow-xl overflow-hidden">
|
|
<!-- <h3 class="text-2xl font-display font-bold p-6 bg-base-200"><%#= t('city.location_on_globe') %></h3>-->
|
|
<div
|
|
data-controller="map"
|
|
data-map-latitude-value="<%= @city.latitude %>"
|
|
data-map-longitude-value="<%= @city.longitude %>"
|
|
data-map-token-value="<%= Rails.application.credentials.dig(:mapbox, :token) %>"
|
|
data-map-weather-art-value="<%= @city.latest_weather_art.to_json %>"
|
|
data-map-weather-art-url-value="<%= rails_blob_url(@city&.latest_weather_art&.webp_image&.processed ) if @city&.latest_weather_art&.image&.attached? %>"
|
|
class="h-[500px] w-full rounded-b-2xl z-10"
|
|
style="touch-action: none"
|
|
></div>
|
|
</div>
|
|
</div> |