diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-01-13 16:01:51 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-01-13 16:01:51 -0500 |
commit | 7e4b9ea0c23eb660ab36a6114a7a3046d8f1c5f6 (patch) | |
tree | d2e020ca045ce3d6f28a6d912bbc343db03265d2 /app/views | |
parent | d91e1d9a9ee98cc364bc62a4dd156500a189b99a (diff) | |
download | pokeviewer-7e4b9ea0c23eb660ab36a6114a7a3046d8f1c5f6.tar.gz pokeviewer-7e4b9ea0c23eb660ab36a6114a7a3046d8f1c5f6.tar.bz2 pokeviewer-7e4b9ea0c23eb660ab36a6114a7a3046d8f1c5f6.zip |
Moved species from Pokémon to revision
The migration will set all of the revisions of each Pokémon to have the species that that Pokémon was set to. If reversed, the migration sets the Pokémon's species to the first revision's species, which mimics the behavior of the engine from before this change, but do note that running the migration backwards like this can lose data. This change slightly affects the loading time of the front page. See #2. refs #3
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/pokeviewer/pokemon/index.html.haml | 12 | ||||
-rw-r--r-- | app/views/pokeviewer/pokemon/show.html.haml | 54 |
2 files changed, 33 insertions, 33 deletions
diff --git a/app/views/pokeviewer/pokemon/index.html.haml b/app/views/pokeviewer/pokemon/index.html.haml index e1793dc..67ea2cf 100644 --- a/app/views/pokeviewer/pokemon/index.html.haml +++ b/app/views/pokeviewer/pokemon/index.html.haml | |||
@@ -8,8 +8,8 @@ | |||
8 | %h3 Party | 8 | %h3 Party |
9 | - party.each do |p| | 9 | - party.each do |p| |
10 | %li | 10 | %li |
11 | %span.party-icon= image_tag p.icon_path | 11 | %span.party-icon= image_tag p.current.icon_path |
12 | %span.party-name= link_to p.nickname, p | 12 | %span.party-name= link_to p.current.nickname, p |
13 | - boxes.each do |box| | 13 | - boxes.each do |box| |
14 | .pc-box | 14 | .pc-box |
15 | %h3= box[:name] | 15 | %h3= box[:name] |
@@ -21,9 +21,9 @@ | |||
21 | - if p.nil? | 21 | - if p.nil? |
22 | .spacer | 22 | .spacer |
23 | - else | 23 | - else |
24 | = link_to image_tag(p.icon_path), p | 24 | = link_to image_tag(p.current.icon_path), p |
25 | .pc-data.pkv-hover | 25 | .pc-data.pkv-hover |
26 | .pc-data-name= p.nickname | 26 | .pc-data-name= p.current.nickname |
27 | .pc-data-ot | 27 | .pc-data-ot |
28 | OT/ | 28 | OT/ |
29 | %span{ class: p.ot_gender }>= p.ot_name | 29 | %span{ class: p.ot_gender }>= p.ot_name |
@@ -34,9 +34,9 @@ | |||
34 | %ul.pokemon-list | 34 | %ul.pokemon-list |
35 | - @unaccounted.each do |p| | 35 | - @unaccounted.each do |p| |
36 | %li.pc-pokemon.pkv-has-hover | 36 | %li.pc-pokemon.pkv-has-hover |
37 | = link_to image_tag(p.icon_path), p | 37 | = link_to image_tag(p.current.icon_path), p |
38 | .pc-data.pkv-hover | 38 | .pc-data.pkv-hover |
39 | .pc-data-name= p.nickname | 39 | .pc-data-name= p.current.nickname |
40 | .pc-data-ot | 40 | .pc-data-ot |
41 | OT/ | 41 | OT/ |
42 | %span{ class: p.ot_gender }>= p.ot_name | 42 | %span{ class: p.ot_gender }>= p.ot_name |
diff --git a/app/views/pokeviewer/pokemon/show.html.haml b/app/views/pokeviewer/pokemon/show.html.haml index 0daabb0..3f2750c 100644 --- a/app/views/pokeviewer/pokemon/show.html.haml +++ b/app/views/pokeviewer/pokemon/show.html.haml | |||
@@ -2,44 +2,44 @@ | |||
2 | .pokemon-basics | 2 | .pokemon-basics |
3 | .pokemon-nameline | 3 | .pokemon-nameline |
4 | = image_tag(@pokemon.pokeball_icon_path, class: "pokemon-ball") | 4 | = image_tag(@pokemon.pokeball_icon_path, class: "pokemon-ball") |
5 | %span.pokemon-name= @pokemon.revisions.last.nickname | 5 | %span.pokemon-name= @pokemon.current.nickname |
6 | %span.pokemon-gender{ class: @pokemon.gender }= @pokemon.gender_symbol | 6 | %span.pokemon-gender{ class: @pokemon.gender }= @pokemon.gender_symbol |
7 | .pokemon-level= "Lv. #{@pokemon.revisions.last.level}" | 7 | .pokemon-level= "Lv. #{@pokemon.current.level}" |
8 | .pokemon-image | 8 | .pokemon-image |
9 | .pokemon-image-wrap | 9 | .pokemon-image-wrap |
10 | = image_tag @pokemon.sprite_path, class: "pokemon-sprite" | 10 | = image_tag @pokemon.current.sprite_path, class: "pokemon-sprite" |
11 | - if @pokemon.shiny? | 11 | - if @pokemon.shiny? |
12 | = image_tag "pokeviewer/ShinyIVStar.png", class: "pkv-shiny-star" | 12 | = image_tag "pokeviewer/ShinyIVStar.png", class: "pkv-shiny-star" |
13 | - if @pokemon.revisions.last.item.nil? | 13 | - if @pokemon.current.item.nil? |
14 | .pokemon-item-label Item | 14 | .pokemon-item-label Item |
15 | .pokemon-item None | 15 | .pokemon-item None |
16 | - else | 16 | - else |
17 | .pokemon-item-label.with-item Item | 17 | .pokemon-item-label.with-item Item |
18 | .pokemon-item.pkv-has-hover | 18 | .pokemon-item.pkv-has-hover |
19 | = image_tag(@pokemon.revisions.last.item.icon_path) | 19 | = image_tag(@pokemon.current.item.icon_path) |
20 | = @pokemon.revisions.last.item.name | 20 | = @pokemon.current.item.name |
21 | .pkv-hover | 21 | .pkv-hover |
22 | .pc-data-name= @pokemon.revisions.last.item.name | 22 | .pc-data-name= @pokemon.current.item.name |
23 | - if @pokemon.revisions.last.item.tm? | 23 | - if @pokemon.current.item.tm? |
24 | .pc-move-name= @pokemon.revisions.last.item.move.name | 24 | .pc-move-name= @pokemon.current.item.move.name |
25 | = @pokemon.revisions.last.item.description(@pokemon.trainer.game) | 25 | = @pokemon.current.item.description(@pokemon.trainer.game) |
26 | .pokemon-tab.pokemon-details | 26 | .pokemon-tab.pokemon-details |
27 | %table | 27 | %table |
28 | %tr | 28 | %tr |
29 | %th Pokédex No. | 29 | %th Pokédex No. |
30 | %td | 30 | %td |
31 | .table-bubble.tb-top= @pokemon.species_id | 31 | .table-bubble.tb-top= @pokemon.current.species_id |
32 | %tr | 32 | %tr |
33 | %th Name | 33 | %th Name |
34 | %td | 34 | %td |
35 | .table-bubble= @pokemon.species.name | 35 | .table-bubble= @pokemon.current.species.name |
36 | %tr | 36 | %tr |
37 | %th Type | 37 | %th Type |
38 | %td | 38 | %td |
39 | .table-bubble | 39 | .table-bubble |
40 | = image_for_type @pokemon.species.type_1 | 40 | = image_for_type @pokemon.current.species.type_1 |
41 | - if @pokemon.species.type_2 | 41 | - if @pokemon.current.species.type_2 |
42 | = image_for_type @pokemon.species.type_2 | 42 | = image_for_type @pokemon.current.species.type_2 |
43 | %tr | 43 | %tr |
44 | %th OT | 44 | %th OT |
45 | %td.ot-gender{ class: @pokemon.ot_gender } | 45 | %td.ot-gender{ class: @pokemon.ot_gender } |
@@ -58,7 +58,7 @@ | |||
58 | %tr | 58 | %tr |
59 | %th HP | 59 | %th HP |
60 | %td | 60 | %td |
61 | .table-bubble.tb-top= @pokemon.revisions.last.hp | 61 | .table-bubble.tb-top= @pokemon.current.hp |
62 | %tr | 62 | %tr |
63 | %th | 63 | %th |
64 | Attack | 64 | Attack |
@@ -67,7 +67,7 @@ | |||
67 | - if @pokemon.nature_hinders?(:attack) | 67 | - if @pokemon.nature_hinders?(:attack) |
68 | %span.nature-hinder - | 68 | %span.nature-hinder - |
69 | %td | 69 | %td |
70 | .table-bubble= @pokemon.revisions.last.attack | 70 | .table-bubble= @pokemon.current.attack |
71 | %tr | 71 | %tr |
72 | %th | 72 | %th |
73 | Defense | 73 | Defense |
@@ -76,7 +76,7 @@ | |||
76 | - if @pokemon.nature_hinders?(:defense) | 76 | - if @pokemon.nature_hinders?(:defense) |
77 | %span.nature-hinder - | 77 | %span.nature-hinder - |
78 | %td | 78 | %td |
79 | .table-bubble= @pokemon.revisions.last.defense | 79 | .table-bubble= @pokemon.current.defense |
80 | %tr | 80 | %tr |
81 | %th | 81 | %th |
82 | Sp. Atk | 82 | Sp. Atk |
@@ -85,7 +85,7 @@ | |||
85 | - if @pokemon.nature_hinders?(:special_attack) | 85 | - if @pokemon.nature_hinders?(:special_attack) |
86 | %span.nature-hinder - | 86 | %span.nature-hinder - |
87 | %td | 87 | %td |
88 | .table-bubble= @pokemon.revisions.last.special_attack | 88 | .table-bubble= @pokemon.current.special_attack |
89 | %tr | 89 | %tr |
90 | %th | 90 | %th |
91 | Sp. Def | 91 | Sp. Def |
@@ -94,7 +94,7 @@ | |||
94 | - if @pokemon.nature_hinders?(:special_defense) | 94 | - if @pokemon.nature_hinders?(:special_defense) |
95 | %span.nature-hinder - | 95 | %span.nature-hinder - |
96 | %td | 96 | %td |
97 | .table-bubble= @pokemon.revisions.last.special_defense | 97 | .table-bubble= @pokemon.current.special_defense |
98 | %tr | 98 | %tr |
99 | %th | 99 | %th |
100 | Speed | 100 | Speed |
@@ -103,7 +103,7 @@ | |||
103 | - if @pokemon.nature_hinders?(:speed) | 103 | - if @pokemon.nature_hinders?(:speed) |
104 | %span.nature-hinder - | 104 | %span.nature-hinder - |
105 | %td | 105 | %td |
106 | .table-bubble.tb-bottom= @pokemon.revisions.last.speed | 106 | .table-bubble.tb-bottom= @pokemon.current.speed |
107 | %tr.pokemon-nature-label | 107 | %tr.pokemon-nature-label |
108 | %th{ colspan: 2 } Nature | 108 | %th{ colspan: 2 } Nature |
109 | %tr | 109 | %tr |
@@ -116,18 +116,18 @@ | |||
116 | %th | 116 | %th |
117 | %td | 117 | %td |
118 | .tb-only.pkv-has-hover | 118 | .tb-only.pkv-has-hover |
119 | = @pokemon.ability.name | 119 | = @pokemon.current.ability.name |
120 | .pkv-hover | 120 | .pkv-hover |
121 | .pc-data-name= @pokemon.ability.name | 121 | .pc-data-name= @pokemon.current.ability.name |
122 | = @pokemon.ability.description | 122 | = @pokemon.current.ability.description |
123 | .pokemon-tab.pokemon-moves | 123 | .pokemon-tab.pokemon-moves |
124 | %table | 124 | %table |
125 | - (1..4).each do |i| | 125 | - (1..4).each do |i| |
126 | = move_details @pokemon.revisions.last, i | 126 | = move_details @pokemon.current, i |
127 | .pokemon-tab.pokemon-contest= condition_diagram @pokemon.revisions.last | 127 | .pokemon-tab.pokemon-contest= condition_diagram @pokemon.current |
128 | .pokemon-tab.pokemon-ribbons | 128 | .pokemon-tab.pokemon-ribbons |
129 | %ul | 129 | %ul |
130 | - @pokemon.revisions.last.ribbons.each do |ribbon| | 130 | - @pokemon.current.ribbons.each do |ribbon| |
131 | %li.pkv-has-hover | 131 | %li.pkv-has-hover |
132 | = image_tag("pokeviewer/ribbons/#{ribbon[:filename]}") | 132 | = image_tag("pokeviewer/ribbons/#{ribbon[:filename]}") |
133 | .pkv-hover | 133 | .pkv-hover |