DG MS; added setting for displaying spotlight members in soup stream
This commit is contained in:
parent
1256b6f3fc
commit
79ec50a16c
11 changed files with 100 additions and 33 deletions
|
|
@ -41,12 +41,20 @@ class UsersController < ApplicationController
|
||||||
else
|
else
|
||||||
flash[:error] = I18n.t 'users.update.password_not_changed'
|
flash[:error] = I18n.t 'users.update.password_not_changed'
|
||||||
end
|
end
|
||||||
elsif u[:language]
|
elsif u[:show_community_spotlight_in_stream]
|
||||||
if @user.update_attributes(:language => u[:language])
|
if @user.update_attributes(u)
|
||||||
I18n.locale = @user.language
|
flash[:notice] = I18n.t 'users.update.settings_updated'
|
||||||
flash[:notice] = I18n.t 'users.update.language_changed'
|
redirect_to soup_path
|
||||||
|
return
|
||||||
else
|
else
|
||||||
flash[:error] = I18n.t 'users.update.language_not_changed'
|
flash[:notice] = I18n.t 'users.update.settings_not_updated'
|
||||||
|
end
|
||||||
|
elsif u[:language]
|
||||||
|
if @user.update_attributes(u)
|
||||||
|
I18n.locale = @user.language
|
||||||
|
flash[:notice] = I18n.t 'users.update.language_updated'
|
||||||
|
else
|
||||||
|
flash[:error] = I18n.t 'users.update.language_not_updated'
|
||||||
end
|
end
|
||||||
elsif u[:email]
|
elsif u[:email]
|
||||||
@user.unconfirmed_email = u[:email]
|
@user.unconfirmed_email = u[:email]
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,8 @@ module InterimStreamHackinessHelper
|
||||||
def what_soup_sentence(post)
|
def what_soup_sentence(post)
|
||||||
from_group(post).map{|x| x.to_s.gsub("_soup", '').gsub('_',' ').titleize}.to_sentence
|
from_group(post).map{|x| x.to_s.gsub("_soup", '').gsub('_',' ').titleize}.to_sentence
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def stream_settings_link(post)
|
||||||
|
link_to "", "#{edit_user_path}#stream-preferences"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,8 @@ class User < ActiveRecord::Base
|
||||||
:language,
|
:language,
|
||||||
:disable_mail,
|
:disable_mail,
|
||||||
:invitation_service,
|
:invitation_service,
|
||||||
:invitation_identifier
|
:invitation_identifier,
|
||||||
|
:show_community_spotlight_in_stream
|
||||||
|
|
||||||
|
|
||||||
def self.all_sharing_with_person(person)
|
def self.all_sharing_with_person(person)
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,12 @@
|
||||||
= render 'shared/publisher', :selected_aspects => stream.aspects, :aspect_ids => stream.aspect_ids, :for_all_aspects => stream.for_all_aspects?, :aspect => stream.aspect
|
= render 'shared/publisher', :selected_aspects => stream.aspects, :aspect_ids => stream.aspect_ids, :for_all_aspects => stream.for_all_aspects?, :aspect => stream.aspect
|
||||||
= render 'aspects/no_posts_message'
|
= render 'aspects/no_posts_message'
|
||||||
|
|
||||||
- if current_user.contacts.size < 2
|
|
||||||
= render 'aspects/no_contacts_message'
|
|
||||||
|
|
||||||
#main_stream.stream{:data => {:guids => stream.aspect_ids.join(','), :time_for_scroll => time_for_scroll(stream.ajax_stream?, stream)}}
|
#main_stream.stream{:data => {:guids => stream.aspect_ids.join(','), :time_for_scroll => time_for_scroll(stream.ajax_stream?, stream)}}
|
||||||
- if !stream.ajax_stream? && stream.posts.length > 0
|
- if !stream.ajax_stream? && stream.posts.length > 0
|
||||||
= render 'shared/stream', :posts => stream.posts
|
= render 'shared/stream', :posts => stream.posts
|
||||||
#pagination
|
#pagination
|
||||||
=link_to(t('more'), next_page_path(:ajax_stream => stream.ajax_stream?), :class => 'paginate')
|
=link_to(t('more'), next_page_path(:ajax_stream => stream.ajax_stream?), :class => 'paginate')
|
||||||
|
|
||||||
|
- if current_user.contacts.size < 2
|
||||||
|
= render 'aspects/no_contacts_message'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,10 @@
|
||||||
%p
|
%p
|
||||||
= 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 => "from #{what_soup_sentence(post)}"}
|
||||||
|
= stream_settings_link(post)
|
||||||
|
|
||||||
.sm_body
|
.sm_body
|
||||||
= person_image_link(post.author, :size => :thumb_small)
|
= person_image_link(post.author, :size => :thumb_small)
|
||||||
.content
|
.content
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,24 @@
|
||||||
= f.select :language, available_language_options
|
= f.select :language, available_language_options
|
||||||
= f.submit t('.change_language')
|
= f.submit t('.change_language')
|
||||||
|
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
%hr
|
||||||
|
|
||||||
|
%br
|
||||||
|
|
||||||
|
%h3#stream-preferences
|
||||||
|
= t('.stream_preferences')
|
||||||
|
= form_for current_user, :url => user_path, :html => { :method => :put } do |f|
|
||||||
|
= f.error_messages
|
||||||
|
|
||||||
|
%p.checkbox_select
|
||||||
|
= f.label t('.show_community_spotlight')
|
||||||
|
= f.check_box :show_community_spotlight_in_stream
|
||||||
|
|
||||||
|
%br
|
||||||
|
= f.submit t('.change'), :class => 'button'
|
||||||
|
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
%hr
|
%hr
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ en:
|
||||||
start_talking: "Nobody has said anything yet!"
|
start_talking: "Nobody has said anything yet!"
|
||||||
no_contacts_message:
|
no_contacts_message:
|
||||||
you_should_add_some_more_contacts: "You should add some more contacts!"
|
you_should_add_some_more_contacts: "You should add some more contacts!"
|
||||||
try_adding_some_more_contacts: "You can search (top) or invite (right) more contacts."
|
try_adding_some_more_contacts: "You can search or invite more contacts."
|
||||||
or_spotlight: "Or you can share with %{link}"
|
or_spotlight: "Or you can share with %{link}"
|
||||||
community_spotlight: "community spotlight"
|
community_spotlight: "community spotlight"
|
||||||
aspect_listings:
|
aspect_listings:
|
||||||
|
|
@ -876,6 +876,8 @@ en:
|
||||||
reshared: "...someone reshares your post?"
|
reshared: "...someone reshares your post?"
|
||||||
change: "Change"
|
change: "Change"
|
||||||
email_awaiting_confirmation: "We have sent you an activation link to %{unconfirmed_email}. Until you follow this link and activate the new address, we will continue to use your original address %{email}."
|
email_awaiting_confirmation: "We have sent you an activation link to %{unconfirmed_email}. Until you follow this link and activate the new address, we will continue to use your original address %{email}."
|
||||||
|
stream_preferences: "Stream Preferences"
|
||||||
|
show_community_spotlight: "Show Community Spotlight in Stream?"
|
||||||
destroy: "Your account has been locked. It may take 20 minutes for us to finish closing your account. Thank you for trying Diaspora."
|
destroy: "Your account has been locked. It may take 20 minutes for us to finish closing your account. Thank you for trying Diaspora."
|
||||||
getting_started:
|
getting_started:
|
||||||
welcome: "Welcome!"
|
welcome: "Welcome!"
|
||||||
|
|
@ -924,8 +926,13 @@ en:
|
||||||
update:
|
update:
|
||||||
password_changed: "Password changed. You can now log in with your new password."
|
password_changed: "Password changed. You can now log in with your new password."
|
||||||
password_not_changed: "Password change failed"
|
password_not_changed: "Password change failed"
|
||||||
|
|
||||||
language_changed: "Language changed"
|
language_changed: "Language changed"
|
||||||
language_not_changed: "Language change failed"
|
language_not_changed: "Language change failed"
|
||||||
|
|
||||||
|
settings_updated: "Settings updated"
|
||||||
|
settings_not_updated: "Settings update failed"
|
||||||
|
|
||||||
email_notifications_changed: "Email notifications changed"
|
email_notifications_changed: "Email notifications changed"
|
||||||
unconfirmed_email_changed: "Email changed. Needs activation."
|
unconfirmed_email_changed: "Email changed. Needs activation."
|
||||||
unconfirmed_email_not_changed: "Email change failed"
|
unconfirmed_email_not_changed: "Email change failed"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
class AddCommunitySpotlightInStream < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
add_column :users, :show_community_spotlight_in_stream, :boolean, :null => false, :default => true
|
||||||
|
|
||||||
|
ActiveRecord::Base.connection.execute <<SQL
|
||||||
|
UPDATE users
|
||||||
|
SET show_community_spotlight_in_stream = false
|
||||||
|
SQL
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
remove_column :users , :show_community_spotlight_in_stream
|
||||||
|
end
|
||||||
|
end
|
||||||
11
db/schema.rb
11
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20111018010003) do
|
ActiveRecord::Schema.define(:version => 20111021184041) do
|
||||||
|
|
||||||
create_table "aspect_memberships", :force => true do |t|
|
create_table "aspect_memberships", :force => true do |t|
|
||||||
t.integer "aspect_id", :null => false
|
t.integer "aspect_id", :null => false
|
||||||
|
|
@ -32,8 +32,10 @@ ActiveRecord::Schema.define(:version => 20111018010003) 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
|
||||||
|
|
@ -58,7 +60,7 @@ ActiveRecord::Schema.define(:version => 20111018010003) do
|
||||||
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", :limit => 60, :default => "Post", :null => false
|
t.string "commentable_type", :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"
|
||||||
|
|
@ -369,10 +371,12 @@ ActiveRecord::Schema.define(:version => 20111018010003) do
|
||||||
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", :limit => 60, :default => "Post", :null => false
|
t.string "shareable_type", :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"
|
||||||
|
|
@ -441,6 +445,7 @@ ActiveRecord::Schema.define(:version => 20111018010003) do
|
||||||
t.string "unconfirmed_email"
|
t.string "unconfirmed_email"
|
||||||
t.string "confirm_email_token", :limit => 30
|
t.string "confirm_email_token", :limit => 30
|
||||||
t.datetime "locked_at"
|
t.datetime "locked_at"
|
||||||
|
t.boolean "show_community_spotlight_in_stream", :default => true, :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true
|
add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class Stream::Soup < Stream::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def include_community_spotlight?
|
def include_community_spotlight?
|
||||||
false
|
user.show_community_spotlight_in_stream?
|
||||||
end
|
end
|
||||||
|
|
||||||
def aspects_post_ids
|
def aspects_post_ids
|
||||||
|
|
|
||||||
|
|
@ -3500,6 +3500,12 @@ ul#getting_started
|
||||||
:height 4px
|
:height 4px
|
||||||
:float right
|
:float right
|
||||||
|
|
||||||
|
a
|
||||||
|
:display block
|
||||||
|
:height 100%
|
||||||
|
:width 100%
|
||||||
|
:padding 0
|
||||||
|
:margin 0
|
||||||
|
|
||||||
.community_spotlight_soup
|
.community_spotlight_soup
|
||||||
.indicator
|
.indicator
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue