From 7e5b3ed21024d8fd3e92b18defd038b855fa3c8d Mon Sep 17 00:00:00 2001 From: Mr-T18 Date: Thu, 28 Aug 2025 02:31:55 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E7=B7=AF=E5=BA=A6=E7=B5=8C=E5=BA=A6?= =?UTF-8?q?=E3=81=AB=E3=82=88=E3=81=A3=E3=81=A6=E3=83=94=E3=83=B3=E3=82=92?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=97=E3=81=9F=E3=81=84(=E3=81=BE?= =?UTF-8?q?=E3=81=A0=E3=81=A7=E3=81=8D=E3=81=A6=E3=81=AA=E3=81=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/controllers/map_controller.js | 2 +- app/views/photo_spots/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/controllers/map_controller.js b/app/javascript/controllers/map_controller.js index 02dacd4..c5ddf39 100644 --- a/app/javascript/controllers/map_controller.js +++ b/app/javascript/controllers/map_controller.js @@ -20,7 +20,7 @@ export default class extends Controller { // 既存のスポットのマーカーを設置 const photo_spotIcon = L.icon({ - iconUrl: '/photo_spot.svg', + iconUrl: '/onsen.svg', iconSize: [32, 32], iconAnchor: [16, 32], }); diff --git a/app/views/photo_spots/index.html.erb b/app/views/photo_spots/index.html.erb index e8ed65a..e2101ad 100644 --- a/app/views/photo_spots/index.html.erb +++ b/app/views/photo_spots/index.html.erb @@ -9,7 +9,7 @@
-
+
- <%# 緯度・経度の入力フィールド %> -
-
- <%= form.label :latitude, '緯度', class: 'block font-semibold mb-1' %> - <%= form.text_field :latitude, - data: { map_target: 'latitudeInput', action: 'input->map#updateMarkerFromInput' }, - class: "block shadow-sm rounded-md border px-3 py-2 w-full border-gray-300 focus:outline-blue-600" %> + <%# 地図エリア(デスクトップ時) %> +
+
+
+
-
- <%= form.label :longitude, '経度', class: 'block font-semibold mb-1' %> - <%= form.text_field :longitude, - data: { map_target: 'longitudeInput', action: 'input->map#updateMarkerFromInput' }, + <%# 緯度・経度の入力フィールドを地図コントローラーのスコープ内に配置 %> +
+
+ <%= form.label :latitude, '緯度', class: 'block font-semibold mb-1' %> + <%= form.text_field :latitude, + data: { form_map_target: 'latitudeInput', action: 'input->form-map#updateMarkerFromInput' }, class: "block shadow-sm rounded-md border px-3 py-2 w-full border-gray-300 focus:outline-blue-600" %> +
+
+ <%= form.label :longitude, '経度', class: 'block font-semibold mb-1' %> + <%= form.text_field :longitude, + data: { form_map_target: 'longitudeInput', action: 'input->form-map#updateMarkerFromInput' }, + class: "block shadow-sm rounded-md border px-3 py-2 w-full border-gray-300 focus:outline-blue-600" %> +
- <%# 地図エリア(デスクトップ時) %> -
-
- -
<%= form.label :detail, '説明', class: 'block font-semibold mb-1' %> <%= form.text_area :detail, rows: 4, class: "block shadow-sm rounded-md border px-3 py-2 w-full border-gray-300 focus:outline-blue-600" %> diff --git a/app/views/photo_spots/_spot_card.html.erb b/app/views/photo_spots/_spot_card.html.erb index fc339a8..f0b426a 100644 --- a/app/views/photo_spots/_spot_card.html.erb +++ b/app/views/photo_spots/_spot_card.html.erb @@ -1,5 +1,7 @@ -<%# フォトスポットスポットカード(Atomic Design: Molecule) %> -<%= link_to photo_spot_path(photo_spot), class: "block bg-white rounded-lg shadow-md hover:shadow-lg p-4 hover:bg-blue-50 transition-all duration-200 cursor-pointer border border-gray-100 focus:outline focus:ring-2 focus:ring-blue-400", 'aria-label': "#{photo_spot.name}の詳細" do %> +<%= link_to photo_spot_path(photo_spot), + class: "block bg-white rounded-lg shadow-md hover:shadow-lg p-4 hover:bg-blue-50 transition-all duration-200 border border-gray-100 focus:outline focus:ring-2 focus:ring-blue-400", + 'aria-label': "#{photo_spot.name}の詳細", + data: { spot_id: photo_spot.id } do %>
<% if photo_spot.images.attached? %> <%= image_tag photo_spot.images.first, class: "w-20 h-20 object-cover rounded-lg flex-shrink-0", alt: photo_spot.name %> @@ -11,7 +13,7 @@
<%= truncate(photo_spot.detail, length: 60) %>
<% if photo_spot.tags.present? %>
- タグ: <%= photo_spot.tags%> + タグ: <%= photo_spot.tags %>
<% end %>
diff --git a/app/views/photo_spots/index.html.erb b/app/views/photo_spots/index.html.erb index e2101ad..5b614b4 100644 --- a/app/views/photo_spots/index.html.erb +++ b/app/views/photo_spots/index.html.erb @@ -7,17 +7,20 @@ <%= render 'search_form' %> <%# メインコンテンツ:地図 + フォトスポット一覧 %>
+ <%# 左側:地図 %>
-
-
+
+
- <%# フォトスポット一覧エリア(右側・デスクトップ時) %> + <%# 右側:フォトスポット一覧 %>
<% if @photo_spots.any? %> @@ -36,3 +39,4 @@
+
\ No newline at end of file