From 56f5841d4b9c12296cdfcaeff174b2627d59afc8 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 7 Dec 2024 11:49:49 -0500 Subject: Migrate to full rails app --- app/views/pokemon/_embed_code.html.haml | 1 + app/views/pokemon/embed.html.haml | 17 +++++++++++++ app/views/pokemon/index.html.haml | 42 +++++++++++++++++++++++++++++++++ app/views/pokemon/show.html.haml | 4 ++++ 4 files changed, 64 insertions(+) create mode 100644 app/views/pokemon/_embed_code.html.haml create mode 100644 app/views/pokemon/embed.html.haml create mode 100644 app/views/pokemon/index.html.haml create mode 100644 app/views/pokemon/show.html.haml (limited to 'app/views/pokemon') diff --git a/app/views/pokemon/_embed_code.html.haml b/app/views/pokemon/_embed_code.html.haml new file mode 100644 index 0000000..6bbff69 --- /dev/null +++ b/app/views/pokemon/_embed_code.html.haml @@ -0,0 +1 @@ +%iframe{ src: embed_pokemon_url(@pokemon), frameborder: 0, width: 382, height: 298 } \ No newline at end of file diff --git a/app/views/pokemon/embed.html.haml b/app/views/pokemon/embed.html.haml new file mode 100644 index 0000000..17fc7ba --- /dev/null +++ b/app/views/pokemon/embed.html.haml @@ -0,0 +1,17 @@ +!!! 5 +%html + %head + %title Pokeviewer + %meta{ name: "viewport", content: "width=device-width,initial-scale=1" } + = stylesheet_link_tag "application", media: "all" + = javascript_include_tag "application" + = csrf_meta_tags + = csp_meta_tag + %body#pokemon-embed + %ul#pokemon-embed-tabs + %li.ptabe-button.ptabe-details= link_to "Details", "\#", data: {tab: "details"} + %li.ptabe-button.ptabe-stats= link_to "Stats", "\#", data: {tab: "stats"} + %li.ptabe-button.ptabe-moves= link_to "Moves", "\#", data: {tab: "moves"} + %li.ptabe-button.ptabe-contest= link_to "Contest", "\#", data: {tab: "contest"} + %li.ptabe-button.ptabe-ribbons= link_to "Ribbons", "\#", data: {tab: "ribbons"} + = render @revision diff --git a/app/views/pokemon/index.html.haml b/app/views/pokemon/index.html.haml new file mode 100644 index 0000000..67ea2cf --- /dev/null +++ b/app/views/pokemon/index.html.haml @@ -0,0 +1,42 @@ +- @trainers.each do |trainer, party, boxes| + .trainer + .trainer-info{ class: trainer.game } + %h2= trainer.name + %span.tid= trainer.display_number + .pc-boxes + %ul.party.pc-box + %h3 Party + - party.each do |p| + %li + %span.party-icon= image_tag p.current.icon_path + %span.party-name= link_to p.current.nickname, p + - boxes.each do |box| + .pc-box + %h3= box[:name] + %table.pc-contents + - box[:pokemon].each_slice(6) do |row| + %tr + - row.each do |p| + %td.pc-pokemon.pkv-has-hover + - if p.nil? + .spacer + - else + = link_to image_tag(p.current.icon_path), p + .pc-data.pkv-hover + .pc-data-name= p.current.nickname + .pc-data-ot + OT/ + %span{ class: p.ot_gender }>= p.ot_name +- if @unaccounted.any? + .trainer + .trainer-info.unaccounted + %h2 Pokémon Not In Any Game + %ul.pokemon-list + - @unaccounted.each do |p| + %li.pc-pokemon.pkv-has-hover + = link_to image_tag(p.current.icon_path), p + .pc-data.pkv-hover + .pc-data-name= p.current.nickname + .pc-data-ot + OT/ + %span{ class: p.ot_gender }>= p.ot_name diff --git a/app/views/pokemon/show.html.haml b/app/views/pokemon/show.html.haml new file mode 100644 index 0000000..cbd879b --- /dev/null +++ b/app/views/pokemon/show.html.haml @@ -0,0 +1,4 @@ += render @revision +%details#pk-embed-code + %summary Embed code + %textarea{ readonly: true }= CGI.escapeHTML(render partial: "embed_code").html_safe -- cgit 1.4.1