Commit 794247d0 authored by danielgrippi's avatar danielgrippi

MS DG; rename soup to stream; fix a bunch of translations

parent 79ec50a1
...@@ -6,7 +6,7 @@ class HomeController < ApplicationController ...@@ -6,7 +6,7 @@ class HomeController < ApplicationController
def show def show
if current_user if current_user
redirect_to :controller => 'aspects', :action => 'index' redirect_to multi_path
elsif is_mobile_device? elsif is_mobile_device?
redirect_to user_session_path redirect_to user_session_path
else else
......
require File.join(Rails.root, 'lib', 'stream', 'multi')
class MultisController < ApplicationController
def index
default_stream_action(Stream::Multi)
end
end
require File.join(Rails.root, 'lib', 'stream', 'soup')
class SoupsController < ApplicationController
#before_filter :redirect_unless_admin
def index
default_stream_action(Stream::Soup)
end
end
...@@ -44,7 +44,7 @@ class UsersController < ApplicationController ...@@ -44,7 +44,7 @@ class UsersController < ApplicationController
elsif u[:show_community_spotlight_in_stream] elsif u[:show_community_spotlight_in_stream]
if @user.update_attributes(u) if @user.update_attributes(u)
flash[:notice] = I18n.t 'users.update.settings_updated' flash[:notice] = I18n.t 'users.update.settings_updated'
redirect_to soup_path redirect_to multi_path
return return
else else
flash[:notice] = I18n.t 'users.update.settings_not_updated' flash[:notice] = I18n.t 'users.update.settings_not_updated'
......
...@@ -21,15 +21,15 @@ module InterimStreamHackinessHelper ...@@ -21,15 +21,15 @@ module InterimStreamHackinessHelper
end end
def from_group(post) def from_group(post)
if defined?(@stream) && params[:controller]== 'soups' if defined?(@stream) && params[:controller] == 'multis'
@stream.post_from_group(post) @stream.post_from_group(post)
else else
[] []
end end
end end
def what_soup_sentence(post) def what_stream_sentence(post)
from_group(post).map{|x| x.to_s.gsub("_soup", '').gsub('_',' ').titleize}.to_sentence from_group(post).map{|x| I18n.t("streams.#{x.to_s}")}.to_sentence
end end
def stream_settings_link(post) def stream_settings_link(post)
......
...@@ -16,8 +16,8 @@ module StreamHelper ...@@ -16,8 +16,8 @@ module StreamHelper
spotlight_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order]) spotlight_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(MentionsController) elsif controller.instance_of?(MentionsController)
mentions_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order]) mentions_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(SoupsController) elsif controller.instance_of?(MultisController)
soup_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order]) multi_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(PostsController) elsif controller.instance_of?(PostsController)
public_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order]) public_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(AspectsController) elsif controller.instance_of?(AspectsController)
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
#aspect_stream_header #aspect_stream_header
#sort_by #sort_by
= t('.recently') = t('streams.recently')
%span.controls %span.controls
= link_to_if(session[:sort_order] == 'created_at', t('.commented_on'), stream.link(:sort_order => 'updated_at')) = link_to_if(session[:sort_order] == 'created_at', t('streams.commented_on'), stream.link(:sort_order => 'updated_at'))
· ·
= link_to_if(session[:sort_order] == 'updated_at', t('.posted'), stream.link(:sort_order => 'created_at' )) = link_to_if(session[:sort_order] == 'updated_at', t('streams.posted'), stream.link(:sort_order => 'created_at' ))
%h3 %h3
= stream.title = stream.title
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
.section .section
%ul.left_nav %ul.left_nav
%li %li
= link_to "Welcome", getting_started_path, :class => "home_selector" = link_to t(".welcome"), getting_started_path, :class => "home_selector"
.section .section
%ul.left_nav %ul.left_nav
%li %li
%b %b
= link_to "Soup", soup_path, :class => 'home_selector' = link_to t("streams.multi.title"), multi_path, :class => 'home_selector'
.section .section
= render 'aspects/aspect_listings', :stream => @stream = render 'aspects/aspect_listings', :stream => @stream
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
%ul.left_nav %ul.left_nav
%li %li
%b %b
= link_to t('.mentions'), mentions_path, :class => 'home_selector' = link_to t('streams.mentions.title'), mentions_path, :class => 'home_selector'
.section#followed_tags_listing .section#followed_tags_listing
= render 'tags/followed_tags_listings' = render 'tags/followed_tags_listings'
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
= t('share_visibilites.update.see_it_on_their_profile', :name => person_link(post.author)).html_safe = t('share_visibilites.update.see_it_on_their_profile', :name => person_link(post.author)).html_safe
= link_to t('undo'), share_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true = link_to t('undo'), share_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true
.indicator{:title => "from #{what_soup_sentence(post)}"} .indicator{:title => "#{what_stream_sentence(post)}"}
= stream_settings_link(post) = stream_settings_link(post)
.sm_body .sm_body
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
- if user_signed_in? - if user_signed_in?
%ul.left_nav %ul.left_nav
%li %li
%b=link_to t('aspects.index.tags_following'), tag_followings_path, :class => 'home_selector' %b=link_to t('streams.followed_tag.title'), tag_followings_path, :class => 'home_selector'
%ul.sub_nav %ul.sub_nav
- if tags.size > 0 - if tags.size > 0
......
...@@ -104,12 +104,6 @@ en: ...@@ -104,12 +104,6 @@ en:
updating: "updating" updating: "updating"
aspect_contacts: aspect_contacts:
done_editing: "done editing" done_editing: "done editing"
aspect_stream:
stream: "Stream"
mentions: "Mentions"
recently: "recently:"
commented_on: "commented on"
posted: "posted"
show: show:
edit_aspect: "edit aspect" edit_aspect: "edit aspect"
no_posts_message: no_posts_message:
...@@ -129,7 +123,6 @@ en: ...@@ -129,7 +123,6 @@ en:
view_all_contacts: "View all contacts" view_all_contacts: "View all contacts"
no_contacts: "You don't have any contacts here yet." no_contacts: "You don't have any contacts here yet."
manage_your_aspects: "Manage your aspects." manage_your_aspects: "Manage your aspects."
new: new:
name: "Name (only visible to you)" name: "Name (only visible to you)"
create: "Create" create: "Create"
...@@ -159,13 +152,12 @@ en: ...@@ -159,13 +152,12 @@ en:
acquaintances: "Acquaintances" acquaintances: "Acquaintances"
friends: "Friends" friends: "Friends"
index: index:
mentions: "Mentions" welcome: "Welcome"
community_spotlight: "Community Spotlight" community_spotlight: "Community Spotlight"
see_more_from_us: "See more of the D* community." see_more_from_us: "See more of the D* community."
donate: "Donate" donate: "Donate"
keep_us_running: "Keep %{pod} running fast and buy servers their coffee fix with a monthly donation!" keep_us_running: "Keep %{pod} running fast and buy servers their coffee fix with a monthly donation!"
your_aspects: "Your Aspects" your_aspects: "Your Aspects"
tags_following: "Followed Tags"
no_tags: "+ Find a tag to follow" no_tags: "+ Find a tag to follow"
unfollow_tag: "Stop following #%{tag}" unfollow_tag: "Stop following #%{tag}"
handle_explanation: "This is your diaspora id. Like an email address, you can give this to people to reach you." handle_explanation: "This is your diaspora id. Like an email address, you can give this to people to reach you."
...@@ -833,18 +825,36 @@ en: ...@@ -833,18 +825,36 @@ en:
no_applications: "You haven't registered any applications yet." no_applications: "You haven't registered any applications yet."
streams: streams:
recently: "recently:"
commented_on: "commented on"
posted: "posted"
community_spotlight_stream: "Community Spotlight"
aspects_stream: "Aspects"
mentioned_stream: "@Mentions"
followed_tags_stream: "#Followed Tags"
mentions: mentions:
title: "Your Mentions" title: "@Mentions"
contacts_title: "People who mentioned you" contacts_title: "People who mentioned you"
followed_tag:
title: "#Followed Tags"
contacts_title: "People who dig these tags"
tags: tags:
title: "Posts tagged: %{tags}" title: "Posts tagged: %{tags}"
contacts_title: "People who dig these tags" contacts_title: "People who dig this tag"
public: public:
title: "Public Activity" title: "Public Activity"
contacts_title: "Recent Posters" contacts_title: "Recent Posters"
soup:
title: "The Soup" multi:
contacts_title: "People in your Soup" title: "Stream"
contacts_title: "People in your Stream"
aspects:
title: "Your Aspects"
users: users:
logged_out: logged_out:
......
...@@ -113,7 +113,7 @@ Diaspora::Application.routes.draw do ...@@ -113,7 +113,7 @@ Diaspora::Application.routes.draw do
get 'community_spotlight' => "contacts#spotlight", :as => 'community_spotlight' get 'community_spotlight' => "contacts#spotlight", :as => 'community_spotlight'
get 'soup' => "soups#index", :as => 'soup' get 'stream' => "multis#index", :as => 'multi'
resources :people, :except => [:edit, :update] do resources :people, :except => [:edit, :update] do
resources :status_messages resources :status_messages
......
...@@ -32,10 +32,8 @@ ActiveRecord::Schema.define(:version => 20111021184041) do ...@@ -32,10 +32,8 @@ ActiveRecord::Schema.define(:version => 20111021184041) do
end end
add_index "aspect_visibilities", ["aspect_id"], :name => "index_aspect_visibilities_on_aspect_id" add_index "aspect_visibilities", ["aspect_id"], :name => "index_aspect_visibilities_on_aspect_id"
add_index "aspect_visibilities", ["shareable_id", "aspect_id"], :name => "index_aspect_visibilities_on_post_id_and_aspect_id", :unique => true
add_index "aspect_visibilities", ["shareable_id", "shareable_type", "aspect_id"], :name => "shareable_and_aspect_id" add_index "aspect_visibilities", ["shareable_id", "shareable_type", "aspect_id"], :name => "shareable_and_aspect_id"
add_index "aspect_visibilities", ["shareable_id", "shareable_type"], :name => "index_aspect_visibilities_on_shareable_id_and_shareable_type" add_index "aspect_visibilities", ["shareable_id", "shareable_type"], :name => "index_aspect_visibilities_on_shareable_id_and_shareable_type"
add_index "aspect_visibilities", ["shareable_id"], :name => "index_aspect_visibilities_on_post_id"
create_table "aspects", :force => true do |t| create_table "aspects", :force => true do |t|
t.string "name", :null => false t.string "name", :null => false
...@@ -50,17 +48,17 @@ ActiveRecord::Schema.define(:version => 20111021184041) do ...@@ -50,17 +48,17 @@ ActiveRecord::Schema.define(:version => 20111021184041) do
add_index "aspects", ["user_id"], :name => "index_aspects_on_user_id" add_index "aspects", ["user_id"], :name => "index_aspects_on_user_id"
create_table "comments", :force => true do |t| create_table "comments", :force => true do |t|
t.text "text", :null => false t.text "text", :null => false
t.integer "commentable_id", :null => false t.integer "commentable_id", :null => false
t.integer "author_id", :null => false t.integer "author_id", :null => false
t.string "guid", :null => false t.string "guid", :null => false
t.text "author_signature" t.text "author_signature"
t.text "parent_author_signature" t.text "parent_author_signature"
t.text "youtube_titles" t.text "youtube_titles"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.integer "likes_count", :default => 0, :null => false t.integer "likes_count", :default => 0, :null => false
t.string "commentable_type", :default => "Post", :null => false t.string "commentable_type", :limit => 60, :default => "Post", :null => false
end end
add_index "comments", ["author_id"], :name => "index_comments_on_person_id" add_index "comments", ["author_id"], :name => "index_comments_on_person_id"
...@@ -366,17 +364,15 @@ ActiveRecord::Schema.define(:version => 20111021184041) do ...@@ -366,17 +364,15 @@ ActiveRecord::Schema.define(:version => 20111021184041) do
add_index "services", ["user_id"], :name => "index_services_on_user_id" add_index "services", ["user_id"], :name => "index_services_on_user_id"
create_table "share_visibilities", :force => true do |t| create_table "share_visibilities", :force => true do |t|
t.integer "shareable_id", :null => false t.integer "shareable_id", :null => false
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.boolean "hidden", :default => false, :null => false t.boolean "hidden", :default => false, :null => false
t.integer "contact_id", :null => false t.integer "contact_id", :null => false
t.string "shareable_type", :default => "Post", :null => false t.string "shareable_type", :limit => 60, :default => "Post", :null => false
end end
add_index "share_visibilities", ["contact_id", "shareable_id"], :name => "index_post_visibilities_on_contact_id_and_post_id", :unique => true
add_index "share_visibilities", ["contact_id"], :name => "index_post_visibilities_on_contact_id" add_index "share_visibilities", ["contact_id"], :name => "index_post_visibilities_on_contact_id"
add_index "share_visibilities", ["shareable_id", "hidden", "contact_id"], :name => "index_post_visibilities_on_post_id_and_hidden_and_contact_id", :unique => true
add_index "share_visibilities", ["shareable_id", "shareable_type", "contact_id"], :name => "shareable_and_contact_id" add_index "share_visibilities", ["shareable_id", "shareable_type", "contact_id"], :name => "shareable_and_contact_id"
add_index "share_visibilities", ["shareable_id", "shareable_type", "hidden", "contact_id"], :name => "shareable_and_hidden_and_contact_id" add_index "share_visibilities", ["shareable_id", "shareable_type", "hidden", "contact_id"], :name => "shareable_and_hidden_and_contact_id"
add_index "share_visibilities", ["shareable_id"], :name => "index_post_visibilities_on_post_id" add_index "share_visibilities", ["shareable_id"], :name => "index_post_visibilities_on_post_id"
......
...@@ -81,7 +81,7 @@ class Stream::Aspect < Stream::Base ...@@ -81,7 +81,7 @@ class Stream::Aspect < Stream::Base
# @return [String] # @return [String]
def title def title
if self.for_all_aspects? if self.for_all_aspects?
I18n.t('aspects.aspect_stream.stream') I18n.t('streams.aspects.title')
else else
self.aspects.to_sentence self.aspects.to_sentence
end end
......
...@@ -5,7 +5,7 @@ class Stream::Base ...@@ -5,7 +5,7 @@ class Stream::Base
def initialize(user, opts={}) def initialize(user, opts={})
self.user = user self.user = user
self.max_time = opts[:max_time] self.max_time = opts[:max_time]
self.order = opts[:order] self.order = opts[:order]
end end
# @return [Person] # @return [Person]
......
...@@ -9,7 +9,7 @@ class Stream::FollowedTag < Stream::Base ...@@ -9,7 +9,7 @@ class Stream::FollowedTag < Stream::Base
end end
def title def title
I18n.t('aspects.index.tags_following') I18n.t('streams.followed_tag.title')
end end
# @return [ActiveRecord::Association<Post>] AR association of posts # @return [ActiveRecord::Association<Post>] AR association of posts
...@@ -19,11 +19,9 @@ class Stream::FollowedTag < Stream::Base ...@@ -19,11 +19,9 @@ class Stream::FollowedTag < Stream::Base
end end
def contacts_title def contacts_title
I18n.translate('streams.tags.contacts_title') I18n.translate('streams.followed_tag.contacts_title')
end end
private private
def tag_string def tag_string
......
class Stream::Soup < Stream::Base class Stream::Multi < Stream::Base
def link(opts) def link(opts)
Rails.application.routes.url_helpers.soup_path Rails.application.routes.url_helpers.multi_path
end end
def title def title
I18n.t('streams.soup.title') I18n.t('streams.multi.title')
end end
def contacts_title def contacts_title
I18n.t('streams.soup.contacts_title') I18n.t('streams.multi.contacts_title')
end end
def posts def posts
...@@ -35,7 +35,7 @@ class Stream::Soup < Stream::Base ...@@ -35,7 +35,7 @@ class Stream::Soup < Stream::Base
def is_in?(sym, post) def is_in?(sym, post)
if self.send("#{sym.to_s}_post_ids").find{|x| x == post.id} if self.send("#{sym.to_s}_post_ids").find{|x| x == post.id}
"#{sym.to_s}_soup".to_sym "#{sym.to_s}_stream".to_sym
end end
end end
......
Diaspora.Pages.SoupsIndex = function() { Diaspora.Pages.MultisIndex = function() {
var self = this; var self = this;
this.subscribe("page/ready", function(evt, document) { this.subscribe("page/ready", function(evt, document) {
......
...@@ -3507,15 +3507,15 @@ ul#getting_started ...@@ -3507,15 +3507,15 @@ ul#getting_started
:padding 0 :padding 0
:margin 0 :margin 0
.community_spotlight_soup .community_spotlight_stream
.indicator .indicator
:background-color #DE5099 :background-color #DE5099
.followed_tags_soup .followed_tags_stream
.indicator .indicator
:background-color $blue :background-color $blue
.aspects_soup .aspects_stream
.indicator .indicator
:background-color $green :background-color $green
.mentioned_soup .mentioned_stream
.indicator .indicator
:background-color #E3E856 :background-color #E3E856
...@@ -12,20 +12,10 @@ describe HomeController do ...@@ -12,20 +12,10 @@ describe HomeController do
response.should_not be_redirect response.should_not be_redirect
end end
it 'redirects to aspects index if user is logged in' do it 'redirects to multis index if user is logged in' do
sign_in alice sign_in alice
get :show, :home => true get :show, :home => true
response.should redirect_to( :controller => 'aspects', :action => 'index') response.should redirect_to(multi_path)
end
it 'redirects to aspects index with stored aspects' do
sign_in alice
@aspect0 = alice.aspects.all[0]
@aspect1 = alice.aspects.create(:name => "Yeaaaah!")
@index_params = {:a_ids => [@aspect0.id.to_s, @aspect1.id.to_s]}
alice.save
get :show
response.should redirect_to( :controller => 'aspects', :action => 'index')
end end
describe "custom logging on success" do describe "custom logging on success" do
......
require 'spec_helper' require 'spec_helper'
require File.join(Rails.root, 'spec', 'shared_behaviors', 'stream') require File.join(Rails.root, 'spec', 'shared_behaviors', 'stream')
describe Stream::Soup do describe Stream::Multi do
before do before do
@stream = Stream::Soup.new(Factory(:user), :max_time => Time.now, :order => 'updated_at') @stream = Stream::Multi.new(Factory(:user), :max_time => Time.now, :order => 'updated_at')
end end
describe 'shared behaviors' do describe 'shared behaviors' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment