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
def show
if current_user
redirect_to :controller => 'aspects', :action => 'index'
redirect_to multi_path
elsif is_mobile_device?
redirect_to user_session_path
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
elsif u[:show_community_spotlight_in_stream]
if @user.update_attributes(u)
flash[:notice] = I18n.t 'users.update.settings_updated'
redirect_to soup_path
redirect_to multi_path
return
else
flash[:notice] = I18n.t 'users.update.settings_not_updated'
......
......@@ -21,15 +21,15 @@ module InterimStreamHackinessHelper
end
def from_group(post)
if defined?(@stream) && params[:controller]== 'soups'
if defined?(@stream) && params[:controller] == 'multis'
@stream.post_from_group(post)
else
[]
end
end
def what_soup_sentence(post)
from_group(post).map{|x| x.to_s.gsub("_soup", '').gsub('_',' ').titleize}.to_sentence
def what_stream_sentence(post)
from_group(post).map{|x| I18n.t("streams.#{x.to_s}")}.to_sentence
end
def stream_settings_link(post)
......
......@@ -16,8 +16,8 @@ module StreamHelper
spotlight_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(MentionsController)
mentions_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(SoupsController)
soup_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(MultisController)
multi_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(PostsController)
public_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(AspectsController)
......
......@@ -4,11 +4,11 @@
#aspect_stream_header
#sort_by
= t('.recently')
= t('streams.recently')
%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
= stream.title
......
......@@ -16,13 +16,13 @@
.section
%ul.left_nav
%li
= link_to "Welcome", getting_started_path, :class => "home_selector"
= link_to t(".welcome"), getting_started_path, :class => "home_selector"
.section
%ul.left_nav
%li
%b
= link_to "Soup", soup_path, :class => 'home_selector'
= link_to t("streams.multi.title"), multi_path, :class => 'home_selector'
.section
= render 'aspects/aspect_listings', :stream => @stream
......@@ -31,7 +31,7 @@
%ul.left_nav
%li
%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
= render 'tags/followed_tags_listings'
......
......@@ -18,7 +18,7 @@
= 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
.indicator{:title => "from #{what_soup_sentence(post)}"}
.indicator{:title => "#{what_stream_sentence(post)}"}
= stream_settings_link(post)
.sm_body
......
......@@ -5,7 +5,7 @@
- if user_signed_in?
%ul.left_nav
%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
- if tags.size > 0
......
......@@ -104,12 +104,6 @@ en:
updating: "updating"
aspect_contacts:
done_editing: "done editing"
aspect_stream:
stream: "Stream"
mentions: "Mentions"
recently: "recently:"
commented_on: "commented on"
posted: "posted"
show:
edit_aspect: "edit aspect"
no_posts_message:
......@@ -129,7 +123,6 @@ en:
view_all_contacts: "View all contacts"
no_contacts: "You don't have any contacts here yet."
manage_your_aspects: "Manage your aspects."
new:
name: "Name (only visible to you)"
create: "Create"
......@@ -159,13 +152,12 @@ en:
acquaintances: "Acquaintances"
friends: "Friends"
index:
mentions: "Mentions"
welcome: "Welcome"
community_spotlight: "Community Spotlight"
see_more_from_us: "See more of the D* community."
donate: "Donate"
keep_us_running: "Keep %{pod} running fast and buy servers their coffee fix with a monthly donation!"
your_aspects: "Your Aspects"
tags_following: "Followed Tags"
no_tags: "+ Find a tag to follow"
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."
......@@ -833,18 +825,36 @@ en:
no_applications: "You haven't registered any applications yet."
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:
title: "Your Mentions"
title: "@Mentions"
contacts_title: "People who mentioned you"
followed_tag:
title: "#Followed Tags"
contacts_title: "People who dig these tags"
tags:
title: "Posts tagged: %{tags}"
contacts_title: "People who dig these tags"
contacts_title: "People who dig this tag"
public:
title: "Public Activity"
contacts_title: "Recent Posters"
soup:
title: "The Soup"
contacts_title: "People in your Soup"
multi:
title: "Stream"
contacts_title: "People in your Stream"
aspects:
title: "Your Aspects"
users:
logged_out:
......
......@@ -113,7 +113,7 @@ Diaspora::Application.routes.draw do
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 :status_messages
......
......@@ -32,10 +32,8 @@ ActiveRecord::Schema.define(:version => 20111021184041) do
end
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"], :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|
t.string "name", :null => false
......@@ -50,17 +48,17 @@ ActiveRecord::Schema.define(:version => 20111021184041) do
add_index "aspects", ["user_id"], :name => "index_aspects_on_user_id"
create_table "comments", :force => true do |t|
t.text "text", :null => false
t.integer "commentable_id", :null => false
t.integer "author_id", :null => false
t.string "guid", :null => false
t.text "text", :null => false
t.integer "commentable_id", :null => false
t.integer "author_id", :null => false
t.string "guid", :null => false
t.text "author_signature"
t.text "parent_author_signature"
t.text "youtube_titles"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "likes_count", :default => 0, :null => false
t.string "commentable_type", :default => "Post", :null => false
t.integer "likes_count", :default => 0, :null => false
t.string "commentable_type", :limit => 60, :default => "Post", :null => false
end
add_index "comments", ["author_id"], :name => "index_comments_on_person_id"
......@@ -366,17 +364,15 @@ ActiveRecord::Schema.define(:version => 20111021184041) do
add_index "services", ["user_id"], :name => "index_services_on_user_id"
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 "updated_at"
t.boolean "hidden", :default => false, :null => false
t.integer "contact_id", :null => false
t.string "shareable_type", :default => "Post", :null => false
t.boolean "hidden", :default => false, :null => false
t.integer "contact_id", :null => false
t.string "shareable_type", :limit => 60, :default => "Post", :null => false
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", ["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", "hidden", "contact_id"], :name => "shareable_and_hidden_and_contact_id"
add_index "share_visibilities", ["shareable_id"], :name => "index_post_visibilities_on_post_id"
......
......@@ -81,7 +81,7 @@ class Stream::Aspect < Stream::Base
# @return [String]
def title
if self.for_all_aspects?
I18n.t('aspects.aspect_stream.stream')
I18n.t('streams.aspects.title')
else
self.aspects.to_sentence
end
......
......@@ -5,7 +5,7 @@ class Stream::Base
def initialize(user, opts={})
self.user = user
self.max_time = opts[:max_time]
self.order = opts[:order]
self.order = opts[:order]
end
# @return [Person]
......
......@@ -9,7 +9,7 @@ class Stream::FollowedTag < Stream::Base
end
def title
I18n.t('aspects.index.tags_following')
I18n.t('streams.followed_tag.title')
end
# @return [ActiveRecord::Association<Post>] AR association of posts
......@@ -19,11 +19,9 @@ class Stream::FollowedTag < Stream::Base
end
def contacts_title
I18n.translate('streams.tags.contacts_title')
I18n.translate('streams.followed_tag.contacts_title')
end
private
def tag_string
......
class Stream::Soup < Stream::Base
class Stream::Multi < Stream::Base
def link(opts)
Rails.application.routes.url_helpers.soup_path
Rails.application.routes.url_helpers.multi_path
end
def title
I18n.t('streams.soup.title')
I18n.t('streams.multi.title')
end
def contacts_title
I18n.t('streams.soup.contacts_title')
I18n.t('streams.multi.contacts_title')
end
def posts
......@@ -35,7 +35,7 @@ class Stream::Soup < Stream::Base
def is_in?(sym, post)
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
......
Diaspora.Pages.SoupsIndex = function() {
Diaspora.Pages.MultisIndex = function() {
var self = this;
this.subscribe("page/ready", function(evt, document) {
......
......@@ -3507,15 +3507,15 @@ ul#getting_started
:padding 0
:margin 0
.community_spotlight_soup
.community_spotlight_stream
.indicator
:background-color #DE5099
.followed_tags_soup
.followed_tags_stream
.indicator
:background-color $blue
.aspects_soup
.aspects_stream
.indicator
:background-color $green
.mentioned_soup
.mentioned_stream
.indicator
:background-color #E3E856
......@@ -12,20 +12,10 @@ describe HomeController do
response.should_not be_redirect
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
get :show, :home => true
response.should redirect_to( :controller => 'aspects', :action => 'index')
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')
response.should redirect_to(multi_path)
end
describe "custom logging on success" do
......
require 'spec_helper'
require File.join(Rails.root, 'spec', 'shared_behaviors', 'stream')
describe Stream::Soup do
describe Stream::Multi 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
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