diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-13 10:57:20 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-13 10:57:20 -0400 |
commit | 5956609f70c72a26f64f9b8ec8b3d6d780ba5c2d (patch) | |
tree | 8330c36cd5a02f022720577922148f9698685923 /app | |
parent | cb6eebdf05c95f15ad6ce8968838772a2b915755 (diff) | |
download | pokeviewer-5956609f70c72a26f64f9b8ec8b3d6d780ba5c2d.tar.gz pokeviewer-5956609f70c72a26f64f9b8ec8b3d6d780ba5c2d.tar.bz2 pokeviewer-5956609f70c72a26f64f9b8ec8b3d6d780ba5c2d.zip |
Added gender symbol to Pokémon display
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/pokeviewer/pokemon.css.scss | 20 | ||||
-rw-r--r-- | app/models/pokeviewer/pokemon.rb | 11 | ||||
-rw-r--r-- | app/views/pokeviewer/pokemon/show.html.haml | 2 |
3 files changed, 27 insertions, 6 deletions
diff --git a/app/assets/stylesheets/pokeviewer/pokemon.css.scss b/app/assets/stylesheets/pokeviewer/pokemon.css.scss index 9d2db44..b7f9358 100644 --- a/app/assets/stylesheets/pokeviewer/pokemon.css.scss +++ b/app/assets/stylesheets/pokeviewer/pokemon.css.scss | |||
@@ -174,12 +174,14 @@ | |||
174 | border: 1px solid #888; | 174 | border: 1px solid #888; |
175 | overflow: hidden; | 175 | overflow: hidden; |
176 | 176 | ||
177 | .male { | 177 | .ot-gender { |
178 | color: blue; | 178 | &.male { |
179 | } | 179 | color: blue; |
180 | } | ||
180 | 181 | ||
181 | .female { | 182 | &.female { |
182 | color: red; | 183 | color: red; |
184 | } | ||
183 | } | 185 | } |
184 | 186 | ||
185 | .pokemon-name { | 187 | .pokemon-name { |
@@ -219,6 +221,14 @@ | |||
219 | 221 | ||
220 | .pokemon-gender { | 222 | .pokemon-gender { |
221 | float: right; | 223 | float: right; |
224 | |||
225 | &.female { | ||
226 | color: #ff6363; | ||
227 | } | ||
228 | |||
229 | &.male { | ||
230 | color: #00a2ff; | ||
231 | } | ||
222 | } | 232 | } |
223 | 233 | ||
224 | .pokemon-level { | 234 | .pokemon-level { |
diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb index f65d68e..36ed8a8 100644 --- a/app/models/pokeviewer/pokemon.rb +++ b/app/models/pokeviewer/pokemon.rb | |||
@@ -194,6 +194,17 @@ module Pokeviewer | |||
194 | end | 194 | end |
195 | end | 195 | end |
196 | 196 | ||
197 | def gender_symbol | ||
198 | case gender.intern | ||
199 | when :female | ||
200 | "♀" | ||
201 | when :male | ||
202 | "♂" | ||
203 | when :genderless | ||
204 | "" | ||
205 | end | ||
206 | end | ||
207 | |||
197 | private | 208 | private |
198 | 209 | ||
199 | def set_uuid | 210 | def set_uuid |
diff --git a/app/views/pokeviewer/pokemon/show.html.haml b/app/views/pokeviewer/pokemon/show.html.haml index 6c478ef..f3568fb 100644 --- a/app/views/pokeviewer/pokemon/show.html.haml +++ b/app/views/pokeviewer/pokemon/show.html.haml | |||
@@ -3,7 +3,7 @@ | |||
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.revisions.last.nickname |
6 | %span.pokemon-gender N | 6 | %span.pokemon-gender{ class: @pokemon.gender }= @pokemon.gender_symbol |
7 | .pokemon-level= "Lv. #{@pokemon.revisions.last.level}" | 7 | .pokemon-level= "Lv. #{@pokemon.revisions.last.level}" |
8 | .pokemon-image | 8 | .pokemon-image |
9 | .pokemon-image-wrap= image_tag @pokemon.sprite_path | 9 | .pokemon-image-wrap= image_tag @pokemon.sprite_path |