Skip to content

Commit

Permalink
adding player view, updating todos, added and organized stylesheet be…
Browse files Browse the repository at this point in the history
…tter, partialized some elements that looked messy, removed broken back button... and a bunch of improvements (_I think_)
  • Loading branch information
michaelparenteau committed Oct 3, 2010
1 parent 9ce778e commit ee50159
Show file tree
Hide file tree
Showing 17 changed files with 191 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
@@ -1,6 +1,6 @@
GIT GIT
remote: git://github.com/michaelparenteau/swish.git remote: git://github.com/michaelparenteau/swish.git
revision: a39808bcb578e2e35b522d77e1601cad1ec5e27f revision: 4cddac75d2f5766a72d506d46184453b8ea34420
specs: specs:
swish (0.6.0) swish (0.6.0)


Expand Down
48 changes: 33 additions & 15 deletions TODO.taskpaper
@@ -1,27 +1,28 @@
Player View: Player View:


- Link to here from Shot page (use player name from shot title as link) - Link to here from Shot page (use player name from shot title as link) @done
- Link to here from List of Players - Link to here from List of Players


# See some data about the player & use shot page as starting template # See some data about the player & use shot page as starting template
- player.name - player.name @done
- player.avatar_url - player.avatar_url @done
- player.url - player.url @done
- player.location - player.location @done
- Link to follow (player.twitter_screen_name) - Link to follow (player.twitter_screen_name) @done
- player.drafted_by_player_id - player.drafted_by_player_id as username


# Player stats # Player stats
- player.shots_count - player.shots_count @done
- Link to shots (separate view) => player.shots , or paginate: player.shots(:page => 2, :per_page => 10) - paginate shots: player.shots(:page => 2, :per_page => 10)
- player.draftees_count - player.draftees_count @done
- List Draftees (separate view) => player.draftees - player.followers_count @done
- player.followers_count - player.following_count @done
- player.following_count




Players List View(s): Players List View(s):


!!! api not sufficient yet for this

- List "All-Stars" - List "All-Stars"
- player.name - player.name
- player.avatar_url - player.avatar_url
Expand All @@ -38,12 +39,16 @@ Shot View:
- comment - comment


Tags List View: Tags List View:


!!! api not sufficient yet for this

- List of popular tags - List of popular tags
- Links to List of Shots (tagged) - Links to List of Shots (tagged)


Navigation: Navigation:


!!! api not sufficient yet for this

- Land on Grid Nav - Land on Grid Nav
- Items: - Items:
- Popular Shots - Popular Shots
Expand All @@ -52,4 +57,17 @@ Navigation:
- About hooppps - About hooppps
- Follow hooppps on Twitter - Follow hooppps on Twitter
- Find a Player - Find a Player
- Current "About" link in header will open this grid nav (will provide access to many points from anywhere in app) - Current "About" link in header will open this grid nav (will provide access to many
points from anywhere in app)

Breadcrumb history for "back" link:

- The "back" button in the header is a requesting url so it does not follow three pages
back. It will loop after the third page between the 2nd and third.

Format page:

- Design page for when "landscape mode" is in effect and if "viewport size" is not
optimal for the hooppps design. This is a mobile dribbble browser... it is not the
end-all app!

7 changes: 7 additions & 0 deletions app/controllers/player_controller.rb
@@ -0,0 +1,7 @@
class PlayerController < ApplicationController

def show
@player = Dribbble::Player.find(params[:id])
end

end
2 changes: 2 additions & 0 deletions app/helpers/player_helper.rb
@@ -0,0 +1,2 @@
module PlayerHelper
end
Binary file added app/views/.DS_Store
Binary file not shown.
9 changes: 9 additions & 0 deletions app/views/player/_player_shots.html.haml
@@ -0,0 +1,9 @@
- @player.shots.each do |shot|
%a{:href => shot_path(shot.id)}
= image_tag shot.image_url
%ul.stats
%li.views=shot.views_count
%li.comments=shot.comments_count
%li.likes=shot.likes_count
%li.view
%a{:href => shot_path(shot.id)} view &raquo;
16 changes: 16 additions & 0 deletions app/views/player/_player_stats.html.haml
@@ -0,0 +1,16 @@
%h3
Drafted by:
= @player.drafted_by_player_id
%ul.player_stats
%li
Shots
%span= @player.shots_count
%li
Draftees
%span= @player.draftees_count
%li
Followers
%span= @player.followers_count
%li
Following
%span= @player.following_count
17 changes: 17 additions & 0 deletions app/views/player/show.html.haml
@@ -0,0 +1,17 @@
#header
%h1.hooppps hooppps
/= link_to "back", :back, :class => 'back_button'
#content
.shot_meta
=image_tag @player.avatar_url
%h2
= @player.name
%span
= @player.location
%br
%a{:href => @player.website_url , :target => '_blank'}=@player.website_url
= render :partial => "player_stats"
%h3=@player.name+'\'s shots:'
= render :partial => "player_shots"

