|
1 | | -<% content_for :title, "Showing game" %> |
| 1 | +<% content_for :title, @game.title %> |
2 | 2 |
|
3 | | -<div class="md:w-2/3 w-full"> |
4 | | - <% if notice.present? %> |
5 | | - <p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block" id="notice"><%= notice %></p> |
6 | | - <% end %> |
| 3 | +<p style="color: green"><%= notice %></p> |
| 4 | +<p style="color: red"><%= alert %></p> |
| 5 | + |
| 6 | +<nav class="breadcrumbs text-sm"> |
| 7 | + <ul> |
| 8 | + <li><%= link_to "Games", admin_games_path %></li> |
| 9 | + <li><%= @game.title %></li> |
| 10 | + </ul> |
| 11 | +</nav> |
7 | 12 |
|
8 | | - <h1 class="font-bold text-4xl">Showing game</h1> |
| 13 | +<header class="flex items-center justify-between mb-4"> |
| 14 | + <h1 class="text-2xl"><%= @game.title %></h1> |
| 15 | + <div class="flex gap-2"> |
| 16 | + <%= link_to "Edit this game", edit_admin_game_path(@game), class: "btn btn-primary" %> |
| 17 | + <%= button_to "Delete this game", [:admin, @game], method: :delete, |
| 18 | + data: { "turbo-confirm": delete_game_confirmation(@game) }, |
| 19 | + class: "btn btn-error" %> |
| 20 | + </div> |
| 21 | +</header> |
9 | 22 |
|
10 | | - <%= render @game %> |
| 23 | +<dl class="mb-8 space-y-4"> |
| 24 | + <div> |
| 25 | + <dt class="font-semibold">Slug</dt> |
| 26 | + <dd><%= @game.slug %></dd> |
| 27 | + </div> |
| 28 | + <div> |
| 29 | + <dt class="font-semibold">Description</dt> |
| 30 | + <dd><%= @game.description.presence || "No description." %></dd> |
| 31 | + </div> |
| 32 | +</dl> |
11 | 33 |
|
12 | | - <%= link_to "Edit this game", edit_admin_game_path(@game), class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %> |
13 | | - <%= link_to "Back to games", admin_games_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %> |
14 | | - <%= button_to "Destroy this game", [:admin, @game], method: :delete, form_class: "sm:inline-block mt-2 sm:mt-0 sm:ml-2", class: "w-full rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %> |
15 | | -</div> |
| 34 | +<section> |
| 35 | + <h2 class="text-lg font-semibold mb-2">Modules</h2> |
| 36 | + <% if @content_modules.any? %> |
| 37 | + <ul class="list-disc pl-6"> |
| 38 | + <% @content_modules.each do |content_module| %> |
| 39 | + <li><%= link_to content_module.name, edit_admin_content_module_path(content_module), class: "link" %></li> |
| 40 | + <% end %> |
| 41 | + </ul> |
| 42 | + <% else %> |
| 43 | + <p class="text-sm opacity-60">Not in any module yet.</p> |
| 44 | + <% end %> |
| 45 | +</section> |
0 commit comments