From 1d7c5940658b8581ceb4ed2ce7730b263a7a13f4 Mon Sep 17 00:00:00 2001 From: Evan Light Date: Sat, 20 Aug 2011 12:52:19 -0400 Subject: [PATCH] Adds twitter handle to User --- app/models/user.rb | 1 + app/views/home/index.html.haml | 4 ++-- app/views/users/_user.html.haml | 6 ++++-- app/views/users/edit.html.haml | 3 +++ app/views/users/show.html.haml | 4 ++++ sass/screen.sass | 8 ++++++++ stylesheets/screen.css | 22 +++++++++++++++++++++- 7 files changed, 43 insertions(+), 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 016d13d..b0455a4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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"] diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 020713a..6da7a64 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -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 diff --git a/app/views/users/_user.html.haml b/app/views/users/_user.html.haml index dabfad2..8000536 100644 --- a/app/views/users/_user.html.haml +++ b/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]}" diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 6cc947f..027c04c 100644 --- a/app/views/users/edit.html.haml +++ b/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 diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 9337f15..23085ae 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -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 diff --git a/sass/screen.sass b/sass/screen.sass index 63c2b8e..48b876b 100644 --- a/sass/screen.sass +++ b/sass/screen.sass @@ -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) diff --git a/stylesheets/screen.css b/stylesheets/screen.css index a92e30a..386570d 100644 --- a/stylesheets/screen.css +++ b/stylesheets/screen.css @@ -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; @@ -169,7 +189,7 @@ body h5 { width: 220px; } -/* line 48, ../sass/screen.sass */ +/* line 56, ../sass/screen.sass */ #user-profile label { font-weight: bold; }