From 5956609f70c72a26f64f9b8ec8b3d6d780ba5c2d Mon Sep 17 00:00:00 2001
From: Kelly Rauchenberger <fefferburbia@gmail.com>
Date: Fri, 13 Oct 2017 10:57:20 -0400
Subject: Added gender symbol to Pokémon display
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/assets/stylesheets/pokeviewer/pokemon.css.scss | 20 +++++++++++++++-----
 app/models/pokeviewer/pokemon.rb                   | 11 +++++++++++
 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 @@
   border: 1px solid #888;
   overflow: hidden;
 
-  .male {
-    color: blue;
-  }
+  .ot-gender {
+    &.male {
+      color: blue;
+    }
 
-  .female {
-    color: red;
+    &.female {
+      color: red;
+    }
   }
 
   .pokemon-name {
@@ -219,6 +221,14 @@
 
     .pokemon-gender {
       float: right;
+
+      &.female {
+        color: #ff6363;
+      }
+
+      &.male {
+        color: #00a2ff;
+      }
     }
 
     .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
       end
     end
 
+    def gender_symbol
+      case gender.intern
+      when :female
+        "♀"
+      when :male
+        "♂"
+      when :genderless
+        ""
+      end
+    end
+
     private
 
       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 @@
     .pokemon-nameline
       = image_tag(@pokemon.pokeball_icon_path, class: "pokemon-ball")
       %span.pokemon-name= @pokemon.revisions.last.nickname
-      %span.pokemon-gender N
+      %span.pokemon-gender{ class: @pokemon.gender }= @pokemon.gender_symbol
     .pokemon-level= "Lv. #{@pokemon.revisions.last.level}"
     .pokemon-image
       .pokemon-image-wrap= image_tag @pokemon.sprite_path
-- 
cgit 1.4.1