Browse Source

UI actions

main
pvincent 3 months ago
parent
commit
131cf55361
  1. 2
      app/views/common/_button.html.erb
  2. 4
      app/views/scores/_score.html.erb
  3. 4
      app/views/scores/_scores.html.erb
  4. 2
      app/views/scores/index.html.erb

2
app/views/common/_button.html.erb

@ -2,7 +2,7 @@
<%= link_to path, <%= link_to path,
data: local_assigns.fetch(:data, nil) do %> data: local_assigns.fetch(:data, nil) do %>
<div class="group relative inline-block"> <div class="group relative inline-block">
<div class='mr-1 py-2 px-3 text-white border rounded-lg bg-white dark:bg-slate-900'>
<div class='bg-blue-600 text-white mr-1 py-2 px-3 border rounded-lg'>
<%=fa_icon icon %> <%=fa_icon icon %>
</div> </div>
<div class="bg-purple-800 text-white absolute top-full left-1/2 z-20 mt-2 -translate-x-1/2 whitespace-nowrap rounded-[5px] py-1.5 px-3.5 text-sm opacity-0 group-hover:opacity-100 pointer-events-none"> <div class="bg-purple-800 text-white absolute top-full left-1/2 z-20 mt-2 -translate-x-1/2 whitespace-nowrap rounded-[5px] py-1.5 px-3.5 text-sm opacity-0 group-hover:opacity-100 pointer-events-none">

4
app/views/scores/_score.html.erb

@ -1,4 +1,4 @@
<tr class="text-sm even:bg-gray-100 dark:even:bg-gray-900 dark:text-gray-200">
<tr class="text-sm even:bg-gray-100 dark:even:bg-gray-600 dark:text-gray-200">
<td class="px-2 w-1/2"> <td class="px-2 w-1/2">
<%= score.name %> <%= score.name %>
</td> </td>
@ -8,7 +8,7 @@
<td class="px-2"> <td class="px-2">
<%= score.created_at %> <%= score.created_at %>
</td> </td>
<td class="w-1/4 p-2 flex flex-nowrap justify-end">
<td class="p-2 m-5 flex justify-end">
<%= render partial: 'common/button', locals: {path: score, icon: :eye, tooltip: 'open score'} %> <%= render partial: 'common/button', locals: {path: score, icon: :eye, tooltip: 'open score'} %>
<%= render partial: 'common/button', locals: {path: edit_score_path(score), icon: :edit, tooltip: 'edit score'} %> <%= render partial: 'common/button', locals: {path: edit_score_path(score), icon: :edit, tooltip: 'edit score'} %>
<%= render partial: 'common/button', locals: {path: score, icon: :trash, tooltip: 'delete score',data:{ turbo_method: :delete}} %> <%= render partial: 'common/button', locals: {path: score, icon: :trash, tooltip: 'delete score',data:{ turbo_method: :delete}} %>

4
app/views/scores/_scores.html.erb

@ -11,7 +11,7 @@
<th scope="col" class="p-2"> <th scope="col" class="p-2">
<%= pagy_sort_link(@q, :created_at) %> <%= pagy_sort_link(@q, :created_at) %>
</th> </th>
<th scope="col" class="p-2">
<th scope="col" class="p-2 m-5 flex justify-end">
Actions Actions
</th> </th>
</tr> </tr>
@ -27,7 +27,7 @@
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody class="divide-y divide-gray-200 dark:divide-gray-500 ">
<tbody class="bg-gray-100 dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-500 ">
<%= render @scores %> <%= render @scores %>
</tbody> </tbody>
</table> </table>

2
app/views/scores/index.html.erb

@ -3,7 +3,7 @@
</h1> </h1>
<div class="m-5 flex justify-end"> <div class="m-5 flex justify-end">
<%= link_to "New score", new_score_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
<%= link_to "New score", new_score_path, class: "border rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
</div> </div>
<div class="p-4 inline-block min-w-full align-middle "> <div class="p-4 inline-block min-w-full align-middle ">

Loading…
Cancel
Save