Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
Daniel Vincent Grippi 2010-09-13 17:57:59 -07:00
commit 5ecbb28dc7
12 changed files with 19 additions and 150 deletions

View file

@ -22,14 +22,6 @@ class RequestsController < ApplicationController
include RequestsHelper
respond_to :html
respond_to :json, :only => :index
def index
@remote_requests = Request.for_user current_user
@request = Request.new
respond_with @remote_requests
end
def destroy
if params[:accept]

View file

@ -38,7 +38,19 @@ class UsersController < ApplicationController
def update
@user = User.find_by_id params[:id]
prep_image_url(params[:user])
@user.update_profile params[:user]
respond_with(@user, :location => root_url)
end
private
def prep_image_url(params)
if params[:profile][:image_url].empty?
params[:profile].delete(:image_url)
else
params[:profile][:image_url] = "http://" + request.host + ":" + request.port.to_s + params[:profile][:image_url]
end
end
end

View file

@ -213,8 +213,6 @@ class User
########### Profile ######################
def update_profile(params)
params[:profile].delete(:image_url) if params[:profile][:image_url].empty?
if self.person.update_attributes(params)
push_to_aspects profile, :all
true

View file

@ -67,7 +67,6 @@
= text_field_tag 'q'
%li= link_to current_user.real_name, current_user.person
%li= link_to "requests (#{@request_count})", requests_path, :class => new_request(@request_count)
%li= link_to "edit profile", edit_user_path(current_user)
%li= link_to "logout", destroy_user_session_path
@ -102,7 +101,3 @@
.span-19.prepend-5.last
= render "posts/debug"
#notification_badge.requests
= link_to "requests (#{@request_count})", requests_path

View file

@ -1,42 +0,0 @@
-# Copyright 2010 Diaspora Inc.
-#
-# This file is part of Diaspora.
-#
-# Diaspora is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Diaspora is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Diaspora. If not, see <http://www.gnu.org/licenses/>.
-#
:javascript
$(document).ready(function(){
$(".aspect_selector").change( function() {
var id = $(this).children(":selected").val();
$(this).parent().children(".accept").html( "<a href=\"/requests/#{request.id}/?accept=true&aspect_id="+id+"\" data-method=\"delete\" rel=\"nofollow\" class=\"button\">Accept</a>");
});
});
%li.message{:id => request.id}
%span.from
= link_to "#{request.person.real_name}", '#'
%ul.request_buttons
%select{ :class => "aspect_selector", :style=>"display:inline;"}
%option Add to aspect
%option
- for aspect in current_user.aspects
%option{:value => aspect.id}= aspect.name
%li.accept= link_to 'Accept', request_path(request, :accept => true), :method => :delete, :class => "button"
%li.ignore= link_to 'Ignore', request_path(request), :confirm => 'Are you sure?', :method => :delete, :class => "button"

View file

@ -1,27 +0,0 @@
-# Copyright 2010 Diaspora Inc.
-#
-# This file is part of Diaspora.
-#
-# Diaspora is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Diaspora is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Diaspora. If not, see <http://www.gnu.org/licenses/>.
-#
- title "Edit Request"
= render 'form'
%p
= link_to "Show", request_path(@person_request)
|
= link_to "View All", request_path

View file

@ -1,32 +0,0 @@
-# Copyright 2010 Diaspora Inc.
-#
-# This file is part of Diaspora.
-#
-# Diaspora is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Diaspora is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Diaspora. If not, see <http://www.gnu.org/licenses/>.
-#
%h1.big_text
.back
= link_to "⇧ home", root_path
Requests
%h3= "currently #{@request_count} requests"
%ul#stream
- for request in @remote_requests
= render "request", :request => request
#content_bottom
.back
= link_to "⇧ home", root_path

View file

@ -1,30 +0,0 @@
-# Copyright 2010 Diaspora Inc.
-#
-# This file is part of Diaspora.
-#
-# Diaspora is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Diaspora is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Diaspora. If not, see <http://www.gnu.org/licenses/>.
-#
- title "Request"
%p
= @request.inspect
%p
= link_to "Edit", edit_request_path(@request)
|
= link_to "Destroy", @request, :confirm => 'Are you sure?', :method => :delete
|
= link_to "View All", requests_path

View file

@ -32,7 +32,7 @@
= link_to "All Aspects", root_url
%li{ :style => "margin-right:0;" }
= link_to "manage", edit_aspect_path(Aspect.first), :class => "edit_aspect_button", :title => "Manage your Aspects"
= link_to ( (@request_count == 0)? "manage" : "manage (#{@request_count})"), edit_aspect_path(Aspect.first), :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects"
.yo{ :style => "display:none;"}
#add_aspect_pane

View file

@ -35,11 +35,11 @@
= p.hidden_field :image_url, :value => @profile.image_url, :id => 'image_url_field'
- for photo in @photos
- if photo.url(:thumb_medium) == @profile.image_url
%div.small_photo{:id => request.host + photo.url(:thumb_medium), :class=>'selected'}
%div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'}
= check_box_tag 'checked_photo', true, true
= link_to image_tag(photo.url(:thumb_medium)), "#"
- else
%div.small_photo{:id => request.host + photo.url(:thumb_medium)}
%div.small_photo{:id => photo.url(:thumb_medium)}
= check_box_tag 'checked_photo'
= link_to image_tag(photo.url(:thumb_medium)), "#"
=will_paginate @photos

View file

@ -483,6 +483,8 @@ h1.big_text {
background-color: #efefef; }
#aspect_nav ul > li.selected a a {
color: black; }
#aspect_nav .new_requests {
color: red; }
#global_search {
display: inline;

View file

@ -654,7 +654,8 @@ h1.big_text
:color #efefef
a
:color #000
.new_requests
:color red
#global_search
:display inline