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
|
||||
else
|
||||
@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
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class StatusMessagesController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
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 }
|
||||
format.html{ respond_with @status_message }
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
= form_for(resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :put }) do |f|
|
||||
%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
|
||||
%h1= t('.invitations_closed')
|
||||
|
||||
= f.hidden_field :invitation_token
|
||||
= f.submit t('.sign_up')
|
||||
= render :partial => "devise/shared/links"
|
||||
-#= form_for(resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :put }) do |f|
|
||||
-#%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
|
||||
-#= f.submit t('.sign_up')
|
||||
-#= render :partial => "devise/shared/links"
|
||||
|
|
|
|||
|
|
@ -56,12 +56,13 @@ default:
|
|||
# Sender address in diaspora's outgoing mail.
|
||||
smtp_sender_address: 'no-reply@example.com'
|
||||
|
||||
# Authentication required to send mail. One of "plain",
|
||||
# "login" or "cram-md5"
|
||||
# Authentication required to send mail. Use one of 'one','plain',
|
||||
# 'login' or 'cram-md5'. Use 'none' if server do not support
|
||||
# authentication
|
||||
smtp_authentication: 'plain'
|
||||
|
||||
# Credentails possibly required to log in to SMTP server if
|
||||
# smtp_authentication != 'plain'
|
||||
# smtp_authentication != 'none'
|
||||
smtp_username: 'smtp_username'
|
||||
smtp_password: 'secret'
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,13 @@ Diaspora::Application.configure do
|
|||
config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]}
|
||||
unless Rails.env == 'test' || APP_CONFIG[:mailer_on] != true
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
if APP_CONFIG[:smtp_authentication] == "none"
|
||||
config.action_mailer.smtp_settings = {
|
||||
:address => APP_CONFIG[:smtp_address],
|
||||
:port => APP_CONFIG[:smtp_port],
|
||||
:domain => APP_CONFIG[:smtp_domain]
|
||||
}
|
||||
else
|
||||
config.action_mailer.smtp_settings = {
|
||||
:address => APP_CONFIG[:smtp_address],
|
||||
:port => APP_CONFIG[:smtp_port],
|
||||
|
|
@ -16,4 +23,5 @@ Diaspora::Application.configure do
|
|||
:enable_starttls_auto => true
|
||||
}
|
||||
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"
|
||||
edit:
|
||||
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:
|
||||
new_status_message:
|
||||
tell_me_something_good: "tell me something good"
|
||||
|
|
@ -390,3 +391,9 @@ en:
|
|||
stream_helper:
|
||||
show_comments: "show 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)
|
||||
http = EventMachine::HttpRequest.new(profile_url).get OPTS
|
||||
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
|
||||
|
||||
def make_person_from_webfinger(webfinger_profile)
|
||||
|
|
@ -86,7 +86,7 @@ class EMWebfinger
|
|||
process_callbacks "No person could be constructed from this hcard."
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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(){
|
||||
// $.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 || {};
|
||||
Diaspora.widgets = Diaspora.widgets || {
|
||||
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 = {
|
||||
initialize : function(){
|
||||
$('#aspect_picker').change(Mobile.changeAspect);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,28 @@ describe AspectsController do
|
|||
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 "with valid params" 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() {
|
||||
|
||||
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("widgets", 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("initialize", 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() {
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
it("sets a shortcut", function() {
|
||||
expect(WSR).toEqual(WebSocketReceiver);
|
||||
|
|
|
|||
Loading…
Reference in a new issue