Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3754 from marpo60/housekeeping

Housekeeping2
  • Loading branch information...
commit c59bb350879fcbc6044d606572c9832775c46326 2 parents 5f6e03c + be2db47
@jhass jhass authored
View
8 app/helpers/application_helper.rb
@@ -44,14 +44,6 @@ def popover_with_close_html(without_close_html)
without_close_html + link_to(image_tag('deletelabel.png'), "#", :class => 'close')
end
- def diaspora_id_host
- User.diaspora_id_host
- end
-
- def modernizer_responsive_tag
- javascript_tag("Modernizr.mq('(min-width:0)') || document.write(unescape('#{j javascript_include_tag("mbp-respond.min")}'));")
- end
-
# Require jQuery from CDN if possible, falling back to vendored copy, and require
# vendored jquery_ujs
def jquery_include_tag
View
33 app/helpers/aspect_global_helper.rb
@@ -3,39 +3,6 @@
# the COPYRIGHT file.
module AspectGlobalHelper
- def aspects_with_post(aspects, post)
- aspects.select do |aspect|
- AspectVisibility.exists?(:aspect_id => aspect.id, :shareable_id => post.id, :shareable_type => 'Post')
- end
- end
-
- def aspect_links(aspects, opts={})
- str = ""
- aspects.each do |aspect|
- str << '<li>'
- str << link_for_aspect(aspect, :params => opts, 'data-guid' => aspect.id).html_safe
- str << '</li>'
- end
- str.html_safe
- end
-
- def link_for_aspect(aspect, opts={})
- opts[:params] ||= {}
- params ||= {}
- opts[:params] = opts[:params].merge("a_ids[]" => aspect.id, :created_at => params[:created_at])
- opts['data-guid'] = aspect.id
-
- link_to aspect.name, aspects_path( opts[:params] ), opts
- end
-
- def aspect_or_all_path(aspect)
- if @aspect.is_a? Aspect
- aspect_path @aspect
- else
- aspects_path
- end
- end
-
def aspect_membership_dropdown(contact, person, hang, aspect=nil)
selected_aspects = all_aspects.select{|aspect| contact.in_aspect?(aspect)}
View
8 app/helpers/aspects_helper.rb
@@ -3,14 +3,6 @@
# the COPYRIGHT file.
module AspectsHelper
- def remove_link(aspect)
- if aspect.contacts.size == 0
- link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete, :confirm => I18n.t('aspects.helper.are_you_sure')
- else
- "<span class='grey' title=#{I18n.t('aspects.helper.aspect_not_empty')}>#{I18n.t('aspects.helper.remove')}</span>"
- end
- end
-
def add_to_aspect_button(aspect_id, person_id)
link_to image_tag('icons/monotone_plus_add_round.png'),
{:controller => 'aspect_memberships',
View
8 app/helpers/interim_stream_hackiness_helper.rb
@@ -39,14 +39,6 @@ def from_group(post)
end
end
- def what_stream_sentence(post)
- from_group(post).map{|x| I18n.t("streams.#{x.to_s}")}.to_sentence
- end
-
- def stream_settings_link(post)
- link_to "", "#{edit_user_path}#stream-preferences"
- end
-
def publisher_open
if defined?(@stream)
@stream.publisher.open?
View
11 app/helpers/invitation_codes_helper.rb
@@ -1,15 +1,4 @@
module InvitationCodesHelper
- def invite_welcome_message
- if invite.present?
- content_tag(:div, :class => 'media well') do
- person_image_link(invite.user.person, :class => 'img') +
- content_tag(:div, :class => 'bd') do
- I18n.translate('invitation_codes.excited', :name => invite.user_name)
- end
- end
- end
- end
-
def invite_hidden_tag(invite)
if invite.present?
hidden_field_tag 'invite[token]', invite.token
View
4 app/helpers/notifications_helper.rb
@@ -54,10 +54,6 @@ def notification_message_for(note)
object_link(note, notification_people_link(note))
end
- def peoples_names(note)
- note.actors.map{|p| p.name}.join(", ")
- end
-
def the_day(i18n)
i18n[0].match(/\d/) ? i18n[0].gsub('.', '') : i18n[1].gsub('.', '')
end
View
8 app/helpers/notifier_helper.rb
@@ -23,12 +23,4 @@ def comment_message(comment, opts={})
text = process_newlines(text) if opts[:process_newlines]
text
end
-
- def invite_email_title
- if @inviter.present?
- I18n.t 'notifier.invited_you', :name => @inviter.person.name
- else
- I18n.t 'notifier.accept_invite'
- end
- end
end
View
8 app/helpers/publisher_helper.rb
@@ -3,18 +3,10 @@
# the COPYRIGHT file.
module PublisherHelper
- def public_value
- params[:controller] == "tags" || params[:controller] == "posts"
- end
-
def remote?
params[:controller] != "tags"
end
- def public_helper_text
- (public_value)? t('javascripts.publisher.public'): t('javascripts.publisher.limited')
- end
-
def all_aspects_selected?(selected_aspects)
@all_aspects_selected ||= all_aspects.size == selected_aspects.size
end
View
4 app/helpers/users_helper.rb
@@ -6,8 +6,4 @@ def owner_image_tag(size=nil)
def owner_image_link
person_image_link(current_user.person, :size => :thumb_small)
end
-
- def mine?(post)
- current_user.owns? post
- end
end
View
6 app/models/person.rb
@@ -167,12 +167,6 @@ def self.search_order
}.call
end
- def self.public_search(query, opts={})
- return [] if query.to_s.blank? || query.to_s.length < 3
- sql, tokens = self.search_query_string(query)
- Person.searchable.where(sql, *tokens)
- end
-
def name(opts = {})
if self.profile.nil?
fix_profile
View
4 app/models/photo.rb
@@ -128,10 +128,6 @@ def ensure_user_picture
}
end
- def thumb_hash
- {:thumb_url => url(:thumb_medium), :id => id, :album_id => nil}
- end
-
def queue_processing_job
Resque.enqueue(Jobs::ProcessPhoto, self.id)
end
View
9 app/models/post.rb
@@ -103,11 +103,6 @@ def reshare_for(user)
reshares.where(:author_id => user.person.id).first
end
- def participation_for(user)
- return unless user
- participations.where(:author_id => user.person.id).first
- end
-
def like_for(user)
return unless user
likes.where(:author_id => user.person.id).first
@@ -133,10 +128,6 @@ def activity_streams?
false
end
- def triggers_caching?
- true
- end
-
def comment_email_subject
I18n.t('notifier.a_post_you_shared')
end
View
11 app/models/user.rb
@@ -165,17 +165,6 @@ def has_hidden_shareables_of_type?(t = Post)
self.hidden_shareables[share_type].present?
end
-
- def self.create_from_invitation!(invitation)
- user = User.new
- user.generate_keys
- user.send(:generate_invitation_token)
- user.email = invitation.identifier if invitation.service == 'email'
- # we need to make a custom validator here to make this safer
- user.save(:validate => false)
- user
- end
-
def send_reset_password_instructions
generate_reset_password_token! if should_generate_reset_token?
Resque.enqueue(Jobs::ResetPassword, self.id)
View
5 lib/stream/base.rb
@@ -50,11 +50,6 @@ def people
includes(:profile)
end
- # @return [String]
- def contacts_link_title
- I18n.translate('aspects.selected_contacts.view_all_contacts')
- end
-
# @return [String] def contacts_title 'change me in lib/base_stream.rb!'
def contacts_title
'change me in lib/base_stream.rb!'
View
5 spec/controllers/registrations_controller_spec.rb
@@ -52,15 +52,10 @@
end
end
-
-
describe "#create" do
context "with valid parameters" do
before do
AppConfig.settings.enable_registrations = true
- end
-
- before do
user = FactoryGirl.build(:user)
User.stub!(:build).and_return(user)
end
View
3  spec/controllers/services_controller_spec.rb
@@ -17,8 +17,6 @@
before do
@user = alice
- @aspect = @user.aspects.first
-
sign_in :user, @user
@controller.stub!(:current_user).and_return(@user)
mock_access_token.stub!(:token => "12345", :secret => "56789")
@@ -106,5 +104,4 @@
}.should change(@user.services, :count).by(-1)
end
end
-
end
View
4 spec/controllers/status_messages_controller_spec.rb
@@ -7,7 +7,6 @@
describe StatusMessagesController do
before do
@aspect1 = alice.aspects.first
- @aspect2 = bob.aspects.first
request.env["HTTP_REFERER"] = ""
sign_in :user, alice
@@ -55,8 +54,7 @@ def pass_test_args(text='cute kitty')
describe '#new' do
it 'succeeds' do
- get :new,
- :person_id => bob.person.id
+ get :new, :person_id => bob.person.id
response.should be_success
end
View
5 spec/controllers/users_controller_spec.rb
@@ -7,8 +7,6 @@
describe UsersController do
before do
@user = alice
- @aspect = @user.aspects.first
- @aspect1 = @user.aspects.create(:name => "super!!")
sign_in :user, @user
@controller.stub(:current_user).and_return(@user)
end
@@ -60,6 +58,7 @@
get :public, :username => @user.username
response.should be_redirect
end
+
it 'redirects to a profile page if mobile is requested' do
get :public, :username => @user.username, :format => :mobile
response.should be_redirect
@@ -210,7 +209,6 @@
Resque.should_receive(:enqueue).with(Jobs::DeleteAccount, anything)
delete :destroy, :user => { :current_password => "bluepin7" }
end
-
end
describe '#confirm_email' do
@@ -252,4 +250,3 @@
end
end
end
-
View
13 spec/helpers/layout_helper_spec.rb
@@ -5,18 +5,7 @@
require 'spec_helper'
describe LayoutHelper do
- include ApplicationHelper
- before do
- @user = alice
- end
-
describe "#page_title" do
- before do
- def current_user
- @current_user
- end
- end
-
context "passed blank text" do
it "returns Diaspora*" do
page_title.should == pod_name
@@ -30,4 +19,4 @@ def current_user
end
end
end
-end
+end
View
5 spec/models/reshare_spec.rb
@@ -1,12 +1,7 @@
require 'spec_helper'
describe Reshare do
- include ActionView::Helpers::UrlHelper
include Rails.application.routes.url_helpers
- def controller
- mock()
- end
-
it 'has a valid Factory' do
FactoryGirl.build(:reshare).should be_valid
View
5 spec/models/status_message_spec.rb
@@ -5,12 +5,7 @@
require 'spec_helper'
describe StatusMessage do
- include ActionView::Helpers::UrlHelper
include PeopleHelper
- include Rails.application.routes.url_helpers
- def controller
- mock()
- end
before do
@user = alice
View
3  spec/shared_behaviors/taggable.rb
@@ -8,9 +8,6 @@
describe Diaspora::Taggable do
shared_examples_for "it is taggable" do
include ActionView::Helpers::UrlHelper
- include Rails.application.routes.url_helpers
- def controller
- end
def tag_link(s)
link_to "##{s}", "/tags/#{s}", :class => 'tag'
View
7 spec/support/user_methods.rb
@@ -31,11 +31,4 @@ def post(class_name, opts = {})
p
end
end
-
- def post_at_time(time)
- to_aspect = self.aspects.length == 1 ? self.aspects.first : self.aspects.where(:name => "generic")
- p = self.post(:status_message, :text => 'hi', :to => to_aspect)
- p.created_at = time
- p.save!
- end
end
Please sign in to comment.
Something went wrong with that request. Please try again.