Skip to content

Commit

Permalink
Adds twitter handle to User
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Light committed Aug 20, 2011
1 parent d71edbd commit 1d7c594
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/models/user.rb
Expand Up @@ -12,6 +12,7 @@ class User
field :location, type: String
field :remote_local_preference, type: String, default: "Both"
field :interests, type: String
field :twitter, type: String

REMOTE_LOCAL_PREFERENCES = ["Local", "Remote", "Both"]

Expand Down
4 changes: 2 additions & 2 deletions app/views/home/index.html.haml
Expand Up @@ -8,12 +8,12 @@
= form_tag "/search", method: :get do
= text_field_tag "query", nil, class: "search-field", placeholder: "Search...", size: 35

#newest_remote_users.push_1.grid_3
#newest_remote_users
%h2 Newest remote
%ul
= render @newest_remote_users

#newest_local_users.push_4.grid_3.push_1
#newest_local_users
%h2 Newest in-person
%ul
= render @newest_local_users
6 changes: 4 additions & 2 deletions app/views/users/_user.html.haml
@@ -1,5 +1,7 @@
%li.user
= link_to image_tag("http://www.gravatar.com/avatar.php?gravatar_id=#{user.gravatar_id}"), user_path(user)
.user-info
%h4.user-name
= user.name
%h4.user-name= user.name
%h4.github-login= link_to user.github_login, "http://github.com/#{user.github_login}"
- if user.twitter
%h4.twitter-handle= link_to user.twitter, "http://twitter.com/#{user.twitter[1..-1]}"
3 changes: 3 additions & 0 deletions app/views/users/edit.html.haml
@@ -1,5 +1,8 @@
= form_for current_user, :url => user_path do |f|
%h3 Interested in...
%p
= f.label :twitter, "Twitter handle"
= f.text_field :twitter
%p
= f.label :remote_local_preference, "Pairing in person, remotely, or both?"
= f.select :remote_local_preference, User::REMOTE_LOCAL_PREFERENCES
Expand Down
4 changes: 4 additions & 0 deletions app/views/users/show.html.haml
Expand Up @@ -10,6 +10,10 @@
%li.email
%label E-mail
= link_to @user.email, "mailto:#{@user.email}"
- if @user.twitter.present?
%li.twitter
%label Twitter
= link_to @user.twitter, "http://twitter.com/#{@user.twitter[1..-1]}"
%li.pairing-preference
%label
Pairing preference
Expand Down
8 changes: 8 additions & 0 deletions sass/screen.sass
Expand Up @@ -39,6 +39,14 @@ body
.user-info
+float-right

#newest_remote_users
+grid-prefix(1,12)
+grid(4,12)

#newest_local_users
+grid-prefix(2,12)
+grid(4,12)

#search
+clearfix
+grid-prefix(9,12)
Expand Down
22 changes: 21 additions & 1 deletion stylesheets/screen.css
Expand Up @@ -158,6 +158,26 @@ body h5 {
}

/* line 42, ../sass/screen.sass */
#newest_remote_users {
padding-left: 80px;
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
width: 300px;
}

/* line 46, ../sass/screen.sass */
#newest_local_users {
padding-left: 160px;
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
width: 300px;
}

/* line 50, ../sass/screen.sass */
#search {
overflow: hidden;
*zoom: 1;
Expand All @@ -169,7 +189,7 @@ body h5 {
width: 220px;
}

/* line 48, ../sass/screen.sass */
/* line 56, ../sass/screen.sass */
#user-profile label {
font-weight: bold;
}

0 comments on commit 1d7c594

Please sign in to comment.