Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
77d46b2d66
17 changed files with 115 additions and 29 deletions
|
|
@ -57,7 +57,7 @@ class AspectsController < ApplicationController
|
||||||
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
|
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
|
||||||
else
|
else
|
||||||
@aspect_contacts = @aspect.contacts
|
@aspect_contacts = @aspect.contacts
|
||||||
@posts = @aspect.posts.find_all_by__type("StatusMessage", :order => 'created_at desc').paginate :per_page => 15
|
@posts = @aspect.posts.find_all_by__type("StatusMessage", :order => 'created_at desc').paginate :page => params[:page], :per_page => 15
|
||||||
respond_with @aspect
|
respond_with @aspect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class StatusMessagesController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js{ render :json => { :post_id => @status_message.id,
|
format.js{ render :json => { :post_id => @status_message.id,
|
||||||
:html => render_to_string(:partial => 'shared/stream_element', :locals => {:post => @status_message, :current_user => current_user})},
|
:html => render_to_string(:partial => 'shared/stream_element', :locals => {:post => @status_message, :aspects => current_user.aspects, :current_user => current_user})},
|
||||||
:status => 201 }
|
:status => 201 }
|
||||||
format.html{ respond_with @status_message }
|
format.html{ respond_with @status_message }
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
= form_for(resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :put }) do |f|
|
%h1= t('.invitations_closed')
|
||||||
%p
|
|
||||||
= f.label :username
|
|
||||||
= f.text_field :username
|
|
||||||
%p
|
|
||||||
= f.label :password
|
|
||||||
= f.password_field :password
|
|
||||||
%p
|
|
||||||
= f.label :password_confirmation
|
|
||||||
= f.password_field :password_confirmation
|
|
||||||
|
|
||||||
= f.hidden_field :invitation_token
|
-#= form_for(resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :put }) do |f|
|
||||||
= f.submit t('.sign_up')
|
-#%p
|
||||||
= render :partial => "devise/shared/links"
|
-#= f.label :username
|
||||||
|
-#= f.text_field :username
|
||||||
|
-#%p
|
||||||
|
-#= f.label :password
|
||||||
|
-#= f.password_field :password
|
||||||
|
-#%p
|
||||||
|
-#= f.label :password_confirmation
|
||||||
|
-#= f.password_field :password_confirmation
|
||||||
|
|
||||||
|
-#= f.hidden_field :invitation_token
|
||||||
|
-#= f.submit t('.sign_up')
|
||||||
|
-#= render :partial => "devise/shared/links"
|
||||||
|
|
|
||||||
|
|
@ -56,12 +56,13 @@ default:
|
||||||
# Sender address in diaspora's outgoing mail.
|
# Sender address in diaspora's outgoing mail.
|
||||||
smtp_sender_address: 'no-reply@example.com'
|
smtp_sender_address: 'no-reply@example.com'
|
||||||
|
|
||||||
# Authentication required to send mail. One of "plain",
|
# Authentication required to send mail. Use one of 'one','plain',
|
||||||
# "login" or "cram-md5"
|
# 'login' or 'cram-md5'. Use 'none' if server do not support
|
||||||
|
# authentication
|
||||||
smtp_authentication: 'plain'
|
smtp_authentication: 'plain'
|
||||||
|
|
||||||
# Credentails possibly required to log in to SMTP server if
|
# Credentails possibly required to log in to SMTP server if
|
||||||
# smtp_authentication != 'plain'
|
# smtp_authentication != 'none'
|
||||||
smtp_username: 'smtp_username'
|
smtp_username: 'smtp_username'
|
||||||
smtp_password: 'secret'
|
smtp_password: 'secret'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,22 @@ Diaspora::Application.configure do
|
||||||
config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]}
|
config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]}
|
||||||
unless Rails.env == 'test' || APP_CONFIG[:mailer_on] != true
|
unless Rails.env == 'test' || APP_CONFIG[:mailer_on] != true
|
||||||
config.action_mailer.delivery_method = :smtp
|
config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.smtp_settings = {
|
if APP_CONFIG[:smtp_authentication] == "none"
|
||||||
:address => APP_CONFIG[:smtp_address],
|
config.action_mailer.smtp_settings = {
|
||||||
:port => APP_CONFIG[:smtp_port],
|
:address => APP_CONFIG[:smtp_address],
|
||||||
:domain => APP_CONFIG[:smtp_domain],
|
:port => APP_CONFIG[:smtp_port],
|
||||||
:authentication => APP_CONFIG[:smtp_authentication],
|
:domain => APP_CONFIG[:smtp_domain]
|
||||||
:user_name => APP_CONFIG[:smtp_username],
|
}
|
||||||
:password => APP_CONFIG[:smtp_password],
|
else
|
||||||
:enable_starttls_auto => true
|
config.action_mailer.smtp_settings = {
|
||||||
}
|
:address => APP_CONFIG[:smtp_address],
|
||||||
|
:port => APP_CONFIG[:smtp_port],
|
||||||
|
:domain => APP_CONFIG[:smtp_domain],
|
||||||
|
:authentication => APP_CONFIG[:smtp_authentication],
|
||||||
|
:user_name => APP_CONFIG[:smtp_username],
|
||||||
|
:password => APP_CONFIG[:smtp_password],
|
||||||
|
:enable_starttls_auto => true
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
6
config/initializers/will_paginate.rb
Normal file
6
config/initializers/will_paginate.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
|
WillPaginate::ViewHelpers.pagination_options[:previous_label] = "« #{I18n.t('pagination.previous')}"
|
||||||
|
WillPaginate::ViewHelpers.pagination_options[:next_label] = "#{I18n.t('pagination.next')} »"
|
||||||
|
|
@ -284,6 +284,7 @@ en:
|
||||||
not_found: "Invitation token not found"
|
not_found: "Invitation token not found"
|
||||||
edit:
|
edit:
|
||||||
sign_up: "sign_up"
|
sign_up: "sign_up"
|
||||||
|
invitations_closed: "Invitations for this Diaspora Pod are closed right now. Don't worry, your invite will still work, please try again in about a week."
|
||||||
status_messages:
|
status_messages:
|
||||||
new_status_message:
|
new_status_message:
|
||||||
tell_me_something_good: "tell me something good"
|
tell_me_something_good: "tell me something good"
|
||||||
|
|
@ -390,3 +391,9 @@ en:
|
||||||
stream_helper:
|
stream_helper:
|
||||||
show_comments: "show comments"
|
show_comments: "show comments"
|
||||||
hide_comments: "hide comments"
|
hide_comments: "hide comments"
|
||||||
|
webfinger:
|
||||||
|
fetch_failed: "failed to fetch webfinger profile for %{profile_url}"
|
||||||
|
hcard_fetch_failed: "there was a problem fetching the hcard for #{@account}"
|
||||||
|
pagination:
|
||||||
|
next: "Next"
|
||||||
|
previous: "Previous"
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ class EMWebfinger
|
||||||
def get_webfinger_profile(profile_url)
|
def get_webfinger_profile(profile_url)
|
||||||
http = EventMachine::HttpRequest.new(profile_url).get OPTS
|
http = EventMachine::HttpRequest.new(profile_url).get OPTS
|
||||||
http.callback{ make_person_from_webfinger(http.response) }
|
http.callback{ make_person_from_webfinger(http.response) }
|
||||||
http.errback{ process_callbacks "failed to fetch webfinger profile for #{profile_url}"}
|
http.errback{ process_callbacks I18n.t('webfinger.fetch_failed', :profile_url => profile_url) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def make_person_from_webfinger(webfinger_profile)
|
def make_person_from_webfinger(webfinger_profile)
|
||||||
|
|
@ -86,7 +86,7 @@ class EMWebfinger
|
||||||
process_callbacks "No person could be constructed from this hcard."
|
process_callbacks "No person could be constructed from this hcard."
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
http.errback{process_callbacks "there was a problem fetching the hcard for #{@account}"}
|
http.errback{process_callbacks I18n.t('webfinger.hcard_fetch_failed', :account => @account) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
// $(document).bind("mobileinit", function(){
|
// $(document).bind("mobileinit", function(){
|
||||||
// $.extend( $.mobile , {
|
// $.extend( $.mobile , {
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
var Diaspora = Diaspora || {};
|
var Diaspora = Diaspora || {};
|
||||||
Diaspora.widgets = Diaspora.widgets || {
|
Diaspora.widgets = Diaspora.widgets || {
|
||||||
pageWidgets: {},
|
pageWidgets: {},
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
var Mobile = {
|
var Mobile = {
|
||||||
initialize : function(){
|
initialize : function(){
|
||||||
$('#aspect_picker').change(Mobile.changeAspect);
|
$('#aspect_picker').change(Mobile.changeAspect);
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,28 @@ describe AspectsController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#show" do
|
||||||
|
it "succeeds" do
|
||||||
|
get :show, 'id' => @aspect.id.to_s
|
||||||
|
response.should be_success
|
||||||
|
end
|
||||||
|
it "assigns aspect, aspect_contacts, and posts" do
|
||||||
|
get :show, 'id' => @aspect.id.to_s
|
||||||
|
assigns(:aspect).should == @aspect
|
||||||
|
assigns(:aspect_contacts).should == @aspect.contacts
|
||||||
|
assigns(:posts).should == []
|
||||||
|
end
|
||||||
|
it "paginates" do
|
||||||
|
16.times { |i| @user2.post(:status_message, :to => @aspect2.id, :message => "hi #{i}") }
|
||||||
|
|
||||||
|
get :show, 'id' => @aspect.id.to_s
|
||||||
|
assigns(:posts).count.should == 15
|
||||||
|
|
||||||
|
get :show, 'id' => @aspect.id.to_s, 'page' => '2'
|
||||||
|
assigns(:posts).count.should == 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#create" do
|
describe "#create" do
|
||||||
describe "with valid params" do
|
describe "with valid params" do
|
||||||
it "creates an aspect" do
|
it "creates an aspect" do
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
describe("AspectEdit", function() {
|
describe("AspectEdit", function() {
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
describe("Diaspora", function() {
|
describe("Diaspora", function() {
|
||||||
describe("widgets", function() {
|
describe("widgets", function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
describe("mobile interface", function() {
|
describe("mobile interface", function() {
|
||||||
describe("initialize", function() {
|
describe("initialize", function() {
|
||||||
it("attaches a change event to the select box", function() {
|
it("attaches a change event to the select box", function() {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
describe("Publisher", function() {
|
describe("Publisher", function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
describe("WebSocketReceiver", function() {
|
describe("WebSocketReceiver", function() {
|
||||||
it("sets a shortcut", function() {
|
it("sets a shortcut", function() {
|
||||||
expect(WSR).toEqual(WebSocketReceiver);
|
expect(WSR).toEqual(WebSocketReceiver);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue