refactor: BoardAccessible concernを導入し、ボード関連コントローラを整理、ターン表示ロジックをTurnモデルへ移動し、ボード提案表示をコントローラで処理するよう変更
This commit is contained in:
@@ -81,42 +81,16 @@
|
||||
</div>
|
||||
|
||||
<% # ゲーム画面(games/show)と統一されたデザインでターン情報を表示 %>
|
||||
<%
|
||||
target_turn = defined?(display_turn) && display_turn ? display_turn : game.latest_turn
|
||||
%>
|
||||
<% target_turn = defined?(display_turn) && display_turn ? display_turn : game.latest_turn %>
|
||||
<% if target_turn && target_turn.phase.present? %>
|
||||
<%
|
||||
# フェーズ名パース (例: S1901M)
|
||||
phase = target_turn.phase
|
||||
year = phase[1..4]
|
||||
season_code = phase[0]
|
||||
type_code = phase[-1]
|
||||
|
||||
season = case season_code
|
||||
when 'S' then '春'
|
||||
when 'F' then '秋'
|
||||
when 'W' then '冬'
|
||||
else ''
|
||||
end
|
||||
|
||||
type = case type_code
|
||||
when 'M' then '移動'
|
||||
when 'R' then '撤退'
|
||||
when 'A' then '調整'
|
||||
else ''
|
||||
end
|
||||
|
||||
display_date = "#{year}年 #{season} (#{type})"
|
||||
%>
|
||||
|
||||
<div class="bg-white shadow overflow-hidden sm:rounded-lg border border-gray-200 mb-6">
|
||||
<div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center bg-gray-50">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-gray-900"><%= display_date %></h2>
|
||||
<h2 class="text-2xl font-bold text-gray-900"><%= target_turn.display_phase %></h2>
|
||||
<div class="mt-1 flex items-center space-x-4 text-sm text-gray-600">
|
||||
<span>ターン: <%= target_turn.number %></span>
|
||||
<span class="text-gray-400">|</span>
|
||||
<span>フェーズ: <%= phase %></span>
|
||||
<span>フェーズ: <%= target_turn.phase %></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -131,3 +105,4 @@
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user