diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3818ae6ae..c46581f80 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -30,11 +30,9 @@ class ApplicationController < ActionController::Base # we need to do this for vanna controller. these should really be controller # helper methods instead def set_header_data - if user_signed_in? - if request.format.html? && !params[:only_posts] - @notification_count = Notification.for(current_user, :unread =>true).count - @unread_message_count = ConversationVisibility.sum(:unread, :conditions => "person_id = #{current_user.person.id}") - end + if user_signed_in? && request.format.html? && !params[:only_posts] + @notification_count = Notification.for(current_user, :unread =>true).count + @unread_message_count = ConversationVisibility.sum(:unread, :conditions => "person_id = #{current_user.person.id}") end end @@ -142,12 +140,7 @@ class ApplicationController < ActionController::Base def default_stream_action(stream_klass) @stream = stream(stream_klass) - - if params[:only_posts] - render :partial => 'shared/stream', :locals => {:posts => @stream.stream_posts} - else - render 'aspects/index' - end + render 'aspects/index' end def max_time diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index bc983571d..2fcc10c31 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -14,20 +14,13 @@ class AspectsController < ApplicationController :json def index - @backbone = true stream_klass = Stream::Aspect aspect_ids = (session[:a_ids] ? session[:a_ids] : []) @stream = Stream::Aspect.new(current_user, aspect_ids, :max_time => params[:max_time].to_i) respond_with do |format| - format.html do - if params[:only_posts] - render :partial => 'shared/stream', :locals => {:posts => @stream.stream_posts} - else - render 'aspects/index' - end - end + format.html { render 'aspects/index' } format.json{ render_for_api :backbone, :json => @stream.stream_posts, :root => :posts } end end diff --git a/app/controllers/comment_stream_controller.rb b/app/controllers/comment_stream_controller.rb index d09524433..f478a6d20 100644 --- a/app/controllers/comment_stream_controller.rb +++ b/app/controllers/comment_stream_controller.rb @@ -9,7 +9,6 @@ class CommentStreamController < ApplicationController respond_to :html, :json def index - @backbone = true stream_klass = Stream::Comments respond_with do |format| diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 2b677fdac..5376bc8ab 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -6,7 +6,7 @@ class HomeController < ApplicationController def show if current_user - redirect_to multi_path + redirect_to multi_path if current_user elsif is_mobile_device? redirect_to user_session_path else @@ -16,11 +16,7 @@ class HomeController < ApplicationController end def toggle_mobile - if session[:mobile_view] - session[:mobile_view] = false - else - session[:mobile_view] = true - end + session[:mobile_view] = !session[:mobile_view] redirect_to :back end end diff --git a/app/controllers/like_stream_controller.rb b/app/controllers/like_stream_controller.rb index d79f26198..5fd8fc631 100644 --- a/app/controllers/like_stream_controller.rb +++ b/app/controllers/like_stream_controller.rb @@ -9,7 +9,6 @@ class LikeStreamController < ApplicationController respond_to :html, :json def index - @backbone = true stream_klass = Stream::Likes respond_with do |format| diff --git a/app/controllers/mentions_controller.rb b/app/controllers/mentions_controller.rb index 879637b2a..87e2f37f7 100644 --- a/app/controllers/mentions_controller.rb +++ b/app/controllers/mentions_controller.rb @@ -9,7 +9,6 @@ class MentionsController < ApplicationController respond_to :html, :json def index - @backbone = true stream_klass = Stream::Mention respond_with do |format| diff --git a/app/controllers/multis_controller.rb b/app/controllers/multis_controller.rb index 84cf43bb6..9eb042503 100644 --- a/app/controllers/multis_controller.rb +++ b/app/controllers/multis_controller.rb @@ -9,7 +9,6 @@ class MultisController < ApplicationController respond_to :html, :json def index - @backbone = true stream_klass = Stream::Multi respond_with do |format| diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index c544fbefa..30cbe1149 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -84,8 +84,6 @@ class PeopleController < ApplicationController end def show - @backbone = true - @person = Person.find_from_id_or_username(params) if remote_profile_with_no_user_session? @@ -125,15 +123,9 @@ class PeopleController < ApplicationController end end - if params[:only_posts] - respond_to do |format| - format.html{ render :partial => 'shared/stream', :locals => {:posts => @stream.stream_posts} } - end - else - respond_to do |format| - format.all { respond_with @person, :locals => {:post_type => :all} } - format.json{ render_for_api :backbone, :json => @stream.stream_posts, :root => :posts } - end + respond_to do |format| + format.all { respond_with @person, :locals => {:post_type => :all} } + format.json{ render_for_api :backbone, :json => @stream.stream_posts, :root => :posts } end end diff --git a/app/controllers/tag_followings_controller.rb b/app/controllers/tag_followings_controller.rb index b17ffd3d4..b99e00a22 100644 --- a/app/controllers/tag_followings_controller.rb +++ b/app/controllers/tag_followings_controller.rb @@ -10,7 +10,6 @@ class TagFollowingsController < ApplicationController respond_to :html, :json def index - @backbone = true stream_klass = Stream::FollowedTag respond_with do |format| @@ -23,7 +22,7 @@ class TagFollowingsController < ApplicationController # POST /tag_followings.xml def create name_normalized = ActsAsTaggableOn::Tag.normalize(params['name']) - + if name_normalized.nil? || name_normalized.empty? flash[:error] = I18n.t('tag_followings.create.none') else diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 17818b8c0..83f69203b 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -33,17 +33,9 @@ class TagsController < ApplicationController end def show - @backbone = true - @stream = Stream::Tag.new(current_user, params[:name], :max_time => max_time, :page => params[:page]) respond_with do |format| - format.html do - if params[:only_posts] - render :partial => 'shared/stream', :locals => {:posts => @stream.stream_posts} - return - end - end format.json{ render_for_api :backbone, :json => @stream.stream_posts, :root => :posts } end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 78346a2c1..9a7d93de1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,7 +3,6 @@ # the COPYRIGHT file. module ApplicationHelper - def how_long_ago(obj) timeago(obj.created_at) end @@ -17,29 +16,6 @@ module ApplicationHelper "javascript:(function(){f='#{AppConfig[:pod_url]}bookmarklet?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'¬es='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=1&';a=function(){if(!window.open(f+'noui=1&jump=doclose','diasporav1','location=yes,links=no,scrollbars=no,toolbar=no,width=620,height=250'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()" end - def object_fields(object) - object.attributes.keys - end - - - def type_partial(post) - class_name = post.class.name.to_s.underscore - "#{class_name.pluralize}/#{class_name}" - end - - def hard_link(string, path) - link_to string, path, :rel => 'external' - end - - - def post_yield_tag(post) - (':' + post.id.to_s).to_sym - end - - def info_text(text) - image_tag 'icons/monotone_question.png', :class => 'what_is_this', :title => text - end - def get_javascript_strings_for(language) defaults = I18n.t('javascripts', :locale => DEFAULT_LANGUAGE) diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index b1d373f2c..5dec3d540 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -9,25 +9,6 @@ module AspectGlobalHelper end end - def aspect_badges(aspects, opts={}) - str = '' - aspects.each do |aspect| - str << aspect_badge(aspect, opts) - end - str.html_safe - end - - def aspect_badge(aspect, opts={}) - str = "" - link = opts.delete(:link) - if !link - str << link_to(aspect.name, "#", 'data-guid' => aspect.id).html_safe - else - str << link_for_aspect(aspect).html_safe - end - str << "" - end - def aspect_links(aspects, opts={}) str = "" aspects.each do |aspect| @@ -79,7 +60,7 @@ LISTITEM def dropdown_may_create_new_aspect @aspect == :profile || @aspect == :tag || @aspect == :search || @aspect == :notification || params[:action] == "getting_started" end - + def aspect_options_for_select(aspects) options = {} aspects.each do |aspect| diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb deleted file mode 100644 index 04d60253c..000000000 --- a/app/helpers/comments_helper.rb +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -module CommentsHelper - GSUB_THIS = "FIUSDHVIUSHDVIUBAIUHAPOIUXJM" - def comment_toggle(post, commenting_disabled=false) - if post.comments.size <= 3 - link_to "#{t('stream_helper.hide_comments')}", post_comments_path(post.id), :class => "toggle_post_comments" - elsif ! user_signed_in? - link_to "#{t('stream_helper.show_comments', :count => post.comments.size - 3)}", post_path(post.id, :all_comments => '1'), :class => "toggle_post_comments" - else - link_to "#{t('stream_helper.show_comments', :count => post.comments.size - 3)}", post_comments_path(post.id), :class => "toggle_post_comments" - end - end - - # This method memoizes the new comment form in order to avoid the overhead of rendering it on every post. - # @param [Integer] post_id The id of the post that this form should post to. - # @param [User] current_user - # @return [String] The HTML for the new comment form. - def new_comment_form(post_id, current_user) - @form ||= controller.render_to_string( - :partial => 'comments/new_comment', :locals => {:post_id => GSUB_THIS, :current_user => current_user}) - @form.gsub(GSUB_THIS, post_id.to_s).html_safe - end - - def comment_form_wrapper_class(post) - if post.comments.empty? && request && request.format != 'mobile' - 'hidden' - else - nil - end - end - - def commenting_disabled?(post) - return true unless user_signed_in? - if defined?(@commenting_disabled) - @commenting_disabled - elsif defined?(@stream) - !@stream.can_comment?(post) - else - false - end - end - - def all_comments? - !! params['all_comments'] - end -end diff --git a/app/helpers/getting_started_helper.rb b/app/helpers/getting_started_helper.rb index 3d8bbc7df..195c24653 100644 --- a/app/helpers/getting_started_helper.rb +++ b/app/helpers/getting_started_helper.rb @@ -3,21 +3,6 @@ # the COPYRIGHT file. module GettingStartedHelper - # @return [Boolean] The user has connected at least one service - def has_connected_services? - AppConfig[:configured_services].blank? || current_user.services.size > 0 - end - - # @return [Boolean] The user has at least 3 contacts - def has_few_contacts? - current_user.contacts.receiving.size > 2 - end - - # @return [Boolean] The user has followed at least 3 tags - def has_few_followed_tags? - current_user.followed_tags.size > 2 - end - # @return [Boolean] The user has connected to cubbi.es def has_connected_cubbies? current_user.authorizations.size > 0 diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index d59ca3555..31067f3a9 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -17,10 +17,6 @@ module LayoutHelper current_user ? current_user.name : t("application.helper.diaspora_alpha") end - def show_title? - @show_title - end - def stylesheet(*args) content_for(:head) { stylesheet_link_tag(*args) } end @@ -28,12 +24,4 @@ module LayoutHelper def javascript(*args) content_for(:head) { javascript_include_tag(*args) } end - - def new_notification_text(count) - t('notifications.helper.new_notifications', :count => count) - end - - def new_message_text(count) - t('conversations.helper.new_messages', :count => count) - end end diff --git a/app/helpers/likes_helper.rb b/app/helpers/likes_helper.rb deleted file mode 100644 index 03d00aa6a..000000000 --- a/app/helpers/likes_helper.rb +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -module LikesHelper - def likes_list(likes) - links = likes.collect { |like| link_to "#{h(like.author.name.titlecase)}", local_or_remote_person_path(like.author) } - links.join(", ").html_safe - end - - def like_action(target, current_user=current_user) - if target.instance_of?(Comment) - if current_user.liked?(target) - link_to t('shared.stream_element.unlike'), comment_like_path(target, current_user.like_for(target)), :method => :delete, :class => 'unlike', :remote => true - else - link_to t('shared.stream_element.like'), comment_likes_path(target, :positive => 'true'), :method => :post, :class => 'like', :remote => true - end - - else - - if current_user.liked?(target) - link_to t('shared.stream_element.unlike'), post_like_path(target, current_user.like_for(target)), :method => :delete, :class => 'unlike', :remote => true - else - link_to t('shared.stream_element.like'), post_likes_path(target, :positive => 'true'), :method => :post, :class => 'like', :remote => true - end - - end - end -end diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 2fc4611cf..c6a9e6d62 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -5,7 +5,7 @@ module NotificationsHelper include PeopleHelper include UsersHelper include ApplicationHelper - + def object_link(note, actors) target_type = note.popup_translation_key actors_count = note.actors.count @@ -32,13 +32,6 @@ module NotificationsHelper t("#{target_type}", opts).html_safe end - - def new_notification_link(count) - if count > 0 - link_to new_notification_text(count), notifications_path - end - end - def notification_people_link(note, people=nil) actors =people || note.actors number_of_actors = actors.count diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb deleted file mode 100644 index c3cb52d84..000000000 --- a/app/helpers/photos_helper.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -module PhotosHelper - -end diff --git a/app/helpers/reshares_helper.rb b/app/helpers/reshares_helper.rb deleted file mode 100644 index eccb75711..000000000 --- a/app/helpers/reshares_helper.rb +++ /dev/null @@ -1,35 +0,0 @@ -module ResharesHelper - def reshare_error_message(reshare) - if @reshare.errors[:root_guid].present? - escape_javascript(@reshare.errors[:root_guid].first) - else - escape_javascript(t('reshares.create.failure')) - end - end - - def resharable?(post) - if reshare?(post) - # Reshare post is resharable if you're not the original author nor the resharer - post.root.present? && post.root.author_id != current_user.person.id && post.author_id != current_user.person.id - else - post.author_id != current_user.person.id && post.public? - end - end - - def reshare_link(post) - if reshare?(post) - return unless post.root - link_to t("reshares.reshare.reshare_original"), - reshares_path(:root_guid => post.root.guid), - :method => :post, - :remote => true, - :confirm => t('reshares.reshare.reshare_confirmation', :author => post.root.author.name) - else - link_to t('shared.reshare.reshare'), - reshares_path(:root_guid => post.guid), - :method => :post, - :remote => true, - :confirm => t('reshares.reshare.reshare_confirmation', :author => post.author.name) - end - end -end diff --git a/app/helpers/status_messages_helper.rb b/app/helpers/status_messages_helper.rb deleted file mode 100644 index 9168e3f07..000000000 --- a/app/helpers/status_messages_helper.rb +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -module StatusMessagesHelper -end diff --git a/app/helpers/stream_element_helper.rb b/app/helpers/stream_element_helper.rb deleted file mode 100644 index 59abd9968..000000000 --- a/app/helpers/stream_element_helper.rb +++ /dev/null @@ -1,27 +0,0 @@ -module StreamElementHelper - def block_user_control(author) - if user_signed_in? && current_user.person.id != author.id - link_to image_tag('icons/ignoreuser.png'), blocks_path(:block => {:person_id => author.id}), - :class => 'block_user control_icon', - :confirm => t('.ignore_user_description'), - :title => t('.ignore_user', :name => author.first_name), - :method => :post - end - end - - def delete_or_hide_button(post) - if user_signed_in? && current_user.owns?(post) - link_to image_tag('deletelabel.png'), post_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete control_icon remove_post", :title => t('delete') - else - link_to image_tag('deletelabel.png'), share_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true, :class => "delete remove_post control_icon vis_hide", :title => t('.hide_and_mute') - end - end - - def nsfw_sheild(post) - if post.respond_to?(:nsfw?) && post.nsfw? - content_tag(:div, :class => 'shield') do - I18n.translate('shared.stream_element.nsfw', :link => link_to(I18n.translate('shared.stream_element.show'), '#')).html_safe - end - end - end -end diff --git a/app/helpers/stream_helper.rb b/app/helpers/stream_helper.rb index 0440f60a2..7420e7cb4 100644 --- a/app/helpers/stream_helper.rb +++ b/app/helpers/stream_helper.rb @@ -39,14 +39,6 @@ module StreamHelper end end - def time_for_sort(post) - post.created_at - end - - def comments_expanded - false - end - def reshare?(post) post.instance_of?(Reshare) end diff --git a/app/helpers/tag_followings_helper.rb b/app/helpers/tag_followings_helper.rb deleted file mode 100644 index 03bd57800..000000000 --- a/app/helpers/tag_followings_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module TagFollowingsHelper -end diff --git a/app/views/aspect_memberships/create.js.erb b/app/views/aspect_memberships/create.js.erb index af3fbeb9d..f1165c0dd 100644 --- a/app/views/aspect_memberships/create.js.erb +++ b/app/views/aspect_memberships/create.js.erb @@ -8,7 +8,6 @@ if( $("#no_contacts").is(':visible') ) { $("#no_contacts").fadeOut(200); } -$(".badges").prepend("<%= escape_javascript( aspect_badge(@aspect).html_safe ) %>"); element.parent().html("<%= escape_javascript(render('aspect_memberships/add_to_aspect', :aspect_id => @aspect.id, :person_id => @person.id)) %>"); if($('#aspects_list').length == 1) { diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index f332c9e9d..564b1d961 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -10,13 +10,7 @@ #gs-shim{:title => popover_with_close_html("3. #{t('.stay_updated')}"), 'data-content' => t('.stay_updated_explanation')} -#main_stream.stream{:data => {:guids => stream.aspect_ids.join(','), :time_for_scroll => (@backbone ? '' : time_for_scroll(stream.ajax_stream?, stream))}} - - if !@backbone && !stream.ajax_stream? && stream.stream_posts.length > 0 - = render 'shared/stream', :posts => stream.stream_posts - - - if !@backbone - #pagination - =link_to(t('more'), next_page_path(:ajax_stream => stream.ajax_stream?), :class => 'paginate') +#main_stream.stream{:data => {:guids => stream.aspect_ids.join(',')}} - if current_user.contacts.size < 2 = render 'aspects/no_contacts_message' diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index daa14c9a2..bd1039821 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -55,7 +55,6 @@ = render 'aspects/aspect_stream', :stream => @stream .span-5.rightBar.last - /= render 'aspects/selected_contacts', :stream => @stream #selected_aspect_contacts.section .title.no_icon %h5.stream_title diff --git a/app/views/aspects/index.js.erb b/app/views/aspects/index.js.erb deleted file mode 100644 index b030d7e46..000000000 --- a/app/views/aspects/index.js.erb +++ /dev/null @@ -1,3 +0,0 @@ -$('#aspect_stream_container').html("<%= escape_javascript(render('aspects/aspect_stream', :stream => @stream)) %>"); -$('#selected_aspect_contacts').html("<%= escape_javascript(render('aspects/selected_contacts', :people => @stream.people.sample(20), :count => @stream.people.size)) %>"); -$('#aspect_stream_container a[rel*=facebox]').facebox(); diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml deleted file mode 100644 index 312ca48ae..000000000 --- a/app/views/comments/_comment.html.haml +++ /dev/null @@ -1,28 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -%li.comment.posted{:id => comment.guid, :class => ("hidden" if(defined? hidden))} - - if current_user && (current_user.owns?(comment) || current_user.owns?(post)) - .right.controls - = link_to image_tag('deletelabel.png'), post_comment_path(comment.commentable_id, comment), :class => "delete comment_delete", :title => t('delete') - = person_image_link(comment.author, :size => :thumb_small) - .content - %span.from - = person_link(comment.author, :class => "hovercardable") - - %span{:class => [direction_for(comment.text), 'collapsible']} - = markdownify(comment, :oembed => true) - - .comment_info - %time.timeago{:datetime => comment.created_at} - = comment.created_at ? timeago(comment.created_at) : timeago(Time.now) - - .likes - .likes_container - = render "likes/likes_container", :target_id => comment.id, :likes_count => comment.likes_count, :target_type => "Comment" - - - unless commenting_disabled?(post) - %span.like_action - = like_action(comment, current_user) - diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml deleted file mode 100644 index a16f10481..000000000 --- a/app/views/comments/_comments.html.haml +++ /dev/null @@ -1,18 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. -.comment_stream - - unless comments_expanded || all_comments? - %ul.show_comments{:class => ("hidden" if post.comments.size <= 3)} - %li - = comment_toggle( post) - - %ul.comments{:class => ('loaded' if post.comments.size <= 3)} - -if post.comments.size > 3 && !comments_expanded && ! all_comments? - = render :partial => 'comments/comment', :collection => post.comments.including_author.last(3), :locals => {:post => post} - -else - = render :partial => 'comments/comment', :collection => post.comments.including_author, :locals => {:post => post} - - - unless commenting_disabled?(post) - .new_comment_form_wrapper{:class => comment_form_wrapper_class(post)} - = new_comment_form(post.id, current_user) diff --git a/app/views/comments/_new_comment.html.haml b/app/views/comments/_new_comment.html.haml deleted file mode 100644 index 5623d3043..000000000 --- a/app/views/comments/_new_comment.html.haml +++ /dev/null @@ -1,12 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -= form_tag( post_comments_path(post_id), :id => "new_comment_on_#{post_id}", :class => 'new_comment', :remote => true) do - = person_image_tag(current_user) - %p - = label_tag "comment_text_on_#{post_id}", t('.comment') - = text_area_tag :text, nil, :rows => 2, :class => "comment_box",:id => "comment_text_on_#{post_id}" - .submit_button - = submit_tag t('.comment'), :id => "comment_submit_#{post_id}", :class => "comment_submit button creation", :disable_with => t('.commenting') - diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb deleted file mode 100644 index 5cf3cb461..000000000 --- a/app/views/comments/create.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -App.stream.collection.get(<%= @comment.post.id %>); - -ContentUpdater.addCommentToPost("<%= @comment.post.guid %>", - "<%= @comment.guid%>", - "<%= escape_javascript(render(:partial => 'comments/comment', :locals => { :comment => @comment, :person => current_user.person, :post => @comment.post}))%>"); diff --git a/app/views/comments/index.html.haml b/app/views/comments/index.html.haml deleted file mode 100644 index 839637079..000000000 --- a/app/views/comments/index.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render :partial => 'comments/comment', :collection => @comments, :locals => {:post => @post} diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 02e3c94d8..2184906c0 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -32,10 +32,6 @@ = render 'photos/index', :photos => @posts - else #main_stream.stream - - if !@backbone - = render 'shared/stream', :posts => @stream.stream_posts - #pagination - =link_to(t('more'), next_page_path, :class => 'paginate') - else #main_stream diff --git a/app/views/reshares/_reshare.haml b/app/views/reshares/_reshare.haml deleted file mode 100644 index c61948502..000000000 --- a/app/views/reshares/_reshare.haml +++ /dev/null @@ -1,26 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -.reshare - - if post - = person_image_link(post.author, :size => :thumb_small) - - .content - .post_initial_info - %span.from - = person_link(post.author, :class => "hovercardable") - %span.details - – - %span.timeago - = link_to(how_long_ago(post), post_path(post)) - – - = t("reshares.reshare.reshare", :count => post.reshares_count) - - - if post.activity_streams? - = link_to image_tag(post.image_url, 'data-small-photo' => post.image_url, 'data-full-photo' => post.image_url, :class => 'stream-photo'), post.object_url, :class => "stream-photo-link" - - else - = render 'status_messages/status_message', :post => post, :photos => post.photos - - else - = t('.deleted') diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml deleted file mode 100644 index ced71df86..000000000 --- a/app/views/status_messages/_status_message.html.haml +++ /dev/null @@ -1,24 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -- begin - - if photos.size > 0 - .photo_attachments - .big_stream_photo - = link_to (image_tag photos.first.url(:scaled_full), :class => "stream-photo", 'data-small-photo' => photos.first.url(:thumb_medium), 'data-full-photo' => photos.first.url), photo_path(photos.first), :class => "stream-photo-link" - - if photos.size > 1 - - if photos.size >= 8 - - for photo in photos[1..8] - = link_to (image_tag photo.url(:thumb_small), :class => 'stream-photo thumb_small', 'data-small-photo' => photo.url(:thumb_medium), 'data-full-photo' => photo.url), photo_path(photo), :class => 'stream-photo-link' - - else - - for photo in photos[1..photos.size] - = link_to (image_tag photo.url(:thumb_small), :class => 'stream-photo thumb_small', 'data-small-photo' => photo.url(:thumb_medium), 'data-full-photo' => photo.url), photo_path(photo), :class => 'stream-photo-link' -- rescue - - nil - - -%div{:class => [direction_for(post.text), 'collapsible']} - != markdownify(post) - - if post.o_embed_cache_id.present? - = o_embed_html(post.o_embed_cache) diff --git a/app/views/tags/show.haml b/app/views/tags/show.haml index 3b563fec4..45ecfb7fc 100644 --- a/app/views/tags/show.haml +++ b/app/views/tags/show.haml @@ -67,11 +67,4 @@ %hr #main_stream.stream - - if !@backbone - - if @stream.stream_posts.length > 0 - = render 'shared/stream', :posts => @stream.stream_posts - #pagination - =link_to(t('more'), next_page_path, :class => 'paginate') - - else - = t('.nobody_talking', :tag => @stream.display_tag_name) diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index b75b48d88..97e3cabf5 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -36,11 +36,6 @@ describe AspectsController do end describe "#index" do - it 'renders just the stream with the infinite scroll param set' do - get :index, :only_posts => true - response.should render_template('shared/_stream') - end - it 'assigns an Stream::Aspect' do get :index assigns(:stream).class.should == Stream::Aspect diff --git a/spec/controllers/jasmine_fixtures/comments_spec.rb b/spec/controllers/jasmine_fixtures/comments_spec.rb deleted file mode 100644 index 7c8b3201a..000000000 --- a/spec/controllers/jasmine_fixtures/comments_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -require 'spec_helper' - -describe CommentsController do - describe '#index' do - before do - sign_in :user, alice - end - - it 'generates a jasmine fixture', :fixture => true do - aspect_to_post = bob.aspects.where(:name => "generic").first - message = bob.post(:status_message, :text => "hey", :to => aspect_to_post.id) - - 2.times do - alice.comment("hey", :post => message) - end - - get :index, :post_id => message.id - save_fixture(response.body, "ajax_comments_on_post") - end - end - -end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index e477e65fd..0a21ea13d 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -10,7 +10,6 @@ describe ApplicationHelper do @person = Factory.create(:person) end - describe "#contacts_link" do before do def current_user diff --git a/spec/helpers/comments_helper_spec.rb b/spec/helpers/comments_helper_spec.rb deleted file mode 100644 index 0f60e248c..000000000 --- a/spec/helpers/comments_helper_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'spec_helper' - -describe CommentsHelper do - describe '.new_comment_form' do - before do - @user = alice - @aspect = @user.aspects.first - @post = @user.post(:status_message, :text => "hi", :to => @aspect.id) - end - it 'renders a new comment form' do - new_comment_form(@post.id, @user).should == - @controller.render_to_string(:partial => 'comments/new_comment', - :locals => {:post_id => @post.id, :current_user => @user}) - end - it 'renders it fast the second time' do - new_comment_form(@post.id, @user) - time = Benchmark.realtime{ - new_comment_form(@post.id, @user) - } - (time*1000).should < 1 - end - end -end diff --git a/spec/helpers/getting_started_helper_spec.rb b/spec/helpers/getting_started_helper_spec.rb index 64dcd829f..c6d7ac49a 100644 --- a/spec/helpers/getting_started_helper_spec.rb +++ b/spec/helpers/getting_started_helper_spec.rb @@ -12,56 +12,6 @@ describe GettingStartedHelper do @current_user end - describe "#has_connected_services?" do - before do - AppConfig[:configured_services] = ['fake_service'] - end - - it 'returns true if the current user has connected at least one service' do - @current_user.services << Factory.build(:service) - has_connected_services?.should be_true - end - - it 'returns true if the current user has zero connected services and the server has no services configured' do - AppConfig[:configured_services] = [] - @current_user.services.delete_all - has_connected_services?.should be_true - end - - it 'returns false if the current user has not connected any service' do - @current_user.services.delete_all - has_connected_services?.should be_false - end - end - - describe "#has_few_contacts?" do - it 'returns true if the current_user has more than 2 contacts' do - 3.times do |n| - @current_user.contacts << Contact.new(:person => Factory(:person), :receiving => true) - end - has_few_contacts?.should be_true - end - - it 'returns false if the current_user has less than 2 contacts (inclusive)' do - @current_user.contacts.destroy_all - has_few_contacts?.should be_false - end - end - - describe "has_few_followed_tags?" do - it 'returns true if the current_user has more than 2 contacts' do - 3.times do |n| - @current_user.followed_tags << ActsAsTaggableOn::Tag.new(:name => "poodles_#{n}") - end - has_few_followed_tags?.should be_true - end - - it 'returns false if the current_user has less than 2 contacts (inclusive)' do - @current_user.followed_tags.delete_all - has_few_followed_tags?.should be_false - end - end - describe "#has_connected_cubbies?" do it 'returns true if the current user has connected cubbies to their account' do @current_user.authorizations << Factory(:oauth_authorization) diff --git a/spec/helpers/photos_helper_spec.rb b/spec/helpers/photos_helper_spec.rb deleted file mode 100644 index df95d274c..000000000 --- a/spec/helpers/photos_helper_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -#require 'spec_helper' - -describe PhotosHelper do -end diff --git a/spec/helpers/reshares_helper_spec.rb b/spec/helpers/reshares_helper_spec.rb deleted file mode 100644 index 5907fcca4..000000000 --- a/spec/helpers/reshares_helper_spec.rb +++ /dev/null @@ -1,50 +0,0 @@ -require 'spec_helper' - -describe ResharesHelper do - include StreamHelper - - describe 'reshare_link' do - it 'does not display a reshare for a post that does not exist' do - reshare = Factory.build(:reshare, :root => nil) - lambda { - reshare_link(reshare) - }.should_not raise_error - end - - describe 'for a typical post' do - before :each do - aspect = alice.aspects.first - @post = alice.build_post :status_message, :text => "ohai", :to => aspect.id, :public => true - @post.save! - alice.add_to_streams(@post, [aspect]) - alice.dispatch_post @post, :to => aspect.id - end - - describe 'which has not been reshared' do - before :each do - @post.reshares_count.should == 0 - end - - it 'has "Reshare" as the English text' do - reshare_link(@post).should =~ %r{>Reshare} - end - end - - describe 'which has been reshared' do - before :each do - @reshare = Factory.create(:reshare, :root => @post) - @post.reload - @post.reshares_count.should == 1 - end - - it 'has "Reshare" as the English text' do - reshare_link(@post).should =~ %r{>Reshare} - end - - it 'its reshare has "Reshare original" as the English text' do - reshare_link(@reshare).should =~ %r{>Reshare original} - end - end - end - end -end diff --git a/spec/helpers/stream_helper_spec.rb b/spec/helpers/stream_helper_spec.rb index 8cefe4fde..37ba469d0 100644 --- a/spec/helpers/stream_helper_spec.rb +++ b/spec/helpers/stream_helper_spec.rb @@ -9,13 +9,6 @@ describe StreamHelper do @post = Factory(:status_message) end - describe "#time_for_sort" do - it "returns post.created_at" do - stub!(:controller).and_return(mock()) - time_for_sort(@post).should == @post.created_at - end - end - describe '#next_page_path' do it 'works for apps page' do stub!(:controller).and_return(AppsController.new)