Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
24b136bbd9
10 changed files with 91 additions and 50 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -13,7 +13,7 @@ public/stylesheets/ui.css
|
||||||
|
|
||||||
# Uploded files and local files
|
# Uploded files and local files
|
||||||
public/uploads/*
|
public/uploads/*
|
||||||
public/source.tar
|
public/source.tar*
|
||||||
tmp/**/*
|
tmp/**/*
|
||||||
db/*.sqlite3
|
db/*.sqlite3
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ class Profile
|
||||||
|
|
||||||
validates_presence_of :first_name, :last_name
|
validates_presence_of :first_name, :last_name
|
||||||
|
|
||||||
|
before_save :strip_names
|
||||||
|
|
||||||
def person_id
|
def person_id
|
||||||
self._parent_document.id
|
self._parent_document.id
|
||||||
end
|
end
|
||||||
|
|
@ -27,4 +29,9 @@ class Profile
|
||||||
self._parent_document
|
self._parent_document
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def strip_names
|
||||||
|
first_name.strip!
|
||||||
|
last_name.strip!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,14 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# 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|
|
= form_for Album.new do |f|
|
||||||
= f.error_messages
|
= f.error_messages
|
||||||
%p
|
%p
|
||||||
= f.label :name
|
= f.label :name
|
||||||
= f.text_field :name
|
= f.text_field :name
|
||||||
= f.hidden_field :to, :value => aspect
|
= f.hidden_field :to, :value => aspect
|
||||||
= f.submit t('.create'), :class => 'button'
|
= f.submit t('.create'), :class => 'button'
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,14 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
%h1=t('.add_a_new_aspect')
|
.span-12.last
|
||||||
= form_for Aspect.new do |aspect|
|
.modal_title_bar
|
||||||
= aspect.error_messages
|
%h4= t('.add_a_new_aspect')
|
||||||
%p
|
|
||||||
= aspect.label :name
|
= form_for Aspect.new do |aspect|
|
||||||
= aspect.text_field :name
|
= aspect.error_messages
|
||||||
= aspect.submit t('.create'), :class => 'button'
|
%p
|
||||||
|
= aspect.label :name
|
||||||
|
= aspect.text_field :name
|
||||||
|
= aspect.submit t('.create'), :class => 'button'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
%h2 Send invitation
|
.span-12.last
|
||||||
= form_for User.new, :url => invitation_path(User) do |invite|
|
.modal_title_bar
|
||||||
%p
|
%h4 Send invitation
|
||||||
= 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"
|
= 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"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,22 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
%h1
|
.span-12.last
|
||||||
=t('.add_a_new_friend_to')
|
.modal_title_bar
|
||||||
%i= aspect.name
|
%h4
|
||||||
|
=t('.add_a_new_friend_to')
|
||||||
|
%i= aspect.name
|
||||||
|
|
||||||
= form_for Request.new do |fr_request|
|
= form_for Request.new do |fr_request|
|
||||||
= fr_request.error_messages
|
= fr_request.error_messages
|
||||||
|
|
||||||
=t('.enter_a_diaspora_username')
|
=t('.enter_a_diaspora_username')
|
||||||
%br
|
%br
|
||||||
%i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle
|
%i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle
|
||||||
|
|
||||||
%p
|
%p
|
||||||
= fr_request.label :destination_url, t(".friends_username")
|
= fr_request.label :destination_url, t(".friends_username")
|
||||||
= fr_request.text_field :destination_url
|
= fr_request.text_field :destination_url
|
||||||
= fr_request.hidden_field :aspect_id, :value => aspect.id
|
= fr_request.hidden_field :aspect_id, :value => aspect.id
|
||||||
= fr_request.submit
|
= fr_request.submit
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,14 @@ fi
|
||||||
chmod 777 /var/lib/diaspora/uploads
|
chmod 777 /var/lib/diaspora/uploads
|
||||||
chown -R diaspora /var/log/diaspora
|
chown -R diaspora /var/log/diaspora
|
||||||
|
|
||||||
|
hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml)
|
||||||
|
|
||||||
if [ -n "$arg_hostname" ]; then
|
if [ -n "$arg_hostname" ]; then
|
||||||
sed -i "/pod_url:/s/$hostname/$arg_hostname/g" config/app_config.yml &&
|
sed -i "/pod_url:/s|$hostname|$arg_hostname|g" config/app_config.yml &&
|
||||||
echo "config/app_config.yml updated."
|
echo "config/app_config.yml updated."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml)
|
|
||||||
while : ; do
|
while : ; do
|
||||||
echo "Current hostname is \"$hostname\""
|
echo "Current hostname is \"$hostname\""
|
||||||
echo -n "Enter new hostname [$hostname] :"
|
echo -n "Enter new hostname [$hostname] :"
|
||||||
|
|
@ -57,7 +58,7 @@ while : ; do
|
||||||
echo -n "Use hostname \"$new_hostname\" as pod_url (Yes/No) [Yes]? :"
|
echo -n "Use hostname \"$new_hostname\" as pod_url (Yes/No) [Yes]? :"
|
||||||
read yesno garbage
|
read yesno garbage
|
||||||
test "${yesno:0:1}" = 'y' -o "${yesno:0:1}" = 'Y' -o -z "$yesno" && {
|
test "${yesno:0:1}" = 'y' -o "${yesno:0:1}" = 'Y' -o -z "$yesno" && {
|
||||||
sed -i "/pod_url:/s/$hostname/$new_hostname/g" config/app_config.yml &&
|
sed -i "/pod_url:/s|$hostname|$new_hostname|g" config/app_config.yml &&
|
||||||
echo "config/app_config.yml updated."
|
echo "config/app_config.yml updated."
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,14 @@ fi
|
||||||
chmod 777 /var/lib/diaspora/uploads
|
chmod 777 /var/lib/diaspora/uploads
|
||||||
chown -R diaspora /var/log/diaspora
|
chown -R diaspora /var/log/diaspora
|
||||||
|
|
||||||
|
hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml)
|
||||||
|
|
||||||
if [ -n "$arg_hostname" ]; then
|
if [ -n "$arg_hostname" ]; then
|
||||||
sed -i "/pod_url:/s/$hostname/$arg_hostname/g" config/app_config.yml &&
|
sed -i "/pod_url:/s|$hostname|$arg_hostname|g" config/app_config.yml &&
|
||||||
echo "config/app_config.yml updated."
|
echo "config/app_config.yml updated."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml)
|
|
||||||
while : ; do
|
while : ; do
|
||||||
echo "Current hostname is \"$hostname\""
|
echo "Current hostname is \"$hostname\""
|
||||||
echo -n "Enter new hostname [$hostname] :"
|
echo -n "Enter new hostname [$hostname] :"
|
||||||
|
|
@ -60,7 +61,7 @@ while : ; do
|
||||||
echo -n "Use hostname \"$new_hostname\" as pod_url (Yes/No) [Yes]? :"
|
echo -n "Use hostname \"$new_hostname\" as pod_url (Yes/No) [Yes]? :"
|
||||||
read yesno garbage
|
read yesno garbage
|
||||||
test "${yesno:0:1}" = 'y' -o "${yesno:0:1}" = 'Y' -o -z "$yesno" && {
|
test "${yesno:0:1}" = 'y' -o "${yesno:0:1}" = 'Y' -o -z "$yesno" && {
|
||||||
sed -i "/pod_url:/s/$hostname/$new_hostname/g" config/app_config.yml &&
|
sed -i "/pod_url:/s|$hostname|$new_hostname|g" config/app_config.yml &&
|
||||||
echo "config/app_config.yml updated."
|
echo "config/app_config.yml updated."
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@ li.message
|
||||||
:display block
|
:display block
|
||||||
:height 100%
|
:height 100%
|
||||||
:padding 2px 5px
|
:padding 2px 5px
|
||||||
|
:cursor default
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
:background
|
:background
|
||||||
|
|
@ -1044,3 +1045,16 @@ header
|
||||||
|
|
||||||
h2
|
h2
|
||||||
:display inline
|
:display inline
|
||||||
|
|
||||||
|
.modal_title_bar
|
||||||
|
:width 100%
|
||||||
|
:background
|
||||||
|
:color #333
|
||||||
|
:margin
|
||||||
|
:bottom 2em
|
||||||
|
h4
|
||||||
|
:color #fff
|
||||||
|
:padding 10px 20px
|
||||||
|
:font
|
||||||
|
:size small
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,15 @@ describe Profile do
|
||||||
@person = Factory.build(:person)
|
@person = Factory.build(:person)
|
||||||
end
|
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
|
describe 'requirements' do
|
||||||
it "should include a first name" do
|
it "should include a first name" do
|
||||||
@person.profile = Factory.build(:profile,:first_name => nil)
|
@person.profile = Factory.build(:profile,:first_name => nil)
|
||||||
|
|
@ -23,7 +32,5 @@ describe Profile do
|
||||||
@person.profile.last_name = "Smith"
|
@person.profile.last_name = "Smith"
|
||||||
@person.profile.valid?.should be true
|
@person.profile.valid?.should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue