From d3b6f8d9dc6fcd978dd28acbd7aca45f7889c478 Mon Sep 17 00:00:00 2001 From: Julien Truchet Date: Mon, 22 Aug 2016 16:09:25 +0200 Subject: [PATCH 1/2] Added nickname mapping and display on pokemon card --- app/assets/stylesheets/pokemon.scss | 7 +++++++ app/models/pokemon.rb | 1 + app/views/pokemons/_pokemon.html.erb | 3 +++ 3 files changed, 11 insertions(+) diff --git a/app/assets/stylesheets/pokemon.scss b/app/assets/stylesheets/pokemon.scss index 3f2bca8..90decfa 100644 --- a/app/assets/stylesheets/pokemon.scss +++ b/app/assets/stylesheets/pokemon.scss @@ -63,6 +63,13 @@ font-size: 1.4rem; } } + .nickname { + margin-top: 0px; + margin-bottom: 0px; + font-size: 2.0rem; + font-weight: bold; + position: relative; + } .name { margin-top: 0px; margin-bottom: 0px; diff --git a/app/models/pokemon.rb b/app/models/pokemon.rb index a90ddfc..0c390b8 100644 --- a/app/models/pokemon.rb +++ b/app/models/pokemon.rb @@ -1,6 +1,7 @@ class Pokemon < ApplicationRecord belongs_to :user, dependent: :destroy validates :poke_id, presence: true + validates :nickname, presence: true validates :move_1, presence: true validates :move_2, presence: true validates :max_health, presence: true diff --git a/app/views/pokemons/_pokemon.html.erb b/app/views/pokemons/_pokemon.html.erb index 81eb96a..144c38e 100644 --- a/app/views/pokemons/_pokemon.html.erb +++ b/app/views/pokemons/_pokemon.html.erb @@ -22,6 +22,9 @@
+ + + From efa899d307ad2466f7b1308cb7e1b21bc64a8e01 Mon Sep 17 00:00:00 2001 From: Julien Truchet Date: Thu, 15 Sep 2016 10:58:56 +0200 Subject: [PATCH 2/2] [NICKNAME] Bigger size for pokemon-card --- app/assets/stylesheets/pokemon.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pokemon.scss b/app/assets/stylesheets/pokemon.scss index 90decfa..84ae6df 100644 --- a/app/assets/stylesheets/pokemon.scss +++ b/app/assets/stylesheets/pokemon.scss @@ -10,7 +10,7 @@ color: rgba(0,0,0,.46); } .pokemon-card { - height: 25rem; + height: 27rem; position: relative; table { width: 100%;
<%=pokemon[:nickname]%>
<%=pokemon[:poke_id]%> <%=pokemon[:cp]%>