%a.big-pink{:href => "http://twitter.com/"+@player.twitter_screen_name , :target => "_blank"} Follow Player on Twitter
Binary file added app/views/shots/.DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions app/views/shots/_shots.html.haml
@@ -0,0 +1,12 @@
- @shots.each do |shot|
%a{:href => shot_path(shot.id)}
= image_tag shot.image_url
%ul.stats
%li.views
= shot.views_count
%li.comments
= shot.comments_count
%li.likes
= shot.likes_count
%li.view
%a{:href => shot_path(shot.id)} view &raquo;
13 changes: 1 addition & 12 deletions app/views/shots/index.html.haml
Expand Up @@ -2,18 +2,7 @@
%h1.hooppps hooppps %h1.hooppps hooppps
%a.about{:href => '#about'} About %a.about{:href => '#about'} About
#content #content
- @shots.each do |shot| = render :partial => "shots"
%a{:href => shot_path(shot.id)}
= image_tag shot.image_url
%ul.stats
%li.views
= shot.views_count
%li.comments
= shot.comments_count
%li.likes
= shot.likes_count
%li.view
%a{:href => shot_path(shot.id)} view &raquo;
- if @page == 1 - if @page == 1
= link_to raw("more shots &rsaquo;"), root_path(:page => @page + 1), :class => 'big-pink' = link_to raw("more shots &rsaquo;"), root_path(:page => @page + 1), :class => 'big-pink'
- elsif @page > 1 && @page < @shots.pages - elsif @page > 1 && @page < @shots.pages
Expand Down
5 changes: 3 additions & 2 deletions app/views/shots/show.html.haml
@@ -1,14 +1,15 @@
#header #header
%h1.hooppps hooppps %h1.hooppps hooppps
= link_to "back", request.env["HTTP_REFERER"], :class => 'back_button' /= link_to "back", :back, :class => 'back_button'
#content #content
.shot_meta .shot_meta
= image_tag @shot.player.avatar_url = image_tag @shot.player.avatar_url
%h2 %h2
= @shot.title = @shot.title
%span %span
%strong By: %strong By:
= @shot.player.name %a{:href => player_path(@shot.player.username)}
= @shot.player.name
= image_tag @shot.image_url = image_tag @shot.image_url
%ul.stats %ul.stats
%li.views %li.views
Expand Down
2 changes: 1 addition & 1 deletion config/environment.rb
Expand Up @@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__) require File.expand_path('../application', __FILE__)


# Initialize the rails application # Initialize the rails application
Hooppps::Application.initialize! Hooppps::Application.initialize!
1 change: 1 addition & 0 deletions config/routes.rb
@@ -1,5 +1,6 @@
Hooppps::Application.routes.draw do Hooppps::Application.routes.draw do
resources :shots resources :shots
resources :player
# The priority is based upon order of creation: # The priority is based upon order of creation:
# first created -> highest priority. # first created -> highest priority.


Expand Down
91 changes: 76 additions & 15 deletions public/stylesheets/hooppps.css
@@ -1,3 +1,5 @@
/* basic html
---------------------------------------------*/
html {-webkit-text-size-adjust:none} html {-webkit-text-size-adjust:none}
body { body {
background-color: #b0b0b0; background-color: #b0b0b0;
Expand All @@ -16,12 +18,34 @@ a:visited {
h3 { h3 {
font-weight: normal; font-weight: normal;
} }


/* structure & #content specified text
---------------------------------------------*/
#header { #header {
border-bottom: 1px solid #8d98a0; border-bottom: 1px solid #8d98a0;
height: 45px; height: 45px;
background: url(img/toolbar.png) 0 0 #6d84a2 repeat-x; background: url(img/toolbar.png) 0 0 #6d84a2 repeat-x;
width: 100%; width: 100%;
} }
#content {
padding: 10px;
}
#content img {
max-width: 100% !important;
display: block;
width: auto;
height: auto;
margin: 0 auto;
margin-bottom: 10px;
}
#content h3 {
font-weight: bold;
text-shadow: 0px 1px 1px #eee;
}

