diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9095dddf4..eed4447b9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -44,14 +44,6 @@ module ApplicationHelper 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 diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index 5dec3d540..0e6cdd5fb 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/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 << '
  • ' - str << link_for_aspect(aspect, :params => opts, 'data-guid' => aspect.id).html_safe - str << '
  • ' - 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)} diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb index f02505b01..3beca488b 100644 --- a/app/helpers/aspects_helper.rb +++ b/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 - "#{I18n.t('aspects.helper.remove')}" - end - end - def add_to_aspect_button(aspect_id, person_id) link_to image_tag('icons/monotone_plus_add_round.png'), {:controller => 'aspect_memberships', diff --git a/app/helpers/interim_stream_hackiness_helper.rb b/app/helpers/interim_stream_hackiness_helper.rb index 14450f233..9ed9ad7a9 100644 --- a/app/helpers/interim_stream_hackiness_helper.rb +++ b/app/helpers/interim_stream_hackiness_helper.rb @@ -39,14 +39,6 @@ module InterimStreamHackinessHelper 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? diff --git a/app/helpers/invitation_codes_helper.rb b/app/helpers/invitation_codes_helper.rb index d4bf88abb..a0f614f42 100644 --- a/app/helpers/invitation_codes_helper.rb +++ b/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 diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 6f69ac3be..13808fc6f 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -54,10 +54,6 @@ module NotificationsHelper 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 diff --git a/app/helpers/notifier_helper.rb b/app/helpers/notifier_helper.rb index 8d17fa342..050d98a4e 100644 --- a/app/helpers/notifier_helper.rb +++ b/app/helpers/notifier_helper.rb @@ -23,12 +23,4 @@ module NotifierHelper 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 diff --git a/app/helpers/publisher_helper.rb b/app/helpers/publisher_helper.rb index d38f8a365..d90836089 100644 --- a/app/helpers/publisher_helper.rb +++ b/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 diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 4f29c511b..0b81a4a3d 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -6,8 +6,4 @@ module UsersHelper def owner_image_link person_image_link(current_user.person, :size => :thumb_small) end - - def mine?(post) - current_user.owns? post - end end diff --git a/app/models/person.rb b/app/models/person.rb index 0ed354f88..4fe1fd9fb 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -167,12 +167,6 @@ class Person < ActiveRecord::Base }.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 diff --git a/app/models/photo.rb b/app/models/photo.rb index ce666b5d1..9741985a7 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -128,10 +128,6 @@ class Photo < ActiveRecord::Base } 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 diff --git a/app/models/post.rb b/app/models/post.rb index be325c829..9d3a85423 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -103,11 +103,6 @@ class Post < ActiveRecord::Base 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 @@ class Post < ActiveRecord::Base false end - def triggers_caching? - true - end - def comment_email_subject I18n.t('notifier.a_post_you_shared') end diff --git a/app/models/user.rb b/app/models/user.rb index cdef755d7..ad4cf3ad4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -165,17 +165,6 @@ class User < ActiveRecord::Base 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) diff --git a/lib/stream/base.rb b/lib/stream/base.rb index f8dd3f4ab..47739a6be 100644 --- a/lib/stream/base.rb +++ b/lib/stream/base.rb @@ -50,11 +50,6 @@ class Stream::Base 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!' diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 69a5f6059..9d52c4d64 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -52,15 +52,10 @@ describe RegistrationsController do 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 diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index 9e39a470b..8ce5d8fde 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -17,8 +17,6 @@ describe ServicesController do 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 @@ describe ServicesController do }.should change(@user.services, :count).by(-1) end end - end diff --git a/spec/controllers/status_messages_controller_spec.rb b/spec/controllers/status_messages_controller_spec.rb index ac76ad6cc..57121d1c5 100644 --- a/spec/controllers/status_messages_controller_spec.rb +++ b/spec/controllers/status_messages_controller_spec.rb @@ -7,7 +7,6 @@ require 'spec_helper' 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 @@ describe StatusMessagesController do 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 diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index cc67471f7..a0000c622 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -7,8 +7,6 @@ require 'spec_helper' 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 @@ describe UsersController do 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 @@ describe UsersController do Resque.should_receive(:enqueue).with(Jobs::DeleteAccount, anything) delete :destroy, :user => { :current_password => "bluepin7" } end - end describe '#confirm_email' do @@ -252,4 +250,3 @@ describe UsersController do end end end - diff --git a/spec/helpers/layout_helper_spec.rb b/spec/helpers/layout_helper_spec.rb index 0dabf3f2b..f63da634a 100644 --- a/spec/helpers/layout_helper_spec.rb +++ b/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 @@ describe LayoutHelper do end end end -end \ No newline at end of file +end diff --git a/spec/models/reshare_spec.rb b/spec/models/reshare_spec.rb index 79b138b84..aedb365d5 100644 --- a/spec/models/reshare_spec.rb +++ b/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 diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 4425c64e0..9fb1700f6 100644 --- a/spec/models/status_message_spec.rb +++ b/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 diff --git a/spec/shared_behaviors/taggable.rb b/spec/shared_behaviors/taggable.rb index ea4957381..1d7efcbc5 100644 --- a/spec/shared_behaviors/taggable.rb +++ b/spec/shared_behaviors/taggable.rb @@ -8,9 +8,6 @@ require 'spec_helper' 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' diff --git a/spec/support/user_methods.rb b/spec/support/user_methods.rb index 6d167f342..74fd44c18 100644 --- a/spec/support/user_methods.rb +++ b/spec/support/user_methods.rb @@ -31,11 +31,4 @@ class User 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