diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-26 17:47:16 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-09-26 17:47:16 -0400 |
| commit | 3e4e4583fb751fb47013580ce86e2cc3a0e8353b (patch) | |
| tree | 8118827bf1f2aa7ac9d967c3d4cc135390f03f23 /app | |
| parent | a65972d34188d14dca10193950732d506d931e8c (diff) | |
| download | pokeviewer-3e4e4583fb751fb47013580ce86e2cc3a0e8353b.tar.gz pokeviewer-3e4e4583fb751fb47013580ce86e2cc3a0e8353b.tar.bz2 pokeviewer-3e4e4583fb751fb47013580ce86e2cc3a0e8353b.zip | |
Added section on homepage for Pokémon not in any game
Diffstat (limited to 'app')
| -rw-r--r-- | app/assets/stylesheets/pokeviewer/pokemon.css.scss | 54 | ||||
| -rw-r--r-- | app/controllers/pokeviewer/pokemon_controller.rb | 1 | ||||
| -rw-r--r-- | app/models/pokeviewer/pokemon.rb | 2 | ||||
| -rw-r--r-- | app/views/pokeviewer/pokemon/index.html.haml | 13 |
4 files changed, 51 insertions, 19 deletions
| diff --git a/app/assets/stylesheets/pokeviewer/pokemon.css.scss b/app/assets/stylesheets/pokeviewer/pokemon.css.scss index 83fac45..766a0e0 100644 --- a/app/assets/stylesheets/pokeviewer/pokemon.css.scss +++ b/app/assets/stylesheets/pokeviewer/pokemon.css.scss | |||
| @@ -47,6 +47,14 @@ | |||
| 47 | background-color: #4E8234; | 47 | background-color: #4E8234; |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | &.unaccounted { | ||
| 51 | background-color: black; | ||
| 52 | |||
| 53 | h2 { | ||
| 54 | color: white; | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 50 | h2 { | 58 | h2 { |
| 51 | margin: 0; | 59 | margin: 0; |
| 52 | display: inline-block; | 60 | display: inline-block; |
| @@ -114,29 +122,39 @@ | |||
| 114 | width: 32px; | 122 | width: 32px; |
| 115 | height: 32px; | 123 | height: 32px; |
| 116 | } | 124 | } |
| 117 | |||
| 118 | .pc-pokemon { | ||
| 119 | .pc-data { | ||
| 120 | display: none; | ||
| 121 | background-color: #111; | ||
| 122 | color: #fff; | ||
| 123 | z-index: 1; | ||
| 124 | padding: .5em; | ||
| 125 | box-shadow: 0px 0px 2px 1px #B3B3B3; | ||
| 126 | border-radius: 4px; | ||
| 127 | position: absolute; | ||
| 128 | |||
| 129 | .pc-data-name { | ||
| 130 | font-weight: bold; | ||
| 131 | white-space: pre; | ||
| 132 | } | ||
| 133 | } | ||
| 134 | } | ||
| 135 | } | 125 | } |
| 136 | } | 126 | } |
| 137 | } | 127 | } |
| 138 | } | 128 | } |
| 139 | 129 | ||
| 130 | .pc-pokemon { | ||
| 131 | .pc-data { | ||
| 132 | display: none; | ||
| 133 | background-color: #111; | ||
| 134 | color: #fff; | ||
| 135 | z-index: 1; | ||
| 136 | padding: .5em; | ||
| 137 | box-shadow: 0px 0px 2px 1px #B3B3B3; | ||
| 138 | border-radius: 4px; | ||
| 139 | position: absolute; | ||
| 140 | |||
| 141 | .pc-data-name { | ||
| 142 | font-weight: bold; | ||
| 143 | white-space: pre; | ||
| 144 | } | ||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 148 | .pokemon-list { | ||
| 149 | display: flex; | ||
| 150 | flex-wrap: wrap; | ||
| 151 | padding: 0 1em; | ||
| 152 | |||
| 153 | li { | ||
| 154 | display: block; | ||
| 155 | } | ||
| 156 | } | ||
| 157 | |||
| 140 | .pokemon { | 158 | .pokemon { |
| 141 | font-family: 'Power Green'; | 159 | font-family: 'Power Green'; |
| 142 | display: flex; | 160 | display: flex; |
| diff --git a/app/controllers/pokeviewer/pokemon_controller.rb b/app/controllers/pokeviewer/pokemon_controller.rb index 44ee791..17bd83d 100644 --- a/app/controllers/pokeviewer/pokemon_controller.rb +++ b/app/controllers/pokeviewer/pokemon_controller.rb | |||
| @@ -4,6 +4,7 @@ module Pokeviewer | |||
| 4 | class PokemonController < ApplicationController | 4 | class PokemonController < ApplicationController |
| 5 | def index | 5 | def index |
| 6 | @trainers = Trainer.all | 6 | @trainers = Trainer.all |
| 7 | @unaccounted = Pokemon.where(trainer: nil) | ||
| 7 | end | 8 | end |
| 8 | 9 | ||
| 9 | def show | 10 | def show |
| diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb index e493c66..7a1d088 100644 --- a/app/models/pokeviewer/pokemon.rb +++ b/app/models/pokeviewer/pokemon.rb | |||
| @@ -102,7 +102,7 @@ module Pokeviewer | |||
| 102 | end | 102 | end |
| 103 | 103 | ||
| 104 | def outsider? | 104 | def outsider? |
| 105 | (ot_name != trainer.name) or (ot_number != trainer.number) | 105 | (trainer.nil?) or (ot_name != trainer.name) or (ot_number != trainer.number) |
| 106 | end | 106 | end |
| 107 | 107 | ||
| 108 | def location | 108 | def location |
| diff --git a/app/views/pokeviewer/pokemon/index.html.haml b/app/views/pokeviewer/pokemon/index.html.haml index 436f48a..7cee27a 100644 --- a/app/views/pokeviewer/pokemon/index.html.haml +++ b/app/views/pokeviewer/pokemon/index.html.haml | |||
| @@ -27,3 +27,16 @@ | |||
| 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 |
| 30 | - if @unaccounted.any? | ||
| 31 | .trainer | ||
| 32 | .trainer-info.unaccounted | ||
| 33 | %h2 Pokémon Not In Any Game | ||
| 34 | %ul.pokemon-list | ||
| 35 | - @unaccounted.each do |p| | ||
| 36 | %li.pc-pokemon | ||
| 37 | = link_to image_tag(p.icon_path), p | ||
| 38 | .pc-data | ||
| 39 | .pc-data-name= p.revisions.last.nickname | ||
| 40 | .pc-data-ot | ||
| 41 | OT/ | ||
| 42 | %span{ class: p.ot_gender }>= p.ot_name | ||