/* header
---------------------------------------------*/
#header h1.hooppps { #header h1.hooppps {
text-indent: 37px; text-indent: 37px;
line-height: 45px; line-height: 45px;
Expand Down Expand Up @@ -66,20 +90,10 @@ h3 {
#header a.back_button:active { #header a.back_button:active {
background: #ae446e url(img/buttons/glare.png) 0 0 repeat-x; background: #ae446e url(img/buttons/glare.png) 0 0 repeat-x;
} }
#content {
padding: 10px;
} /* about
#content img { ---------------------------------------------*/
max-width: 100% !important;
display: block;
width: auto;
height: auto;
margin: 0 auto;
margin-bottom: 10px;
}
#content a {
color: #fff;
}
#about { #about {
display: none; display: none;
margin: 10px; margin: 10px;
Expand All @@ -91,6 +105,10 @@ h3 {
#about a { #about a {
color: #EA4C88; color: #EA4C88;
} }


/* shot stats
---------------------------------------------*/
#content ul.stats { #content ul.stats {
margin: 10px 0; margin: 10px 0;
background: #9d9fa1; background: #9d9fa1;
Expand All @@ -99,7 +117,6 @@ h3 {
padding: 10px; padding: 10px;
position: relative; position: relative;
} }

#content ul.stats li { #content ul.stats li {
list-style-type: none; list-style-type: none;
display: inline-block; display: inline-block;
Expand Down Expand Up @@ -142,12 +159,17 @@ h3 {
font-weight: bold; font-weight: bold;
text-shadow: 0px 1px 1px #000; text-shadow: 0px 1px 1px #000;
} }


/* shot title & meta
---------------------------------------------*/
#content .shot_meta { #content .shot_meta {
min-height: 50px; min-height: 50px;
} }
#content .shot_meta h2 { #content .shot_meta h2 {
padding: 0 0 0 65px; padding: 0 0 0 65px;
color: #333; color: #333;
text-shadow: 0px 1px 1px #eee;
} }
#content .shot_meta img { #content .shot_meta img {
position: absolute; position: absolute;
Expand All @@ -161,6 +183,15 @@ h3 {
font-size: 14px; font-size: 14px;
display: block; display: block;
} }
#content .shot_meta h2 span a:link,
#content .shot_meta h2 span a:visited {
color: #EA4C88;
font-weight: bold;
}


/* Button styles
---------------------------------------------*/
#content a.big-pink:link, #content a.big-pink:link,
#content a.big-pink:visited { #content a.big-pink:visited {
display: block; display: block;
Expand Down Expand Up @@ -222,3 +253,33 @@ h3 {
text-align: center; text-align: center;
width: 24%; width: 24%;
} }


/* player stats
---------------------------------------------*/
#content ul.player_stats {
margin: 10px 0;
background: #9d9fa1;
border: 1px solid #989a9b;
border-radius: 4px;
padding: 10px;
position: relative;
}
#content ul.player_stats li {
list-style-type: none;
display: inline-block;
font-size: 10px;
font-weight: bold;
line-height: px;
text-align: center;
width: 23%;
border-right: 1px solid #666;
}
#content ul.player_stats li:last-child {
border: none;
}
#content ul.player_stats li span {
display: block;
font-size: 24px;
text-shadow: 0px 1px 1px #ccc;
}
8 changes: 8 additions & 0 deletions test/functional/player_controller_test.rb
@@ -0,0 +1,8 @@
require 'test_helper'

class PlayerControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
4 changes: 4 additions & 0 deletions test/unit/helpers/player_helper_test.rb
@@ -0,0 +1,4 @@
require 'test_helper'

class PlayerHelperTest < ActionView::TestCase
end

0 comments on commit ee50159

Please sign in to comment.