From edae8f1e66bce20f0d03b3961c17ac9ce724d7d0 Mon Sep 17 00:00:00 2001 From: Daniel Vincent Grippi Date: Wed, 8 Sep 2010 11:58:03 -0700 Subject: [PATCH 1/4] DG MS; fixed a view bug in user edit page. page also displays diaspora username . --- app/models/user.rb | 4 ++++ app/views/requests/_new_request.haml | 7 +++++-- app/views/users/edit.html.haml | 11 ++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 6466e5d3e..a8c7411c9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -261,6 +261,10 @@ class User terse end + def diaspora_handle + "#{self.username}@#{self.terse_url}" + end + def do_bad_things self.password_confirmation = self.password end diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index 13aba98d9..87b9776b8 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -5,9 +5,12 @@ = form_for Request.new do |f| = f.error_messages - Enter a Diaspora URL, Diaspora username, or random email address: + Enter a Diaspora username: + %br + %i= "Your Diaspora username is: #{current_user.diaspora_handle}" + %p - = f.label :destination_url, "Your Diaspora URL is: #{current_user.username}@#{request.host}" + = f.label :destination_url, "Friend's username" = f.text_field :destination_url = f.hidden_field :group_id, :value => @group.id = f.submit diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index e4c884d83..d8866d275 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -25,8 +25,13 @@ = link_to image_tag(photo.url(:thumb_medium)), "#" =will_paginate @photos - %h3 Info + + %p + %b + DIASPORA USERNAME: + = @user.diaspora_handle + %p = p.label :first_name = p.text_field :first_name, :value => @profile.first_name @@ -38,10 +43,6 @@ = f.label :email = f.text_field :email - %p - = f.label :url - = f.text_field :url - #submit_block = link_to "Cancel", root_path or From 5fd105c1dc7da6f34664f4e77bf937b72c1b5ac1 Mon Sep 17 00:00:00 2001 From: Daniel Vincent Grippi Date: Wed, 8 Sep 2010 12:04:05 -0700 Subject: [PATCH 2/4] DG MS; search now links user names if you're friends with them --- app/views/people/index.html.haml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index bbd50ddd0..e550ae090 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -18,7 +18,11 @@ %th url - for person in @people %tr - %td= person.real_name + - if current_user.friends.include? person + %td= link_to person.real_name, person + - else + %td= person.real_name + %td= person.email %td= person.url From f7dd0b10b950be3aa5dbe5c36688b24db96a427e Mon Sep 17 00:00:00 2001 From: Daniel Vincent Grippi Date: Wed, 8 Sep 2010 12:34:08 -0700 Subject: [PATCH 3/4] DG MS; changed the gear on top nav to not be a tab --- app/models/user.rb | 3 +-- app/views/shared/_group_nav.haml | 5 ++--- public/stylesheets/application.css | 7 +++++++ public/stylesheets/sass/application.sass | 13 +++++++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index a8c7411c9..1fbc1a849 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -255,8 +255,7 @@ class User end def terse_url - terse= self.url.gsub(/https?:\/\//, '') - terse.gsub!(/www\./, '') + terse = self.url.gsub(/(https?:|www\.)\/\//, '') terse = terse.chop! if terse[-1, 1] == '/' terse end diff --git a/app/views/shared/_group_nav.haml b/app/views/shared/_group_nav.haml index 70968780a..8dee94dc9 100644 --- a/app/views/shared/_group_nav.haml +++ b/app/views/shared/_group_nav.haml @@ -9,9 +9,8 @@ %li.new_group= link_to("+", "#add_group_pane", :id => "add_group_button") - %li - %span{:class => '⚙'} - = link_to "⚙", edit_group_path(Group.first), :class => "edit_group_button", :title => "Manage your facets." + #group_edit_button + = link_to "edit", edit_group_path(Group.first), :class => "edit_group_button", :title => "Manage your facets." .yo{ :style => "display:none;"} #add_group_pane diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 75ba1f34c..9a6a61cbc 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -448,7 +448,14 @@ h1.big_text { display: none; } #group_nav { + position: relative; color: black; } + #group_nav #group_edit_button { + display: inline; + margin-top: 1px; + font-size: 12px; } + #group_nav #group_edit_button a { + color: #999999; } #group_nav ul { margin-bottom: 0; padding: 0; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b774327f6..76a14df91 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -567,7 +567,19 @@ h1.big_text :display none #group_nav + :position relative :color #000 + + #group_edit_button + :display inline + :margin + :top 1px + :font + :size 12px + + a + :color #999 + ul :margin :bottom 0 @@ -602,6 +614,7 @@ h1.big_text a :color #999 + .selected :font From 20d5043e8196da1d7f2e17c5a41d100fa64d9cc0 Mon Sep 17 00:00:00 2001 From: Daniel Vincent Grippi Date: Wed, 8 Sep 2010 12:52:28 -0700 Subject: [PATCH 4/4] DG MS; moved tabs around up top --- app/views/shared/_group_nav.haml | 6 ++++-- public/stylesheets/application.css | 5 +++++ public/stylesheets/sass/application.sass | 7 +++++++ public/stylesheets/sass/ui.sass | 2 -- public/stylesheets/ui.css | 3 +-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/views/shared/_group_nav.haml b/app/views/shared/_group_nav.haml index 8dee94dc9..6e400001d 100644 --- a/app/views/shared/_group_nav.haml +++ b/app/views/shared/_group_nav.haml @@ -1,7 +1,5 @@ #group_nav %ul - %li{:class => ("selected" if @group == :all)} - = link_to "All Groups", root_url - for group in @groups %li{:id => group.id, :class => ("selected" if current_group?(group))} %span.group_name @@ -12,6 +10,10 @@ #group_edit_button = link_to "edit", edit_group_path(Group.first), :class => "edit_group_button", :title => "Manage your facets." + %ul{ :style => "position:absolute;right:0;bottom:0;"} + %li{:class => ("selected" if @group == :all)} + = link_to "All Groups", root_url + .yo{ :style => "display:none;"} #add_group_pane = render "groups/new_group" diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 9a6a61cbc..709db609b 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -458,9 +458,12 @@ h1.big_text { color: #999999; } #group_nav ul { margin-bottom: 0; + margin-right: 0; padding: 0; padding-bottom: 0px; padding-top: 35px; + padding-right: 0; + display: inline-block; list-style: none; font-size: 14px; } #group_nav ul > li { @@ -469,6 +472,8 @@ h1.big_text { margin-right: 0.5em; padding: 3px 8px; border: 1px solid #555555; } + #group_nav ul > li.last-child { + margin-right: 0; } #group_nav ul > li a { color: #999999; } #group_nav ul > li a:hover { diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 76a14df91..2e9454234 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -583,9 +583,12 @@ h1.big_text ul :margin :bottom 0 + :right 0 :padding 0 :bottom 0px :top 35px + :right 0 + :display inline-block :list :style none :font @@ -601,6 +604,10 @@ h1.big_text :border 1px solid #555 + &.last-child + :margin + :right 0 + a :color #999 &:hover diff --git a/public/stylesheets/sass/ui.sass b/public/stylesheets/sass/ui.sass index ee01e08bc..e680232e6 100644 --- a/public/stylesheets/sass/ui.sass +++ b/public/stylesheets/sass/ui.sass @@ -89,8 +89,6 @@ ul.button_set .right :position absolute :right 0 - :margin - :top 5px .contextual_pane :z-index 20 diff --git a/public/stylesheets/ui.css b/public/stylesheets/ui.css index dd791bafb..6a0dd8850 100644 --- a/public/stylesheets/ui.css +++ b/public/stylesheets/ui.css @@ -57,8 +57,7 @@ ul.button_set { .right { position: absolute; - right: 0; - margin-top: 5px; } + right: 0; } .contextual_pane { z-index: 20;