diff options
Diffstat (limited to 'app/views/pokedex_entries')
-rw-r--r-- | app/views/pokedex_entries/_entry.html.erb | 12 | ||||
-rw-r--r-- | app/views/pokedex_entries/index.html.erb | 13 |
2 files changed, 13 insertions, 12 deletions
diff --git a/app/views/pokedex_entries/_entry.html.erb b/app/views/pokedex_entries/_entry.html.erb new file mode 100644 index 0000000..992aa69 --- /dev/null +++ b/app/views/pokedex_entries/_entry.html.erb @@ -0,0 +1,12 @@ +<div class="flex space-x-2 items-center"> + <div class="flex justify-around bg-white h-[60px] w-[60px] border border-orange-900 + p-1 rounded shadow"> + <%= image_tag entry.pokemon.sprite_path(shiny: entry.shiny?) %> + </div> + <div> + <div><%= "Shiny " if entry.shiny? %><%= entry.pokemon.name %></div> + <div class="text-sm">Recorded by + <%= link_to entry.user.name || "???", user_path(entry.user) %> @ <%= entry.recorded_at %> + </div> + </div> +</div> diff --git a/app/views/pokedex_entries/index.html.erb b/app/views/pokedex_entries/index.html.erb index e31cf2d..d5bdfb1 100644 --- a/app/views/pokedex_entries/index.html.erb +++ b/app/views/pokedex_entries/index.html.erb @@ -3,18 +3,7 @@ <div class="space-y-2 p-4 h-[400px] border border-orange-900 overflow-y-scroll"> <% @pokedex_entries.each do |entry| %> - <div class="flex space-x-2 items-center"> - <div class="flex justify-around bg-white h-[60px] w-[60px] border border-orange-900 - rounded shadow"> - <%= image_tag entry.pokemon.sprite_path(shiny: entry.shiny?) %> - </div> - <div> - <div><%= "Shiny " if entry.shiny? %><%= entry.pokemon.name %></div> - <div class="text-sm">Recorded by - <%= link_to entry.user.name || "???", user_path(entry.user) %> @ <%= entry.recorded_at %> - </div> - </div> - </div> + <%= render partial: "entry", locals: {entry:} %> <% end %> </div> <% end %> |