From 2c66bbbe00c70474b822eb8307733cc953930aa7 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 19 Oct 2010 13:51:31 -0700 Subject: [PATCH 1/4] Strip profile names, resolve 357 --- app/models/profile.rb | 7 +++++++ spec/models/profile_spec.rb | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/models/profile.rb b/app/models/profile.rb index ecc0fb5ef..328fa45c0 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -19,6 +19,8 @@ class Profile validates_presence_of :first_name, :last_name + before_save :strip_names + def person_id self._parent_document.id end @@ -27,4 +29,9 @@ class Profile self._parent_document end + private + def strip_names + first_name.strip! + last_name.strip! + end end diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index 7bba8311c..4830652f8 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -9,6 +9,15 @@ describe Profile do @person = Factory.build(:person) end + describe 'sanitization' do + it 'strips the names' do + @person.profile = Factory.build(:profile, :first_name => " Bob", :last_name => "Bobson ") + @person.profile.save + @person.profile.first_name.should == "Bob" + @person.profile.last_name.should == "Bobson" + end + end + describe 'requirements' do it "should include a first name" do @person.profile = Factory.build(:profile,:first_name => nil) @@ -23,7 +32,5 @@ describe Profile do @person.profile.last_name = "Smith" @person.profile.valid?.should be true end - end - end From b218a53bf78455252c2701815ee9ec4cf7ed58f0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 19 Oct 2010 14:06:44 -0700 Subject: [PATCH 2/4] fancyboxes have title bars now, kind of. --- app/views/albums/_new_album.haml | 18 ++++++++------- app/views/aspects/_new_aspect.haml | 18 +++++++++------ app/views/invitations/_new.haml | 29 +++++++++++++----------- app/views/requests/_new_request.haml | 28 ++++++++++++----------- public/stylesheets/sass/application.sass | 14 ++++++++++++ 5 files changed, 66 insertions(+), 41 deletions(-) diff --git a/app/views/albums/_new_album.haml b/app/views/albums/_new_album.haml index 07431d20c..d7bd2d997 100644 --- a/app/views/albums/_new_album.haml +++ b/app/views/albums/_new_album.haml @@ -2,12 +2,14 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%h1=t('.add_a_new_album') +.span-12.last + .modal_title_bar + %h4= t('.add_a_new_album') -= form_for Album.new do |f| - = f.error_messages - %p - = f.label :name - = f.text_field :name - = f.hidden_field :to, :value => aspect - = f.submit t('.create'), :class => 'button' + = form_for Album.new do |f| + = f.error_messages + %p + = f.label :name + = f.text_field :name + = f.hidden_field :to, :value => aspect + = f.submit t('.create'), :class => 'button' diff --git a/app/views/aspects/_new_aspect.haml b/app/views/aspects/_new_aspect.haml index 151ab07d4..a3dec9d31 100644 --- a/app/views/aspects/_new_aspect.haml +++ b/app/views/aspects/_new_aspect.haml @@ -2,10 +2,14 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%h1=t('.add_a_new_aspect') -= form_for Aspect.new do |aspect| - = aspect.error_messages - %p - = aspect.label :name - = aspect.text_field :name - = aspect.submit t('.create'), :class => 'button' +.span-12.last + .modal_title_bar + %h4= t('.add_a_new_aspect') + + = form_for Aspect.new do |aspect| + = aspect.error_messages + %p + = aspect.label :name + = aspect.text_field :name + = aspect.submit t('.create'), :class => 'button' + diff --git a/app/views/invitations/_new.haml b/app/views/invitations/_new.haml index 8c540092b..8619562a3 100644 --- a/app/views/invitations/_new.haml +++ b/app/views/invitations/_new.haml @@ -1,15 +1,18 @@ -%h2 Send invitation -= form_for User.new, :url => invitation_path(User) do |invite| - %p - = invite.label :email - = invite.text_field :email - To - - unless @aspect.is_a? Aspect - = invite.select(:aspects, @aspects_dropdown_array) - - else - = invite.select(:aspects, @aspects_dropdown_array, :selected => @aspect.id) - Message: - = invite.text_area :invite_messages +.span-12.last + .modal_title_bar + %h4 Send invitation - %p= invite.submit "Send an invitation" + = form_for User.new, :url => invitation_path(User) do |invite| + %p + = invite.label :email + = invite.text_field :email + To + - unless @aspect.is_a? Aspect + = invite.select(:aspects, @aspects_dropdown_array) + - else + = invite.select(:aspects, @aspects_dropdown_array, :selected => @aspect.id) + Message: + = invite.text_area :invite_messages + + %p= invite.submit "Send an invitation" diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index 68ee5922e..4c12486b8 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -2,20 +2,22 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%h1 - =t('.add_a_new_friend_to') - %i= aspect.name +.span-12.last + .modal_title_bar + %h4 + =t('.add_a_new_friend_to') + %i= aspect.name -= form_for Request.new do |fr_request| - = fr_request.error_messages + = form_for Request.new do |fr_request| + = fr_request.error_messages - =t('.enter_a_diaspora_username') - %br - %i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle + =t('.enter_a_diaspora_username') + %br + %i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle - %p - = fr_request.label :destination_url, t(".friends_username") - = fr_request.text_field :destination_url - = fr_request.hidden_field :aspect_id, :value => aspect.id - = fr_request.submit + %p + = fr_request.label :destination_url, t(".friends_username") + = fr_request.text_field :destination_url + = fr_request.hidden_field :aspect_id, :value => aspect.id + = fr_request.submit diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 360d64967..bac5ca956 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -341,6 +341,7 @@ li.message :display block :height 100% :padding 2px 5px + :cursor default &:hover :background @@ -1044,3 +1045,16 @@ header h2 :display inline + +.modal_title_bar + :width 100% + :background + :color #333 + :margin + :bottom 2em + h4 + :color #fff + :padding 10px 20px + :font + :size small + From ea36790e2121d4607cba7c19c61d67eb7a78bfd8 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 19 Oct 2010 14:06:57 -0700 Subject: [PATCH 3/4] Add gzipped source.tar to gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 379d97a20..a17dc3a1b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ public/stylesheets/ui.css # Uploded files and local files public/uploads/* -public/source.tar +public/source.tar* tmp/**/* db/*.sqlite3 From 8dbd61f167120881eec03ebd4ab5f368ae5d5ef9 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Tue, 19 Oct 2010 23:39:22 +0200 Subject: [PATCH 4/4] Point fix: error in diaspora-setup (x2) blocks build. --- pkg/fedora/diaspora-setup | 7 ++++--- pkg/ubuntu/diaspora-setup | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/fedora/diaspora-setup b/pkg/fedora/diaspora-setup index a1df72fbc..0fa90dc9e 100755 --- a/pkg/fedora/diaspora-setup +++ b/pkg/fedora/diaspora-setup @@ -43,13 +43,14 @@ fi chmod 777 /var/lib/diaspora/uploads chown -R diaspora /var/log/diaspora +hostname=$( awk '/pod_url:/ { print $2; exit }'