diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index fc2e40006..04328b5fe 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -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 diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index abbd28223..1581df0de 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -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 diff --git a/app/views/invitations/edit.html.haml b/app/views/invitations/edit.html.haml index 1eac967f6..1f9c01d40 100644 --- a/app/views/invitations/edit.html.haml +++ b/app/views/invitations/edit.html.haml @@ -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" diff --git a/config/app_config.yml.example b/config/app_config.yml.example index 29cbccd95..ebc90d56e 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -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' diff --git a/config/initializers/mailer_config.rb b/config/initializers/mailer_config.rb index b334cdb42..25cd82ce5 100644 --- a/config/initializers/mailer_config.rb +++ b/config/initializers/mailer_config.rb @@ -6,14 +6,22 @@ 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 - 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 - } + 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], + :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 diff --git a/config/initializers/will_paginate.rb b/config/initializers/will_paginate.rb new file mode 100644 index 000000000..eb149ea22 --- /dev/null +++ b/config/initializers/will_paginate.rb @@ -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')} »" diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 6702dc9b5..e0e00110e 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -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" diff --git a/lib/em-webfinger.rb b/lib/em-webfinger.rb index 569640605..db6006d4e 100644 --- a/lib/em-webfinger.rb +++ b/lib/em-webfinger.rb @@ -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 diff --git a/public/javascripts/custom-mobile-scripting.js b/public/javascripts/custom-mobile-scripting.js index 6d7583b6a..25e614dcd 100644 --- a/public/javascripts/custom-mobile-scripting.js +++ b/public/javascripts/custom-mobile-scripting.js @@ -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 , { // diff --git a/public/javascripts/diaspora.js b/public/javascripts/diaspora.js index 4543959fe..dc454466f 100644 --- a/public/javascripts/diaspora.js +++ b/public/javascripts/diaspora.js @@ -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: {}, diff --git a/public/javascripts/mobile.js b/public/javascripts/mobile.js index 89c7368ff..65e8de4d4 100644 --- a/public/javascripts/mobile.js +++ b/public/javascripts/mobile.js @@ -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); diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index c017d5554..ac78d930a 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -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 diff --git a/spec/javascripts/aspect-edit-spec.js b/spec/javascripts/aspect-edit-spec.js index 3b340039b..1e84d3eef 100644 --- a/spec/javascripts/aspect-edit-spec.js +++ b/spec/javascripts/aspect-edit-spec.js @@ -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() { diff --git a/spec/javascripts/diaspora-spec.js b/spec/javascripts/diaspora-spec.js index 259d1288d..fc64b2f37 100644 --- a/spec/javascripts/diaspora-spec.js +++ b/spec/javascripts/diaspora-spec.js @@ -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() { diff --git a/spec/javascripts/mobile-interface-spec.js b/spec/javascripts/mobile-interface-spec.js index b8b39e4d0..4b8e6ed37 100644 --- a/spec/javascripts/mobile-interface-spec.js +++ b/spec/javascripts/mobile-interface-spec.js @@ -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() { diff --git a/spec/javascripts/publisher-spec.js b/spec/javascripts/publisher-spec.js index 9cbfdc54b..82e7c9bc8 100644 --- a/spec/javascripts/publisher-spec.js +++ b/spec/javascripts/publisher-spec.js @@ -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() { }); diff --git a/spec/javascripts/web-socket-receiver-spec.js b/spec/javascripts/web-socket-receiver-spec.js index 95ab03a33..84bb8321b 100644 --- a/spec/javascripts/web-socket-receiver-spec.js +++ b/spec/javascripts/web-socket-receiver-spec.js @@ -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);