refactor: move map partial to shared directory
- 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.
This commit is contained in:
parent
67dcaf7a9d
commit
98a335100b
@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="relative max-w-3xl mx-auto px-4 pt-4 ">
|
||||
<div class="relative max-w-6xl mx-auto px-4 pt-4 ">
|
||||
<%= link_to cities_path,
|
||||
class: "inline-flex items-center btn btn-ghost gap-2 " do %>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
@ -23,7 +23,7 @@
|
||||
<div class="relative pt-8 pb-8">
|
||||
<div class="container mx-auto px-4">
|
||||
|
||||
<div class="max-w-3xl mx-auto text-center space-y-6">
|
||||
<div class="max-w-6xl mx-auto text-center space-y-6">
|
||||
<h1 class="text-5xl md:text-6xl font-display font-bold leading-tight">
|
||||
<%= @city.localized_name %>
|
||||
</h1>
|
||||
@ -61,7 +61,9 @@
|
||||
], as: :stat %>
|
||||
</div>
|
||||
|
||||
<%= render 'cities/map', city: @city %>
|
||||
<div class="card bg-base-100 backdrop-blur-md shadow-lg border border-primary/20 overflow-hidden"> <!-- 调整透明度和阴影 -->
|
||||
<%= render 'shared/map', city: @city %>
|
||||
</div>
|
||||
|
||||
<%= render 'cities/admin_panel' %>
|
||||
</div>
|
||||
@ -71,8 +73,8 @@
|
||||
|
||||
<!-- 天气艺术历史记录 -->
|
||||
<div class="bg-base-100">
|
||||
<div class="container mx-auto px-4 py-16">
|
||||
<div class="max-w-7xl mx-auto space-y-8">
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="max-w-6xl mx-auto space-y-8">
|
||||
<!-- 标题和更新时间 -->
|
||||
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
|
||||
<h2 class="text-3xl font-display font-bold">Weather Art History</h2>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!-- 插入到 "主要统计信息" 的下方 -->
|
||||
<div class="container mx-auto px-2 my-16">
|
||||
<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
|
@ -19,7 +19,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 主要内容 -->
|
||||
<div class="card bg-base-200/80 backdrop-blur-md shadow-lg overflow-hidden"> <!-- 调整透明度和阴影 -->
|
||||
<div class="card bg-base-100 backdrop-blur-md shadow-lg border border-primary/20 overflow-hidden"> <!-- 调整透明度和阴影 -->
|
||||
<div class="grid lg:grid-cols-2 gap-6 items-center">
|
||||
|
||||
<!-- 图片区域 -->
|
||||
@ -73,6 +73,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card bg-base-100 backdrop-blur-md shadow-lg border border-primary/20 overflow-hidden"> <!-- 调整透明度和阴影 -->
|
||||
<%= render 'shared/map', city: @weather_art.city %>
|
||||
</div>
|
||||
|
||||
<!-- AI Prompt -->
|
||||
<div class="bg-primary/10 backdrop-blur-md p-6 rounded-lg border border-primary/20">
|
||||
<div class="flex items-center gap-3 mb-4">
|
||||
|
Loading…
Reference in New Issue
Block a user