From 78c3d91abdf29bf7bbfd3eb366ee2b312830a156 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Sun, 31 Jul 2011 12:29:56 +0200 Subject: [PATCH 001/133] Show correct contact count in right bar when changing target aspect. --- app/controllers/aspects_controller.rb | 2 +- app/views/aspects/index.js.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index a13b47fcb..13d1aff4e 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -52,7 +52,7 @@ class AspectsController < ApplicationController if params[:only_posts] render :partial => 'shared/stream', :locals => {:posts => @posts} else - @contact_count = current_user.contacts.receiving.count + @contact_count = all_selected_people.count @aspect = :all unless params[:a_ids] @aspect ||= @aspects.first # used in mobile diff --git a/app/views/aspects/index.js.erb b/app/views/aspects/index.js.erb index 1d61bd5a1..c001b58f0 100644 --- a/app/views/aspects/index.js.erb +++ b/app/views/aspects/index.js.erb @@ -1,3 +1,3 @@ $('#aspect_stream_container').html("<%= escape_javascript(render('aspects/aspect_stream', :aspect => @aspect, :aspect_ids => @aspect_ids, :posts => @posts)) %>"); -$('#selected_aspect_contacts').html("<%= escape_javascript(render('aspects/selected_contacts', :people => @selected_people[0..19], :count => @selected_people.size )) %>"); +$('#selected_aspect_contacts').html("<%= escape_javascript(render('aspects/selected_contacts', :people => @selected_people[0..19], :count => @contact_count )) %>"); $('#aspect_stream_container a[rel*=facebox]').facebox(); From fead6032f716c9c7459e4deec5f7083de8de0392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sch=C3=B6lling?= Date: Tue, 26 Jul 2011 23:59:03 +0200 Subject: [PATCH 002/133] Issue 1586: added a aspect drop down next to the submit button in the publisher --- app/controllers/people_controller.rb | 2 +- app/helpers/aspect_global_helper.rb | 20 +++++++++- .../_aspect_dropdown.html.haml | 21 ---------- app/views/contacts/sharing.haml | 2 +- app/views/notifications/index.html.haml | 2 +- .../people/_aspect_membership_dropdown.haml | 1 + app/views/people/_relationship_action.haml | 2 +- app/views/shared/_aspect_dropdown.html.haml | 24 ++++++++++++ .../_aspect_dropdown_list_item.haml | 0 app/views/shared/_publisher.html.haml | 7 +--- config/assets.yml | 1 + public/javascripts/aspects-dropdown.js | 33 ++++++++++++++++ public/javascripts/contact-edit.js | 38 +++---------------- public/javascripts/publisher.js | 25 ++++++++---- public/stylesheets/sass/application.sass | 14 +++++-- 15 files changed, 116 insertions(+), 76 deletions(-) delete mode 100644 app/views/aspect_memberships/_aspect_dropdown.html.haml create mode 100644 app/views/people/_aspect_membership_dropdown.haml create mode 100644 app/views/shared/_aspect_dropdown.html.haml rename app/views/{aspect_memberships => shared}/_aspect_dropdown_list_item.haml (100%) create mode 100644 public/javascripts/aspects-dropdown.js diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index a627d2498..32d942946 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -148,7 +148,7 @@ class PeopleController < ApplicationController def aspect_membership_dropdown @person = Person.find(params[:person_id]) @contact = current_user.contact_for(@person) || Contact.new - render :partial => 'aspect_memberships/aspect_dropdown', :locals => {:contact => @contact, :person => @person, :hang => 'left'} + render :partial => 'aspect_membership_dropdown', :locals => {:contact => @contact, :person => @person} end private diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index 5d7b71c76..675af2e9d 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -65,8 +65,24 @@ module AspectGlobalHelper end end - def aspect_dropdown_list_item(aspect, contact, person) - checked = (contact.persisted? && contact.aspect_memberships.detect{ |am| am.aspect_id == aspect.id}) + def aspectmembership_dropdown(contact, person, hang, aspect=nil) + @selected_aspects = [] + if contact.persisted? + @selected_aspects = all_aspects.find_all{|aspect| contact.aspect_memberships.detect{ |am| am.aspect_id == aspect.id}} + end + @selected_aspects = [@selected_aspects] if @selected_aspects.kind_of? Aspect + + render "shared/aspect_dropdown", + :contact => @contact, + :selected_aspects => @selected_aspects, + :person => person, + :hang => hang, + :dropdown_class => "aspect_membership", + :button_class => ("in_aspects" if @selected_aspects.size > 0), + :may_create_new_aspect => ( @aspect == :profile || @aspect == :tag || @aspect == :search || @aspect == :notification) + end + + def aspect_dropdown_list_item(aspect, checked) klass = checked ? "selected" : "" str = < "hang_#{hang}"} - .button.toggle{:class => ("in_aspects" if contact.aspects.size > 0)} - - if contact.aspects.size == 1 - = contact.aspects.first.name - - else - = t('.toggle', :count => contact.aspects.size) - ▼ - - .wrapper - %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => ((person.id) if person)} - - for aspect in all_aspects - = aspect_dropdown_list_item(aspect, contact, person) - - - if defined?(@aspect) && ( @aspect == :profile || @aspect == :getting_started || @aspect == :tag || @aspect == :search || @aspect == :notification) - %li.newItem - .add_aspect - = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id), :rel => 'facebox', :class => 'new_aspect' diff --git a/app/views/contacts/sharing.haml b/app/views/contacts/sharing.haml index 8e687f361..7ac6883c5 100644 --- a/app/views/contacts/sharing.haml +++ b/app/views/contacts/sharing.haml @@ -23,7 +23,7 @@ = contact.person.diaspora_handle .right - = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => contact.person, :hang => 'right' + = aspectmembership_dropdown(contact, contact.person, 'right') %br %div{:style => "text-align:right;"} diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index cc02bb16a..c78a657cd 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -24,7 +24,7 @@ .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note[:target]) .right - = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => note[:target], :hang => 'left' + = aspectmembership_dropdown(contact, note[:target], 'left') %span.from = notification_message_for(note) diff --git a/app/views/people/_aspect_membership_dropdown.haml b/app/views/people/_aspect_membership_dropdown.haml new file mode 100644 index 000000000..0636c85a1 --- /dev/null +++ b/app/views/people/_aspect_membership_dropdown.haml @@ -0,0 +1 @@ += aspectmembership_dropdown(@contact, @person, 'left') diff --git a/app/views/people/_relationship_action.haml b/app/views/people/_relationship_action.haml index 9f70f9981..744b6dc9b 100644 --- a/app/views/people/_relationship_action.haml +++ b/app/views/people/_relationship_action.haml @@ -1,6 +1,6 @@ - unless person == current_user.person - contact = current_user.contacts.find_by_person_id(person.id) - contact ||= Contact.new(:person => person) - = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => person, :hang => 'left' + = aspectmembership_dropdown(contact, person, 'left') -else = t('people.person.thats_you') diff --git a/app/views/shared/_aspect_dropdown.html.haml b/app/views/shared/_aspect_dropdown.html.haml new file mode 100644 index 000000000..13ddfa5c8 --- /dev/null +++ b/app/views/shared/_aspect_dropdown.html.haml @@ -0,0 +1,24 @@ +-# Copyright (c) 2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +.dropdown{:class => ["hang_#{hang}", defined?(dropdown_class) && dropdown_class]} + - selected_aspects = [selected_aspects] if selected_aspects.kind_of? Aspect + - if !selected_aspects.kind_of? Array + - selected_aspects = all_aspects + .button.toggle{:class => (button_class if defined?(button_class))} + - if selected_aspects.size == 1 + = selected_aspects.first.name + - else + = t('.toggle', :count => selected_aspects.size) + ▼ + + .wrapper + %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => (person.id if defined?person && person)} + - for aspect in all_aspects + = aspect_dropdown_list_item(aspect, selected_aspects.include?(aspect) ) + + - if (defined?may_create_new_aspect && may_create_new_aspect) && (defined?person && person) + %li.newItem + .add_aspect + = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id), :rel => 'facebox' diff --git a/app/views/aspect_memberships/_aspect_dropdown_list_item.haml b/app/views/shared/_aspect_dropdown_list_item.haml similarity index 100% rename from app/views/aspect_memberships/_aspect_dropdown_list_item.haml rename to app/views/shared/_aspect_dropdown_list_item.haml diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index d899c3d02..0261c4ef0 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -29,12 +29,6 @@ = hidden_field_tag 'aspect_ids[]', aspect_id.to_s .options_and_submit - - if aspect == :profile - .mention_helper - .badges - %i= t('.publishing_to') - = aspect_badges(aspects_with_person, :link => false) - .public_toggle %span#publisher_service_icons = t("shared.publisher.click_to_share_with") @@ -45,6 +39,7 @@ - for service in current_user.services = image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider.titleize, :class => "service_icon dim", :id =>"#{service.provider}", :maxchar => "#{service.class::MAX_CHARACTERS}" = link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage') + = render "shared/aspect_dropdown", :selected_aspects => Aspect.find(aspect_ids), :hang => 'left' = status.submit t('.share'), :disable_with => t('.posting'), :class => 'button creation', :tabindex => 2 .facebox_content diff --git a/config/assets.yml b/config/assets.yml index d8a16bd96..3533bc519 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -42,6 +42,7 @@ javascripts: - public/javascripts/stream.js - public/javascripts/content-updater.js - public/javascripts/search.js + - public/javascripts/aspects-dropdown.js - public/javascripts/contact-edit.js - public/javascripts/contact-list.js - public/javascripts/aspect-sorting.js diff --git a/public/javascripts/aspects-dropdown.js b/public/javascripts/aspects-dropdown.js new file mode 100644 index 000000000..5aed7eeb9 --- /dev/null +++ b/public/javascripts/aspects-dropdown.js @@ -0,0 +1,33 @@ +// Copyright (c) 2011, Diaspora Inc. This file is +// licensed under the Affero General Public License version 3 or later. See +// the COPYRIGHT file. + +var AspectsDropdown = { + updateNumber: function(dropdown, personId, number, inAspectClass){ + var button = dropdown.parents(".dropdown").children('.button.toggle'), + replacement; + + if (number == 0) { + button.removeClass(inAspectClass); + replacement = Diaspora.widgets.i18n.t("aspect_dropdown.toggle.zero"); + }else if (number == 1) { + button.addClass(inAspectClass); + replacement = dropdown.find(".selected").first().text(); + }else if (number < 3) { + replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.few', { count: number.toString()}) + }else if (number > 3) { + replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.many', { count: number.toString()}) + }else { + //the above one are a tautology, but I want to have them here once for once we figure out a neat way i18n them + replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.other', { count: number.toString()}) + } + + button.html(replacement + ' ▼'); + }, + + toggleCheckbox: + function(check){ + check.parent('li').toggleClass('selected'); + }, +}; + diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index b12dbb9d7..4b585f72f 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -4,38 +4,12 @@ var ContactEdit = { init: function(){ - $('.dropdown .dropdown_list > li').live('click', function(evt){ + $.extend(ContactEdit, AspectsDropdown); + $('.dropdown.aspect_membership .dropdown_list > li').live('click', function(evt){ ContactEdit.processClick($(this), evt); }); }, - updateNumber: function(dropdown, personId, number){ - var button = dropdown.parents(".dropdown").children('.button.toggle'), - replacement; - - if (number == 0) { - button.removeClass("in_aspects"); - replacement = Diaspora.widgets.i18n.t("aspect_dropdown.toggle.zero"); - }else if (number == 1) { - button.addClass("in_aspects"); - replacement = dropdown.find(".selected").first().text(); - }else if (number < 3) { - replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.few', { count: number.toString()}) - }else if (number > 3) { - replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.many', { count: number.toString()}) - }else { - //the above one are a tautology, but I want to have them here once for once we figure out a neat way i18n them - replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.other', { count: number.toString()}) - } - - button.html(replacement + ' ▼'); - }, - - toggleCheckbox: - function(check){ - check.parent('li').toggleClass('selected'); - }, - processClick: function(li, evt){ var button = li.find('.button'); if(button.hasClass('disabled') || li.hasClass('newItem')){ return; } @@ -50,13 +24,13 @@ var ContactEdit = { "_method": (selected) ? "DELETE" : "POST" }, function(aspectMembership) { ContactEdit.toggleCheckbox(checkbox); - ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length); + ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length, 'in_aspect'); Diaspora.widgets.publish("aspectDropdown/updated", [li.parent().data("person_id"), li.parents(".dropdown").parent(".right").html()]); }); }, }; - $(document).ready(function(){ - ContactEdit.init(); - }); +$(document).ready(function(){ + ContactEdit.init(); +}); diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 77950f6e2..5549da2d4 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -340,16 +340,24 @@ var Publisher = { }, bindAspectToggles: function() { - $('#publisher .aspect_badge').bind("click", function(){ - var unremovedAspects = $(this).parent().children('.aspect_badge').length - $(this).parent().children(".aspect_badge.removed").length; - if(!$(this).hasClass('removed') && ( unremovedAspects == 1 )){ - alert(Diaspora.widgets.i18n.t('publisher.at_least_one_aspect')); - }else{ - Publisher.toggleAspectIds($(this).children('a').attr('data-guid')); - $(this).toggleClass("removed"); - } + $('#publisher .dropdown .dropdown_list li').bind("click", function(evt){ + var li = $(this), + button = li.find('.button'), + checkbox = li.find('img.check'); + if(button.hasClass('disabled')) { return; } + + AspectsDropdown.toggleCheckbox(checkbox); + AspectsDropdown.updateNumber(li.closest(".dropdown_list"), null, li.parent().find('li.selected').length, ''); + + Publisher.toggleAspectIds(li.attr('data-aspect_id')); }); }, + beforeSubmit: function(){ + if($("#publisher .content_creation form #aspect_ids_").length == 0){ + alert(Diaspora.widgets.i18n.t('publisher.at_least_one_aspect')); + return false; + } + }, onSubmit: function(data, json, xhr){ $("#photodropzone").find('li').remove(); $("#publisher textarea").removeClass("with_attachments").css('paddingBottom', ''); @@ -371,6 +379,7 @@ var Publisher = { Stream.setUpAudioLinks(); }, bindAjax: function(){ + Publisher.form().bind('submit', Publisher.beforeSubmit); Publisher.form().bind('ajax:loading', Publisher.onSubmit); Publisher.form().bind('ajax:failure', Publisher.onFailure); Publisher.form().bind('ajax:success', Publisher.onSuccess); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index d2c1cd02f..2a6ccff02 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -765,8 +765,12 @@ a.paginate, #infscr-loading &:hover :border 1px solid #1C6D99 -#main_stream .pagination - :display none +#main_stream + :position relative + :z-index 0 + + .pagination + :display none .request_buttons :position absolute @@ -866,7 +870,7 @@ label #publisher - :z-index 0 + :z-index 1 :color #999 :position relative :margin @@ -930,6 +934,9 @@ label .public_toggle :text :align right + .dropdown + :text + :align left #publisher_service_icons :position relative @@ -945,6 +952,7 @@ label :position relative :top -2px + .content_creation :margin :top 1em From d9484e3dd5979f1969f726aca11f47b547b0903e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sch=C3=B6lling?= Date: Wed, 27 Jul 2011 20:48:58 +0200 Subject: [PATCH 003/133] Added a JS notification if the aspect the user posted to is not visible --- public/javascripts/publisher.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 5549da2d4..d3265c2ec 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -315,6 +315,12 @@ var Publisher = { ''); } }, + selectedAspectIds: function() { + var aspects = $('#publisher [name="aspect_ids[]"]'); + var aspectIds = []; + aspects.each(function() { aspectIds.push( parseInt($(this).attr('value'))); }); + return aspectIds; + }, toggleAspectIds: function(aspectId) { var hidden_field = $('#publisher [name="aspect_ids[]"][value="'+aspectId+'"]'); if(hidden_field.length > 0){ @@ -338,7 +344,6 @@ var Publisher = { $('#status_message_fake_text').charCount({allowed: min, warning: min/10 }); } }, - bindAspectToggles: function() { $('#publisher .dropdown .dropdown_list li').bind("click", function(evt){ var li = $(this), @@ -371,7 +376,21 @@ var Publisher = { } }, onSuccess: function(data, json, xhr){ - ContentUpdater.addPostToStream(json.html); + var isPostVisible = false; + var postedTo = Publisher.selectedAspectIds(); + $.each(AspectFilters.selectedGUIDS, function(index, value){ + if(postedTo.indexOf(parseInt(value))>-1) + isPostVisible = true; + }); + + if(isPostVisible) + ContentUpdater.addPostToStream(json.html); + else + Diaspora.widgets.flashes.render({ + success: true, + message: Diaspora.widgets.i18n.t('successfully_posted_message_to_an_aspects_that_is_not_visible') + }); + //collapse publisher Publisher.close(); Publisher.clear(); From 08ae8d23cc8195943e778ed2496f839bab5b9185 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 4 Aug 2011 22:28:10 -0700 Subject: [PATCH 004/133] aspect_membership_dropdown, not aspectmembership --- app/helpers/aspect_global_helper.rb | 2 +- app/views/contacts/sharing.haml | 2 +- app/views/notifications/index.html.haml | 2 +- app/views/people/_aspect_membership_dropdown.haml | 2 +- app/views/people/_relationship_action.haml | 2 +- app/views/people/_sub_header.html.haml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index 675af2e9d..77428b8fb 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -65,7 +65,7 @@ module AspectGlobalHelper end end - def aspectmembership_dropdown(contact, person, hang, aspect=nil) + def aspect_membership_dropdown(contact, person, hang, aspect=nil) @selected_aspects = [] if contact.persisted? @selected_aspects = all_aspects.find_all{|aspect| contact.aspect_memberships.detect{ |am| am.aspect_id == aspect.id}} diff --git a/app/views/contacts/sharing.haml b/app/views/contacts/sharing.haml index 7ac6883c5..3ef702ece 100644 --- a/app/views/contacts/sharing.haml +++ b/app/views/contacts/sharing.haml @@ -23,7 +23,7 @@ = contact.person.diaspora_handle .right - = aspectmembership_dropdown(contact, contact.person, 'right') + = aspect_membership_dropdown(contact, contact.person, 'right') %br %div{:style => "text-align:right;"} diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index c78a657cd..a09e5086d 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -24,7 +24,7 @@ .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note[:target]) .right - = aspectmembership_dropdown(contact, note[:target], 'left') + = aspect_memberhip_dropdown(contact, note[:target], 'left') %span.from = notification_message_for(note) diff --git a/app/views/people/_aspect_membership_dropdown.haml b/app/views/people/_aspect_membership_dropdown.haml index 0636c85a1..c344095d1 100644 --- a/app/views/people/_aspect_membership_dropdown.haml +++ b/app/views/people/_aspect_membership_dropdown.haml @@ -1 +1 @@ -= aspectmembership_dropdown(@contact, @person, 'left') += aspect_memberhip_dropdown(@contact, @person, 'left') diff --git a/app/views/people/_relationship_action.haml b/app/views/people/_relationship_action.haml index 744b6dc9b..610e97fa9 100644 --- a/app/views/people/_relationship_action.haml +++ b/app/views/people/_relationship_action.haml @@ -1,6 +1,6 @@ - unless person == current_user.person - contact = current_user.contacts.find_by_person_id(person.id) - contact ||= Contact.new(:person => person) - = aspectmembership_dropdown(contact, person, 'left') + = aspect_memberhip_dropdown(contact, person, 'left') -else = t('people.person.thats_you') diff --git a/app/views/people/_sub_header.html.haml b/app/views/people/_sub_header.html.haml index 4d376461f..8d36533d7 100644 --- a/app/views/people/_sub_header.html.haml +++ b/app/views/people/_sub_header.html.haml @@ -1,7 +1,7 @@ #author_info .right - if user_signed_in? && current_user.person != person - = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => person, :hang => 'left' + = aspect_memberhip_dropdown(contact, person, 'left') - elsif user_signed_in? && current_user.person == person = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path, :class => 'button creation' From 79d0dfc7bb46cb3ed62ffc74c5b1b5212111773f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sch=C3=B6lling?= Date: Sat, 6 Aug 2011 17:20:09 +0200 Subject: [PATCH 005/133] added missing hang=>left and people's AspectMembershipDropdown is not a partial anymore --- app/controllers/people_controller.rb | 2 +- ...membership_dropdown.haml => aspect_membership_dropdown.haml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename app/views/people/{_aspect_membership_dropdown.haml => aspect_membership_dropdown.haml} (100%) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 32d942946..c94160b72 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -148,7 +148,7 @@ class PeopleController < ApplicationController def aspect_membership_dropdown @person = Person.find(params[:person_id]) @contact = current_user.contact_for(@person) || Contact.new - render :partial => 'aspect_membership_dropdown', :locals => {:contact => @contact, :person => @person} + render :partial => 'aspect_membership_dropdown', :locals => {:contact => @contact, :person => @person, :hang => 'left'} end private diff --git a/app/views/people/_aspect_membership_dropdown.haml b/app/views/people/aspect_membership_dropdown.haml similarity index 100% rename from app/views/people/_aspect_membership_dropdown.haml rename to app/views/people/aspect_membership_dropdown.haml From 8b99ae9cb6617cd31ffd13838e61dbff4fe2d630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sch=C3=B6lling?= Date: Sun, 7 Aug 2011 19:44:01 +0200 Subject: [PATCH 006/133] Changed translation and fixed misspelled function call --- app/views/aspects/create.js.erb | 2 +- app/views/people/_sub_header.html.haml | 2 +- config/locales/diaspora/en.yml | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/aspects/create.js.erb b/app/views/aspects/create.js.erb index 304732473..7df0ce631 100644 --- a/app/views/aspects/create.js.erb +++ b/app/views/aspects/create.js.erb @@ -3,7 +3,7 @@ // the COPYRIGHT file. var dropdown = $("ul.dropdown_list[data-person_id=<%= @person.id %>]") -$('.newItem', dropdown).before("<%= escape_javascript( render('aspect_memberships/aspect_dropdown_list_item', :aspect => @aspect, :person => @person, :contact => @contact)) %>"); +$('.newItem', dropdown).before("<%= escape_javascript( render('shared/aspect_dropdown_list_item', :aspect => @aspect, :person => @person, :contact => @contact)) %>"); ContactEdit.updateNumber(dropdown, "<%= @person.id %>", <%= @contact.aspects.size %>); $.facebox.close(); diff --git a/app/views/people/_sub_header.html.haml b/app/views/people/_sub_header.html.haml index 8d36533d7..fd9b70547 100644 --- a/app/views/people/_sub_header.html.haml +++ b/app/views/people/_sub_header.html.haml @@ -1,7 +1,7 @@ #author_info .right - if user_signed_in? && current_user.person != person - = aspect_memberhip_dropdown(contact, person, 'left') + = aspect_membership_dropdown(contact, person, 'left') - elsif user_signed_in? && current_user.person == person = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path, :class => 'button creation' diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 9060cff59..3e9a83a4f 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -178,14 +178,6 @@ en: success: "Successfully removed person from aspect" failure: "Failed to remove person from aspect" no_membership: "Could not find the selected person in that aspect" - aspect_dropdown: - add_to_aspect: "Add to aspect" - toggle: - zero: "Add to aspect" - one: "In %{count} aspect" - few: "In %{count} aspects" - many: "In %{count} aspects" - other: "In %{count} aspects" bookmarklet: heading: "Bookmarklet" @@ -651,6 +643,14 @@ en: invite: "invite" shared: + aspect_dropdown: + add_to_aspect: "Add to aspect" + toggle: + zero: "Add to aspect" + one: "In %{count} aspect" + few: "In %{count} aspects" + many: "In %{count} aspects" + other: "In %{count} aspects" publisher: posting: "Posting..." share: "Share" From ad5bd90b639e2ca0030abda2d1f7ece74110b247 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Wed, 10 Aug 2011 21:08:42 -0700 Subject: [PATCH 007/133] add number to inviter --- lib/rake_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rake_helpers.rb b/lib/rake_helpers.rb index a13863245..2e842c750 100644 --- a/lib/rake_helpers.rb +++ b/lib/rake_helpers.rb @@ -22,7 +22,7 @@ module RakeHelpers backer_name = backers[n+offset][1].to_s.strip backer_email = backers[n+offset][0].to_s.strip unless User.find_by_email(backer_email) || User.find_by_invitation_identifier(backer_email) - puts "sending email to: #{backer_name} #{backer_email}" unless Rails.env == 'test' + puts "#{n}: sending email to: #{backer_name} #{backer_email}" unless Rails.env == 'test' Invitation.create_invitee(:service => 'email', :identifier => backer_email, :name => backer_name ) unless test else puts "user with the email exists: #{backer_email} , #{backer_name} " unless Rails.env == 'test' From a2043671ce41096c0a80ad655cdc13ee0cc75cf5 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 10:45:28 -0700 Subject: [PATCH 008/133] Move comment email subject line code into models --- app/mailers/notifier.rb | 9 ++++++--- app/models/activity_streams/photo.rb | 4 ++++ app/models/post.rb | 4 ++++ app/models/reshare.rb | 3 +++ app/models/status_message.rb | 4 ++++ config/locales/diaspora/en.yml | 2 ++ 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 35249586e..76387c56d 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -74,7 +74,7 @@ class Notifier < ActionMailer::Base I18n.with_locale(@receiver.language) do mail(:from => "\"#{@sender.name} (Diaspora)\" <#{AppConfig[:smtp_sender_address]}>", :to => "\"#{@receiver.name}\" <#{@receiver.email}>", - :subject => "Re: #{post_message(@comment.parent, :length => TRUNCATION_LEN)}") + :subject => "Re: #{comment_email_subject}") end end @@ -89,13 +89,16 @@ class Notifier < ActionMailer::Base log_mail(recipient_id, sender_id, 'comment_on_post') I18n.with_locale(@receiver.language) do - subject_message = post_message(@comment.parent, :length => TRUNCATION_LEN) mail(:from => "\"#{@sender.name} (Diaspora)\" <#{AppConfig[:smtp_sender_address]}>", :to => "\"#{@receiver.name}\" <#{@receiver.email}>", - :subject => "Re: #{subject_message}") + :subject => "Re: #{comment_email_subject}") end end + def comment_email_subject + truncate(@comment.parent.comment_email_subject, :length => TRUNCATION_LEN) + end + def private_message(recipient_id, sender_id, message_id) @receiver = User.find_by_id(recipient_id) @sender = Person.find_by_id(sender_id) diff --git a/app/models/activity_streams/photo.rb b/app/models/activity_streams/photo.rb index c45cbbfdb..1d67dc957 100644 --- a/app/models/activity_streams/photo.rb +++ b/app/models/activity_streams/photo.rb @@ -53,5 +53,9 @@ class ActivityStreams::Photo < Post # A better solution is needed. # @return [Boolean] true def activity_streams?; true; end + + def comment_email_subject + I18n.t("photos.comment_email_subject", :name => author.name) + end end diff --git a/app/models/post.rb b/app/models/post.rb index 1141f2fa0..b6d8b08cb 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -117,6 +117,10 @@ class Post < ActiveRecord::Base false end + def comment_email_subject + I18n.t('notifier.a_post_you_shared') + end + # @return [Array] def last_three_comments self.comments.order('created_at DESC').limit(3).includes(:author => :profile).reverse diff --git a/app/models/reshare.rb b/app/models/reshare.rb index f23569791..f82769a3c 100644 --- a/app/models/reshare.rb +++ b/app/models/reshare.rb @@ -31,6 +31,9 @@ class Reshare < Post end end + def comment_email_subject + I18n.t('reshares.comment_email_subject', :resharer => author.name, :author => root.author.name) + end private def after_parse diff --git a/app/models/status_message.rb b/app/models/status_message.rb index 58ed733bb..c08386234 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -132,6 +132,10 @@ class StatusMessage < Post end end + def comment_email_subject + formatted_message(:plain_text => true) + end + protected def message_or_photos_present? diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 453c80f75..d934e2d93 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -533,6 +533,7 @@ en: new_profile_photo: upload: "Upload a new profile photo!" or_select_one: "or select one from your already existing" + comment_email_subject: "%{name}'s photo" posts: show: @@ -621,6 +622,7 @@ en: deleted: "Original post deleted by author." create: failure: "There was an error resharing this post." + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" services: index: logged_in_as: "logged in as" From 7021cd79c85691c8ff27e8836d9bce614844c33c Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 11:56:23 -0700 Subject: [PATCH 009/133] Select distinct people in contacts index --- app/controllers/contacts_controller.rb | 1 + spec/controllers/contacts_controller_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index c87aeec93..6ec8d65db 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -25,6 +25,7 @@ class ContactsController < ApplicationController format.mobile { @contacts = sort_and_paginate_profiles(@contacts) } format.json { @people = Person.joins(:contacts => :aspect_memberships). + select('DISTINCT people.*'). where(:contacts => { :user_id => current_user.id }, :aspect_memberships => { :aspect_id => params[:aspect_ids] }) diff --git a/spec/controllers/contacts_controller_spec.rb b/spec/controllers/contacts_controller_spec.rb index dfdff97a2..a0b00d5ca 100644 --- a/spec/controllers/contacts_controller_spec.rb +++ b/spec/controllers/contacts_controller_spec.rb @@ -67,6 +67,14 @@ describe ContactsController do get :index save_fixture(html_for("body"), "aspects_manage") end + + it 'does not select duplicate contacts' do + aspect = bob.aspects.create(:name => 'hilarious people') + aspect.contacts << bob.contact_for(eve.person) + get :index, :format => 'json', :aspect_ids => bob.aspect_ids + assigns[:people].map{|p| p.id}.uniq.should == assigns[:people].map{|p| p.id} + assigns[:people].should == bob.contacts.map(&:person) + end end describe '#featured' do From 0b00616b8c266c5c5f2a90fc0ed1f78f15b0d286 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 12:01:14 -0700 Subject: [PATCH 010/133] Create appConfig option for following diasporahq --- app/models/user.rb | 6 ++++-- config/application.yml.example | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index d99102ec6..ec38e9392 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -349,8 +349,10 @@ class User < ActiveRecord::Base self.aspects.create(:name => I18n.t('aspects.seed.work')) aq = self.aspects.create(:name => I18n.t('aspects.seed.acquaintances')) - default_account = Webfinger.new('diasporahq@joindiaspora.com').fetch - self.share_with(default_account, aq) if default_account + unless AppConfig[:no_follow_diasporahq] + default_account = Webfinger.new('diasporahq@joindiaspora.com').fetch + self.share_with(default_account, aq) if default_account + end aq end diff --git a/config/application.yml.example b/config/application.yml.example index d2bd7396e..7c01c0747 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -17,6 +17,12 @@ defaults: &defaults # Set this to true if you want users to invite as many people as they want open_invitations: true + # Set this to true if you don't want your users to follow the diasporahq@joindiaspora.com + # account on account creation. The diasporahq account helps users start with some + # activity in their stream and get news about Diaspora, but if you don't want your server + # to contact joindiaspora.com, set this to true: + no_follow_diasporahq: false + # # Logging setup # From 6e0630c43f65e36893a7331bef26c05e0543e861 Mon Sep 17 00:00:00 2001 From: MrZYX Date: Thu, 11 Aug 2011 22:21:32 +0200 Subject: [PATCH 011/133] updated locales --- config/locales/devise/devise.de.yml | 24 +-- config/locales/devise/devise.es.yml | 2 +- config/locales/devise/devise.it.yml | 16 +- config/locales/devise/devise.ru.yml | 2 +- config/locales/devise/devise.zh-TW.yml | 2 +- config/locales/diaspora/ar.yml | 17 +- config/locales/diaspora/bg.yml | 13 +- config/locales/diaspora/br.yml | 13 +- config/locales/diaspora/cs.yml | 13 +- config/locales/diaspora/cy.yml | 13 +- config/locales/diaspora/da.yml | 13 +- config/locales/diaspora/de.yml | 13 +- config/locales/diaspora/el.yml | 13 +- config/locales/diaspora/en_pirate.yml | 13 +- config/locales/diaspora/en_shaw.yml | 13 +- config/locales/diaspora/eo.yml | 13 +- config/locales/diaspora/es-AR.yml | 13 +- config/locales/diaspora/es-CL.yml | 13 +- config/locales/diaspora/es.yml | 13 +- config/locales/diaspora/eu.yml | 13 +- config/locales/diaspora/fi.yml | 13 +- config/locales/diaspora/fr.yml | 13 +- config/locales/diaspora/ga.yml | 13 +- config/locales/diaspora/he.yml | 201 +++++++++--------- config/locales/diaspora/hu.yml | 13 +- config/locales/diaspora/id.yml | 13 +- config/locales/diaspora/is.yml | 13 +- config/locales/diaspora/it.yml | 17 +- config/locales/diaspora/ja.yml | 13 +- config/locales/diaspora/ko.yml | 83 ++++---- config/locales/diaspora/lt.yml | 13 +- config/locales/diaspora/mk.yml | 13 +- config/locales/diaspora/nb.yml | 13 +- config/locales/diaspora/nl.yml | 13 +- config/locales/diaspora/pa.yml | 13 +- config/locales/diaspora/pl.yml | 13 +- config/locales/diaspora/pt-BR.yml | 13 +- config/locales/diaspora/pt-PT.yml | 13 +- config/locales/diaspora/ro.yml | 13 +- config/locales/diaspora/ru.yml | 13 +- config/locales/diaspora/sk.yml | 13 +- config/locales/diaspora/sl.yml | 13 +- config/locales/diaspora/sv.yml | 13 +- config/locales/diaspora/tr.yml | 13 +- config/locales/diaspora/zh-CN.yml | 13 +- config/locales/diaspora/zh-TW.yml | 15 +- config/locales/javascript/javascript.ar.yml | 6 +- config/locales/javascript/javascript.bg.yml | 4 +- config/locales/javascript/javascript.de.yml | 4 +- config/locales/javascript/javascript.es.yml | 4 +- config/locales/javascript/javascript.it.yml | 6 +- config/locales/javascript/javascript.ko.yml | 4 +- .../locales/javascript/javascript.zh-TW.yml | 4 +- 53 files changed, 583 insertions(+), 296 deletions(-) diff --git a/config/locales/devise/devise.de.yml b/config/locales/devise/devise.de.yml index d6ccca8c7..314fd3d85 100644 --- a/config/locales/devise/devise.de.yml +++ b/config/locales/devise/devise.de.yml @@ -16,8 +16,8 @@ de: invalid_token: "Ungültiger Authentifizierungstoken." locked: "Dein Konto ist gesperrt." timeout: "Deine Sitzung ist abgelaufen! Um fortzufahren, melde dich bitte erneut an." - unauthenticated: "Du musst dich anmelden oder registrieren um fortzufahren." - unconfirmed: "Du musst dein Konto bestätigen um fortzufahren." + unauthenticated: "Du musst dich anmelden oder registrieren, um fortzufahren." + unconfirmed: "Du musst dein Konto bestätigen, um fortzufahren." invitations: invitation_token_invalid: "Das Einladungstoken ist ungültig!" send_instructions: "Deine Einladung wurde versandt." @@ -34,19 +34,19 @@ de: no_account_till: "Dein Konto wird nicht erstellt solange du dich nicht über den oberen Link registrierst." subject: "Du wurdest zu Diaspora eingeladen!" inviters: - accept_at: "%{url} teilzunehmen. Du kannst die Einladung durch den Link unten annehmen." - has_invited_you: "%{name} hat dich dazu eingeladen, bei Diaspora auf" - have_invited_you: "%{names} haben dich dazu eingeladen, bei Diaspora auf" + accept_at: "%{url} teilzunehmen. Du kannst die Einladung durch den unten aufgeführten Link annehmen." + has_invited_you: "%{name} hat dich dazu eingeladen, Diaspora beizutreten" + have_invited_you: "%{names} haben dich dazu eingeladen, Diaspora beizutreten" reset_password_instructions: change: "Mein Kennwort ändern" ignore: "Wenn du dies nicht angefordert hast, ignoriere bitte diese E-Mail." - someone_requested: "Jemand hat einen Link angefordert, um dein Kennwort zu ändern und du kannst das durch den Link unten tun." - subject: "Zurücksetzen deines Kennworts" - wont_change: "Dein Kennwort bleibt unverändert, bis du es über den Link änderst." + someone_requested: "Jemand hat einen Link angefordert, um dein Kennwort zu ändern und du kannst das durch den unten aufgeführten Link tun." + subject: "Setze dein Passwort zurück" + wont_change: "Dein Kennwort bleibt unverändert, bis du es über den Link änderst und ein neues erstellst." unlock_instructions: - account_locked: "Dein Konto wurde aufgrund zu vieler fehlgeschlagener Anmeldeversuche gesperrt." + account_locked: "Dein Konto wurde aufgrund von zu vielen fehlgeschlagenen Anmeldeversuchen gesperrt." click_to_unlock: "Folge dem unten aufgeführten Link, um dein Konto zu entsperren:" - subject: "Konto entsperren" + subject: "Anweisungen entsperren" unlock: "Mein Konto entsperren" welcome: "Willkommen %{email}!" passwords: @@ -54,7 +54,7 @@ de: change_password: "Mein Kennwort ändern" new: forgot_password: "Kennwort vergessen?" - no_account: "Es existiert kein Benutzerkonto mit dieser E-Mail-Adresse. Falls du auf eine Einladung wartest, dann geben wir dir eine sobald wie möglich" + no_account: "Es existiert kein Benutzerkonto mit dieser E-Mail-Adresse. Falls du auf eine Einladung wartest, dann geben wir dir sobald wie möglich eine" send_password_instructions: "Anleitung zum Zurücksetzen des Кennworts anfordern" send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Kennwort zurücksetzt." updated: "Dein Kennwort wurde erfolgreich geändert. Du bist nun angemeldet." @@ -93,5 +93,5 @@ de: errors: messages: already_confirmed: "wurde bereits bestätigt" - not_found: "nicht gefunden" + not_found: "wurde nicht gefunden" not_locked: "war nicht gesperrt" diff --git a/config/locales/devise/devise.es.yml b/config/locales/devise/devise.es.yml index ac1337316..a703e35d6 100644 --- a/config/locales/devise/devise.es.yml +++ b/config/locales/devise/devise.es.yml @@ -34,7 +34,7 @@ es: no_account_till: "Tu cuenta no será creada hasta que no accedas al enlace de arriba para registrarte." subject: "¡Has sido invitado a unirte a Diaspora*!" inviters: - accept_at: ", en %{url}, puedes aceptar en el siguiente enlace." + accept_at: "en %{url}, puedes aceptarlo en el siguiente enlace." has_invited_you: "%{name} te ha invitado a unirte a Diaspora" have_invited_you: "%{names} te han invitado a unirte a Diaspora" reset_password_instructions: diff --git a/config/locales/devise/devise.it.yml b/config/locales/devise/devise.it.yml index 751994764..98bb977a6 100644 --- a/config/locales/devise/devise.it.yml +++ b/config/locales/devise/devise.it.yml @@ -30,22 +30,22 @@ it: hello: "Ciao %{email}!" invitation_instructions: accept: "Accetta l'invito" - ignore: "Se non vuoi accettare l'invito, perfavore ignora questa email." - no_account_till: "Il tuo account non sarà creato finché non cliccherai sul link qui sopra e ti registrerai." + ignore: "Se non vuoi accettare l'invito, per favore ignora questa email." + no_account_till: "Il tuo account non sarà creato finché non cliccherai sul link qua sopra ed effettuerai la registrazione." subject: "Hai un invito per iscriverti a Diaspora!" inviters: - accept_at: ", a %{url}, lo puoi accettare tramite il link sottostante." + accept_at: "su %{url}, puoi accettarlo dal link sottostante." has_invited_you: "%{name} ti ha invitato a unirti a Diaspora" have_invited_you: "%{names} ti ha invitato a unirti a Diaspora" reset_password_instructions: - change: "cambia la mia password" - ignore: "Se non l'hai richiesta, per favore ignora questa email." - someone_requested: "qualcuno ha richiesto un link per cambiare la tua password, e tu puoi farlo cliccando sul link sottostante." + change: "Cambia la mia password" + ignore: "Se non hai effettuato la richiesta, per favore ignora questa email." + someone_requested: "qualcuno ha richiesto un link per cambiare la tua password, puoi farlo cliccando sul link sottostante." subject: "Istruzioni per reimpostare la password" wont_change: "La tua password non verrà cambiata finché non visiti il link sopra e ne crei una nuova." unlock_instructions: - account_locked: "Il tuo account è stato bloccato a causa degli eccessivi tentativi falliti di accesso." - click_to_unlock: "clicca il link sottostante per sbloccare il mio account:" + account_locked: "Il tuo account è stato bloccato per i troppi tentativi di accesso falliti." + click_to_unlock: "Clicca il link sottostante per sbloccare il tuo account:" subject: "Istruzioni di sblocco" unlock: "sblocca il mio account" welcome: "Benvenuto %{email}!" diff --git a/config/locales/devise/devise.ru.yml b/config/locales/devise/devise.ru.yml index 5a79c6a89..e5ac4edd8 100644 --- a/config/locales/devise/devise.ru.yml +++ b/config/locales/devise/devise.ru.yml @@ -34,7 +34,7 @@ ru: no_account_till: "Ваш аккаунт не будет создан, пока вы не зарегистрировались." subject: "Вы приглашены присоединиться к диаспоре!" inviters: - accept_at: "вы можете принять его, нажaв на ссылку %{url}" + accept_at: "вы можете принять, нажaв на ссылку %{url}" has_invited_you: "%{name} приглашает вас присоединиться к Диаспоре" have_invited_you: "%{names} приглашает вас присоединиться к Диаспоре" reset_password_instructions: diff --git a/config/locales/devise/devise.zh-TW.yml b/config/locales/devise/devise.zh-TW.yml index 3f2381162..dfd3d8b6a 100644 --- a/config/locales/devise/devise.zh-TW.yml +++ b/config/locales/devise/devise.zh-TW.yml @@ -34,7 +34,7 @@ zh-TW: no_account_till: "在你按了以上連結並註冊後,你的帳號才會成功開戶." subject: "有人邀請你加入 Diaspora!" inviters: - accept_at: ", 在 %{url}, 你可以透過以下連結來接受." + accept_at: "於 %{url}, 你可以透過以下連結來接受." has_invited_you: "%{name} 邀請你加入 Diaspora" have_invited_you: "%{names} 邀請你加入 Diaspora" reset_password_instructions: diff --git a/config/locales/diaspora/ar.yml b/config/locales/diaspora/ar.yml index a99191799..477538260 100644 --- a/config/locales/diaspora/ar.yml +++ b/config/locales/diaspora/ar.yml @@ -37,6 +37,7 @@ ar: person: invalid: "غير صالح." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "حُجِزَ بالفعل." ago: "منذ %{time}" all_aspects: "كل الفئات" @@ -117,6 +118,7 @@ ar: content: "يمكنك وصل حساب ديسبورا الخاص بك بالخدمات الآتية:" heading: "صل حسابك بالخدمات" tags_following: "الوسوم المتابعة" + unfollow_tag: "Stop following #%{tag}" your_aspects: "فئاتك" many: "%{count} فئات" move_contact: @@ -234,7 +236,7 @@ ar: correct_the_following_errors_and_try_again: ".صَحِّح الأخطاء التالية ثم أعد المحاولة" invalid_fields: "حقولٌ غير صالحة" fill_me_out: "إملأني" - find_people: "ابحث عن الناس" + find_people: "ابحث عن الأصدقاء أو #الوسوم" hide: "آَخْفِ" home: show: @@ -251,6 +253,7 @@ ar: tagline_first_half: "شارك ما تريد،" tagline_second_half: "مع من تريد." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "الدعوة الرمزية غير موجودة" create: @@ -390,6 +393,7 @@ ar: other: "%{actors} بدؤوا المشاركة معك." zero: "%{actors} بدأ المشاركة معك." notifier: + a_post_you_shared: "a post." click_here: "اضغط هنا" comment_on_post: reply: "رُد أو اعرض مشاركة %{name} >" @@ -470,6 +474,7 @@ ar: fail: "للأسف، لم نجد %{handle}." zero: "لا أحد" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "فشل رفع الصورة، أواثقٌ أن هذا الملف صورة؟" runtime_error: "فشل رفع الصورة، هل قمت بربطها مع نص؟" @@ -497,9 +502,8 @@ ar: edit: "عَدِّل" edit_delete_photo: "عَدِّل وصف الصورة / احْذِف الصورة" make_profile_photo: "اجعلها صورة شخصية" - original_post: "المشاركة الأصلية" + show_original_post: "Show original post" update_photo: "حَدِّث الصورة" - view: "شاهد" update: error: "فشل تحرير الصورة." notice: "حُدِّثَت الصورة بنجاح." @@ -574,6 +578,7 @@ ar: new_request_to_person: sent: "أُرْسِلَت!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "هناك خطأ ما في إعادة نشر هذه المشاركة." reshare: @@ -585,7 +590,7 @@ ar: other: "أُعِيدَ نشرها %{count} مرة" zero: "أَعِد النشر" reshare_confirmation: "هل أُعِد نشر مشاركة %{author} - ومحتواها: %{text} ?" - reshare_original: "Reshare orignial" + reshare_original: "أعد نشر المشاركة الأصلية" show_original: "اعرض الأصلية" search: "بحث" services: @@ -747,10 +752,12 @@ ar: your_email: "بريدك الإلكتروني" your_handle: "وسيط ديسبورا الخاص بك" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/bg.yml b/config/locales/diaspora/bg.yml index 87fafe697..063b7644a 100644 --- a/config/locales/diaspora/bg.yml +++ b/config/locales/diaspora/bg.yml @@ -37,6 +37,7 @@ bg: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "е вече заето." ago: "преди %{time}" all_aspects: "Всички аспекти" @@ -117,6 +118,7 @@ bg: content: "Можете да свържете следните услуги към Diaspora:" heading: "Свързване към услуги" tags_following: "Тагове, които следите" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Вашите аспекти" many: "%{count} аспекта" move_contact: @@ -251,6 +253,7 @@ bg: tagline_first_half: "Споделете каквото желаете," tagline_second_half: "с когото пожелаете." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Данните за поканата не са намерени" create: @@ -390,6 +393,7 @@ bg: other: "%{actors} започна да споделя с вас." zero: "%{actors} започна да споделя с вас." notifier: + a_post_you_shared: "a post." click_here: "кликнете тук" comment_on_post: reply: "Отговорете или прегледайте публикацията на %{name} >" @@ -470,6 +474,7 @@ bg: fail: "За съжаление %{handle} не може да бъде намерен." zero: "няма хора" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Снимката не бе качена. Сигурни ли сте, че сте избрали изображение?" runtime_error: "Снимката не бе качена. Сигурни ли сте, че сте закопчали колана си?" @@ -497,9 +502,8 @@ bg: edit: "редактиране" edit_delete_photo: "Редактиране на описанието / изтриване" make_profile_photo: "ползване като профилна снимка" - original_post: "Оригинална публикация" + show_original_post: "Show original post" update_photo: "Update Photo" - view: "view" update: error: "Снимката не бе изтрита." notice: "Снимката е обновена." @@ -574,6 +578,7 @@ bg: new_request_to_person: sent: "изпратена!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "Възникна грешка при споделянето на публикацията." reshare: @@ -747,10 +752,12 @@ bg: your_email: "Вашата ел. поща" your_handle: "Вашият адрес в Diaspora" getting_started: + aspects: "aspects" connect_to: "Свържете профила си с" connect_to_your_other_social_networks: "Свържете профила си с други социални мрежи" connect_with_people: "Свържете се с интересни хора" - connect_with_people_explanation: "Свържете се като поставяте хората в един или няколко аспекта. Аспектите са начин за групиране контактите ви, който позволява лесно филтриране/споделяне само с точно определена подгрупа." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Отличени тагове" featured_users: "Отличени потребители" fill_out_your_profile: "Попълнете профила си" diff --git a/config/locales/diaspora/br.yml b/config/locales/diaspora/br.yml index a1da0b901..ae076027a 100644 --- a/config/locales/diaspora/br.yml +++ b/config/locales/diaspora/br.yml @@ -37,6 +37,7 @@ br: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "zo bet dibabet dija." ago: "%{time} zo" all_aspects: "An Holl Arvezioù" @@ -117,6 +118,7 @@ br: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} arvez" move_contact: @@ -251,6 +253,7 @@ br: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Ar bilhed-pediñ n'eo ket bet kaset" create: @@ -390,6 +393,7 @@ br: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ br: fail: "Siwazh, n'eus ket moaien kavout %{handle}." zero: "den ebet" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Photo upload failed. Are you sure that was an image?" runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" @@ -497,9 +502,8 @@ br: edit: "kemmañ" edit_delete_photo: "Kemmañ deskrivadenn ar foto / skarzhañ ar foto" make_profile_photo: "lakaat e-giz poltred" - original_post: "Skrid Orin" + show_original_post: "Show original post" update_photo: "Nevesaat ar Foto" - view: "view" update: error: "Failed to edit photo." notice: "Foto bet kaset mat." @@ -574,6 +578,7 @@ br: new_request_to_person: sent: "kaset!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ br: your_email: "Ho postel" your_handle: "Ho skor diaspora" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index e51d16e4a..4728ff2c1 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -37,6 +37,7 @@ cs: person: invalid: "je neplatný." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "je již obsazeno." ago: "před %{time}" all_aspects: "Všechny aspekty" @@ -117,6 +118,7 @@ cs: content: "Můžete připojit následující služby na Diasporu:" heading: "Připojit služby" tags_following: "Následované značky" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Vaše aspekty" many: "%{count} aspektů" move_contact: @@ -251,6 +253,7 @@ cs: tagline_first_half: "Sdílejte co chcete," tagline_second_half: "s kým chcete." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Pozvánkový tiket nebyl nalezen" create: @@ -390,6 +393,7 @@ cs: other: "%{actors} s vámi začali sdílet." zero: "%{actors} s vámi začali sdílet." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ cs: fail: "Omlouváme se, ale %{handle} nebyl nalezen." zero: "žádní lidé" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Nahrání fotky selhalo. Jste si jist, že to byl obrázek?" runtime_error: "Nahrání obrázku selhalo. Jste si jist, že váš bezpečnostní pás je připevněn?" @@ -497,9 +502,8 @@ cs: edit: "upravit" edit_delete_photo: "Upravit popis fotky / smazat fotku" make_profile_photo: "vytvořit profilovou fotku" - original_post: "Původní příspěvek" + show_original_post: "Show original post" update_photo: "Aktualizovat fotku" - view: "zobrazit" update: error: "Nepodařilo se upravit fotku." notice: "Fotka úspěšně aktualizována." @@ -574,6 +578,7 @@ cs: new_request_to_person: sent: "odesláno!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ cs: your_email: "Váš email" your_handle: "Vaše Diaspora ID" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/cy.yml b/config/locales/diaspora/cy.yml index e9b7c7097..b222cdcba 100644 --- a/config/locales/diaspora/cy.yml +++ b/config/locales/diaspora/cy.yml @@ -37,6 +37,7 @@ cy: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} ago" all_aspects: "All aspects" @@ -117,6 +118,7 @@ cy: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ cy: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Invitation token not found" create: @@ -390,6 +393,7 @@ cy: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ cy: fail: "Sorry, we couldn't find %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Photo upload failed. Are you sure that was an image?" runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" @@ -497,9 +502,8 @@ cy: edit: "edit" edit_delete_photo: "Edit photo description / delete photo" make_profile_photo: "make profile photo" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Update Photo" - view: "view" update: error: "Failed to edit photo." notice: "Photo successfully updated." @@ -574,6 +578,7 @@ cy: new_request_to_person: sent: "sent!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ cy: your_email: "Your email" your_handle: "Your diaspora handle" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/da.yml b/config/locales/diaspora/da.yml index ad986d21c..1e4ae5490 100644 --- a/config/locales/diaspora/da.yml +++ b/config/locales/diaspora/da.yml @@ -37,6 +37,7 @@ da: person: invalid: "er ugyldig." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "er allerede taget." ago: "%{time} siden" all_aspects: "Alle aspekter" @@ -117,6 +118,7 @@ da: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Dine aspekter" many: "%{count} aspekter" move_contact: @@ -251,6 +253,7 @@ da: tagline_first_half: "Del hvad du vil," tagline_second_half: "med hvem du vil." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Invitationstoken ikke fundet" create: @@ -390,6 +393,7 @@ da: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ da: fail: "Undskyld, vi kunne ikke finde %{handle}." zero: "ingen personer" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Billed-upload fejlede. Er du sikker på det var et billede?" runtime_error: "Billed-upload fejlede. Er du sikker på at du har spændt sikkerhedsselen?" @@ -497,9 +502,8 @@ da: edit: "Redigér" edit_delete_photo: "Redigér billedbeskrivelse / slet billede" make_profile_photo: "Gør til profilbillede" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Opdatér billede" - view: "se" update: error: "Kunne ikke redigere billede." notice: "Billedet blev opdateret." @@ -574,6 +578,7 @@ da: new_request_to_person: sent: "afsendt!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ da: your_email: "Din e-mail" your_handle: "Dit diaspora handle" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 7dc9971f7..654f6be17 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -37,6 +37,7 @@ de: person: invalid: "ist nicht gültig." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "wird schon benutzt." ago: "Vor %{time}" all_aspects: "Alle Aspekte" @@ -117,6 +118,7 @@ de: content: "Du kannst die folgenden Dienste mit Diaspora verbinden:" heading: "Verbinde Dienste" tags_following: "Tags, denen ich folge" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Deine Aspekte" many: "%{count} Aspekte" move_contact: @@ -251,6 +253,7 @@ de: tagline_first_half: "Teile was du willst," tagline_second_half: "mit wem du willst." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Einladungstoken nicht gefunden" create: @@ -390,6 +393,7 @@ de: other: "%{actors} haben angefangen mit dir zu teilen." zero: "Niemand hat angefangen mit dir zu teilen." notifier: + a_post_you_shared: "a post." click_here: "hier klicken" comment_on_post: reply: "Antworte oder schau dir %{name}s Beitrag an >" @@ -470,6 +474,7 @@ de: fail: "Entschuldigung, wir konnten %{handle} nicht finden." zero: "Keine Personen" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Hochladen des Fotos fehlgeschlagen. Bist du sicher, dass es eine Bilddatei war?" runtime_error: "Hochladen des Fotos fehlgeschlagen. Bist du sicher, dass du deinen Morgenkaffee hattest?" @@ -497,9 +502,8 @@ de: edit: "Bearbeiten" edit_delete_photo: "Fotobeschreibung bearbeiten / Foto löschen" make_profile_photo: "Als Profilbild verwenden" - original_post: "Ursprünglicher Beitrag" + show_original_post: "Show original post" update_photo: "Foto aktualisieren" - view: "Anzeigen" update: error: "Bearbeiten des Fotos fehlgeschlagen." notice: "Foto erfolgreich aktualisiert." @@ -574,6 +578,7 @@ de: new_request_to_person: sent: "Gesendet!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "Ein Fehler trat beim weitersagen dieses Beitrags auf." reshare: @@ -747,10 +752,12 @@ de: your_email: "Deine E-Mail-Adresse" your_handle: "Deine Diaspora ID" getting_started: + aspects: "aspects" connect_to: "Verbinde dich zu" connect_to_your_other_social_networks: "Verbinde dich zu deinen anderen sozialen Netzwerken" connect_with_people: "Kontaktiere tolle Leute" - connect_with_people_explanation: "Verbinde dich mit Leuten, indem du sie in einen oder mehrere Aspekte sortierst. Aspekte sind ein intuitiver Weg, um neue und altbekannte Gesichter in Gruppen zusammenzufassen, was dir ermöglicht, einfach Personen herauszusieben oder etwas nur mit einer Untermenge von Kontakten zu teilen." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Empfohlene Tags" featured_users: "Featured users" fill_out_your_profile: "Fülle dein Profil aus" diff --git a/config/locales/diaspora/el.yml b/config/locales/diaspora/el.yml index c1e5ed052..eefca1033 100644 --- a/config/locales/diaspora/el.yml +++ b/config/locales/diaspora/el.yml @@ -37,6 +37,7 @@ el: person: invalid: "είναι άκυρη." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "είναι ήδη σε χρήση." ago: "%{time} πριν" all_aspects: "Όλες οι πτυχές" @@ -117,6 +118,7 @@ el: content: "Μπορείτε να συνδέσετε τις παρακάτω υπηρεσίες στο Diaspora:" heading: "Συνδέστε Υπηρεσίες" tags_following: "Ετικέτες που ακολουθείτε" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Οι Πτυχές σας" many: "%{count} πτυχές" move_contact: @@ -251,6 +253,7 @@ el: tagline_first_half: "Μοιραστείτε ό,τι θέλετε," tagline_second_half: "με όποιον θέλετε." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Το σύμβολο της πρόσκλησης δεν βρέθηκε" create: @@ -390,6 +393,7 @@ el: other: "Οι χρήστες %{actors} άρχισαν να διαμοιράζονται μαζί σας." zero: "Οι χρήστες %{actors} άρχισαν να διαμοιράζονται μαζί σας." notifier: + a_post_you_shared: "a post." click_here: "πατήστε εδώ" comment_on_post: reply: "Απαντήστε ή δείτε τη δημοσίευση του χρήστη %{name} >" @@ -470,6 +474,7 @@ el: fail: "Λυπούμαστε, δεν ήταν δυνατή η εύρεση του %{handle}." zero: "κανένα άτομο" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Η μεταφόρτωση της φωτογραφίας απέτυχε. Είστε σίγουρος/η ότι ήταν φωτογραφία;" runtime_error: "Η μεταφόρτωση της φωτογραφίας απέτυχε. Είστε σίγουρος/η πως φορέσατε ζώνη ασφαλείας πριν ξεκινήσετε;" @@ -497,9 +502,8 @@ el: edit: "Επεξεργασία" edit_delete_photo: "Επεξεργασία περιγραφής φωτογραφίας / διαγραφή φωτογραφίας" make_profile_photo: "ορισμός ως φωτογραφίας προφίλ" - original_post: "Αυθεντική Δημοσίευση" + show_original_post: "Show original post" update_photo: "Ενημέρωση Φωτογραφίας" - view: "προβολή" update: error: "Αποτυχία επεξεργασίας φωτογραφίας." notice: "Η φωτογραφία ενημερώθηκε επιτυχώς." @@ -574,6 +578,7 @@ el: new_request_to_person: sent: "εστάλη!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "Υπήρξε κάποιο σφάλμα κατά την κοινοποίηση αυτής της δημοσίευσης." reshare: @@ -747,10 +752,12 @@ el: your_email: "Το email σας" your_handle: "Το αναγνωριστικό σας στο diaspora" getting_started: + aspects: "aspects" connect_to: "Συνδεθείτε με" connect_to_your_other_social_networks: "Συνδεθείτε με άλλα κοινωνικά δίκτυα" connect_with_people: "Συνδεθείτε με ενδιαφέροντα άτομα" - connect_with_people_explanation: "Συνδεθείτε με άτομα τοποθετώντας τα σε μια ή περισσότερες από τις πτυχές σας. Οι πτυχές είναι ένας άμεσος τρόπος να ομαδοποιήσετε νέα και γνωστά σας πρόσωπα, έχοντας τη δυνατότητα να φιλτράρετε και να μοιράζεστε με υποσύνολα των επαφών σας." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Αξιόλογες ετικέτες" featured_users: "Αξιόλογοι χρήστες" fill_out_your_profile: "Συμπληρώστε το προφίλ σας " diff --git a/config/locales/diaspora/en_pirate.yml b/config/locales/diaspora/en_pirate.yml index 65f9c7953..f2bbc4bf1 100644 --- a/config/locales/diaspora/en_pirate.yml +++ b/config/locales/diaspora/en_pirate.yml @@ -37,6 +37,7 @@ en_pirate: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} ago" all_aspects: "Yer Crews" @@ -117,6 +118,7 @@ en_pirate: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Yer Crews" many: "%{count} crews" move_contact: @@ -251,6 +253,7 @@ en_pirate: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Invitation token not found" create: @@ -390,6 +393,7 @@ en_pirate: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ en_pirate: fail: "Sorry, we couldn't find %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Photo upload failed. Are you sure that was an image?" runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" @@ -497,9 +502,8 @@ en_pirate: edit: "edit" edit_delete_photo: "Edit photo description / delete photo" make_profile_photo: "make profile photo" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Update Photo" - view: "view" update: error: "Failed to edit photo." notice: "Photo successfully updated." @@ -574,6 +578,7 @@ en_pirate: new_request_to_person: sent: "sent!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ en_pirate: your_email: "Your email" your_handle: "Your diaspora id" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/en_shaw.yml b/config/locales/diaspora/en_shaw.yml index e583edbdb..3de548884 100644 --- a/config/locales/diaspora/en_shaw.yml +++ b/config/locales/diaspora/en_shaw.yml @@ -37,6 +37,7 @@ en_shaw: person: invalid: "𐑦𐑟 𐑦𐑯𐑝𐑨𐑤𐑦𐑛." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "𐑦𐑟 𐑷𐑤𐑮𐑧𐑛𐑦 𐑑𐑱𐑒𐑩𐑯." ago: "%{time} ago" all_aspects: "𐑷𐑤 𐑨𐑕𐑐𐑧𐑒𐑑𐑕" @@ -117,6 +118,7 @@ en_shaw: content: "𐑿 𐑒𐑨𐑯 𐑒𐑩𐑯𐑧𐑒𐑑 𐑞 𐑓𐑪𐑤𐑴𐑦𐑙 𐑕𐑻𐑝𐑦𐑕𐑩𐑟 𐑑 ·𐑛𐑦𐑨𐑕𐑐𐑹𐑩:" heading: "𐑒𐑩𐑯𐑧𐑒𐑑 𐑕𐑻𐑝𐑦𐑕𐑩𐑟" tags_following: "𐑓𐑪𐑤𐑴𐑛 𐑑𐑨𐑜𐑟" + unfollow_tag: "Stop following #%{tag}" your_aspects: "𐑿𐑼 𐑨𐑕𐑐𐑧𐑒𐑑𐑕" many: "%{count} 𐑨𐑕𐑐𐑧𐑒𐑑𐑕" move_contact: @@ -251,6 +253,7 @@ en_shaw: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "𐑦𐑯𐑝𐑦𐑑𐑱𐑖𐑩𐑯 𐑑𐑴𐑒𐑩𐑯 𐑯𐑪𐑑 𐑓𐑬𐑯𐑛" create: @@ -390,6 +393,7 @@ en_shaw: other: "%{actors} 𐑕𐑑𐑸𐑑𐑩𐑛 𐑖𐑺𐑦𐑙 𐑢𐑦𐑞 𐑿." zero: "%{actors} 𐑕𐑑𐑸𐑑𐑩𐑛 𐑖𐑺𐑦𐑙 𐑢𐑦𐑞 𐑿." notifier: + a_post_you_shared: "a post." click_here: "𐑒𐑤𐑦𐑒 𐑣𐑽" comment_on_post: reply: "𐑮𐑦𐑐𐑤𐑲 𐑹 𐑝𐑿 %{name}𐑟 𐑐𐑴𐑕𐑑 >" @@ -470,6 +474,7 @@ en_shaw: fail: "𐑕𐑪𐑮𐑦, 𐑢𐑰 𐑒𐑫𐑛𐑯𐑑 𐑓𐑲𐑯𐑛 %{handle}." zero: "𐑯𐑴 𐑐𐑰𐑐𐑩𐑤" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "𐑓𐑴𐑑𐑴 𐑳𐑐𐑤𐑴𐑛 𐑓𐑱𐑤𐑛. 𐑸 𐑿 𐑖𐑻 𐑞𐑨𐑑 𐑢𐑪𐑟 𐑩𐑯 𐑦𐑥𐑩𐑡?" runtime_error: "𐑓𐑴𐑑𐑴 𐑳𐑐𐑤𐑴𐑛 𐑓𐑱𐑤𐑛. 𐑸 𐑿 𐑖𐑻 𐑿𐑼 𐑕𐑰𐑑𐑚𐑧𐑤𐑑 𐑦𐑟 𐑓𐑨𐑕𐑩𐑯𐑛?" @@ -497,9 +502,8 @@ en_shaw: edit: "𐑧𐑛𐑦𐑑" edit_delete_photo: "𐑧𐑛𐑦𐑑 𐑓𐑴𐑑𐑴 𐑛𐑦𐑕𐑒𐑮𐑦𐑐𐑖𐑩𐑯 / 𐑛𐑦𐑤𐑰𐑑 𐑓𐑴𐑑𐑴" make_profile_photo: "𐑥𐑱𐑒 𐑐𐑮𐑴𐑓𐑲𐑤 𐑓𐑴𐑑𐑴" - original_post: "𐑩𐑮𐑦𐑡𐑦𐑯𐑩𐑤 𐑐𐑴𐑕𐑑" + show_original_post: "Show original post" update_photo: "𐑩𐑐𐑛𐑱𐑑 𐑓𐑴𐑑𐑴" - view: "𐑝𐑿" update: error: "𐑓𐑱𐑤𐑛 𐑑 𐑧𐑛𐑦𐑑 𐑓𐑴𐑑𐑴." notice: "𐑓𐑴𐑑𐑴 𐑕𐑩𐑒𐑕𐑧𐑕𐑓𐑫𐑤𐑦 𐑳𐑐𐑛𐑱𐑑𐑩𐑛." @@ -574,6 +578,7 @@ en_shaw: new_request_to_person: sent: "𐑕𐑧𐑯𐑑!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "𐑞𐑺 𐑢𐑳𐑟 𐑩𐑯 𐑺𐑼 𐑮𐑦𐑖𐑺𐑦𐑙 𐑞𐑦𐑕 𐑐𐑴𐑕𐑑." reshare: @@ -747,10 +752,12 @@ en_shaw: your_email: "𐑿𐑼 𐑦-𐑥𐑱𐑤" your_handle: "𐑿𐑼 ·𐑛𐑦𐑨𐑕𐑐𐑹𐑩 𐑲𐑛𐑧𐑯𐑑𐑦𐑓𐑦𐑒𐑱𐑖𐑩𐑯" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/eo.yml b/config/locales/diaspora/eo.yml index 65de34b63..2c37c46a6 100644 --- a/config/locales/diaspora/eo.yml +++ b/config/locales/diaspora/eo.yml @@ -37,6 +37,7 @@ eo: person: invalid: "ne estas valida." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "jam okupiĝis." ago: "antaŭ %{time}" all_aspects: "Ĉiuj Aspektoj" @@ -117,6 +118,7 @@ eo: content: "Vi povas konekti la postajn servojn kun DIASPORA*:" heading: "Konekti Servojn" tags_following: "Abonitaj Etikedoj" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Viaj Aspektoj" many: "%{count} aspektoj" move_contact: @@ -251,6 +253,7 @@ eo: tagline_first_half: "Konigi tio, kio vi volas," tagline_second_half: "kun kiu vi volas." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Ne povis trovi invitan ĵetonon" create: @@ -390,6 +393,7 @@ eo: other: "%{actors} komencis konigi kun vi." zero: "%{actors} komencis konigi kun vi." notifier: + a_post_you_shared: "a post." click_here: "kliku tie ĉi" comment_on_post: reply: "Respondi aŭ vidi afiŝon de %{name} >" @@ -470,6 +474,7 @@ eo: fail: "Ni bedaŭras, sed ni ne povis trovi je %{handle}." zero: "neniu homo" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Ne povis alŝuti bildon. Ĉu vi certas, ke tiu estis bilda doseiro?" runtime_error: "Ne povis alŝuti bildon. Probable estis la farado de unu el tiuj Volapukistoj." @@ -497,9 +502,8 @@ eo: edit: "redakti" edit_delete_photo: "Redakti bildpriskribon / forigi bildon" make_profile_photo: "estigi profilbildon" - original_post: "Origina Afiŝo" + show_original_post: "Show original post" update_photo: "Ĝisdatigi Bildon" - view: "vidi" update: error: "Ne povis redakti bildon." notice: "Bildo sukcese ĝisdatiĝis." @@ -574,6 +578,7 @@ eo: new_request_to_person: sent: "sendita!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "Estis eraro, kiam repartoprenanta tiun ĉi afiŝon." reshare: @@ -747,10 +752,12 @@ eo: your_email: "Via retpoŝtadreso" your_handle: "Via DIASPORA* uzantnomo" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/es-AR.yml b/config/locales/diaspora/es-AR.yml index 1d543c8d7..ed5441dd4 100644 --- a/config/locales/diaspora/es-AR.yml +++ b/config/locales/diaspora/es-AR.yml @@ -37,6 +37,7 @@ es-AR: person: invalid: "no es válido." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "ya está ocupado." ago: "hace %{time}" all_aspects: "Todos los aspectos" @@ -117,6 +118,7 @@ es-AR: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspectos" move_contact: @@ -251,6 +253,7 @@ es-AR: tagline_first_half: "Compartí lo que quieras," tagline_second_half: "con quien vos quieras." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "No se encontró la udentificación de invitación" create: @@ -390,6 +393,7 @@ es-AR: other: "%{actors} comparten con vos." zero: "%{actors} comparte con vos." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ es-AR: fail: "Lo sentimos, no pudimos encontrar a %{handle}." zero: "nadie" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Error subiendo la foto. ¿Estás seguro de que era una imagen válida?" runtime_error: "Error subiendo la foto. ¿Hay alguna restricción de seguridad?" @@ -497,9 +502,8 @@ es-AR: edit: "editar" edit_delete_photo: "Editar descripción de foto / eliminar foto" make_profile_photo: "convertir en foto de perfil" - original_post: "Publicación original" + show_original_post: "Show original post" update_photo: "Actualizar foto" - view: "ver" update: error: "Error al editar la foto." notice: "La foto se subió correctamente." @@ -574,6 +578,7 @@ es-AR: new_request_to_person: sent: "¡Enviado!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ es-AR: your_email: "Tu correo electrónico" your_handle: "Tu dirección Diáspora*" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/es-CL.yml b/config/locales/diaspora/es-CL.yml index 1d267a738..297ce24c9 100644 --- a/config/locales/diaspora/es-CL.yml +++ b/config/locales/diaspora/es-CL.yml @@ -37,6 +37,7 @@ es-CL: person: invalid: "No es valido." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "Ya está siendo ocupado." ago: "hace %{time}" all_aspects: "Todos los Aspectos" @@ -117,6 +118,7 @@ es-CL: content: "Puedes enlazar los siguientes servicios a Diaspora:" heading: "Servicios que puedes enlazar" tags_following: "Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Tus Aspectos" many: "%{count} aspectos" move_contact: @@ -251,6 +253,7 @@ es-CL: tagline_first_half: "Comparte lo que quieras," tagline_second_half: "con los que quiera." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Identificación de invitación no encontrada" create: @@ -390,6 +393,7 @@ es-CL: other: "%{actors} comenzaron a compartir contigo." zero: "%{actors} comenzó a compartir contigo." notifier: + a_post_you_shared: "a post." click_here: "haz click aquí" comment_on_post: reply: "Responde o mira el post de %{name}>" @@ -470,6 +474,7 @@ es-CL: fail: "Lo siento, no pudimos encontrar %{handle}." zero: "ninguna persona" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Error al subir la foto. ¿Estás seguro que eso era una imagen?" runtime_error: "Error al subir la foto. ¿Estás seguro que tienes puesto el cinturon de seguridad?" @@ -497,9 +502,8 @@ es-CL: edit: "editar" edit_delete_photo: "Editar descripción de foto / borrar foto" make_profile_photo: "convertir en foto de perfil" - original_post: "Post original" + show_original_post: "Show original post" update_photo: "Actualizar Foto" - view: "ver" update: error: "Error al editar foto." notice: "Foto actualizada correctamente." @@ -574,6 +578,7 @@ es-CL: new_request_to_person: sent: "¡enviado!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "Hubo un error al compartir este post." reshare: @@ -747,10 +752,12 @@ es-CL: your_email: "Tu correo electrónico" your_handle: "Tu id de diaspora" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index 246d8ca25..c44023865 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -37,6 +37,7 @@ es: person: invalid: "no es válido." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "ya está ocupado." ago: "hace %{time} " all_aspects: "Todos los aspectos" @@ -117,6 +118,7 @@ es: content: "Ahora puedes enlazar los siguientes servicios a Diaspora*:" heading: "Servicios enlazados" tags_following: "Etiquetas" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Tus Aspectos" many: "%{count} aspectos" move_contact: @@ -251,6 +253,7 @@ es: tagline_first_half: "Comparte lo que quieras, " tagline_second_half: "con quien te gustaría" invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Identificación de invitación no encontrada" create: @@ -390,6 +393,7 @@ es: other: "%{actors} comenzaron a compartir contigo." zero: "%{actors} comenzó a compartir contigo." notifier: + a_post_you_shared: "a post." click_here: "pulsa aquí" comment_on_post: reply: "Responder o ver los comentarios de %{name} >" @@ -470,6 +474,7 @@ es: fail: "Perdona, no pudimos encontrar %{handle}" zero: "ninguna persona" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Error subiendo la foto. ¿Seguro que era una imagen?" runtime_error: "Error subiendo la foto. ¿Alguna restricción de seguridad?" @@ -497,9 +502,8 @@ es: edit: "editar" edit_delete_photo: "Editar pie de foto / eliminar foto" make_profile_photo: "convertir en foto de perfil" - original_post: "Publicación original" + show_original_post: "Show original post" update_photo: "Actualizar foto" - view: "ver" update: error: "Error editando la foto." notice: "Foto actualizada con éxito." @@ -574,6 +578,7 @@ es: new_request_to_person: sent: "¡Enviado!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "Ocurrió un error al volver a compartir este comentario." reshare: @@ -747,10 +752,12 @@ es: your_email: "Tu email" your_handle: "Tu dirección Diaspora*" getting_started: + aspects: "aspects" connect_to: "Conectar a" connect_to_your_other_social_networks: "Conéctate a tus otras redes sociales" connect_with_people: "Conectate con gente interesante" - connect_with_people_explanation: "" + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Etiquetas ofrecidas" featured_users: "Usuarios ofrecidos" fill_out_your_profile: "" diff --git a/config/locales/diaspora/eu.yml b/config/locales/diaspora/eu.yml index 57c5839ba..0e75a5e78 100644 --- a/config/locales/diaspora/eu.yml +++ b/config/locales/diaspora/eu.yml @@ -37,6 +37,7 @@ eu: person: invalid: "ez da erabilgarria." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "erabilpenean dago jada." ago: "%{time} d(ir)ela" all_aspects: "Alderdi guztiak" @@ -117,6 +118,7 @@ eu: content: "Honako zerbitzuak lotu ditzakezu Diasporara:" heading: "Zerbitzuak Lotu" tags_following: "Jarraitutako Etiketak" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Zure Alderdiak" many: "%{count} alderdi" move_contact: @@ -251,6 +253,7 @@ eu: tagline_first_half: "Partekatu nahi duzuna," tagline_second_half: "nahi duzunarekin." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Gonbidapena ez da aurkitu" create: @@ -390,6 +393,7 @@ eu: other: "%{actors} zurekin harremanetan hasi d(ir)a" zero: "%{actors} zurekin harremanetan hasi d(ir)a" notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ eu: fail: "%{handle} ezin izan dugu aurkitu." zero: "jenderik ez" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Argazki igoerak huts egin du. Ziur al zaude irudi bat zela?" runtime_error: "Argazki igoerak huts egin du. Ziur zaude zure uhala azkarra dela?" @@ -497,9 +502,8 @@ eu: edit: "aldatu" edit_delete_photo: "Argazkiaren deskribapena aldatu / argazkia ezabatu" make_profile_photo: "profileko argazki bihurtu" - original_post: "Jatorrizko mezua" + show_original_post: "Show original post" update_photo: "Argazkia Eguneratu" - view: "ikusi" update: error: "Huts argazkia aldatzean." notice: "Argazkia arrakastaz eguneratua." @@ -574,6 +578,7 @@ eu: new_request_to_person: sent: "bidalia!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ eu: your_email: "Zure e-posta" your_handle: "Zure Diaspora IDa" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/fi.yml b/config/locales/diaspora/fi.yml index 075421533..89dc3f1e6 100644 --- a/config/locales/diaspora/fi.yml +++ b/config/locales/diaspora/fi.yml @@ -37,6 +37,7 @@ fi: person: invalid: "ei ole kelvollinen." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "on jo varattu." ago: "%{time} sitten" all_aspects: "Kaikki näkymät" @@ -117,6 +118,7 @@ fi: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Seuratut Tagit" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Näkymäsi" many: "%{count} näkymää" move_contact: @@ -251,6 +253,7 @@ fi: tagline_first_half: "Jaa mitä haluat," tagline_second_half: "kenen kanssa haluat." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Kutsun tunnusta ei löytynyt" create: @@ -390,6 +393,7 @@ fi: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ fi: fail: "Valitettavasti tunnusta %{handle} ei löytynyt." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Kuvan lataus epäonnistui. Oletko varma, että se oli kuva?" runtime_error: "Kuvan lataus epäonnistui. Onhan turvavyösi kiinni?" @@ -497,9 +502,8 @@ fi: edit: "muokkaa" edit_delete_photo: "Muokkaa kuvan kuvausta / poista kuva" make_profile_photo: "laita profiilikuvaksi" - original_post: "Alkuperäinen viesti" + show_original_post: "Show original post" update_photo: "Päivitä kuva" - view: "näytä" update: error: "Kuvan muokkaus epäonnistui." notice: "Kuva päivitettiin onnistuneesti." @@ -574,6 +578,7 @@ fi: new_request_to_person: sent: "lähetetty!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ fi: your_email: "Sähköpostiosoitteesi" your_handle: "Diaspora-tunnuksesi" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/fr.yml b/config/locales/diaspora/fr.yml index a7c1ed35f..7da48a69f 100644 --- a/config/locales/diaspora/fr.yml +++ b/config/locales/diaspora/fr.yml @@ -37,6 +37,7 @@ fr: person: invalid: "est invalide." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "est déjà pris." ago: "Il y a %{time}" all_aspects: "Tous les aspects" @@ -117,6 +118,7 @@ fr: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Vos aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ fr: tagline_first_half: "Partagez ce que vous voulez," tagline_second_half: "avec qui vous voudrez." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Jeton d'invitation introuvable" create: @@ -390,6 +393,7 @@ fr: other: "%{actors} a/ont commencé à partager avec vous." zero: "%{actors} a/ont commencé à partager avec vous." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ fr: fail: "Impossible de trouver %{handle}." zero: "personne" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Impossible d'envoyer la photo. S'agit-il réellement d'une image ?" runtime_error: "L'envoi de la photo a échoué. Avez-vous attaché votre ceinture ?" @@ -497,9 +502,8 @@ fr: edit: "modifier" edit_delete_photo: "Modifier la description de la photo / supprimer la photo" make_profile_photo: "en faire la photo de profil" - original_post: "Message original" + show_original_post: "Show original post" update_photo: "Mettre à jour la photo" - view: "voir" update: error: "La modification de la photo a échoué." notice: "La photo a été mise à jour." @@ -574,6 +578,7 @@ fr: new_request_to_person: sent: "envoyée !" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ fr: your_email: "Votre adresse électronique" your_handle: "Votre identifiant diaspora" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/ga.yml b/config/locales/diaspora/ga.yml index 345667152..3fa00c603 100644 --- a/config/locales/diaspora/ga.yml +++ b/config/locales/diaspora/ga.yml @@ -37,6 +37,7 @@ ga: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} ó shin" all_aspects: "All aspects" @@ -117,6 +118,7 @@ ga: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ ga: tagline_first_half: "Roinnt cad atá tú ag iarraidh," tagline_second_half: "le cé atá tú ag iarraidh." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Níl aon comhceallaigh cuireadh ann" create: @@ -390,6 +393,7 @@ ga: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ ga: fail: "Brón orn, níor raibhamar abálta %{handle} a fháil." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Níor d'éirigh le uaslódáil an pictiúr. An bhfuil tú cinnte go raibh sé pictiúr?" runtime_error: "Níor d'éirigh le uaslódáil an pictiúr. An bhfuil tú cinnte go bhfuil to crios sábhala ort?" @@ -497,9 +502,8 @@ ga: edit: "athraigh" edit_delete_photo: "Athraigh tuarisc an pictiúr / scrios pictiúr" make_profile_photo: "Déan mar mo pictiúr prófíl" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Nuashonraigh Pictiúr" - view: "féach ar" update: error: "Níor d'éirigh le aithrú an pictiúr." notice: "Pictiure Uaslódaithe." @@ -574,6 +578,7 @@ ga: new_request_to_person: sent: "seolta!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ ga: your_email: "Do seola ríomhphost" your_handle: "Do hanla diaspora" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 0765ee731..79a3f5efc 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -4,9 +4,9 @@ he: - _applications: "Applications" + _applications: "יישומים" _comments: "תגובות" - _contacts: "Contacts" + _contacts: "אנשי קשר" _home: "בית" _photos: "תמונות" _services: "שירותים" @@ -29,7 +29,7 @@ he: reshare: attributes: root_guid: - taken: "You've already reshared that post!" + taken: "כבר שיתפת מחדש רשומה זו!" user: attributes: email: @@ -37,6 +37,7 @@ he: person: invalid: "שגוי." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "כבר תפוס." ago: "%{time} עברו" all_aspects: "כל ההיבטים" @@ -67,12 +68,12 @@ he: aspect_contacts: done_editing: "סיום העריכה" aspect_listings: - add_an_aspect: "+ Add an aspect" + add_an_aspect: "+ הוספת היבט" aspect_stream: - commented_on: "commented on" - posted: "posted" - recently: "recently:" - stream: "Stream" + commented_on: "הגיב/ה על" + posted: "פורסם" + recently: "לאחרונה:" + stream: "תזרים" contacts_not_visible: "אנשי הקשר בהיבט זה לא יוכלו לראות אחד את השני." contacts_visible: "אנשי קשר בהיבט זה יוכלו לראות זה את זה." create: @@ -103,21 +104,22 @@ he: heading: "התחברות ל־Cubbi.es" learn_more: "מידע נוסף" diaspora_id: - content_1: "Your Diaspora ID is:" + content_1: "המזהה שלך בדיאספורה הוא:" content_2: "Give it to anyone and they'll be able to find you on Diaspora." - heading: "Diaspora ID" + heading: "מזהה בדיאספורה" donate: "Donate" - handle_explanation: "זהו שם המשתמש שלך בדיאספורה. כמו כתובת דואר אלקטרוני, ניתן לחלוק אותו עם אנשים כדי שיגיעו אליך." + handle_explanation: "זהו שם המשתמש שלך בדיאספורה. בדיוק כמו כתובת דואר אלקטרוני, ניתן לחלוק אותו עם אנשים כדי שיגיעו אליך." keep_us_running: "Keep %{pod} running fast, buy our servers their monthly coffee fix!" no_contacts: "אין אנשי קשר" - no_tags: "No tags" + no_tags: "+ חיפוש תגית למעקב" people_sharing_with_you: "אנשים המשתפים אתך" post_a_message: "פרסום הודעה >>" services: - content: "You can connect the following services to Diaspora:" - heading: "Connect Services" - tags_following: "Followed Tags" - your_aspects: "Your Aspects" + content: "ניתן לקשר את השירותים הבאים לדיאספורה:" + heading: "שירותים מקושרים" + tags_following: "תגיות במעקב" + unfollow_tag: "Stop following #%{tag}" + your_aspects: "ההיבטים שלך" many: "%{count} היבטים" move_contact: error: "שגיאה בהעברת איש הקשר: %{inspect}" @@ -127,12 +129,12 @@ he: create: "יצירה" name: "שם" no_contacts_message: - featured_users: "featured users" - or_featured: "Or you can share with %{link}" + featured_users: "משתמשים מומלצים" + or_featured: "או שבאפשרותך לשתף עם %{link}" try_adding_some_more_contacts: "You can search (top) or invite (right) more contacts." - you_should_add_some_more_contacts: "You should add some more contacts!" + you_should_add_some_more_contacts: "עליך להוסיף אנשי קשר נוספים!" no_posts_message: - start_talking: "אף אחד לא דיבר עדיין. בואו נתחיל להתקשקש פה!" + start_talking: "אף אחד לא דיבר עדיין!" one: "היבט אחד" other: "%{count} היבטים" seed: @@ -141,9 +143,9 @@ he: friends: "Friends" work: "עבודה" selected_contacts: - manage_your_aspects: "Manage your aspects." - no_contacts: "You don't have any contacts here yet." - view_all_contacts: "View all contacts" + manage_your_aspects: "ניהול ההיבטים שלך." + no_contacts: "אין לך עדיין אנשי קשר כאן." + view_all_contacts: "הצגת כל אנשי הקשר" show: edit_aspect: "עריכת היבט" update: @@ -152,7 +154,7 @@ he: zero: "אין היבטים" authorizations: index: - revoke_access: "Revoke Access" + revoke_access: "שלילת הגישה" back: "חזרה" bookmarklet: explanation: "פרסום ישירות לדיאספורה מכל מקום על ידי הוספת %{link} לסימניות." @@ -177,17 +179,17 @@ he: featured_users: "Featured Users" few: "%{count} אנשי קשר" index: - add_a_new_aspect: "Add a new aspect" - all_contacts: "All Contacts" - edit_aspect: "Edit %{name}" + add_a_new_aspect: "הוספת היבט חדש" + all_contacts: "כל אנשי הקשר" + edit_aspect: "עריכת %{name}" many_people_are_you_sure: "Are you sure you want to start a private conversation with more than %{suggested_limit} contacts? Posting to this aspect may be a better way to contact them." - my_contacts: "My Contacts" - no_contacts: "No contacts." - only_sharing_with_me: "Only sharing with me" - remove_person_from_aspect: "Remove %{person_name} from \"%{aspect_name}\"" - start_a_conversation: "Start a conversation" - title: "Contacts" - your_contacts: "Your Contacts" + my_contacts: "אנשי הקשר שלי" + no_contacts: "אין אנשי קשר." + only_sharing_with_me: "רק אלו המשתפים אתי" + remove_person_from_aspect: "הסרת %{person_name} מההיבט \"%{aspect_name}\"" + start_a_conversation: "התחלת דיון" + title: "אנשי קשר" + your_contacts: "אנשי הקשר שלך" many: "%{count} אנשי קשר" one: "איש קשר אחד" other: "%{count} אנשי קשר" @@ -214,7 +216,7 @@ he: no_conversation_selected: "לא נבחר דיון" no_messages: "אין הודעות" new: - abandon_changes: "Abandon changes?" + abandon_changes: "האם להתעלם מהשינויים?" send: "שליחה" sending: "Sending..." subject: "נושא" @@ -251,6 +253,7 @@ he: tagline_first_half: "שיתוף מה שבא לך," tagline_second_half: "עם מי שבא לך." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "אסימון ההזמנה לא נמצא" create: @@ -261,10 +264,10 @@ he: rejected: "בכתובת הדוא״ל הבאה התגלו שגיאות:" sent: "נשלחו הזמנות אל:" edit: - accept_your_invitation: "Accept your invitation" + accept_your_invitation: "קבלת ההזמנה שלך" your_account_awaits: "Your account awaits!" new: - already_invited: "כבר נשלחה הזמנה" + already_invited: "האנשים הבאים לא נענו להזמנה שלך:" aspect: "היבט" comma_seperated_plz: "באפשרותך להזין מספר כתובות דוא״ל ולהפרידן בפסיקים." if_they_accept_info: "אם הם יאשרו, הם יתווספו להיבט שאליו הזמנת אותם." @@ -289,9 +292,9 @@ he: login: "כניסה" logout: "יציאה" profile: "פרופיל" - recent_notifications: "Recent notifications" + recent_notifications: "התרעות אחרונות" settings: "הגדרות" - view_all: "View all" + view_all: "צפייה בהכול" likes: likes: people_dislike_this: @@ -307,12 +310,12 @@ he: other: "%{count} אנשים אהבו את זה" zero: "אף אחד לא אהב את זה" people_like_this_comment: - few: "%{count} likes" - many: "%{count} likes" + few: "%{count} אהבו זאת" + many: "%{count} אהבו זאת" one: "%{count} like" other: "%{count} likes" zero: "no likes" - limited: "Limited" + limited: "מוגבל" more: "המשך" next: "הבאה" no_results: "לא נמצאו תוצאות" @@ -390,31 +393,32 @@ he: other: "%{actors} החל/ה לשתף אתך." zero: "%{actors} החלו לשתף אתך." notifier: - click_here: "click here" + a_post_you_shared: "a post." + click_here: "יש ללחוץ כאן" comment_on_post: - reply: "Reply or view %{name}'s post >" + reply: "שליחת תגובה או צפייה ברשומה של %{name} >" confirm_email: click_link: "To activate your new e-mail address %{unconfirmed_email}, please click this link:" subject: "Please activate your new e-mail address %{unconfirmed_email}" - email_sent_by_diaspora: "This email was sent by Diaspora. If you'd like to stop getting emails like this," + email_sent_by_diaspora: "הודעת דוא״ל זו נשלחה על ידי דיאספורה. אם אין לך עניין בקבלת הודעות כגון זו," hello: "שלום %{name}!" liked: - liked: "%{name} בדיוק עכשיו סימן/נה את הרשומה שלך כאהובה: " - view_post: "View post >" + liked: "%{name} בדיוק עכשיו סימן/נה את הרשומה שלך כאהובה" + view_post: "צפייה ברשומה >" mentioned: mentioned: "ציין/ה אותך ברשומה:" subject: "הוזכרת על ידי %{name} בדיאספורה*" private_message: - reply_to_or_view: "Reply to or view this conversation >" + reply_to_or_view: "שליחת תגובה או צפייה בדיון זה >" single_admin: admin: "מנהל הדיאספורה שלך" subject: "הודעה בנוגע לחשבונך בדיאספורה:" started_sharing: sharing: "החל/ה לשתף אתך!" subject: "%{name} החל/ה לשתף אתך בדיאספורה*" - view_profile: "View %{name}'s profile" + view_profile: "צפייה בפרופיל של %{name}" thanks: "רב תודות," - to_change_your_notification_settings: "to change your notification settings" + to_change_your_notification_settings: "כדי לשנות את הגדרות ההתרעה שלך" ok: "אישור" or: "או" password: "ססמה" @@ -470,6 +474,7 @@ he: fail: "לא ניתן למצוא את %{handle}, עמך הסליחה." zero: "אין אנשים" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "העלאת התמונה נכשלה. האם זו אכן הייתה תמונה?" runtime_error: "העלאת התמונה נכשלה. האם החגורה שלך אכן מהודקת??" @@ -497,9 +502,8 @@ he: edit: "עריכה" edit_delete_photo: "עריכת תיאור תמונה / מחיקת תמונה" make_profile_photo: "יצירת תמונת פרופיל" - original_post: "רשומה מקורית" + show_original_post: "Show original post" update_photo: "עדכון התמונה" - view: "צפייה" update: error: "אירע כשל בעריכת התמונה." notice: "התמונה עודכנה בהצלחה." @@ -508,9 +512,9 @@ he: post_hidden: "הרשומה של %{name} הוסתרה." posts: show: - destroy: "Delete" - not_found: "Sorry, we couldn't find that post." - permalink: "permalink" + destroy: "מחיקה" + not_found: "לא ניתן למצוא רשומה זו, עמך הסליחה." + permalink: "קישור קבוע" previous: "הקודמת" profile: "פרופיל" profiles: @@ -528,12 +532,12 @@ he: your_photo: "התמונה שלך" your_private_profile: "הפרופיל הפרטי שלך" your_public_profile: "הפרופיל הציבורי שלך" - your_tags: "את/ה: ב־5 #תגיות" - your_tags_placeholder: "לדוגמה: #לדיאספורה #גיהוץ #חתלתולים #מוזיקה" + your_tags: "תאר/י את עצמך ב־5 מילים" + your_tags_placeholder: "כגון #סרטים #חתלתולים #טיולים #מורה #כרמיאל" update: failed: "אירע כשל בעדכון הפרופיל" updated: "הפרופיל עודכן" - public: "Public" + public: "ציבורי" registrations: closed: "אפשרות ההרשמה סגורה בפוד זה של דיאספורה." create: @@ -546,13 +550,13 @@ he: unhappy: "בבאסה?" update: "עדכון" new: - create_my_account: "Create my account" + create_my_account: "יצירת החשבון שלי" enter_email: "נא להזין כתובת דוא״ל" enter_password: "נא להזין ססמה" enter_password_again: "להזין את אותה הססמה כמקודם" enter_username: "נא לבחור שם משתמש (אותיות, מספרים וקווים תחתונים בלבד)" - join_the_movement: "Join the movement!" - sign_up_today: "Sign up today" + join_the_movement: "הצטרפות לתנועה!" + sign_up_today: "הרשמה עוד היום" requests: create: sending: "בשליחה" @@ -574,18 +578,19 @@ he: new_request_to_person: sent: "נשלחה!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: - failure: "There was an error resharing this post." + failure: "פרסום מחדש של רשומה זאת הוביל לשגיאה." reshare: - deleted: "Original post deleted by author." + deleted: "הרשומה המקורית נמחקה על ידי הכותב." reshare: few: "%{count} Reshares" many: "%{count} Reshares" one: "1 Reshare" other: "%{count} Reshares" - zero: "Reshare" + zero: "שיתוף מחדש" reshare_confirmation: "Reshare %{author} - %{text}?" - reshare_original: "Reshare orignial" + reshare_original: "שיתוף המקור מחדש" show_original: "Show Original" search: "חיפוש" services: @@ -611,7 +616,7 @@ he: disconnect: "ניתוק" edit_services: "עריכת שירותים" logged_in_as: "נכנסת בשם" - no_services: "You have not connected any services yet." + no_services: "לא קישרת אף שירות עדיין." really_disconnect: "האם לנתק את %{service}?" inviter: click_link_to_accept_invitation: "יש ללחוץ על קישור זה כדי לקבל את ההזמנה שלך" @@ -622,9 +627,9 @@ he: settings: "הגדרות" shared: add_contact: - add_new_contact: "Add a new contact" + add_new_contact: "הוספת איש קשר חדש" create_request: "חיפוש לפי שם משתמש בדיאספורה" - diaspora_handle: "diaspora@handle.org" + diaspora_handle: "diaspora@pod.org" enter_a_diaspora_username: "נא להזין שם משתמש בדיאספורה:" know_email: "כתובת הדוא״ל שלהם ידועה לך? עליך להזמין אותם" your_diaspora_username_is: "שם המשתמש שלך בדיאספורה הוא: %{diaspora_handle}" @@ -653,24 +658,24 @@ he: all: "הכול" all_contacts: "כל אנשי הקשר" click_to_share_with: "יש ללחוץ כדי לשתף עם:" - discard_post: "Discard post" + discard_post: "התעלמות מרשומה" make_public: "הפיכה לציבורי" post_a_message_to: "פרסום הודעה אל %{aspect}" posting: "פרסום..." publishing_to: "פרסום אל:" share: "שיתוף" share_with: "שיתוף עם" - upload_photos: "Upload photos" + upload_photos: "העלאת תמונות" whats_on_your_mind: "מה עובר לך בראש?" reshare: reshare: "שיתוף מחדש" stream_element: dislike: "לא אהבתי את זה" like: "אהבתי" - shared_with: "Shared with: %{aspect_names}" + shared_with: "משותף עם: %{aspect_names}" unlike: "לא אהבתי" via: "באמצעות %{link}" - viewable_to_anyone: "This post is viewable to anyone on the web" + viewable_to_anyone: "רשומה זו ניתנת לצפייה לכל גולשי הרשת" status_messages: create: success: "אוזכרו בהצלחה: %{names}" @@ -687,23 +692,23 @@ he: other: "נא לוודא שהודעות המצב שלך אינן עולות על %{count} תווים" zero: "נא לוודא שהודעות המצב שלך אינן עולות על %{count} תווים" stream_helper: - hide_comments: "הסתרת הערות" - show_more_comments: "Show %{number} more comments" + hide_comments: "הסתרת כל ההערות" + show_more_comments: "הצגת %{number} תגובות נוספות" tag_followings: create: - failure: "Failed to follow: #%{name}" - success: "Successfully following: #%{name}" + failure: "אירע כשל בעת המעקב: #%{name}" + success: "המעקב הוגדר בהצלחה אחר: #%{name}" destroy: - failure: "Failed to stop following: #%{name}" - success: "Successfully stopped following: #%{name}" + failure: "אירע כשל בעצירת הבא: #%{name}" + success: "הבא נעצר בהצלחה: #%{name}" tags: show: - follow: "Follow #%{tag}" - following: "Following #%{tag}" + follow: "מעקב אחר #%{tag}" + following: "במעקב אחר #%{tag}" nobody_talking: "אף אחד עדיין לא דיבר על %{tag}." people_tagged_with: "אנשים תויגו ב־%{tag}" posts_tagged_with: "אנשים תויגו ב־%{tag}" - stop_following: "Stop Following #%{tag}" + stop_following: "הפסקת המעקב אחר #%{tag}" tokens: show: connect_to_cubbies: "התחברות ל־Cubbi.es" @@ -747,30 +752,32 @@ he: your_email: "כתובת הדוא״ל שלך" your_handle: "שם המשתמש שלך בדיאספורה" getting_started: - connect_to: "Connect to" + aspects: "aspects" + connect_to: "התחברות אל" connect_to_your_other_social_networks: "Connect to your other social networks" - connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people: "התחברות לאנשים מגניבים" + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" - find_friends: "Find friends" + find_friends: "חיפוש חברים" find_friends_from_facebook: "find friends from Facebook" - finished: "סיימת!" + finished: "הסתיים" follow_your_interests: "Follow your interests" hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." profile_description: "Make it easier for people to find you by filling out your profile information." profile_fields: - bio: "Bio" - birthday: "Birthday" - gender: "Gender" - location: "Location" - name: "Name" - photo: "Photo" - tags: "Tags" + bio: "ביוגרפיה" + birthday: "יום הולדת" + gender: "מגדר" + location: "מיקום" + name: "שם" + photo: "תמונה" + tags: "תגיות" see_all_featured_users: "See all featured users" - welcome: "ברוך בואך לדיאספורה!" - welcome_with_name: "Welcome, %{name}!" + welcome: "ברוך בואך!" + welcome_with_name: "ברוך בואך, %{name}!" public: does_not_exist: "המשתמש %{username} אינו קיים!" update: @@ -779,8 +786,8 @@ he: language_not_changed: "החלפת השפה נכשלה" password_changed: "הססמה הוחלפה. כעת באפשרותך להיכנס עם הססמה החדשה שלך." password_not_changed: "החלפת הססמה נכשלה" - unconfirmed_email_changed: "E-Mail Changed. Needs activation." - unconfirmed_email_not_changed: "E-Mail Change Failed" + unconfirmed_email_changed: "כתובת הדוא״ל הוחלפה. נדרשת הפעלה." + unconfirmed_email_not_changed: "החלפת כתובת הדוא״ל נכשלה" webfinger: fetch_failed: "אירע כשל בקבלת פרופיל ה־webfinger שלך ל־%{profile_url}" hcard_fetch_failed: "אירעה שגיאה בעת קבלת ה־hcard לחשבון %{account}" diff --git a/config/locales/diaspora/hu.yml b/config/locales/diaspora/hu.yml index 2ff7f6444..f0ccd4664 100644 --- a/config/locales/diaspora/hu.yml +++ b/config/locales/diaspora/hu.yml @@ -37,6 +37,7 @@ hu: person: invalid: "érvénytelen." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "már foglalt." ago: "ezelőtt" all_aspects: "Összes csoport" @@ -117,6 +118,7 @@ hu: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} csoport" move_contact: @@ -251,6 +253,7 @@ hu: tagline_first_half: "Oszd meg..." tagline_second_half: "akivel akarod!" invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Meghívó token nem található" create: @@ -390,6 +393,7 @@ hu: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ hu: fail: "Sajnáljuk, de nem találjuk őt: %{handle}." zero: "nincs személy" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Kép feltöltése nem sikerült. Biztos vagy benne, hogy ez egy kép?" runtime_error: "Kép feltöltése nem sikerült. Szerver nem válaszol!" @@ -497,9 +502,8 @@ hu: edit: "szerkesztés" edit_delete_photo: "Kép leírás szerkesztése / kép törlése" make_profile_photo: "beállítás profilképnek" - original_post: "Eredeti bejegyzés" + show_original_post: "Show original post" update_photo: "Kép frissítése" - view: "nézet" update: error: "Nem sikerült szerkeszteni a képet." notice: "Kép szerkesztése sikerült." @@ -574,6 +578,7 @@ hu: new_request_to_person: sent: "elküldve!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ hu: your_email: "E-mail címed" your_handle: "Diaspora felhasználóneved" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/id.yml b/config/locales/diaspora/id.yml index 594a871cf..9c49f6840 100644 --- a/config/locales/diaspora/id.yml +++ b/config/locales/diaspora/id.yml @@ -37,6 +37,7 @@ id: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} ago" all_aspects: "All aspects" @@ -117,6 +118,7 @@ id: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ id: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Invitation token not found" create: @@ -390,6 +393,7 @@ id: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ id: fail: "Sorry, we couldn't find %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Photo upload failed. Are you sure that was an image?" runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" @@ -497,9 +502,8 @@ id: edit: "edit" edit_delete_photo: "Edit photo description / delete photo" make_profile_photo: "make profile photo" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Update Photo" - view: "view" update: error: "Gagal mengubah foto." notice: "Foto berhasil diperbarui." @@ -574,6 +578,7 @@ id: new_request_to_person: sent: "sent!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ id: your_email: "Your email" your_handle: "Your diaspora handle" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/is.yml b/config/locales/diaspora/is.yml index f436fdeb0..07de3151f 100644 --- a/config/locales/diaspora/is.yml +++ b/config/locales/diaspora/is.yml @@ -37,6 +37,7 @@ is: person: invalid: "er ógilt." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "er þegar í notkun." ago: "%{time} síðan" all_aspects: "All aspects" @@ -117,6 +118,7 @@ is: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ is: tagline_first_half: "Deildu því sem þú vilt," tagline_second_half: "með þeim sem þú vilt." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Invitation token not found" create: @@ -390,6 +393,7 @@ is: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ is: fail: "Því miður, %{handle} fannst ekki." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Innhlöðunn myndar mistókst. Ertu viss um að þetta hafi verið mynd?" runtime_error: "Innsetning á mynd mistóḱst. Ertu viss um að sætisbeltin séu spennt?" @@ -497,9 +502,8 @@ is: edit: "breyta" edit_delete_photo: "Breyta lýsingu við mynd / eyða mynd" make_profile_photo: "setja mynd á síðuna mína" - original_post: "Upphaflegur póstur." + show_original_post: "Show original post" update_photo: "Uppfæra mynd" - view: "sýn" update: error: "Ekki tókst að breyta mynd." notice: "Velheppnuð uppfærsla á mynd. " @@ -574,6 +578,7 @@ is: new_request_to_person: sent: "sent!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ is: your_email: "Netfangið þitt" your_handle: "Díaspora netfangið þitt." getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 935ceccfe..d3fbfe163 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -37,6 +37,7 @@ it: person: invalid: "non è valido." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "è già stato preso." ago: "%{time} fa" all_aspects: "Tutti gli aspetti" @@ -117,6 +118,7 @@ it: content: "Puoi abbinare a Diaspora i seguenti servizi:" heading: "Servizi connessi" tags_following: "Tag che segui" + unfollow_tag: "Stop following #%{tag}" your_aspects: "I tuoi aspetti" many: "%{count} aspetti" move_contact: @@ -177,7 +179,7 @@ it: featured_users: "Utenti consigliati" few: "%{count} contatti" index: - add_a_new_aspect: "Aggiungi aspetto della vita" + add_a_new_aspect: "Aggiungi un aspetto" all_contacts: "Tutti i contatti" edit_aspect: "Modifica %{name}" many_people_are_you_sure: "Stai inviando un messaggio privato a più di %{suggested_limit} contatti. Vuoi farlo davvero? Forse potrebbe essere più opportuno pubblicarlo su un aspetto!" @@ -241,7 +243,7 @@ it: already_account: "hai già un account?" choice: "Scelta" choice_explanation: "Diaspora ti permette di suddividere i tuoi contatti in gruppi chiamati aspetti. Solo su Diaspora, gli aspetti fanno sì che le foto, i racconti e gli scherzi siano condivisi solamente con le persone che desideri." - learn_about_host: "Impara come ospitare il tuo server Diaspora." + learn_about_host: "Impara come creare il tuo server Diaspora." login_here: "accedi qui" ownership: "Proprietà" ownership_explanation: "Su Diaspora possiedi le tue foto, se le vuoi condividere non hai l'obbligo di cedere i diritti d'uso a nessun altro. Tutto ciò che pubblichi rimane tuo ed hai il controllo sulla sua diffusione." @@ -251,6 +253,7 @@ it: tagline_first_half: "Condividi ciò che desideri," tagline_second_half: "con chi vuoi." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Token di invito non trovato" create: @@ -390,6 +393,7 @@ it: other: "%{actors} hanno iniziato a condividere con te." zero: "%{actors} ha iniziato a condividere con te." notifier: + a_post_you_shared: "a post." click_here: "clicca qui" comment_on_post: reply: "Rispondi o leggi il post di %{name} >" @@ -470,6 +474,7 @@ it: fail: "Spiacenti, non possiamo trovare %{handle}." zero: "nessuna persona" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Il caricamento della foto non è riuscito. Sei sicuro che fosse un'immagine?" runtime_error: "La fotografia non si è caricata. Hai dimenticato forse di allacciare la cintura?" @@ -497,9 +502,8 @@ it: edit: "modifica" edit_delete_photo: "Modifica descrizione della foto / elimina foto" make_profile_photo: "usa come immagine del profilo" - original_post: "Post Originale" + show_original_post: "Show original post" update_photo: "Aggiorna Foto" - view: "guarda" update: error: "Modifica della foto fallita." notice: "Foto aggiornata con successo." @@ -574,6 +578,7 @@ it: new_request_to_person: sent: "richiesta inviata!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "C'è stato un errore nel condividere questo post." reshare: @@ -747,10 +752,12 @@ it: your_email: "La tua email" your_handle: "Il tuo ID" getting_started: + aspects: "aspects" connect_to: "Connettiti a" connect_to_your_other_social_networks: "Connetti altri social network" connect_with_people: "Connettiti con gente speciale" - connect_with_people_explanation: "Connettiti con altre persone mettendole in uno o più aspetti. Gli aspetti sono un modo intuitivo per raggruppare vecchie e nuove conoscenze, così per te sarà facile filtrare o condividere i messaggi solo con chi vuoi." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Tag consigliati" featured_users: "Utenti consigliati" fill_out_your_profile: "Riempi il tuo profilo" diff --git a/config/locales/diaspora/ja.yml b/config/locales/diaspora/ja.yml index 0756d7e4e..6fde4f542 100644 --- a/config/locales/diaspora/ja.yml +++ b/config/locales/diaspora/ja.yml @@ -37,6 +37,7 @@ ja: person: invalid: "無効です。" username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "既に使われています。" ago: "%{time}前" all_aspects: "全てのアスペクト" @@ -117,6 +118,7 @@ ja: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "アスペクト%{count}集" move_contact: @@ -251,6 +253,7 @@ ja: tagline_first_half: "好きなことだけ共有する" tagline_second_half: "好きな人に。" invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "招待トークンが見つかりません。" create: @@ -390,6 +393,7 @@ ja: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ ja: fail: "%{handle}が見つかりませんでした。" zero: "連絡先無し" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "写真のアップロードに失敗しました。確かに画像ファイルだったのでしょうか。" runtime_error: "写真のアップロードに失敗しました。シートベルトはしっかりとお締めでしょうか。" @@ -497,9 +502,8 @@ ja: edit: "編集" edit_delete_photo: "写真の説明を編集する/写真を削除する" make_profile_photo: "プロフィール写真にする" - original_post: "元の投稿" + show_original_post: "Show original post" update_photo: "写真を更新する" - view: "表示" update: error: "写真の編集に失敗しました。" notice: "写真の更新に成功しました。" @@ -574,6 +578,7 @@ ja: new_request_to_person: sent: "送信しました!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ ja: your_email: "メールアドレス" your_handle: "ダイアスポラのユーザ名" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/ko.yml b/config/locales/diaspora/ko.yml index 13d51233c..4f2c50137 100644 --- a/config/locales/diaspora/ko.yml +++ b/config/locales/diaspora/ko.yml @@ -37,6 +37,7 @@ ko: person: invalid: "유효하지 않습니다." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "이미 쓰이고 있습니다." ago: "%{time} 전" all_aspects: "모든 애스펙" @@ -106,7 +107,7 @@ ko: content_1: "내 디아스포라 ID:" content_2: "내 ID를 주면 누구든지 디아스포라에서 날 찾을수 있습니다." heading: "디아스포라 ID" - donate: "Donate" + donate: "기부하기" handle_explanation: "이 디아스포라 핸들은 이메일 주소처럼 남에게 건넬 수 있습니다." keep_us_running: "Keep %{pod} running fast, buy our servers their monthly coffee fix!" no_contacts: "컨택 없음" @@ -117,6 +118,7 @@ ko: content: "다음의 여러 서비스를 디아스포라에 연결할 수 있습니다" heading: "서비스 연결" tags_following: "팔로우된 태그들" + unfollow_tag: "Stop following #%{tag}" your_aspects: "내 애스펙" many: "애스펙 %{count}개" move_contact: @@ -127,18 +129,18 @@ ko: create: "만들기" name: "이름" no_contacts_message: - featured_users: "featured users" - or_featured: "Or you can share with %{link}" - try_adding_some_more_contacts: "You can search (top) or invite (right) more contacts." - you_should_add_some_more_contacts: "You should add some more contacts!" + featured_users: "추천 사용자" + or_featured: "%{link}와 공유할 수도 있습니다" + try_adding_some_more_contacts: "더 많은 컨택을 검색(위)하거나 초대(오른쪽)하세요." + you_should_add_some_more_contacts: "컨택을 좀 더 추가하세요!" no_posts_message: start_talking: "아직 아무 이야기도 없습니다. 대화를 시작하세요!" one: "애스펙 한 개" other: "애스펙 %{count}개" seed: - acquaintances: "Acquaintances" + acquaintances: "지인" family: "가족" - friends: "Friends" + friends: "친구" work: "직장" selected_contacts: manage_your_aspects: "내 애스펙 관리하기." @@ -174,7 +176,7 @@ ko: create: failure: "컨택을 만들 수 없습니다" featured: - featured_users: "Featured Users" + featured_users: "추천 사용자" few: "컨택 %{count}명" index: add_a_new_aspect: "새 애스펙 추가" @@ -216,7 +218,7 @@ ko: new: abandon_changes: "변경을 포기할까요?" send: "보내기" - sending: "Sending..." + sending: "보내는 중···" subject: "제목" to: "받는이" show: @@ -251,6 +253,7 @@ ko: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "초대장 토큰을 찾을 수 없습니다" create: @@ -261,8 +264,8 @@ ko: rejected: "아래의 이메일 주소는 문제가 있습니다: " sent: "초대장이 보내진 이메일 주소: " edit: - accept_your_invitation: "Accept your invitation" - your_account_awaits: "Your account awaits!" + accept_your_invitation: "초대 승락하기" + your_account_awaits: "내 계정이 기다리고있습니다!" new: already_invited: "초대한 친구들" aspect: "애스펙" @@ -390,6 +393,7 @@ ko: other: "%{actors}님이 나와 공유를 시작했습니다." zero: "%{actors}님이 나와 공유를 시작했습니다." notifier: + a_post_you_shared: "a post." click_here: "여기를 클릭하세요" comment_on_post: reply: "%{name}님의 공유물에 댓글달기 >" @@ -454,7 +458,7 @@ ko: add_some: "태그 달기" does_not_exist: "없는 사람입니다!" edit: "고치기" - has_not_shared_with_you_yet: "%{name} has not shared any posts with you yet!" + has_not_shared_with_you_yet: "%{name}님은 아직 나와 아무것도 공유하지 않았습니다!" incoming_request: "%{name}님이 나와 공유하길 원합니다" mention: "멘션" message: "쪽지" @@ -470,6 +474,7 @@ ko: fail: "%{handle} 핸들을 찾을 수 없습니다." zero: "없음" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "사진 업로드할 수 없습니다. 이미지가 맞습니까?" runtime_error: "사진을 업로드할 수 없습니다. 안전벨트를 확인하셨습니까?" @@ -497,9 +502,8 @@ ko: edit: "고치기" edit_delete_photo: "사진 설명 고치기 / 사진 지우기" make_profile_photo: "프로필 사진 만들기" - original_post: "원래 공유물" + show_original_post: "Show original post" update_photo: "사진 갱신" - view: "보기" update: error: "사진 고치기 실패." notice: "사진을 성공적으로 갱신했습니다." @@ -546,13 +550,13 @@ ko: unhappy: "무슨 문제라도?" update: "갱신하기" new: - create_my_account: "Create my account" + create_my_account: "내 계정 만들기" enter_email: "이메일 주소를 입력하세요" enter_password: "암호를 입력하세요" enter_password_again: "암호를 다시 입력하세요" enter_username: "사용자명을 선택하세요 (로마자, 아라비아 숫자, 언더스코어만)" - join_the_movement: "Join the movement!" - sign_up_today: "Sign up today" + join_the_movement: "합류하세요!" + sign_up_today: "지금 가입하세요" requests: create: sending: "공유를 요청하고 있습니다." @@ -574,6 +578,7 @@ ko: new_request_to_person: sent: "보냈습니다." reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "이 공유물을 재공유하는데 오류가 발생했습니다." reshare: @@ -747,30 +752,32 @@ ko: your_email: "이메일 주소" your_handle: "디아스포라 핸들" getting_started: - connect_to: "Connect to" - connect_to_your_other_social_networks: "Connect to your other social networks" - connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." - featured_tags: "Featured tags" - featured_users: "Featured users" - fill_out_your_profile: "Fill out your profile" - find_friends: "Find friends" - find_friends_from_facebook: "find friends from Facebook" + aspects: "aspects" + connect_to: "연결하기:" + connect_to_your_other_social_networks: "내 다른 소셜네트워크와 연결하기" + connect_with_people: "멋진 사람들과 연결하기" + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." + featured_tags: "추천 태그" + featured_users: "추천 사용자" + fill_out_your_profile: "내 프로필 채우기" + find_friends: "친구 찾기" + find_friends_from_facebook: "페이스북에서 친구 찾기" finished: "완료!" - follow_your_interests: "Follow your interests" - hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." - profile_description: "Make it easier for people to find you by filling out your profile information." + follow_your_interests: "내 관심사 팔로우하기" + hashtag_explanation: "해시태그로 내 관심사에 대해 말하거나 팔로우할 수 있습니다. 디아스포라에서 새로운 사람들을 찾을 수 있는 또 하나의 훌륭한 방법입니다." + profile_description: "내 프로필 정보를 채우면 사람들이 나를 찾기가 더욱 쉬워집니다." profile_fields: - bio: "Bio" - birthday: "Birthday" - gender: "Gender" - location: "Location" - name: "Name" - photo: "Photo" - tags: "Tags" - see_all_featured_users: "See all featured users" + bio: "자기소개" + birthday: "생일" + gender: "성별" + location: "위치" + name: "이름" + photo: "사진" + tags: "태그" + see_all_featured_users: "모든 추천 사용자 보기" welcome: "디아스포라에 오신걸 환영합니다!" - welcome_with_name: "Welcome, %{name}!" + welcome_with_name: "%{name}님 환영합니다!" public: does_not_exist: "%{username}님을 찾을 수 없습니다!" update: diff --git a/config/locales/diaspora/lt.yml b/config/locales/diaspora/lt.yml index b39b039ca..9650002d0 100644 --- a/config/locales/diaspora/lt.yml +++ b/config/locales/diaspora/lt.yml @@ -37,6 +37,7 @@ lt: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} prieš" all_aspects: "All aspects" @@ -117,6 +118,7 @@ lt: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ lt: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Pakvietimo raktas nerastas" create: @@ -390,6 +393,7 @@ lt: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ lt: fail: "Sorry, we couldn't find %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Photo upload failed. Are you sure that was an image?" runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" @@ -497,9 +502,8 @@ lt: edit: "redaguoti" edit_delete_photo: "Redaguoti nuotraukos aprašymą / pašalinti nuotrauką" make_profile_photo: "padaryti profilio nuotrauką" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Atnaujinti nuotrauką" - view: "rodyti" update: error: "Nuotraukos atnaujinti nepavyko." notice: "Nuotrauka atnaujinta sėkmingai." @@ -574,6 +578,7 @@ lt: new_request_to_person: sent: "išsiųsta!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ lt: your_email: "Tavo el. pašto adresas" your_handle: "Tavo Diasporos vartotojo vardas" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/mk.yml b/config/locales/diaspora/mk.yml index f894e3866..d7fff01bb 100644 --- a/config/locales/diaspora/mk.yml +++ b/config/locales/diaspora/mk.yml @@ -37,6 +37,7 @@ mk: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} пред" all_aspects: "All aspects" @@ -117,6 +118,7 @@ mk: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ mk: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Токенот за поканата не е пронајден" create: @@ -390,6 +393,7 @@ mk: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ mk: fail: "Sorry, we couldn't find %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Photo upload failed. Are you sure that was an image?" runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" @@ -497,9 +502,8 @@ mk: edit: "уреди" edit_delete_photo: "Уреди опис на слика/избриши слика" make_profile_photo: "направи ја профил слика" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Ажурирај слика" - view: "поглед" update: error: "Неуспешно уредување на слика." notice: "Ажурирањето на сликата е успешно." @@ -574,6 +578,7 @@ mk: new_request_to_person: sent: "испратено!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ mk: your_email: "Вашиот е-маил" your_handle: "Вашето diaspora корисничко име" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/nb.yml b/config/locales/diaspora/nb.yml index 2e2b3ccbd..385d7a68a 100644 --- a/config/locales/diaspora/nb.yml +++ b/config/locales/diaspora/nb.yml @@ -37,6 +37,7 @@ nb: person: invalid: "er invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "er allerede tatt." ago: "%{time} siden" all_aspects: "Alle aspekter" @@ -117,6 +118,7 @@ nb: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspekter" move_contact: @@ -251,6 +253,7 @@ nb: tagline_first_half: "Del hva du vil," tagline_second_half: "med hvem du vil." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Invitation token not found" create: @@ -390,6 +393,7 @@ nb: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ nb: fail: "Beklager, vi kunne ikke finne %{handle}." zero: "ingen personer" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Bildeopplastning mislyktes. Er du sikker på det var et bilde?" runtime_error: "Bildeopplastning mislyktes. Har du festet sikkerhetsbeltet?" @@ -497,9 +502,8 @@ nb: edit: "rediger" edit_delete_photo: "Rediger bildebeskrivelse / slett bilde" make_profile_photo: "gjør til profilbilde" - original_post: "Orginalt Innlegg" + show_original_post: "Show original post" update_photo: "Oppdater Bilde" - view: "vis" update: error: "Greide ikke å endre bildet." notice: "Bildet er oppdatert." @@ -574,6 +578,7 @@ nb: new_request_to_person: sent: "sendt!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ nb: your_email: "Din epost" your_handle: "Ditt Diaspora brukernavn" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/nl.yml b/config/locales/diaspora/nl.yml index 3c86b9829..6564cac29 100644 --- a/config/locales/diaspora/nl.yml +++ b/config/locales/diaspora/nl.yml @@ -37,6 +37,7 @@ nl: person: invalid: "is ongeldig." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is al bezet." ago: "%{time} geleden" all_aspects: "Alle Aspecten" @@ -117,6 +118,7 @@ nl: content: "Je kunt de volgende service met Diaspora verbinden:" heading: "Verbind Services" tags_following: "Gevolgde Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Jouw Aspecten" many: "%{count} aspecten" move_contact: @@ -251,6 +253,7 @@ nl: tagline_first_half: "Deel wat je wilt delen," tagline_second_half: "met degenen met wie je het wilt delen." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Uitnodigingstoken niet gevonden" create: @@ -390,6 +393,7 @@ nl: other: "%{actors} delen nu met jou." zero: "%{actors} deelt nu met jou." notifier: + a_post_you_shared: "a post." click_here: "klik hier" comment_on_post: reply: "Reageer of bekijk %{name}'s post >" @@ -470,6 +474,7 @@ nl: fail: "Sorry, we konden %{handle} niet vinden." zero: "geen mensen" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Foto uploaden mislukt. Weet je zeker dat het een afbeelding was?" runtime_error: "Foto uploaden mislukt. Weet je zeker dat je je gordel omhebt?" @@ -497,9 +502,8 @@ nl: edit: "bewerk" edit_delete_photo: "Bewerk foto-omschrijving / verwijder foto" make_profile_photo: "kies als profielfoto" - original_post: "Originele post" + show_original_post: "Show original post" update_photo: "Update foto" - view: "bekijk" update: error: "Foto veranderen niet gelukt." notice: "Foto succesvol veranderd." @@ -574,6 +578,7 @@ nl: new_request_to_person: sent: "verzonden!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "Er is een fout opgetreden bij het herdelen van deze post." reshare: @@ -747,10 +752,12 @@ nl: your_email: "Jouw e-mail" your_handle: "Jouw Diaspora ID" getting_started: + aspects: "aspects" connect_to: "Verbind met" connect_to_your_other_social_networks: "Verbind met je andere sociale netwerken" connect_with_people: "Maak kennis met interessante mensen" - connect_with_people_explanation: "Leg contact met mensen door ze in een of meerdere aspecten te plaatsen. Aspecten zijn een handige manier om nieuwe en bekende gezichten in groepen in te delen, waardoor je jou contacten gemakkelijk kunt filteren en heel gericht berichten met ze kunt delen." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Aanbevolen tags" featured_users: "Aanbevolen gebruikers" fill_out_your_profile: "Vul je profiel aan" diff --git a/config/locales/diaspora/pa.yml b/config/locales/diaspora/pa.yml index 02a66e126..ed09ce5e7 100644 --- a/config/locales/diaspora/pa.yml +++ b/config/locales/diaspora/pa.yml @@ -37,6 +37,7 @@ pa: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} ਪਹਿਲਾਂ" all_aspects: "All aspects" @@ -117,6 +118,7 @@ pa: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ pa: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Invitation token not found" create: @@ -390,6 +393,7 @@ pa: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ pa: fail: "Sorry, we couldn't find %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Photo upload failed. Are you sure that was an image?" runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" @@ -497,9 +502,8 @@ pa: edit: "edit" edit_delete_photo: "Edit photo description / delete photo" make_profile_photo: "make profile photo" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Update Photo" - view: "view" update: error: "Failed to edit photo." notice: "Photo successfully updated." @@ -574,6 +578,7 @@ pa: new_request_to_person: sent: "ਭੇਜਿਆ!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ pa: your_email: "Your email" your_handle: "Your diaspora handle" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/pl.yml b/config/locales/diaspora/pl.yml index 4ca0da250..6311ab7ed 100644 --- a/config/locales/diaspora/pl.yml +++ b/config/locales/diaspora/pl.yml @@ -37,6 +37,7 @@ pl: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "jest już zajęta." ago: "%{time} temu" all_aspects: "Wszystkie aspekty" @@ -117,6 +118,7 @@ pl: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspektów" move_contact: @@ -251,6 +253,7 @@ pl: tagline_first_half: "Dziel się czym chcesz" tagline_second_half: "i z kim chcesz." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Identyfikator zaproszenia nie znaleziony" create: @@ -390,6 +393,7 @@ pl: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ pl: fail: "Wybacz, nie można było znaleźć %{handle}." zero: "nikt" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Nie udało się przesłać zdjęcia. Czy @{m,f:jesteś pew}{m:ien|f:na|n:to na pewno}{m,f: że to} był obraz?" runtime_error: "Nie udało się przesłać zdjęcia. Czy @{m:zapiąłeś |f:zapięłaś }pasy bezpieczeństwa@{n: są zapięte}?" @@ -497,9 +502,8 @@ pl: edit: "edytuj" edit_delete_photo: "Edytuj opis zdjęcia / usuń zdjęcie" make_profile_photo: "ustaw jako zdjęcie profilowe" - original_post: "Pierwotny wpis" + show_original_post: "Show original post" update_photo: "Aktualizuj zdjęcie" - view: "podgląd" update: error: "Błąd podczas edycji zdjęcia." notice: "Pomyślnie zaktualizowano zdjęcie." @@ -574,6 +578,7 @@ pl: new_request_to_person: sent: "wysłano!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ pl: your_email: "Twój e-mail" your_handle: "Twój identyfikator w Diasporze" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/pt-BR.yml b/config/locales/diaspora/pt-BR.yml index 5174d6bc9..148aed6f9 100644 --- a/config/locales/diaspora/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -37,6 +37,7 @@ pt-BR: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} atrás" all_aspects: "All aspects" @@ -117,6 +118,7 @@ pt-BR: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ pt-BR: tagline_first_half: "Compartilhe o que você quer," tagline_second_half: "com quem você quer." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Convite não encontrado." create: @@ -390,6 +393,7 @@ pt-BR: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ pt-BR: fail: "Desculpe, não conseguimos encontrar %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "O envio da foto falhou. Tem certeza que era uma imagem?" runtime_error: "O envio da foto falhou. Você colocou seu cinto de segurança?" @@ -497,9 +502,8 @@ pt-BR: edit: "Editar" edit_delete_photo: "Editar descrição / remover foto" make_profile_photo: "Toarnar esta foto a do seu perfil" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Atualizar foto" - view: "ver" update: error: "Falha ao editar foto." notice: "Foto enviada com sucesso." @@ -574,6 +578,7 @@ pt-BR: new_request_to_person: sent: "Enviado!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ pt-BR: your_email: "Seu email" your_handle: "Seu endereço Diaspora*" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/pt-PT.yml b/config/locales/diaspora/pt-PT.yml index bab0ff95a..19ec8b7fe 100644 --- a/config/locales/diaspora/pt-PT.yml +++ b/config/locales/diaspora/pt-PT.yml @@ -37,6 +37,7 @@ pt-PT: person: invalid: "não é válido." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "já foi escolhido." ago: "Há %{time} atrás" all_aspects: "Todos os Aspectos" @@ -117,6 +118,7 @@ pt-PT: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspectos" move_contact: @@ -251,6 +253,7 @@ pt-PT: tagline_first_half: "Partilhe o que desejar," tagline_second_half: "com quem desejar." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Código de convite não encontrado" create: @@ -390,6 +393,7 @@ pt-PT: other: "%{actors} começaram a partilhar consigo." zero: "%{actors} começou a partilhar consigo." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ pt-PT: fail: "Lamentamos muito, não conseguimos encontrar %{handle}." zero: "não há pessoas" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "O envio da fotografia falhou. Tem a certeza de que o ficheiro que seleccionou era uma imagem?" runtime_error: "O envio da fotografia falhou. Tem a certeza que o seu cinto de segurança está apertado?" @@ -497,9 +502,8 @@ pt-PT: edit: "editar" edit_delete_photo: "Editar descrição da fotografia / apagar fotografia" make_profile_photo: "tornar foto de perfil" - original_post: "Publicação Original" + show_original_post: "Show original post" update_photo: "Actualizar Fotografia" - view: "ver" update: error: "Falha ao editar a fotografia" notice: "Fotografia actualizada com sucesso." @@ -574,6 +578,7 @@ pt-PT: new_request_to_person: sent: "enviado!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ pt-PT: your_email: "O seu endereço de email" your_handle: "O seu endereço do Diaspora" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/ro.yml b/config/locales/diaspora/ro.yml index 37e32d5c6..9e37b28b8 100644 --- a/config/locales/diaspora/ro.yml +++ b/config/locales/diaspora/ro.yml @@ -37,6 +37,7 @@ ro: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} ago" all_aspects: "All aspects" @@ -117,6 +118,7 @@ ro: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ ro: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Invitaţia nu a fost găsită" create: @@ -390,6 +393,7 @@ ro: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ ro: fail: "Sorry, we couldn't find %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Încărcarea fotografiei a eşuat. Eşti sigur că a fost o imagine?" runtime_error: "Încărcarea fotografiei a eşuat. Eşti sigur că ai centura de siguranţă pusă?" @@ -497,9 +502,8 @@ ro: edit: "editează " edit_delete_photo: "Edit photo description / delete photo" make_profile_photo: "Setează ca fotografie de profil" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Actualizează fotografia" - view: "vizualizează" update: error: "Nu s-a reuşit editarea fotografiii." notice: "Fotografia a fost actualizată cu succes." @@ -574,6 +578,7 @@ ro: new_request_to_person: sent: "trimis!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ ro: your_email: "E-mailul tău" your_handle: "Identificatorul tau pe Diaspora" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index 71a9a2f47..e462b6422 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -37,6 +37,7 @@ ru: person: invalid: "недействительно." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "уже занято." ago: "%{time} назад" all_aspects: "Все аспекты" @@ -117,6 +118,7 @@ ru: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} аспект[-а, -ов]" move_contact: @@ -251,6 +253,7 @@ ru: tagline_first_half: "Поделитесь чем хотите," tagline_second_half: "с кем вы хотите." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Код приглашения не найден" create: @@ -390,6 +393,7 @@ ru: other: "%{actors} начали делиться с вами." zero: "%{actors} начали делиться с вами." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ ru: fail: "К сожалению, мы не смогли найти %{handle}." zero: "нет никого" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Сбой при загрузке фотографии. Вы уверены, что это правильный файл?" runtime_error: "Сбой при загрузке фотографии." @@ -497,9 +502,8 @@ ru: edit: "редактировать" edit_delete_photo: "Изменить описание фотографии / удалить фотографию" make_profile_photo: "сделать фотографией профиля" - original_post: "Исходное сообщение" + show_original_post: "Show original post" update_photo: "Обновить фотографию" - view: "смотреть" update: error: "Не удалось изменить фотографию." notice: "Фотография успешно загружена." @@ -574,6 +578,7 @@ ru: new_request_to_person: sent: "отправлено!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ ru: your_email: "Ваш адрес электронной почты (email)" your_handle: "Ваше управление Диаспорой" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/sk.yml b/config/locales/diaspora/sk.yml index bb885825d..d874c6335 100644 --- a/config/locales/diaspora/sk.yml +++ b/config/locales/diaspora/sk.yml @@ -37,6 +37,7 @@ sk: person: invalid: "je neplatný." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "je už obsadený." ago: "%{time} dozadu" all_aspects: "All aspects" @@ -117,6 +118,7 @@ sk: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ sk: tagline_first_half: "Zdieľajte čo chcete," tagline_second_half: "s ktorým chcete byť." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Pozývací token nenájdený" create: @@ -390,6 +393,7 @@ sk: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ sk: fail: "Prepáčte, nie je možné nájsť %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Chyba pri nahrávani fotky. Ste si istý, že je to obrázkový formát?" runtime_error: "Nahrávanie fotky zlyhalo. Ste si istý, že máte zapnuté bezpečnostné pásy? :)" @@ -497,9 +502,8 @@ sk: edit: "upraviť" edit_delete_photo: "Upraviť popis fotky / zmazať fotku" make_profile_photo: "Zhotoviť profilovú fotku" - original_post: "Pôvodný príspevok" + show_original_post: "Show original post" update_photo: "Aktualizovať fotku" - view: "Pozrieť" update: error: "Úprava fotky zlyhala." notice: "Fotka bola úspešne aktualizovaná." @@ -574,6 +578,7 @@ sk: new_request_to_person: sent: "Poslané!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ sk: your_email: "Váš e-mail" your_handle: "Príručka k Diaspore" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/sl.yml b/config/locales/diaspora/sl.yml index 9b52808bc..ae2e7a4d8 100644 --- a/config/locales/diaspora/sl.yml +++ b/config/locales/diaspora/sl.yml @@ -37,6 +37,7 @@ sl: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} nazaj" all_aspects: "Vse skupine" @@ -117,6 +118,7 @@ sl: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ sl: tagline_first_half: "Delite kar želite," tagline_second_half: "s komerkoli želite." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Povabilo ni bilo najdeno" create: @@ -390,6 +393,7 @@ sl: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ sl: fail: "Žal ni bilo mogoče najti %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Nalaganje slike ni uspelo. Ste prepričani, da je bila izbrana slika?" runtime_error: "Nalaganje slike ni uspelo. Imate pripet varnostni pas?" @@ -497,9 +502,8 @@ sl: edit: "uredi" edit_delete_photo: "Dodaj opis slike ali izbriši sliko" make_profile_photo: "uporabi sliko za moj profil" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Posodobi sliko" - view: "poglej" update: error: "Urejanje slike ni uspelo." notice: "Slika uspešno posodobljena." @@ -574,6 +578,7 @@ sl: new_request_to_person: sent: "poslano!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ sl: your_email: "Vaš e-naslov" your_handle: "Vaš diaspora naslov" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/sv.yml b/config/locales/diaspora/sv.yml index b407a8ee3..9c538674f 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -37,6 +37,7 @@ sv: person: invalid: "är ogiltig." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "är redan taget." ago: "%{time} sedan" all_aspects: "Alla Aspekter" @@ -117,6 +118,7 @@ sv: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspekter" move_contact: @@ -251,6 +253,7 @@ sv: tagline_first_half: "Dela vad du vill," tagline_second_half: "med vem du vill." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Inbjudan inte funnen" create: @@ -390,6 +393,7 @@ sv: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ sv: fail: "Förlåt, vi kunde inte hitta %{handle}." zero: "inga personer" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Fotouppladdning misslyckades. Är du säker på att det var en bild?" runtime_error: "Fotouppladdning misslyckades. Har du på dig ditt säkerhetsbälte?" @@ -497,9 +502,8 @@ sv: edit: "ändra" edit_delete_photo: "Ändra beskrivning / ta bort bild" make_profile_photo: "använd som profilbild" - original_post: "Ursprungligt inlägg" + show_original_post: "Show original post" update_photo: "Uppdatera foto" - view: "visa" update: error: "Misslyckades med att ändra fotot." notice: "Fotot är nu uppdaterat." @@ -574,6 +578,7 @@ sv: new_request_to_person: sent: "skickat!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ sv: your_email: "Din epost" your_handle: "Ditt Diaspora-användarnamn" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/tr.yml b/config/locales/diaspora/tr.yml index d40399f63..9542135b4 100644 --- a/config/locales/diaspora/tr.yml +++ b/config/locales/diaspora/tr.yml @@ -37,6 +37,7 @@ tr: person: invalid: "is invalid." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "is already taken." ago: "%{time} önce" all_aspects: "All aspects" @@ -117,6 +118,7 @@ tr: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count} aspects" move_contact: @@ -251,6 +253,7 @@ tr: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "Invitation token not found" create: @@ -390,6 +393,7 @@ tr: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ tr: fail: "Sorry, we couldn't find %{handle}." zero: "no people" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "Photo upload failed. Are you sure that was an image?" runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" @@ -497,9 +502,8 @@ tr: edit: "edit" edit_delete_photo: "Fotoğrafın tanımını düzenle/ fotoğrafı sil" make_profile_photo: "profil fotoğrafı yap" - original_post: "Original Post" + show_original_post: "Show original post" update_photo: "Fotoğrafı güncelle" - view: "view" update: error: "Fotoyu düzeltme basarısız oldu." notice: "Resim başarıyla eklendi." @@ -574,6 +578,7 @@ tr: new_request_to_person: sent: "yollandı!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ tr: your_email: "E-postan" your_handle: "Your diaspora handle" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/zh-CN.yml b/config/locales/diaspora/zh-CN.yml index 0a24ae45e..10c774ab6 100644 --- a/config/locales/diaspora/zh-CN.yml +++ b/config/locales/diaspora/zh-CN.yml @@ -37,6 +37,7 @@ zh-CN: person: invalid: "不合法。" username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "已被注册。" ago: "%{time}前" all_aspects: "所有视图" @@ -117,6 +118,7 @@ zh-CN: content: "You can connect the following services to Diaspora:" heading: "Connect Services" tags_following: "Followed Tags" + unfollow_tag: "Stop following #%{tag}" your_aspects: "Your Aspects" many: "%{count}个视图" move_contact: @@ -251,6 +253,7 @@ zh-CN: tagline_first_half: "分享您想分享的内容," tagline_second_half: "给您想分享给的人。" invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "找不到该邀请码" create: @@ -390,6 +393,7 @@ zh-CN: other: "%{actors} started sharing with you." zero: "%{actors} started sharing with you." notifier: + a_post_you_shared: "a post." click_here: "click here" comment_on_post: reply: "Reply or view %{name}'s post >" @@ -470,6 +474,7 @@ zh-CN: fail: "抱歉,找不到 %{handle}。" zero: "没有联络人" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "照片上传失败。你确定它是图片吗?" runtime_error: "照片上传失败。你确定有扣安全带吗?" @@ -497,9 +502,8 @@ zh-CN: edit: "编辑" edit_delete_photo: "编辑照片描述或删除照片" make_profile_photo: "选为个人头像" - original_post: "原式内容" + show_original_post: "Show original post" update_photo: "更新照片" - view: "查看" update: error: "照片更新失败。" notice: "照片更新成功。" @@ -574,6 +578,7 @@ zh-CN: new_request_to_person: sent: "发送成功!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "There was an error resharing this post." reshare: @@ -747,10 +752,12 @@ zh-CN: your_email: "您的电子邮箱" your_handle: "您的 diaspora 帐号" getting_started: + aspects: "aspects" connect_to: "Connect to" connect_to_your_other_social_networks: "Connect to your other social networks" connect_with_people: "Connect with cool people" - connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Featured tags" featured_users: "Featured users" fill_out_your_profile: "Fill out your profile" diff --git a/config/locales/diaspora/zh-TW.yml b/config/locales/diaspora/zh-TW.yml index 963c20872..391ebf9d1 100644 --- a/config/locales/diaspora/zh-TW.yml +++ b/config/locales/diaspora/zh-TW.yml @@ -37,6 +37,7 @@ zh-TW: person: invalid: "不合格." username: + invalid: "is invalid. We only allow letters, numbers, and underscores" taken: "已被使用." ago: "%{time}前" all_aspects: "所有面向" @@ -117,6 +118,7 @@ zh-TW: content: "你可以連結以下服務至 Diaspora:" heading: "連結服務" tags_following: "追蹤的標籤" + unfollow_tag: "Stop following #%{tag}" your_aspects: "你的面向" many: "%{count}個面向" move_contact: @@ -251,6 +253,7 @@ zh-TW: tagline_first_half: "分享你想分享的東西," tagline_second_half: "給你想分享的人." invitations: + a_facebook_user: "A Facebook user" check_token: not_found: "找不到該邀請信物" create: @@ -312,7 +315,7 @@ zh-TW: one: "有%{count}個人說讚" other: "有%{count}個人說讚" zero: "沒人說讚" - limited: "有限分享" + limited: "限制" more: "更多" next: "後面" no_results: "搜尋沒有結果" @@ -390,6 +393,7 @@ zh-TW: other: "%{actors}開始跟你分享了." zero: "%{actors}開始跟你分享了." notifier: + a_post_you_shared: "a post." click_here: "按這裡" comment_on_post: reply: "回或看 %{name} 的貼文 >" @@ -470,6 +474,7 @@ zh-TW: fail: "抱歉, 找不到 %{handle}." zero: "沒有聯絡人" photos: + comment_email_subject: "%{name}'s photo" create: integrity_error: "相片上傳失敗. 你確定它是圖片嗎?" runtime_error: "相片上傳失敗. 你確定有扣安全帶嗎?" @@ -497,9 +502,8 @@ zh-TW: edit: "編輯" edit_delete_photo: "編輯相片敘述或刪除相片" make_profile_photo: "選為個人照" - original_post: "原貼文" + show_original_post: "Show original post" update_photo: "更新相片" - view: "檢視" update: error: "相片編輯失敗." notice: "相片更新成功." @@ -574,6 +578,7 @@ zh-TW: new_request_to_person: sent: "已送出!" reshares: + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: failure: "轉貼這篇貼文時發生錯誤." reshare: @@ -747,10 +752,12 @@ zh-TW: your_email: "你的電子郵件" your_handle: "你的 diaspora 識別碼" getting_started: + aspects: "aspects" connect_to: "連結至" connect_to_your_other_social_networks: "與其他社交網站連結" connect_with_people: "與酷咖連結" - connect_with_people_explanation: "將別人放進你的任何一個或多個面向中, 來和他們連結. 面向是區分新人或熟人的直覺方法, 讓你可以輕易過濾他們, 或只和部份聯絡人分享." + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "特色標籤" featured_users: "特色使用者" fill_out_your_profile: "填寫個人檔案" diff --git a/config/locales/javascript/javascript.ar.yml b/config/locales/javascript/javascript.ar.yml index c40ff5561..03f90428c 100644 --- a/config/locales/javascript/javascript.ar.yml +++ b/config/locales/javascript/javascript.ar.yml @@ -23,10 +23,10 @@ ar: no_more: "لا توجد أية رسائل أخرى" publisher: at_least_one_aspect: "حدد فئة واحدة على الأقل" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "محدودة - مشاركتك ستكون متاحة لجهات إتصالك فقط" + public: "عام - مشاركتك ستكون متاحة للجميع ومفهرسة في محركات البحث" reshares: - duplicate: "You've already reshared that post!" + duplicate: "أعدت نشر هذه المشاركة مسبقا!" search_for: "إبحث عن {{name}}" show_more: "المزيد" timeago: diff --git a/config/locales/javascript/javascript.bg.yml b/config/locales/javascript/javascript.bg.yml index e7c31e05a..964f21fe1 100644 --- a/config/locales/javascript/javascript.bg.yml +++ b/config/locales/javascript/javascript.bg.yml @@ -23,8 +23,8 @@ bg: no_more: "Няма повече публикации." publisher: at_least_one_aspect: "Трябва да публикувате в поне един аспект" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "Ограничено - публикацията ще бъде видима само за хората, с които я споделите" + public: "Публично - публикацията ще бъде видима за всеки, а съдържанието ѝ ще бъде налично за търсещите машини" reshares: duplicate: "Вече сте споделили публикацията!" search_for: "Търсене за {{name}}" diff --git a/config/locales/javascript/javascript.de.yml b/config/locales/javascript/javascript.de.yml index fcdb33989..777ca18fd 100644 --- a/config/locales/javascript/javascript.de.yml +++ b/config/locales/javascript/javascript.de.yml @@ -23,8 +23,8 @@ de: no_more: "Keine weiteren Beiträge." publisher: at_least_one_aspect: "Du musst zumindest zu einem Aspekt posten" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "Eingeschränkt - dein Beitrag wird nur Leuten, mit denen du teilst, sichtbar sein" + public: "Öffentlich - dein Beitrag ist für alle sichtbar und kann von Suchmaschinen gefunden werden" reshares: duplicate: "Du hast diesen Beitrag bereits wiederholt!" search_for: "Nach {{name}} suchen" diff --git a/config/locales/javascript/javascript.es.yml b/config/locales/javascript/javascript.es.yml index 026d9b556..abcf91991 100644 --- a/config/locales/javascript/javascript.es.yml +++ b/config/locales/javascript/javascript.es.yml @@ -23,8 +23,8 @@ es: no_more: "No hay más publicaciones." publisher: at_least_one_aspect: "Debes publicarlo en al menos un aspecto" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "Limitado - tu publicación será visible solo para la gente con la que lo compartas" + public: "Público - tu publicación será visible para todos e indexado por buscadores" reshares: duplicate: "¡Ya has vuelto a compartir esa publicación!" search_for: "Buscar a {{name}}" diff --git a/config/locales/javascript/javascript.it.yml b/config/locales/javascript/javascript.it.yml index 7663b9f5b..10251f3c2 100644 --- a/config/locales/javascript/javascript.it.yml +++ b/config/locales/javascript/javascript.it.yml @@ -23,10 +23,10 @@ it: no_more: "Non ci sono altri post." publisher: at_least_one_aspect: "Devi condividere almeno con un aspetto" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "Non pubblico - il tuo post sarà visibile solamente a coloro con cui lo condividi" + public: "Pubblico - il tuo post sarà visibile a tutti inclusi i motori di ricerca" reshares: - duplicate: "You've already reshared that post!" + duplicate: "Hai già condiviso questo post!" search_for: "Ricerca per {{name}}" show_more: "mostra altro" timeago: diff --git a/config/locales/javascript/javascript.ko.yml b/config/locales/javascript/javascript.ko.yml index b635f126c..df2440d84 100644 --- a/config/locales/javascript/javascript.ko.yml +++ b/config/locales/javascript/javascript.ko.yml @@ -23,8 +23,8 @@ ko: no_more: "공유물이 더 없습니다." publisher: at_least_one_aspect: "공유하려면 적어도 한 애스펙을 골라야 합니다." - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "제한됨 - 내 공유물을 나와 공유하고 있는 사람들만 볼 수 있습니다" + public: "공개 - 내 공유물을 누구나 볼 수 있고 검색 엔진으로 찾을 수 있습니다" reshares: duplicate: "이미 재공유된 공유물입니다!" search_for: "{{name}} 검색" diff --git a/config/locales/javascript/javascript.zh-TW.yml b/config/locales/javascript/javascript.zh-TW.yml index 1b7445ae0..c2fcb81e8 100644 --- a/config/locales/javascript/javascript.zh-TW.yml +++ b/config/locales/javascript/javascript.zh-TW.yml @@ -23,8 +23,8 @@ zh-TW: no_more: "沒有貼文了." publisher: at_least_one_aspect: "發表時請至少選擇一個面向" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "限制 - 只有你想分享的人才看得到你的貼文" + public: "公開 - 所有人都能看到你的貼文, 包括搜尋引擎" reshares: duplicate: "你已經轉貼過該篇貼文了!" search_for: "搜尋 {{name}}" From 3594d3ba8b81e5901dfdae8287beb51eb2693fba Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 13:59:31 -0700 Subject: [PATCH 012/133] Fix error raising in message after_receive --- app/models/message.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/message.rb b/app/models/message.rb index 1f79ad6a4..fb46d91e4 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -1,3 +1,4 @@ +class NotVisibleError < RuntimeError; end class Message < ActiveRecord::Base include ROXML @@ -63,7 +64,7 @@ class Message < ActiveRecord::Base vis.save self else - raise NotVisibleException("Attempting to access a ConversationVisibility that does not exist!") + raise NotVisibleError.new("User #{user.id} with person #{user.person.id} is not allowed to see conversation #{conversation.id}!") end end From c67b2a5e93eb0167b269cd5a7802250b081384f9 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 11 Aug 2011 14:05:12 -0700 Subject: [PATCH 013/133] be back later page. this is not auto added, as you need your server to point to it --- public/be_back_soon.html | 160 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 public/be_back_soon.html diff --git a/public/be_back_soon.html b/public/be_back_soon.html new file mode 100644 index 000000000..17de38125 --- /dev/null +++ b/public/be_back_soon.html @@ -0,0 +1,160 @@ + + + + + +THE SYSTEM IS **DOWN** + + + + + + + + +
+ +
+

DIASPORA* is down right now, but we are probably doing something awesome.

+

We will be back shortly!

+ +

Be sure to check out some sites we love:

+ + +

Still need your DIASPORA* fix?

+ +
+
+ + + From 7900f291e413472fd5fb93c7cc76238ef38d86fd Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 14:25:44 -0700 Subject: [PATCH 014/133] Try to get rid of the googlebot error on posts/show --- app/controllers/posts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index c0bca6d06..0bf9408ce 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -27,8 +27,8 @@ class PostsController < ApplicationController end respond_to do |format| - format.all{ } format.xml{ render :xml => @post.to_diaspora_xml } + format.any{} end else From 55daaf2b6cf2060449c4d634bc1cf484ece02b93 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Thu, 11 Aug 2011 23:33:59 +0200 Subject: [PATCH 015/133] Make tag unfollow icon slightly larger and add a helpful tooltip to it --- app/views/tags/_followed_tags_listings.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/tags/_followed_tags_listings.haml b/app/views/tags/_followed_tags_listings.haml index cf3e6ce71..d288c1a3b 100644 --- a/app/views/tags/_followed_tags_listings.haml +++ b/app/views/tags/_followed_tags_listings.haml @@ -12,7 +12,7 @@ - for tg in current_user.followed_tags %li.unfollow{:id => tg.name} .unfollow_icon.hidden - = link_to image_tag("icons/monotone_close_exit_delete.png", :height => 12), tag_tag_followings_path(:name => tg.name, :remote => true), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :id => "unfollow_" + tg.name + = link_to image_tag("icons/monotone_close_exit_delete.png", :height => 16, :title => t('aspects.index.unfollow_tag', :tag => tg.name)), tag_tag_followings_path(:name => tg.name, :remote => true), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :id => "unfollow_" + tg.name =link_to "##{tg.name}", tag_path(:name => tg.name), :class => "tag_selector" - else %li From 08f12ee34863aa25382ec93113ecf2b926e37189 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 11 Aug 2011 14:40:29 -0700 Subject: [PATCH 016/133] fixed the 'a post' bug in notification emails --- app/helpers/notifier_helper.rb | 14 ++++++++++++++ app/views/notifier/also_commented.html.haml | 2 +- app/views/notifier/also_commented.text.haml | 2 +- app/views/notifier/comment_on_post.html.haml | 2 +- app/views/notifier/comment_on_post.text.haml | 2 +- spec/helpers/notifier_helper_spec.rb | 20 ++++++++++++++++++++ 6 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 spec/helpers/notifier_helper_spec.rb diff --git a/app/helpers/notifier_helper.rb b/app/helpers/notifier_helper.rb index 582e80115..3f841fdb5 100644 --- a/app/helpers/notifier_helper.rb +++ b/app/helpers/notifier_helper.rb @@ -1,4 +1,8 @@ module NotifierHelper + + # @param post [Post] The post object. + # @param opts [Hash] Optional hash. Accepts :length and :process_newlines parameters. + # @return [String] The truncated and formatted post. def post_message(post, opts={}) opts[:length] ||= 200 if post.respond_to? :formatted_message @@ -9,4 +13,14 @@ module NotifierHelper I18n.translate 'notifier.a_post_you_shared' end end + + # @param comment [Comment] The comment to process. + # @param opts [Hash] Optional hash. Accepts :length and :process_newlines parameters. + # @return [String] The truncated and formatted comment. + def comment_message(comment, opts={}) + opts[:length] ||= 600 + text = truncate(@comment.text, :length => opts[:length]) + text = process_newlines(text) if opts[:process_newlines] + text + end end diff --git a/app/views/notifier/also_commented.html.haml b/app/views/notifier/also_commented.html.haml index ee9cf451c..9b37b4d73 100644 --- a/app/views/notifier/also_commented.html.haml +++ b/app/views/notifier/also_commented.html.haml @@ -1,4 +1,4 @@ %p - = post_message(@comment, :process_newlines => true, :length => 600) + = comment_message(@comment.text, :process_newlines => true) %p = link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.first_name), post_url(@comment.post) diff --git a/app/views/notifier/also_commented.text.haml b/app/views/notifier/also_commented.text.haml index cbb52570a..7bc518d95 100644 --- a/app/views/notifier/also_commented.text.haml +++ b/app/views/notifier/also_commented.text.haml @@ -1 +1 @@ -!= truncate(@comment.text, :length => 600) +!= comment_message(@comment.text) diff --git a/app/views/notifier/comment_on_post.html.haml b/app/views/notifier/comment_on_post.html.haml index c5209611a..407aea032 100644 --- a/app/views/notifier/comment_on_post.html.haml +++ b/app/views/notifier/comment_on_post.html.haml @@ -1,4 +1,4 @@ %p - = post_message(@comment, :process_newlines => true, :length => 600) + = comment_message(@comment.text, :process_newlines => true) %p = link_to t('notifier.comment_on_post.reply', :name => @comment.post.author.name), post_url(@comment.post) diff --git a/app/views/notifier/comment_on_post.text.haml b/app/views/notifier/comment_on_post.text.haml index cbb52570a..7bc518d95 100644 --- a/app/views/notifier/comment_on_post.text.haml +++ b/app/views/notifier/comment_on_post.text.haml @@ -1 +1 @@ -!= truncate(@comment.text, :length => 600) +!= comment_message(@comment.text) diff --git a/spec/helpers/notifier_helper_spec.rb b/spec/helpers/notifier_helper_spec.rb new file mode 100644 index 000000000..d7ee368cb --- /dev/null +++ b/spec/helpers/notifier_helper_spec.rb @@ -0,0 +1,20 @@ +# Copyright (c) 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 NotifierHelper do + include MarkdownifyHelper + + describe '#comment_message' do + before do + @comment = Factory(:comment) + end + + it 'truncates the comment' do + opts = {:length => 2} + comment_message(@comment, opts).should == truncate(@comment.text, opts) + end + end +end From 78a637f25112a1b2a342481993d9754bceeeba82 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 14:42:30 -0700 Subject: [PATCH 017/133] Take out useless line in Reshare#receive --- app/models/reshare.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/models/reshare.rb b/app/models/reshare.rb index f82769a3c..d11d0a5d2 100644 --- a/app/models/reshare.rb +++ b/app/models/reshare.rb @@ -20,12 +20,9 @@ class Reshare < Post def receive(recipient, sender) local_reshare = Reshare.where(:guid => self.guid).first if local_reshare && local_reshare.root.author_id == recipient.person.id - local_reshare.root.reshares << local_reshare - if recipient.contact_for(sender) local_reshare.receive(recipient, sender) end - else super(recipient, sender) end From d9904ecd30ac245f99832710f7156a25f35713ce Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 14:50:43 -0700 Subject: [PATCH 018/133] InvitationsController update has an error, and our non-specific error catching is messing up knowing what our problems are --- app/controllers/invitations_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 412dd7fd1..3296a98a2 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -55,6 +55,7 @@ class InvitationsController < Devise::InvitationsController user.accept_invitation!(params[:user]) user.seed_aspects rescue Exception => e #What exception is this trying to rescue? If it is ActiveRecord::NotFound, we should say so. + raise e unless e.respond_to?(:record) user = nil record = e.record record.errors.delete(:person) From 0981f04c776e57b35a59d6f2ad713c29e855ea61 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 11 Aug 2011 15:19:16 -0700 Subject: [PATCH 019/133] smooth scroll like a smooth criminal --- public/javascripts/view.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/javascripts/view.js b/public/javascripts/view.js index ae61758f2..247a36d97 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -26,18 +26,24 @@ var View = { }); /*scroll to top */ + var back_to_top = jQuery('#back-to-top'); jQuery(window).scroll(function(){ if(jQuery(window).scrollTop() > 1000){ // show back to top - jQuery('#back-to-top').stop().animate({opacity: .5}); + back_to_top.stop().animate({opacity: .5}); } else{ // hide back to top - jQuery('#back-to-top').stop().animate({opacity: 0}); + back_to_top.stop().animate({opacity: 0}); } }); - /* Showing debug messages */ + back_to_top.click(function(event){ + event.preventDefault(); + $('html,body').animate({scrollTop:0}, 500); + }) + + /* Showing debug messages */ $(this.debug.selector) .click(this.debug.click); From c5726bb3793086ee0504777a3f3fc5680d1e8abb Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 15:49:54 -0700 Subject: [PATCH 020/133] Don't show a hide post button to non-logged in users --- app/views/posts/show.mobile.haml | 9 +++++---- app/views/shared/_stream_element.html.haml | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/posts/show.mobile.haml b/app/views/posts/show.mobile.haml index e5107893b..af3a960a1 100644 --- a/app/views/posts/show.mobile.haml +++ b/app/views/posts/show.mobile.haml @@ -21,10 +21,11 @@ = t('ago', :time => time_ago_in_words(@post.created_at)) %br - - if current_user.owns? @post - = link_to t('delete'), post_path(@post), :confirm => t('are_you_sure'), :method => :delete - - else - = link_to t('hide'), post_visibility_path(:id => "42", :post_id => @post.id), :confirm => t('are_you_sure'), :method => :put, :remote => true + - if user_signed_in? + - if current_user.owns? @post + = link_to t('delete'), post_path(@post), :confirm => t('are_you_sure'), :method => :delete + - else + = link_to t('hide'), post_visibility_path(:id => "42", :post_id => @post.id), :confirm => t('are_you_sure'), :method => :put, :remote => true .stream.show{:data=>{:guid=>@post.id}} = render "comments/comments", :post => @post, :comments => @post.comments, :comments_expanded => true diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index a33a26908..2fd74b23c 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -7,7 +7,6 @@ - if post.author.owner_id == current_user.id .right.controls = link_to image_tag('deletelabel.png'), post_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete stream_element_delete", :title => t('delete') - - else .right.controls = link_to image_tag('deletelabel.png'), post_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true, :class => "delete stream_element_delete", :title => t('hide') From 8296b8ca1ab64dfd2d59bb766f30e5bdbedb7c3b Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Fri, 12 Aug 2011 00:39:02 +0200 Subject: [PATCH 021/133] Tag unfollow and aspect edit icons are now made more opaque on mouseover --- public/stylesheets/sass/application.sass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index ffc8da7b1..a1769c291 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -2901,11 +2901,18 @@ ul.left_nav :weight 700 :color #666 - .contact_count, + .contact_count + :float right + .edit, .unfollow_icon + @include transition(opacity) + @include opacity(0.3) :float right + &:hover + @include opacity(1) + .unfollow_icon :margin-top 4px From 7f69714d08b9046a414328c771626b725180702a Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 16:25:58 -0700 Subject: [PATCH 022/133] Fix paul.elicker link, refactor people_helper --- app/helpers/people_helper.rb | 32 +++++++++++++++--------------- spec/helpers/people_helper_spec.rb | 25 ++++++++++++++++++++++- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 906bf5d88..f215f4575 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -27,18 +27,14 @@ module PeopleHelper I18n.l bday, :format => I18n.t('date.formats.birthday_with_year') end end - + def person_link(person, opts={}) opts[:class] ||= "" opts[:class] << " self" if defined?(user_signed_in?) && user_signed_in? && current_user.person == person remote_or_hovercard_link = "/people/#{person.id}".html_safe - if person.local? - "#{h(person.name)}".html_safe - else - "#{h(person.name)}".html_safe - end + "#{h(person.name)}".html_safe end - + def person_image_tag(person, size=nil) size ||= :thumb_small "\"#{h(person.name)}\"".html_safe @@ -49,16 +45,20 @@ module PeopleHelper if opts[:to] == :photos link_to person_image_tag(person, opts[:size]), person_photos_path(person) else - if person.local? - " - #{person_image_tag(person, opts[:size])} - ".html_safe - else - " - #{person_image_tag(person, opts[:size])} - ".html_safe - end + " + #{person_image_tag(person, opts[:size])} + ".html_safe end end + def person_href(person) + if person.local? + username = person.diaspora_handle.split('@')[0] + unless username.include?('.') + return "href='/u/#{person.diaspora_handle.split('@')[0]}'" + end + end + return "href='/people/#{person.id}'" + end + end diff --git a/spec/helpers/people_helper_spec.rb b/spec/helpers/people_helper_spec.rb index 320dcddc5..0fb8e166c 100644 --- a/spec/helpers/people_helper_spec.rb +++ b/spec/helpers/people_helper_spec.rb @@ -58,6 +58,29 @@ describe PeopleHelper do person_link(@person).should_not include("

") end end - + + describe '#person_href' do + before do + @user = Factory(:user) + end + it "links by id if there is a period in the user's username" do + @user.username = "invalid.username" + @user.save(:validate => false).should == true + person = @user.person + person.diaspora_handle = "#{@user.username}@#{AppConfig[:pod_uri].authority}" + person.save! + + person_href(@user.person).should include("href='/people/#{@user.person.id}'") + end + + it 'links by username for a local user' do + person_href(@user.person).should include(@user.username) + end + it 'links by id for a remote person' do + person = Factory(:person) + person_href(person).should include("/people/#{person.id}") + end + end + end From 9a77d3518f6e6439e02a1785075cadba9a051f69 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 16:39:39 -0700 Subject: [PATCH 023/133] Mobile authorizations index view --- app/views/authorizations/index.mobile.haml | 24 +++++++++++++++++++ .../authorizations_controller_spec.rb | 6 ++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 app/views/authorizations/index.mobile.haml diff --git a/app/views/authorizations/index.mobile.haml b/app/views/authorizations/index.mobile.haml new file mode 100644 index 000000000..2dfb9ce1e --- /dev/null +++ b/app/views/authorizations/index.mobile.haml @@ -0,0 +1,24 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +%h3 + = t('_applications') +#applications_stream.stream + - if @applications.count > 0 + - for app in @applications + .stream_element{:id => app.id} + .right + = link_to t('.revoke_access'), authorization_path(:id => app.id), :method => :delete, :confirm => 'are you sure?', :class => "button" + + - if app.icon_url + = image_tag(app.application_base_url + app.icon_url, :class => "avatar") + + .content + %div.from + = link_to app.name, app.application_base_url + = app.description + + - else + You haven't registered any applications yet. +%br diff --git a/spec/controllers/authorizations_controller_spec.rb b/spec/controllers/authorizations_controller_spec.rb index c193cde55..1458343aa 100644 --- a/spec/controllers/authorizations_controller_spec.rb +++ b/spec/controllers/authorizations_controller_spec.rb @@ -81,7 +81,7 @@ describe AuthorizationsController do post :token, @params_hash response.code.should == "200" end - + it 'renders something for localhost' do prepare_manifest("http://localhost:3423/") @controller.stub!(:verify).and_return('ok') @@ -133,6 +133,10 @@ describe AuthorizationsController do get :index response.should be_success end + it 'succeeds on a phone' do + get :index, :format => :mobile + response.should be_success + end it 'assigns the auth. & apps for the current user' do app1 = Factory.create(:app, :name => "Authorized App") From e2b16ab16f2a40662bea2c7827ef9cbf1d0a71a5 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 17:10:49 -0700 Subject: [PATCH 024/133] Correct my own spelling mistake --- app/views/notifications/index.html.haml | 2 +- app/views/people/_relationship_action.haml | 2 +- app/views/people/aspect_membership_dropdown.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index a09e5086d..88a098ab2 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -24,7 +24,7 @@ .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note[:target]) .right - = aspect_memberhip_dropdown(contact, note[:target], 'left') + = aspect_membership_dropdown(contact, note[:target], 'left') %span.from = notification_message_for(note) diff --git a/app/views/people/_relationship_action.haml b/app/views/people/_relationship_action.haml index 610e97fa9..98119128c 100644 --- a/app/views/people/_relationship_action.haml +++ b/app/views/people/_relationship_action.haml @@ -1,6 +1,6 @@ - unless person == current_user.person - contact = current_user.contacts.find_by_person_id(person.id) - contact ||= Contact.new(:person => person) - = aspect_memberhip_dropdown(contact, person, 'left') + = aspect_membership_dropdown(contact, person, 'left') -else = t('people.person.thats_you') diff --git a/app/views/people/aspect_membership_dropdown.haml b/app/views/people/aspect_membership_dropdown.haml index c344095d1..778ca85bf 100644 --- a/app/views/people/aspect_membership_dropdown.haml +++ b/app/views/people/aspect_membership_dropdown.haml @@ -1 +1 @@ -= aspect_memberhip_dropdown(@contact, @person, 'left') += aspect_membership_dropdown(@contact, @person, 'left') From 190332308be6a5d2fdff55fada47cffc3d3801b2 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 11 Aug 2011 17:15:05 -0700 Subject: [PATCH 025/133] started on the real stats page --- app/controllers/admins_controller.rb | 26 +++++++++- app/views/admins/stats.html.haml | 60 +++++++++++++++++++++++- public/stylesheets/sass/application.sass | 6 +++ 3 files changed, 89 insertions(+), 3 deletions(-) diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index f4c32ae68..4f27161d2 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -31,7 +31,29 @@ class AdminsController < ApplicationController def stats @popular_tags = ActsAsTaggableOn::Tagging.joins(:tag).limit(15).count(:group => :tag, :order => 'count(taggings.id) DESC') - @new_posts = Post.where(:type => ['StatusMessage','ActivityStreams::Photo'], - :public => true).order('created_at DESC').limit(15).all + + [Post, Comment, AspectMembership, User].each do |model| + create_hash(model) + end + + @posts[:new_public] = Post.where(:type => ['StatusMessage','ActivityStreams::Photo'], + :public => true).order('created_at DESC').limit(15).all + end + + private + def percent_change(today, yesterday) + sprintf( "%0.02f", ((today-yesterday) / yesterday.to_f)*100).to_f + end + + def create_hash(model) + plural = model.to_s.underscore.pluralize + eval(< #{model}.where(:created_at => ((Time.now.midnight - 1.day)..Time.now.midnight)).count, + :today => #{model}.where(:created_at => ((Time.now.midnight)..Time.now)).count + } + @#{plural}[:change] = percent_change(@#{plural}[:today], @#{plural}[:yesterday]) +DATA + ) end end diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index 565e7cfdf..25fe2748e 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -1,4 +1,62 @@ + .span-24.last + %br + %br + %h1 + Usage Statistics + %br + %br + %br + +%hr +.clearfix + +.span-24.last + + %h3 + New Today + + - [:posts, :comments, :aspect_memberships, :users].each do |name| + - model = eval("@#{name.to_s}") + - if name == :aspect_memberships + - name = :shares + + .span-6{:class => ('last' if name == :users)} + %h2{:style => 'font-weight:bold;'} + = model[:today] + = name.to_s + %h4 + = model[:yesterday] + + %span.percent_change{:class => (model[:change] > 0 ? "green" : "red")} + = "(#{model[:change]}%)" + + %br + %br + %br + %br + %br +%hr + + +%br +%br +%br +%br +%br +%br +%br +%br +%br +%br +%br + +.span-24.last + %h2 + Misc Stuff + %br + %br + %h3 = for tg in @popular_tags = link_to tg, tags_path(tg) @@ -10,7 +68,7 @@ %h3 New public posts .stream - = render 'shared/stream', :posts => @new_posts + = render 'shared/stream', :posts => @new_public_posts .span-12.last %h3 diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index a1769c291..1626b2486 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3388,3 +3388,9 @@ ul#getting_started :background-color #aaa &:hover :opacity .85 !important + +.red + :color $red + +.green + :color green From 2d9b9270cba20247c3baef95812d304f54ae38c7 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 11 Aug 2011 17:27:20 -0700 Subject: [PATCH 026/133] go off of yesterday's stats (full day comparison) --- app/controllers/admins_controller.rb | 3 ++- app/views/admins/stats.html.haml | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index 4f27161d2..542d2dcd7 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -49,10 +49,11 @@ class AdminsController < ApplicationController plural = model.to_s.underscore.pluralize eval(< #{model}.where(:created_at => ((Time.now.midnight - 2.days)..Time.now.midnight - 1.day)).count, :yesterday => #{model}.where(:created_at => ((Time.now.midnight - 1.day)..Time.now.midnight)).count, :today => #{model}.where(:created_at => ((Time.now.midnight)..Time.now)).count } - @#{plural}[:change] = percent_change(@#{plural}[:today], @#{plural}[:yesterday]) + @#{plural}[:change] = percent_change(@#{plural}[:yesterday], @#{plural}[:day_before]) DATA ) end diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index 25fe2748e..aa45cfe46 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -14,7 +14,7 @@ .span-24.last %h3 - New Today + Yesterday's results - [:posts, :comments, :aspect_memberships, :users].each do |name| - model = eval("@#{name.to_s}") @@ -23,11 +23,10 @@ .span-6{:class => ('last' if name == :users)} %h2{:style => 'font-weight:bold;'} - = model[:today] + = model[:yesterday] = name.to_s %h4 - = model[:yesterday] - + = model[:day_before] %span.percent_change{:class => (model[:change] > 0 ? "green" : "red")} = "(#{model[:change]}%)" From 5c6441f6db24e629e1ba57206959a196016ea14f Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 11 Aug 2011 17:58:57 -0700 Subject: [PATCH 027/133] add basic graph to stats view --- app/controllers/admins_controller.rb | 8 +++++-- app/views/admins/stats.html.haml | 31 +++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index 542d2dcd7..f65be9ea9 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -36,8 +36,12 @@ class AdminsController < ApplicationController create_hash(model) end - @posts[:new_public] = Post.where(:type => ['StatusMessage','ActivityStreams::Photo'], - :public => true).order('created_at DESC').limit(15).all + @posts_per_day = Post.count(:group => "DATE(created_at)", :conditions => ["created_at >= ?", Date.today - 21.days], :order => "DATE(created_at) ASC") + @most_posts_within = @posts_per_day.values.max.to_f + + #@posts[:new_public] = Post.where(:type => ['StatusMessage','ActivityStreams::Photo'], + # :public => true).order('created_at DESC').limit(15).all + end private diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index aa45cfe46..97c839db8 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -35,7 +35,24 @@ %br %br %br -%hr + %hr + + %br + %br + + %h3 + Posts over time + + #stats_graph{:style => "text-align:right;position:relative;vertical-align:bottom;background-color:#eee;"} + - @posts_per_day.each do |key, val| + .asdo{:style => "display:inline-block;width:35px;vertical-align:bottom;background-color:#666;height:#{(val/@most_posts_within)*200}px;"} + + + %br + %br + %br + %br + %br @@ -49,6 +66,14 @@ %br %br %br +%br +%br +%br +%br +%br +%br +%br +%br .span-24.last %h2 @@ -66,8 +91,8 @@ .span-12 %h3 New public posts - .stream - = render 'shared/stream', :posts => @new_public_posts + /.stream + / /= render 'shared/stream', :posts => @new_public_posts .span-12.last %h3 From 76b34ec75da73a3099a6472f7fe932411908d4c8 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 11 Aug 2011 18:01:39 -0700 Subject: [PATCH 028/133] remove 500 --- app/views/admins/stats.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index 97c839db8..20bf38b7e 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -44,8 +44,9 @@ Posts over time #stats_graph{:style => "text-align:right;position:relative;vertical-align:bottom;background-color:#eee;"} - - @posts_per_day.each do |key, val| - .asdo{:style => "display:inline-block;width:35px;vertical-align:bottom;background-color:#666;height:#{(val/@most_posts_within)*200}px;"} + = @posts_per_day.inspect + /- @posts_per_day.each do |key, val| + / .asdo{:style => "display:inline-block;width:35px;vertical-align:bottom;background-color:#666;height:#{(val/@most_posts_within)*200}px;"} %br From 56fc409a394a47f9be32d05f2fa3919454da65bb Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 18:15:18 -0700 Subject: [PATCH 029/133] Most of the way towards getting posts feature working --- app/views/aspects/create.js.erb | 2 +- app/views/shared/_aspect_dropdown_list_item.haml | 6 ------ features/posts.feature | 3 ++- features/step_definitions/custom_web_steps.rb | 9 +++++++++ 4 files changed, 12 insertions(+), 8 deletions(-) delete mode 100644 app/views/shared/_aspect_dropdown_list_item.haml diff --git a/app/views/aspects/create.js.erb b/app/views/aspects/create.js.erb index 7df0ce631..1b3b6d428 100644 --- a/app/views/aspects/create.js.erb +++ b/app/views/aspects/create.js.erb @@ -3,7 +3,7 @@ // the COPYRIGHT file. var dropdown = $("ul.dropdown_list[data-person_id=<%= @person.id %>]") -$('.newItem', dropdown).before("<%= escape_javascript( render('shared/aspect_dropdown_list_item', :aspect => @aspect, :person => @person, :contact => @contact)) %>"); +$('.newItem', dropdown).before("<%= escape_javascript( aspect_dropdown_list_item(@aspect, @contact.aspects.include?(@aspect))) %>"); ContactEdit.updateNumber(dropdown, "<%= @person.id %>", <%= @contact.aspects.size %>); $.facebox.close(); diff --git a/app/views/shared/_aspect_dropdown_list_item.haml b/app/views/shared/_aspect_dropdown_list_item.haml deleted file mode 100644 index d7508aa0c..000000000 --- a/app/views/shared/_aspect_dropdown_list_item.haml +++ /dev/null @@ -1,6 +0,0 @@ --# Copyright (c) 2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -= aspect_dropdown_list_item(aspect, contact, person) - diff --git a/features/posts.feature b/features/posts.feature index 95a6436eb..b95cea3cb 100644 --- a/features/posts.feature +++ b/features/posts.feature @@ -154,7 +154,8 @@ Feature: posting And I click "Mention" button And I expand the publisher in the modal window And I append "I am eating a yogurt" to the publisher - And I follow "DidntPostTo" within "#publisher" in the modal window + And I press the aspect dropdown in the modal window + And I toggle the aspect "DidntPostTo" in the modal window And I press "Share" in the modal window And I am on the aspects page And I follow "" within "#aspect_nav" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 08b99dd74..594ffc2f6 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -11,6 +11,15 @@ And /^I expand the publisher$/ do ') end +When /^I press the aspect dropdown$/ do + find('.dropdown .button').click +end + +And /^I toggle the aspect "([^"]*)"$/ do |aspect_name| + aspect = @me.aspects.where(:name => aspect_name).first + find("li[data-aspect_id='#{aspect.id}']").click +end + Then /^the publisher should be collapsed$/ do find("#publisher")["class"].should include("closed") end From 673397508f9e6cca7dee566209351ae1f3d813eb Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 11 Aug 2011 18:34:26 -0700 Subject: [PATCH 030/133] added segments to stats --- app/controllers/admins_controller.rb | 21 ++++++++++++++----- app/views/admins/stats.html.haml | 31 +++++++++++++++++++++------- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index f65be9ea9..b1226e344 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -32,8 +32,19 @@ class AdminsController < ApplicationController def stats @popular_tags = ActsAsTaggableOn::Tagging.joins(:tag).limit(15).count(:group => :tag, :order => 'count(taggings.id) DESC') + case params[:range] + when "week" + range = 1.week + when "2weeks" + range = 2.weeks + when "month" + range = 1.month + else + range = 1.day + end + [Post, Comment, AspectMembership, User].each do |model| - create_hash(model) + create_hash(model, :range => range) end @posts_per_day = Post.count(:group => "DATE(created_at)", :conditions => ["created_at >= ?", Date.today - 21.days], :order => "DATE(created_at) ASC") @@ -49,13 +60,13 @@ class AdminsController < ApplicationController sprintf( "%0.02f", ((today-yesterday) / yesterday.to_f)*100).to_f end - def create_hash(model) + def create_hash(model, opts={}) + opts[:range] ||= 1.day plural = model.to_s.underscore.pluralize eval(< #{model}.where(:created_at => ((Time.now.midnight - 2.days)..Time.now.midnight - 1.day)).count, - :yesterday => #{model}.where(:created_at => ((Time.now.midnight - 1.day)..Time.now.midnight)).count, - :today => #{model}.where(:created_at => ((Time.now.midnight)..Time.now)).count + :day_before => #{model}.where(:created_at => ((Time.now.midnight - #{opts[:range]*2})..Time.now.midnight - #{opts[:range]})).count, + :yesterday => #{model}.where(:created_at => ((Time.now.midnight - #{opts[:range]})..Time.now.midnight)).count } @#{plural}[:change] = percent_change(@#{plural}[:yesterday], @#{plural}[:day_before]) DATA diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index 20bf38b7e..f0884e8d1 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -13,8 +13,25 @@ .span-24.last + %div{:style => "float:right;"} + = form_tag('/admins/stats', :method => 'get') do + %select{:name => 'range'} + %option{:value => 'daily', :selected => ('selected' if params[:range] == 'daily')} + Daily + %option{:value => 'week', :selected => ('selected' if params[:range] == 'week')} + Week + %option{:value => '2weeks', :selected => ('selected' if params[:range] == '2weeks')} + 2 Weeks + %option{:value => 'month', :selected => ('selected' if params[:range] == 'month')} + Month + + = submit_tag 'go' + %h3 - Yesterday's results + Results from the + %b + = params[:range] + segment - [:posts, :comments, :aspect_memberships, :users].each do |name| - model = eval("@#{name.to_s}") @@ -40,13 +57,13 @@ %br %br - %h3 - Posts over time + /%h3 + / Posts over time - #stats_graph{:style => "text-align:right;position:relative;vertical-align:bottom;background-color:#eee;"} - = @posts_per_day.inspect - /- @posts_per_day.each do |key, val| - / .asdo{:style => "display:inline-block;width:35px;vertical-align:bottom;background-color:#666;height:#{(val/@most_posts_within)*200}px;"} + /#stats_graph{:style => "text-align:right;position:relative;vertical-align:bottom;background-color:#eee;"} + / = @posts_per_day.inspect + / /- @posts_per_day.each do |key, val| + / / .asdo{:style => "display:inline-block;width:35px;vertical-align:bottom;background-color:#666;height:#{(val/@most_posts_within)*200}px;"} %br From 7df883eaf046f190c49e9545f935570983fd9a60 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 11 Aug 2011 18:52:31 -0700 Subject: [PATCH 031/133] added summary text per user on stats --- app/controllers/admins_controller.rb | 6 ++++ app/views/admins/stats.html.haml | 51 +++++++++++++++------------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index b1226e344..07459baac 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -35,12 +35,16 @@ class AdminsController < ApplicationController case params[:range] when "week" range = 1.week + @segment = "week" when "2weeks" range = 2.weeks + @segment = "2 week" when "month" range = 1.month + @segment = "month" else range = 1.day + @segment = "daily" end [Post, Comment, AspectMembership, User].each do |model| @@ -50,6 +54,8 @@ class AdminsController < ApplicationController @posts_per_day = Post.count(:group => "DATE(created_at)", :conditions => ["created_at >= ?", Date.today - 21.days], :order => "DATE(created_at) ASC") @most_posts_within = @posts_per_day.values.max.to_f + @user_count = User.count + #@posts[:new_public] = Post.where(:type => ['StatusMessage','ActivityStreams::Photo'], # :public => true).order('created_at DESC').limit(15).all diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index f0884e8d1..d90d9db77 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -4,6 +4,26 @@ %br %h1 Usage Statistics + %div{:style => "float:right;"} + = form_tag('/admins/stats', :method => 'get') do + %select{:name => 'range'} + %option{:value => 'daily', :selected => ('selected' if params[:range] == 'daily')} + Daily + %option{:value => 'week', :selected => ('selected' if params[:range] == 'week')} + Week + %option{:value => '2weeks', :selected => ('selected' if params[:range] == '2weeks')} + 2 Weeks + %option{:value => 'month', :selected => ('selected' if params[:range] == 'month')} + Month + + = submit_tag 'go' + %br + %h3 + Displaying results from the + %b + = @segment + segment + %br %br %br @@ -12,27 +32,6 @@ .clearfix .span-24.last - - %div{:style => "float:right;"} - = form_tag('/admins/stats', :method => 'get') do - %select{:name => 'range'} - %option{:value => 'daily', :selected => ('selected' if params[:range] == 'daily')} - Daily - %option{:value => 'week', :selected => ('selected' if params[:range] == 'week')} - Week - %option{:value => '2weeks', :selected => ('selected' if params[:range] == '2weeks')} - 2 Weeks - %option{:value => 'month', :selected => ('selected' if params[:range] == 'month')} - Month - - = submit_tag 'go' - - %h3 - Results from the - %b - = params[:range] - segment - - [:posts, :comments, :aspect_memberships, :users].each do |name| - model = eval("@#{name.to_s}") - if name == :aspect_memberships @@ -54,8 +53,14 @@ %br %hr - %br - %br + + %p{:style => "text-align:center;"} + The current segment is averaging + %b + #{@posts[:yesterday]/@user_count.to_f} + posts per user, from + %b + #{@posts[:day_before]/@user_count.to_f} /%h3 / Posts over time From 3c34749dd775e63fda9d6b7e8b564a4a5011a18e Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 12 Aug 2011 10:13:29 -0700 Subject: [PATCH 032/133] Put a select limit on the person query on contactsController index, since we know exactly what we're doing with the data --- app/controllers/contacts_controller.rb | 5 ++--- app/models/person.rb | 3 ++- spec/models/person_spec.rb | 21 ++++++++++++++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 6ec8d65db..c1c321b54 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -24,12 +24,11 @@ class ContactsController < ApplicationController format.html { @contacts = sort_and_paginate_profiles(@contacts) } format.mobile { @contacts = sort_and_paginate_profiles(@contacts) } format.json { - @people = Person.joins(:contacts => :aspect_memberships). - select('DISTINCT people.*'). + @people = Person.for_json.joins(:contacts => :aspect_memberships). where(:contacts => { :user_id => current_user.id }, :aspect_memberships => { :aspect_id => params[:aspect_ids] }) - render :json => @people.includes(:profile).to_json + render :json => @people.to_json } end end diff --git a/app/models/person.rb b/app/models/person.rb index d2674bbfc..84f9b41e0 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -45,6 +45,7 @@ class Person < ActiveRecord::Base scope :searchable, joins(:profile).where(:profiles => {:searchable => true}) scope :remote, where('people.owner_id IS NULL') scope :local, where('people.owner_id IS NOT NULL') + scope :for_json, select('DISTINCT people.id, people.diaspora_handle').includes(:profile) def self.featured_users AppConfig[:featured_users].present? ? Person.where(:diaspora_handle => AppConfig[:featured_users]) : [] @@ -63,7 +64,7 @@ class Person < ActiveRecord::Base p end - + def self.search_query_string(query) query = query.downcase diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 13d9477d9..63a8861b3 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -12,6 +12,25 @@ describe Person do end context 'scopes' do + describe '.for_json' do + it 'does not select public keys' do + proc { + Person.for_json.first.serialized_public_key + }.should raise_error ActiveModel::MissingAttributeError + end + it 'eager loads profiles' do + Person.for_json.first.loaded_profile?.should be_true + end + it 'selects distinct people' do + aspect = bob.aspects.create(:name => 'hilarious people') + aspect.contacts << bob.contact_for(eve.person) + person_ids = Person.for_json.joins(:contacts => :aspect_memberships). + where(:contacts => {:user_id => bob.id}, + :aspect_memberships => {:aspect_id => bob.aspect_ids}).map{|p| p.id} + + person_ids.uniq.should == person_ids + end + end describe '.local' do it 'returns only local people' do Person.local =~ [@person] @@ -28,7 +47,7 @@ describe Person do it 'searchs for a person if id is passed' do Person.find_from_id_or_username(:id => @person.id).id.should == @person.id end - + it 'searchs a person from a user if username is passed' do Person.find_from_id_or_username(:username => @user.username).id.should == @user.person.id end From cd640e1ac6d5f8717e6c34d90656c742ee7162e7 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 12 Aug 2011 10:37:24 -0700 Subject: [PATCH 033/133] Pending spec for statusnet linkback plugin --- spec/controllers/posts_controller_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/controllers/posts_controller_spec.rb b/spec/controllers/posts_controller_spec.rb index 2efaad4f9..f6231596e 100644 --- a/spec/controllers/posts_controller_spec.rb +++ b/spec/controllers/posts_controller_spec.rb @@ -30,6 +30,7 @@ describe PostsController do response.should be_success end + it 'succeeds on mobile with a reshare' do get :show, "id" => Factory(:reshare, :author => alice.person).id, :format => :mobile response.should be_success @@ -60,6 +61,14 @@ describe PostsController do response.status.should == 200 end + it 'succeeds for statusnet' do + pending "StatusNet send a weird ACCEPT header" + status = alice.post(:status_message, :text => "hello", :public => true, :to => 'all') + @request.env["HTTP_ACCEPT"] = "application/html+xml,text/html" + get :show, :id => status.id + response.should be_success + end + it 'shows a public photo' do pending status = Factory(:status_message_with_photo, :public => true, :author => alice.person) From 7e901d0220f92f288b3ced80c3c4771a71636ac4 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 12 Aug 2011 11:12:11 -0700 Subject: [PATCH 034/133] remove shapado --- app/views/layouts/application.html.haml | 2 -- config/locales/diaspora/en.yml | 1 - 2 files changed, 3 deletions(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 12ed3985a..d1522e709 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -107,8 +107,6 @@ %li= link_to t('.whats_new'), 'https://github.com/diaspora/diaspora/wiki/Changelog' %li= link_to(t('layouts.application.toggle'), toggle_mobile_path) if is_mobile_device? = image_tag 'powered_by_diaspora.png', :height => "11px", :width => "145px" - %br - = link_to t('.have_a_problem'), 'http://diaspora.shapado.com/' -if !@landing_page && request.url.match(/joindiaspora.com/) :javascript diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index d934e2d93..3058565ae 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -321,7 +321,6 @@ en: application: powered_by: "POWERED BY DIASPORA*" whats_new: "what's new?" - have_a_problem: "Have a problem? Find an answer here" toggle: "toggle mobile site" public_feed: "Public Diaspora Feed for %{name}" your_aspects: "your aspects" From 1062cc5bf6fb5a45287c300cb0ded2d36df37eed Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Fri, 12 Aug 2011 22:04:53 +0200 Subject: [PATCH 035/133] Fix contact count displayed on the right for good. Also use only one randomization when selecting the random contacts to display. --- app/controllers/aspects_controller.rb | 4 ++-- app/views/aspects/index.js.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 6a770c72f..6d0dd55fb 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -32,7 +32,7 @@ class AspectsController < ApplicationController all_selected_people = Person.joins(:contacts => :aspect_memberships). where(:contacts => {:user_id => current_user.id}, :aspect_memberships => {:aspect_id => aspect_ids}) - @selected_people = all_selected_people.select("DISTINCT people.*").order('RAND()').limit(20).includes(:profile) + @selected_people = all_selected_people.select("DISTINCT people.*").includes(:profile) end @aspect_ids = @aspects.map { |a| a.id } @@ -45,7 +45,7 @@ class AspectsController < ApplicationController if params[:only_posts] render :partial => 'shared/stream', :locals => {:posts => @posts} else - @contact_count = all_selected_people.count + @contact_count = @selected_people.count @aspect = :all unless params[:a_ids] @aspect ||= @aspects.first # used in mobile diff --git a/app/views/aspects/index.js.erb b/app/views/aspects/index.js.erb index c001b58f0..acf2b8961 100644 --- a/app/views/aspects/index.js.erb +++ b/app/views/aspects/index.js.erb @@ -1,3 +1,3 @@ $('#aspect_stream_container').html("<%= escape_javascript(render('aspects/aspect_stream', :aspect => @aspect, :aspect_ids => @aspect_ids, :posts => @posts)) %>"); -$('#selected_aspect_contacts').html("<%= escape_javascript(render('aspects/selected_contacts', :people => @selected_people[0..19], :count => @contact_count )) %>"); +$('#selected_aspect_contacts').html("<%= escape_javascript(render('aspects/selected_contacts', :people => @selected_people.sample(20), :count => @contact_count )) %>"); $('#aspect_stream_container a[rel*=facebox]').facebox(); From 2f3e5048110bd766370a8973c98a6f59320be531 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Fri, 12 Aug 2011 22:15:03 +0200 Subject: [PATCH 036/133] Add tooltip to aspect edit icon in aspect listings --- app/views/aspects/_aspect_listings.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/aspects/_aspect_listings.haml b/app/views/aspects/_aspect_listings.haml index 82a7237cf..e290258f6 100644 --- a/app/views/aspects/_aspect_listings.haml +++ b/app/views/aspects/_aspect_listings.haml @@ -13,7 +13,7 @@ - for aspect in all_aspects %li{:data => {:aspect_id => aspect.id}, :class => ("active" if params["a_id"].to_i == aspect.id)} .edit - = link_to image_tag("icons/pencil.svg", :height => 12), edit_aspect_path(aspect), :rel => "facebox" + = link_to image_tag("icons/pencil.svg", :height => 12, :title => t('contacts.index.edit_aspect', :name => aspect.name)), edit_aspect_path(aspect), :rel => "facebox" %a.aspect_selector{aspect_listing_link_opts(aspect)} .contact_count From 31b55aef0bfaac24dbf2daba7ab7fe8e3f22769d Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 12 Aug 2011 11:51:06 -0700 Subject: [PATCH 037/133] Start saving the usernames of facebook users --- app/models/services/facebook.rb | 4 ++-- .../20110812175614_add_username_to_service_users.rb | 9 +++++++++ db/schema.rb | 11 ++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 db/migrate/20110812175614_add_username_to_service_users.rb diff --git a/app/models/services/facebook.rb b/app/models/services/facebook.rb index 645d0dc3e..b77e68809 100644 --- a/app/models/services/facebook.rb +++ b/app/models/services/facebook.rb @@ -38,11 +38,11 @@ class Services::Facebook < Service data = JSON.parse(response.body)['data'] return unless data data.map!{ |p| - su = ServiceUser.new(:service_id => self.id, :uid => p["id"], :photo_url => p["picture"], :name => p["name"]) + su = ServiceUser.new(:service_id => self.id, :uid => p["id"], :photo_url => p["picture"], :name => p["name"], :username => p["username"]) su.attach_local_models su } - ServiceUser.import(data, :on_duplicate_key_update => [:updated_at, :contact_id, :person_id, :request_id, :invitation_id, :photo_url, :name]) + ServiceUser.import(data, :on_duplicate_key_update => [:updated_at, :contact_id, :person_id, :request_id, :invitation_id, :photo_url, :name, :username]) end private diff --git a/db/migrate/20110812175614_add_username_to_service_users.rb b/db/migrate/20110812175614_add_username_to_service_users.rb new file mode 100644 index 000000000..c2a9fc715 --- /dev/null +++ b/db/migrate/20110812175614_add_username_to_service_users.rb @@ -0,0 +1,9 @@ +class AddUsernameToServiceUsers < ActiveRecord::Migration + def self.up + add_column :service_users, :username, :string, :limit => 127 + end + + def self.down + remove_column :service_users, :username + end +end diff --git a/db/schema.rb b/db/schema.rb index b44897fee..a4ab4ab6e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110730173443) do +ActiveRecord::Schema.define(:version => 20110812175614) do create_table "aspect_memberships", :force => true do |t| t.integer "aspect_id", :null => false @@ -319,16 +319,17 @@ ActiveRecord::Schema.define(:version => 20110730173443) do add_index "profiles", ["person_id"], :name => "index_profiles_on_person_id" create_table "service_users", :force => true do |t| - t.string "uid", :null => false - t.string "name", :null => false - t.string "photo_url", :null => false - t.integer "service_id", :null => false + t.string "uid", :null => false + t.string "name", :null => false + t.string "photo_url", :null => false + t.integer "service_id", :null => false t.integer "person_id" t.integer "contact_id" t.integer "request_id" t.integer "invitation_id" t.datetime "created_at" t.datetime "updated_at" + t.string "username", :limit => 127 end add_index "service_users", ["service_id"], :name => "index_service_users_on_service_id" From 8b743e7e3b06ed3545a67c0afeacb66e9b9d8808 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 12 Aug 2011 13:11:23 -0700 Subject: [PATCH 038/133] Fix stack level too deep error on reshares --- app/models/post.rb | 2 +- app/models/reshare.rb | 7 ++----- lib/diaspora/user/querying.rb | 6 ++++++ spec/models/reshare_spec.rb | 12 +++++++++++- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index b6d8b08cb..8447a730b 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -86,7 +86,7 @@ class Post < ActiveRecord::Base local_post = Post.where(:guid => self.guid).first if local_post && local_post.author_id == self.author_id - known_post = user.visible_posts.where(:guid => self.guid).first + known_post = user.find_visible_post_by_id(self.guid, :key => :guid) if known_post if known_post.mutable? known_post.update_attributes(self.attributes) diff --git a/app/models/reshare.rb b/app/models/reshare.rb index d11d0a5d2..2b89ccd9f 100644 --- a/app/models/reshare.rb +++ b/app/models/reshare.rb @@ -20,12 +20,9 @@ class Reshare < Post def receive(recipient, sender) local_reshare = Reshare.where(:guid => self.guid).first if local_reshare && local_reshare.root.author_id == recipient.person.id - if recipient.contact_for(sender) - local_reshare.receive(recipient, sender) - end - else - super(recipient, sender) + return unless recipient.has_contact_for?(sender) end + super(recipient, sender) end def comment_email_subject diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index 7e0f6ef45..c34c0a37b 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -66,6 +66,12 @@ module Diaspora Contact.where(:user_id => self.id, :person_id => person_id).includes(:person => :profile).first end + # @param [Person] person + # @return [Boolean] whether person is a contact of this user + def has_contact_for?(person) + Contact.exists?(:user_id => self.id, :person_id => person.id) + end + def people_in_aspects(requested_aspects, opts={}) allowed_aspects = self.aspects & requested_aspects person_ids = contacts_in_aspects(allowed_aspects).collect{|contact| contact.person_id} diff --git a/spec/models/reshare_spec.rb b/spec/models/reshare_spec.rb index b9c075ddd..91319f460 100644 --- a/spec/models/reshare_spec.rb +++ b/spec/models/reshare_spec.rb @@ -26,19 +26,29 @@ describe Reshare do end describe "#receive" do + let(:receive) {@reshare.receive(@root.author.owner, @reshare.author)} before do @reshare = Factory.create(:reshare, :root => Factory(:status_message, :author => bob.person, :public => true)) @root = @reshare.root - @reshare.receive(@root.author.owner, @reshare.author) end it 'increments the reshare count' do + receive @root.resharers.count.should == 1 end it 'adds the resharer to the re-sharers of the post' do + receive @root.resharers.should include(@reshare.author) end + it 'does not error if the root author has a contact for the resharer' do + bob.share_with @reshare.author, bob.aspects.first + proc { + Timeout.timeout(5) do + receive #This doesn't ever terminate on my machine before it was fixed. + end + }.should_not raise_error + end end describe "XML" do From abd576056956be15a8f53bdc04e9178096117af1 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 12 Aug 2011 13:32:14 -0700 Subject: [PATCH 039/133] Write, don't append backup --- lib/tasks/backup.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake index 15598df8d..4f8a3ce4a 100644 --- a/lib/tasks/backup.rake +++ b/lib/tasks/backup.rake @@ -24,7 +24,7 @@ namespace :backup do puts "Dumping Mysql at #{Time.now.to_s}" `mkdir -p /tmp/backup/mysql` - `nice mysqldump --single-transaction --user=#{user} --password=#{password} #{database} >> /tmp/backup/mysql/backup.txt ` + `nice mysqldump --single-transaction --user=#{user} --password=#{password} #{database} > /tmp/backup/mysql/backup.txt ` puts "Gzipping dump at #{Time.now.to_s}" tar_name = "mysql_#{Time.now.to_i}.tar" From 3831c13a4a22cb48e1f34abfe5f9e2bb6f7de3f8 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 12 Aug 2011 15:56:01 -0700 Subject: [PATCH 040/133] Move the app/models/jobs folder to match the name of the module --- app/models/{jobs => job}/base.rb | 0 app/models/{jobs => job}/delete_account.rb | 0 app/models/{jobs => job}/http_multi.rb | 0 app/models/{jobs => job}/http_post.rb | 0 app/models/{jobs => job}/invite_user_by_email.rb | 0 app/models/{jobs => job}/mail/also_commented.rb | 0 app/models/{jobs => job}/mail/comment_on_post.rb | 0 app/models/{jobs => job}/mail/confirm_email.rb | 0 app/models/{jobs => job}/mail/liked.rb | 0 app/models/{jobs => job}/mail/mentioned.rb | 0 app/models/{jobs => job}/mail/private_message.rb | 0 app/models/{jobs => job}/mail/started_sharing.rb | 0 app/models/{jobs => job}/notify_local_users.rb | 0 app/models/{jobs => job}/post_to_service.rb | 0 app/models/{jobs => job}/process_photo.rb | 0 app/models/{jobs => job}/publish_to_hub.rb | 0 app/models/{jobs => job}/receive.rb | 0 app/models/{jobs => job}/receive_local_batch.rb | 0 app/models/{jobs => job}/receive_salmon.rb | 0 app/models/{jobs => job}/resend_invitation.rb | 0 app/models/{jobs => job}/socket_webfinger.rb | 0 app/models/{jobs => job}/update_service_users.rb | 0 config/initializers/resque.rb | 3 --- 23 files changed, 3 deletions(-) rename app/models/{jobs => job}/base.rb (100%) rename app/models/{jobs => job}/delete_account.rb (100%) rename app/models/{jobs => job}/http_multi.rb (100%) rename app/models/{jobs => job}/http_post.rb (100%) rename app/models/{jobs => job}/invite_user_by_email.rb (100%) rename app/models/{jobs => job}/mail/also_commented.rb (100%) rename app/models/{jobs => job}/mail/comment_on_post.rb (100%) rename app/models/{jobs => job}/mail/confirm_email.rb (100%) rename app/models/{jobs => job}/mail/liked.rb (100%) rename app/models/{jobs => job}/mail/mentioned.rb (100%) rename app/models/{jobs => job}/mail/private_message.rb (100%) rename app/models/{jobs => job}/mail/started_sharing.rb (100%) rename app/models/{jobs => job}/notify_local_users.rb (100%) rename app/models/{jobs => job}/post_to_service.rb (100%) rename app/models/{jobs => job}/process_photo.rb (100%) rename app/models/{jobs => job}/publish_to_hub.rb (100%) rename app/models/{jobs => job}/receive.rb (100%) rename app/models/{jobs => job}/receive_local_batch.rb (100%) rename app/models/{jobs => job}/receive_salmon.rb (100%) rename app/models/{jobs => job}/resend_invitation.rb (100%) rename app/models/{jobs => job}/socket_webfinger.rb (100%) rename app/models/{jobs => job}/update_service_users.rb (100%) diff --git a/app/models/jobs/base.rb b/app/models/job/base.rb similarity index 100% rename from app/models/jobs/base.rb rename to app/models/job/base.rb diff --git a/app/models/jobs/delete_account.rb b/app/models/job/delete_account.rb similarity index 100% rename from app/models/jobs/delete_account.rb rename to app/models/job/delete_account.rb diff --git a/app/models/jobs/http_multi.rb b/app/models/job/http_multi.rb similarity index 100% rename from app/models/jobs/http_multi.rb rename to app/models/job/http_multi.rb diff --git a/app/models/jobs/http_post.rb b/app/models/job/http_post.rb similarity index 100% rename from app/models/jobs/http_post.rb rename to app/models/job/http_post.rb diff --git a/app/models/jobs/invite_user_by_email.rb b/app/models/job/invite_user_by_email.rb similarity index 100% rename from app/models/jobs/invite_user_by_email.rb rename to app/models/job/invite_user_by_email.rb diff --git a/app/models/jobs/mail/also_commented.rb b/app/models/job/mail/also_commented.rb similarity index 100% rename from app/models/jobs/mail/also_commented.rb rename to app/models/job/mail/also_commented.rb diff --git a/app/models/jobs/mail/comment_on_post.rb b/app/models/job/mail/comment_on_post.rb similarity index 100% rename from app/models/jobs/mail/comment_on_post.rb rename to app/models/job/mail/comment_on_post.rb diff --git a/app/models/jobs/mail/confirm_email.rb b/app/models/job/mail/confirm_email.rb similarity index 100% rename from app/models/jobs/mail/confirm_email.rb rename to app/models/job/mail/confirm_email.rb diff --git a/app/models/jobs/mail/liked.rb b/app/models/job/mail/liked.rb similarity index 100% rename from app/models/jobs/mail/liked.rb rename to app/models/job/mail/liked.rb diff --git a/app/models/jobs/mail/mentioned.rb b/app/models/job/mail/mentioned.rb similarity index 100% rename from app/models/jobs/mail/mentioned.rb rename to app/models/job/mail/mentioned.rb diff --git a/app/models/jobs/mail/private_message.rb b/app/models/job/mail/private_message.rb similarity index 100% rename from app/models/jobs/mail/private_message.rb rename to app/models/job/mail/private_message.rb diff --git a/app/models/jobs/mail/started_sharing.rb b/app/models/job/mail/started_sharing.rb similarity index 100% rename from app/models/jobs/mail/started_sharing.rb rename to app/models/job/mail/started_sharing.rb diff --git a/app/models/jobs/notify_local_users.rb b/app/models/job/notify_local_users.rb similarity index 100% rename from app/models/jobs/notify_local_users.rb rename to app/models/job/notify_local_users.rb diff --git a/app/models/jobs/post_to_service.rb b/app/models/job/post_to_service.rb similarity index 100% rename from app/models/jobs/post_to_service.rb rename to app/models/job/post_to_service.rb diff --git a/app/models/jobs/process_photo.rb b/app/models/job/process_photo.rb similarity index 100% rename from app/models/jobs/process_photo.rb rename to app/models/job/process_photo.rb diff --git a/app/models/jobs/publish_to_hub.rb b/app/models/job/publish_to_hub.rb similarity index 100% rename from app/models/jobs/publish_to_hub.rb rename to app/models/job/publish_to_hub.rb diff --git a/app/models/jobs/receive.rb b/app/models/job/receive.rb similarity index 100% rename from app/models/jobs/receive.rb rename to app/models/job/receive.rb diff --git a/app/models/jobs/receive_local_batch.rb b/app/models/job/receive_local_batch.rb similarity index 100% rename from app/models/jobs/receive_local_batch.rb rename to app/models/job/receive_local_batch.rb diff --git a/app/models/jobs/receive_salmon.rb b/app/models/job/receive_salmon.rb similarity index 100% rename from app/models/jobs/receive_salmon.rb rename to app/models/job/receive_salmon.rb diff --git a/app/models/jobs/resend_invitation.rb b/app/models/job/resend_invitation.rb similarity index 100% rename from app/models/jobs/resend_invitation.rb rename to app/models/job/resend_invitation.rb diff --git a/app/models/jobs/socket_webfinger.rb b/app/models/job/socket_webfinger.rb similarity index 100% rename from app/models/jobs/socket_webfinger.rb rename to app/models/job/socket_webfinger.rb diff --git a/app/models/jobs/update_service_users.rb b/app/models/job/update_service_users.rb similarity index 100% rename from app/models/jobs/update_service_users.rb rename to app/models/job/update_service_users.rb diff --git a/config/initializers/resque.rb b/config/initializers/resque.rb index ad4925ae1..f97cc4e26 100644 --- a/config/initializers/resque.rb +++ b/config/initializers/resque.rb @@ -1,6 +1,3 @@ -require File.join(Rails.root, 'app', 'models', 'jobs', 'base') -Dir[File.join(Rails.root, 'app', 'models', 'jobs', '*.rb')].each { |file| require file } - require 'resque' begin From 38a89629457d7665c34c028d441265c297ccb51c Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 12 Aug 2011 15:58:42 -0700 Subject: [PATCH 041/133] Fix 500 on photo destroy --- app/controllers/photos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 14782c51a..7a1406ea9 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -128,7 +128,7 @@ class PhotosController < ApplicationController format.html do flash[:notice] = I18n.t 'photos.destroy.notice' if photo.status_message_guid - respond_with photo, :location => photo.status_message + respond_with photo, :location => post_path(photo.status_message) else respond_with photo, :location => person_photos_path(current_user.person) end From 7b85dcec9c9a47d30f890fd1a6263066c18aa9c6 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 12 Aug 2011 15:05:58 -0700 Subject: [PATCH 042/133] dg rs; seed bob with facebook friends & fixed invitation view --- app/views/shared/_invitations.haml | 17 +++++++---------- app/views/shared/_right_sections.html.haml | 2 +- db/seeds.rb | 10 ++++------ spec/factories.rb | 7 +++++++ 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app/views/shared/_invitations.haml b/app/views/shared/_invitations.haml index d3a726009..12c99f8ca 100644 --- a/app/views/shared/_invitations.haml +++ b/app/views/shared/_invitations.haml @@ -1,10 +1,7 @@ --if AppConfig[:open_invitations] - - if AppConfig.configured_services.include?('facebook') - - if defined? remote - = link_to t('.from_facebook'), friend_finder_path('facebook', :remote => remote), :rel => 'facebox' - -else - = link_to t('.from_facebook'), friend_finder_path('facebook'), :rel => 'facebox' - %br - = link_to t('.by_email'), new_user_invitation_path, :title => t('.invite_someone'), :rel => 'facebox' -- else - = t('.dont_have_now') +- if AppConfig.configured_services.include?('facebook') + - if defined? remote + = link_to t('.from_facebook'), friend_finder_path('facebook', :remote => remote), :rel => 'facebox' + -else + = link_to t('.from_facebook'), friend_finder_path('facebook'), :rel => 'facebox' + %br += link_to t('.by_email'), new_user_invitation_path, :title => t('.invite_someone'), :rel => 'facebox' diff --git a/app/views/shared/_right_sections.html.haml b/app/views/shared/_right_sections.html.haml index 00c4afafa..90923488d 100644 --- a/app/views/shared/_right_sections.html.haml +++ b/app/views/shared/_right_sections.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -- unless AppConfig[:invites_off] +- if AppConfig[:open_invitations] .section .title = image_tag('/images/icons/plus.png') diff --git a/db/seeds.rb b/db/seeds.rb index eb165a208..53e29fd9a 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -39,12 +39,10 @@ connect_users(bob, bob.aspects.first, alice, alice.aspects.first) connect_users(bob, bob.aspects.first, eve, eve.aspects.first) puts "done!" -# Uncomment these and return out of Service::Facebook#save_friends -#service = Service.new(:user_id => bob.id) -#service.type = "Services::Facebook" -#service.access_token = "abc123" -#service.save! -#su = ServiceUser.create!(:service_id => service.id, :photo_url => "/images/user/angela.jpg", :uid => "abc123", :name => "Angelica") +print "Adding Facebook contacts... " +facebook = Factory(:service, :type => 'Services::Facebook', :user_id => bob.id) +ServiceUser.import((1..10).map{|n| Factory.build(:service_user, :service => facebook) }) +puts "done!" require 'spec/support/fake_resque' require 'spec/support/fake_redis' diff --git a/spec/factories.rb b/spec/factories.rb index 4e8b4281d..e5bca7665 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -105,6 +105,13 @@ Factory.define :service do |service| service.sequence(:access_secret) { |token| "98765#{token}" } end +Factory.define :service_user do |s_user| + s_user.sequence(:uid) { |id| "a#{id}"} + s_user.sequence(:name) { |num| "Rob Fergus the #{num.ordinalize}" } + s_user.association :service + s_user.photo_url "/images/user/adams.jpg" +end + Factory.define(:comment) do |comment| comment.sequence(:text) {|n| "#{n} cats"} comment.association(:author, :factory => :person) From a8d37fb3fc630dd19c563ccdedb6d14e3a6920ba Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 12 Aug 2011 15:40:04 -0700 Subject: [PATCH 043/133] Move Facebook inviter view into the contacts layout, rather than a facebox --- app/controllers/services_controller.rb | 2 +- app/views/services/finder.html.haml | 62 ++++++++++++++------- app/views/shared/_contact_sidebar.html.haml | 5 +- app/views/shared/_invitations.haml | 4 +- config/locales/diaspora/en.yml | 10 +--- public/stylesheets/sass/application.sass | 5 -- 6 files changed, 49 insertions(+), 39 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index f699297dc..842db8e1c 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -47,7 +47,7 @@ class ServicesController < ApplicationController def finder service = current_user.services.where(:type => "Services::#{params[:provider].titleize}").first @friends = service ? service.finder(:remote => params[:remote]) : [] - render :layout => false + # render :layout => false end def inviter diff --git a/app/views/services/finder.html.haml b/app/views/services/finder.html.haml index 5c8453adb..89174bdc0 100644 --- a/app/views/services/finder.html.haml +++ b/app/views/services/finder.html.haml @@ -5,27 +5,49 @@ - content_for :head do = include_javascripts :finder -#aspect_edit_pane.larger.friend_finder - #facebox_header - %h4 - = t('.invite_your_friends_from', :service => params[:provider].titleize) - .description - - if @friends.size > 0 - = t('.friends', :count => @friends.size) - - else - %i= t('.not_connected') +#section_header + %h2 + = t('contacts.index.title') += render 'shared/contact_sidebar' - .contact_list +.span-18.last + %h3 + = t('.service_friends', :service => params[:provider].titleize) + #people_stream.stream.contacts - if @friends.size > 0 - = render :partial => 'services/finder', :locals => {:friends => @friends} + - for friend in @friends + .stream_element{:id => friend.id} + .right + + - if friend.already_invited? + = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id) + - elsif friend.on_diaspora? + = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left' + - else + = facebook_invite_form(friend) + + - if friend.on_diaspora? + = person_image_link(friend.person, :size => :thumb_small) + - else + = image_tag(friend.photo_url, :class => 'avatar') + + .content + %span.from + - if friend.on_diaspora? + = link_to friend.name, person_path(friend.person) + - else + = friend.name + + + .info + - if friend.person + = friend.person.diaspora_handle + - else + not yet on diaspora + + /= will_paginate @friends - else - %br - %br - %br - %br - %br - %br - %br - %h4{:style => 'text-align:center;'} - = link_to t('services.index.connect_to_facebook'), "/auth/facebook" if AppConfig[:configured_services].include?('facebook') + %h3.no_contacts + = t('.no_friends') + diff --git a/app/views/shared/_contact_sidebar.html.haml b/app/views/shared/_contact_sidebar.html.haml index bdc9fca08..e260e7d00 100644 --- a/app/views/shared/_contact_sidebar.html.haml +++ b/app/views/shared/_contact_sidebar.html.haml @@ -11,7 +11,6 @@ - if AppConfig[:featured_users] %li{:class => ("active" if defined?(@featured))} = link_to t('contacts.featured.featured_users'), "/featured", :class => "element_selector" - /%li - / = link_to "Invite friends", "#", :class => "element_selector" - + %li + = link_to "Facebook Friends", friend_finder_path('facebook'), :class => "element_selector" diff --git a/app/views/shared/_invitations.haml b/app/views/shared/_invitations.haml index 12c99f8ca..502f5c423 100644 --- a/app/views/shared/_invitations.haml +++ b/app/views/shared/_invitations.haml @@ -1,7 +1,7 @@ - if AppConfig.configured_services.include?('facebook') - if defined? remote - = link_to t('.from_facebook'), friend_finder_path('facebook', :remote => remote), :rel => 'facebox' + = link_to t('.from_facebook'), friend_finder_path('facebook', :remote => remote) -else - = link_to t('.from_facebook'), friend_finder_path('facebook'), :rel => 'facebox' + = link_to t('.from_facebook'), friend_finder_path('facebook') %br = link_to t('.by_email'), new_user_invitation_path, :title => t('.invite_someone'), :rel => 'facebox' diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 3058565ae..d3a5eceb4 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -642,14 +642,8 @@ en: join_me_on_diaspora: "Join me on DIASPORA*" click_link_to_accept_invitation: "Click this link to accept your invitation" finder: - invite_your_friends_from: "Invite your friends from %{service}" - friends: - zero: "no friends" - one: "1 friend" - few: "%{count} friends" - many: "%{count} friends" - other: "%{count} friends" - not_connected: "not connected" + service_friends: "%{service} Friends" + no_friends: "No Facebook friends found." remote_friend: resend: "resend" invite: "invite" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 1626b2486..a881c8a08 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -2670,11 +2670,6 @@ h1.tag .hover_edit :display inline -.friend_finder - .share_with - :background - :color rgb(245,245,245) - #contacts_of_contact .section :margin From 75f3accd3724cef477f7b6707cc19605503d02e7 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 12 Aug 2011 17:04:36 -0700 Subject: [PATCH 044/133] moved facebook friend inviter/finder into contacts layout & re-added search --- app/controllers/services_controller.rb | 12 +++- app/helpers/services_helper.rb | 13 +--- .../_aspect_dropdown.html.haml | 6 +- app/views/aspects/_aspect_listings.haml | 2 +- app/views/services/_facebook_invite.html.haml | 4 -- app/views/services/_finder.html.haml | 8 --- app/views/services/finder.html.haml | 17 +++-- app/views/shared/_contact_list.html.haml | 6 +- app/views/shared/_contact_sidebar.html.haml | 4 +- public/javascripts/contact-edit.js | 68 ++++++++++++------- public/javascripts/contact-list.js | 8 +-- public/stylesheets/sass/application.sass | 4 +- 12 files changed, 81 insertions(+), 71 deletions(-) delete mode 100644 app/views/services/_facebook_invite.html.haml delete mode 100644 app/views/services/_finder.html.haml diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 842db8e1c..f368e6748 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -4,6 +4,9 @@ class ServicesController < ApplicationController before_filter :authenticate_user! + respond_to :html + respond_to :json, :only => :inviter + def index @services = current_user.services end @@ -45,9 +48,9 @@ class ServicesController < ApplicationController end def finder + @finder = true service = current_user.services.where(:type => "Services::#{params[:provider].titleize}").first @friends = service ? service.finder(:remote => params[:remote]) : [] - # render :layout => false end def inviter @@ -66,6 +69,11 @@ class ServicesController < ApplicationController \n #{accept_invitation_url(invited_user, :invitation_token => invited_user.invitation_token)} MSG - redirect_to "https://www.facebook.com/?compose=1&id=#{@uid}&subject=#{@subject}&message=#{@message}&sk=messages" + + url = "https://www.facebook.com/?compose=1&id=#{@uid}&subject=#{@subject}&message=#{@message}&sk=messages" + respond_to do |format| + format.html{ redirect_to url } + format.json{ render :json => {:url => url} } + end end end diff --git a/app/helpers/services_helper.rb b/app/helpers/services_helper.rb index 33f5f328b..64040ada5 100644 --- a/app/helpers/services_helper.rb +++ b/app/helpers/services_helper.rb @@ -1,16 +1,5 @@ module ServicesHelper - GSUB_THIS = "FIUSDHVIUSHDVIUBAIUHAPOIUXJM" def contact_proxy(friend) - friend.contact || Contact.new(:person => friend.person) - end - - # This method memoizes the facebook invite form in order to avoid the overhead of rendering it on every post. - # @param [ServiceUser] friend - # @return [String] The HTML for the form. - def facebook_invite_form friend - @form ||= controller.render_to_string( - :partial => 'services/facebook_invite', - :locals => {:uid => GSUB_THIS}) - @form.gsub(GSUB_THIS, friend.uid).html_safe + friend.contact || Contact.new(:person => friend.person, :aspects => []) end end diff --git a/app/views/aspect_memberships/_aspect_dropdown.html.haml b/app/views/aspect_memberships/_aspect_dropdown.html.haml index 2be491c2d..fc90b4174 100644 --- a/app/views/aspect_memberships/_aspect_dropdown.html.haml +++ b/app/views/aspect_memberships/_aspect_dropdown.html.haml @@ -2,7 +2,7 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -.dropdown{:class => "hang_#{hang}"} +.dropdown{:class => "hang_#{hang} #{extra_class if defined?(extra_class)}"} .button.toggle{:class => ("in_aspects" if contact.aspects.size > 0)} - if contact.aspects.size == 1 = contact.aspects.first.name @@ -11,11 +11,11 @@ ▼ .wrapper - %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => ((person.id) if person)} + %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => ((person.id) if person), 'data-service_uid' => (service_uid if defined?(service_uid))} - for aspect in all_aspects = aspect_dropdown_list_item(aspect, contact, person) - - if defined?(@aspect) && ( @aspect == :profile || @aspect == :getting_started || @aspect == :tag || @aspect == :search || @aspect == :notification) + - if @aspect && (@aspect == :profile || @aspect == :getting_started || @aspect == :tag || @aspect == :search || @aspect == :notification) %li.newItem .add_aspect = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id), :rel => 'facebox', :class => 'new_aspect' diff --git a/app/views/aspects/_aspect_listings.haml b/app/views/aspects/_aspect_listings.haml index e290258f6..560a7888e 100644 --- a/app/views/aspects/_aspect_listings.haml +++ b/app/views/aspects/_aspect_listings.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. %ul#aspect_nav.left_nav - %li.all_aspects{:class => ("active" if params["set"] != "all" && params["set"] != "only_sharing" && !defined?(@featured))} + %li.all_aspects{:class => ("active" if params["set"] != "all" && params["set"] != "only_sharing" && !@featured && !@finder)} %a.home_selector{:href => controller_index_path, :class => ("sub_selected" if params["a_id"])} .contact_count = my_contacts_count diff --git a/app/views/services/_facebook_invite.html.haml b/app/views/services/_facebook_invite.html.haml deleted file mode 100644 index 816f0a332..000000000 --- a/app/views/services/_facebook_invite.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -= form_tag service_inviter_path(:provider => 'facebook') do - = select_tag(:aspect_id, options_from_collection_for_select(all_aspects, 'id', 'name')) - = hidden_field_tag :uid, uid - = submit_tag t('services.remote_friend.invite') diff --git a/app/views/services/_finder.html.haml b/app/views/services/_finder.html.haml deleted file mode 100644 index e6f54345c..000000000 --- a/app/views/services/_finder.html.haml +++ /dev/null @@ -1,8 +0,0 @@ --# Copyright (c) 2010, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -= search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('shared.contact_list.all_contacts') - -%ul.friend_finder - = render :partial => 'services/remote_friend', :collection => friends, :as => :friend diff --git a/app/views/services/finder.html.haml b/app/views/services/finder.html.haml index 89174bdc0..cb6f4c252 100644 --- a/app/views/services/finder.html.haml +++ b/app/views/services/finder.html.haml @@ -11,13 +11,14 @@ = render 'shared/contact_sidebar' -.span-18.last +.span-18.last.searchable + = search_field_tag :contact_search, "", :id => "contact_list_search", :class => 'contact_list_search', :results => 5, :placeholder => t('search') %h3 = t('.service_friends', :service => params[:provider].titleize) #people_stream.stream.contacts - if @friends.size > 0 - for friend in @friends - .stream_element{:id => friend.id} + .stream_element.contact{:id => friend.id} .right - if friend.already_invited? @@ -25,7 +26,7 @@ - elsif friend.on_diaspora? = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left' - else - = facebook_invite_form(friend) + = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left', :extra_class => 'inviter', :service_uid => friend.uid - if friend.on_diaspora? = person_image_link(friend.person, :size => :thumb_small) @@ -33,7 +34,7 @@ = image_tag(friend.photo_url, :class => 'avatar') .content - %span.from + %span.from.name - if friend.on_diaspora? = link_to friend.name, person_path(friend.person) - else @@ -48,6 +49,10 @@ /= will_paginate @friends - else - %h3.no_contacts - = t('.no_friends') + .no_contacts + = link_to(image_tag("social_media_logos/facebook-48x48.png"), "/auth/facebook") + %br + %br + %h4 + = link_to t('services.index.connect_to_facebook'), '/auth/facebook' diff --git a/app/views/shared/_contact_list.html.haml b/app/views/shared/_contact_list.html.haml index 953a1b9f1..74c513780 100644 --- a/app/views/shared/_contact_list.html.haml +++ b/app/views/shared/_contact_list.html.haml @@ -7,10 +7,10 @@ = search_field_tag :contact_search, "", :id => "contact_list_search", :class => 'contact_list_search', :results => 5, :placeholder => t('.all_contacts') = t('contacts', :count =>@aspect_contacts_count) -.contact_list - %ul +.contact_list.searchable + %ul.contacts - for contact in contacts - %li{:data=>{:contact_id=>contact.id}} + %li.contact{:data=>{:contact_id=>contact.id}} = person_image_tag contact.person .name = link_to contact.person.name, contact.person diff --git a/app/views/shared/_contact_sidebar.html.haml b/app/views/shared/_contact_sidebar.html.haml index e260e7d00..e070364de 100644 --- a/app/views/shared/_contact_sidebar.html.haml +++ b/app/views/shared/_contact_sidebar.html.haml @@ -9,8 +9,8 @@ %ul.left_nav - if AppConfig[:featured_users] - %li{:class => ("active" if defined?(@featured))} + %li{:class => ("active" if @featured)} = link_to t('contacts.featured.featured_users'), "/featured", :class => "element_selector" - %li + %li{:class => ("active" if @finder)} = link_to "Facebook Friends", friend_finder_path('facebook'), :class => "element_selector" diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index b12dbb9d7..ccbbc4b80 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -9,6 +9,46 @@ var ContactEdit = { }); }, + processClick: function(li, evt){ + var dropdown = li.closest('.dropdown'); + + if (dropdown.hasClass('inviter')) { + ContactEdit.inviteFriend(li, evt); + } + else { + ContactEdit.toggleAspectMembership(li, evt); + } + }, + + inviteFriend: function(li, evt) { + $.post('/services/inviter/facebook.json', { + "aspect_id" : li.data("aspect_id"), + "uid" : li.parent().data("service_uid") + }, function(data){ + window.location = data.url; + }); + }, + + toggleAspectMembership: function(li, evt) { + var button = li.find('.button'); + if(button.hasClass('disabled') || li.hasClass('newItem')){ return; } + + var checkbox = li.find('img.check'), + selected = li.hasClass("selected"), + routedId = selected ? "/42" : ""; + + $.post("/aspect_memberships" + routedId + ".json", { + "aspect_id": li.data("aspect_id"), + "person_id": li.parent().data("person_id"), + "_method": (selected) ? "DELETE" : "POST" + }, function(aspectMembership) { + ContactEdit.toggleCheckbox(checkbox); + ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length); + + Diaspora.widgets.publish("aspectDropdown/updated", [li.parent().data("person_id"), li.parents(".dropdown").parent(".right").html()]); + }); + }, + updateNumber: function(dropdown, personId, number){ var button = dropdown.parents(".dropdown").children('.button.toggle'), replacement; @@ -34,29 +74,9 @@ var ContactEdit = { toggleCheckbox: function(check){ check.parent('li').toggleClass('selected'); - }, - - processClick: function(li, evt){ - var button = li.find('.button'); - if(button.hasClass('disabled') || li.hasClass('newItem')){ return; } - - var checkbox = li.find('img.check'), - selected = li.hasClass("selected"), - routedId = selected ? "/42" : ""; - - $.post("/aspect_memberships" + routedId + ".json", { - "aspect_id": li.data("aspect_id"), - "person_id": li.parent().data("person_id"), - "_method": (selected) ? "DELETE" : "POST" - }, function(aspectMembership) { - ContactEdit.toggleCheckbox(checkbox); - ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length); - - Diaspora.widgets.publish("aspectDropdown/updated", [li.parent().data("person_id"), li.parents(".dropdown").parent(".right").html()]); - }); - }, + } }; - $(document).ready(function(){ - ContactEdit.init(); - }); +$(document).ready(function(){ + ContactEdit.init(); +}); diff --git a/public/javascripts/contact-list.js b/public/javascripts/contact-list.js index 342a5edfa..1fd184a09 100644 --- a/public/javascripts/contact-list.js +++ b/public/javascripts/contact-list.js @@ -7,10 +7,10 @@ var List = { initialize: function() { $(".contact_list_search").live("keyup", function(e) { var search = $(this); - var list = $("ul", ".contact_list"); + var list = $(".contacts", ".searchable"); var query = new RegExp(search.val(),'i'); - $("> li", list).each( function(idx, element) { + $("> .contact", list).each( function(idx, element) { element = $(element); if( !element.find(".name").text().match(query) ) { element.addClass('hidden'); @@ -25,8 +25,8 @@ var List = { url: "/contacts/" + contact_id, type: "DELETE", success: function(){ - if( $('.contact_list').length == 1){ - $('.contact_list li[data-contact_id='+contact_id+']').fadeOut(200); + if( $('.searchable').length == 1){ + $('.searchable .contact[data-contact_id='+contact_id+']').fadeOut(200); } else if($('#aspects_list').length == 1) { $.facebox.close(); }; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index a881c8a08..f006caffe 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1763,12 +1763,12 @@ ul#request_result :right 8px :top 3px - > ul + > .contacts :margin 0 :padding 5px :right 0 - > li + > .contact @include border-radius(3px) :background :color #fff From 565d71a0cd1e55e6749b82313350f4b536424795 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 12 Aug 2011 17:32:52 -0700 Subject: [PATCH 045/133] Bad solution for making sure that an invited facebook user is marked immediately as having been invited --- app/controllers/services_controller.rb | 5 +++++ spec/controllers/services_controller_spec.rb | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index f368e6748..c9a332399 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -70,6 +70,11 @@ class ServicesController < ApplicationController #{accept_invitation_url(invited_user, :invitation_token => invited_user.invitation_token)} MSG + service = current_user.services.where(:type => "Services::Facebook").first + su = ServiceUser.where(:service_id => service.id, :uid => @uid).first + su.attach_local_models + su.save + url = "https://www.facebook.com/?compose=1&id=#{@uid}&subject=#{@subject}&message=#{@message}&sk=messages" respond_to do |format| format.html{ redirect_to url } diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index 80edbc208..11d161dd0 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -38,7 +38,7 @@ describe ServicesController do end describe '#create' do - it 'creates a new OmniauthService' do + it 'creates a new OmniauthService' do request.env['omniauth.auth'] = omniauth_auth lambda{ post :create, :provider => 'twitter' @@ -105,9 +105,12 @@ describe ServicesController do end end - describe '#invite' do + describe '#inviter' do before do @uid = "abc" + fb = Factory(:service, :type => "Services::Facebook", :user => @user) + fb = Services::Facebook.find(fb.id) + @su = Factory(:service_user, :service => fb, :uid => @uid) @invite_params = {:provider => 'facebook', :uid => @uid, :aspect_id => @user.aspects.first.id} end @@ -132,6 +135,11 @@ describe ServicesController do }.should change(Invitation, :count).by(1) end + it 'sets the invitation_id on the service_user' do + post :inviter, @invite_params + @su.reload.invitation.should_not be_nil + end + it 'does not create a duplicate invitation' do inv = Invitation.create!(:sender_id => @user.id, :recipient_id => eve.id, :aspect_id => @user.aspects.first.id) @invite_params[:invitation_id] = inv.id From 1c5f61fb78a09049d5e4a83e05bf120f110962ee Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 12 Aug 2011 18:18:58 -0700 Subject: [PATCH 046/133] dropdown images as embedded assets and not 2 separate image tags --- app/helpers/aspect_global_helper.rb | 2 -- public/javascripts/contact-edit.js | 9 +------- public/stylesheets/sass/ui.sass | 35 +++++++++++++---------------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index 5d7b71c76..8798ddf12 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -71,8 +71,6 @@ module AspectGlobalHelper str = < - - #{aspect.name} LISTITEM diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index ccbbc4b80..8066892e3 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -11,7 +11,6 @@ var ContactEdit = { processClick: function(li, evt){ var dropdown = li.closest('.dropdown'); - if (dropdown.hasClass('inviter')) { ContactEdit.inviteFriend(li, evt); } @@ -42,9 +41,8 @@ var ContactEdit = { "person_id": li.parent().data("person_id"), "_method": (selected) ? "DELETE" : "POST" }, function(aspectMembership) { - ContactEdit.toggleCheckbox(checkbox); + li.toggleClass("selected"); ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length); - Diaspora.widgets.publish("aspectDropdown/updated", [li.parent().data("person_id"), li.parents(".dropdown").parent(".right").html()]); }); }, @@ -70,11 +68,6 @@ var ContactEdit = { button.html(replacement + ' ▼'); }, - - toggleCheckbox: - function(check){ - check.parent('li').toggleClass('selected'); - } }; $(document).ready(function(){ diff --git a/public/stylesheets/sass/ui.sass b/public/stylesheets/sass/ui.sass index a5b9eaaa1..2d3a25a15 100644 --- a/public/stylesheets/sass/ui.sass +++ b/public/stylesheets/sass/ui.sass @@ -136,15 +136,17 @@ :position relative :color #222 - .check, - .checkWhite - :position absolute - :left 4px - :top 1px + &.selected + :background + :image url('/images/icons/check_yes_ok.png') + :position 3px 1px + :repeat no-repeat - .checkWhite - :display none - :top 0px + &.selected:hover + :background + :image url('/images/icons/check_yes_ok_white.png') + /* bump top position up 1px to compensate for the 1px added top border */ + :position 3px 0px &.newItem a @@ -154,10 +156,6 @@ &:hover :text-decoration none - &:not(.selected) - .check - :display none - &.hang_right .wrapper @include border-radius(3px, 0, 3px, 3px) @@ -180,9 +178,13 @@ .selected :font-weight bold + .button + :background #666 + .button, .wrapper ul > li:hover - :background #666 + :background + :color #666 :color #fff :text-shadow none @@ -202,10 +204,3 @@ .wrapper ul > li * :cursor pointer - .selected:hover .checkWhite - :display block - - .selected:hover .check - :display none - - From fe93fd5c9133394802cbcb28fba9e32c371c9aee Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Sat, 13 Aug 2011 03:57:41 +0200 Subject: [PATCH 047/133] Write a cucumber test for starting a private conversation --- features/conversations.feature | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 features/conversations.feature diff --git a/features/conversations.feature b/features/conversations.feature new file mode 100644 index 000000000..d25cfd35d --- /dev/null +++ b/features/conversations.feature @@ -0,0 +1,26 @@ +@javascript +Feature: private messages + In order to be talkative + As a User + I want to converse with people + + Background: + Given a user with username "bob" + And a user named "Alice Awesome" with email "alice@alice.alice" + When I sign in as "bob@bob.bob" + And a user with username "bob" is connected with "Alice_Awesome" + + And I am on the conversations page + + Scenario: send a message + Given I follow "New Message" + And I wait for the ajax to finish + And I fill in "contact_autocomplete" with "Alice" + And I press the first ".as-result-item" within ".as-results" + And I fill in "conversation_subject" with "Greetings" + And I fill in "conversation_text" with "hello, alice!" + And I press "Send" + And I wait for the ajax to finish + Then I should see "Greetings" within "#conversation_inbox" + And I should see "Greetings" within "#conversation_show" + And I should see "hello, alice!" within ".stream" From 23262065867fd7e38f96345220e208ec3a265dbb Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Fri, 12 Aug 2011 21:26:39 -0300 Subject: [PATCH 048/133] Refactor conversations creation --- app/controllers/conversations_controller.rb | 2 ++ app/models/conversation.rb | 10 +------- ...nversation_visibilities_controller_spec.rb | 8 ++++-- .../conversations_controller_spec.rb | 25 ++++++++++++++----- spec/controllers/messages_controller_spec.rb | 8 ++++-- spec/mailers/notifier_spec.rb | 8 ++++-- spec/models/conversation_spec.rb | 10 +++++--- spec/models/message_spec.rb | 16 +++++++++--- .../notifications/private_message_spec.rb | 8 ++++-- 9 files changed, 65 insertions(+), 30 deletions(-) diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb index eaa6ed522..80d963caa 100644 --- a/app/controllers/conversations_controller.rb +++ b/app/controllers/conversations_controller.rb @@ -28,6 +28,8 @@ class ConversationsController < ApplicationController params[:conversation][:participant_ids] = person_ids | [current_user.person.id] params[:conversation][:author] = current_user.person + message_text = params[:conversation].delete(:text) + params[:conversation][:messages_attributes] = [ {:author => current_user.person, :text => message_text }] if @conversation = Conversation.create(params[:conversation]) Postzord::Dispatch.new(current_user, @conversation).post diff --git a/app/models/conversation.rb b/app/models/conversation.rb index 785e80628..e10b27030 100644 --- a/app/models/conversation.rb +++ b/app/models/conversation.rb @@ -15,15 +15,7 @@ class Conversation < ActiveRecord::Base belongs_to :author, :class_name => 'Person' - def self.create(opts={}) - opts = opts.dup - msg_opts = {:author => opts[:author], :text => opts.delete(:text)} - - cnv = super(opts) - message = Message.new(msg_opts.merge({:conversation_id => cnv.id})) - message.save - cnv - end + accepts_nested_attributes_for :messages def recipients self.participants - [self.author] diff --git a/spec/controllers/conversation_visibilities_controller_spec.rb b/spec/controllers/conversation_visibilities_controller_spec.rb index 514396903..211316957 100644 --- a/spec/controllers/conversation_visibilities_controller_spec.rb +++ b/spec/controllers/conversation_visibilities_controller_spec.rb @@ -9,8 +9,12 @@ describe ConversationVisibilitiesController do @user1 = alice sign_in :user, @user1 - hash = { :author => @user1.person, :participant_ids => [@user1.contacts.first.person.id, @user1.person.id], - :subject => 'not spam', :text => 'cool stuff'} + hash = { + :author => @user1.person, + :participant_ids => [@user1.contacts.first.person.id, @user1.person.id], + :subject => 'not spam', + :messages_attributes => [ {:author => @user1.person, :text => 'cool stuff'} ] + } @conversation = Conversation.create(hash) end diff --git a/spec/controllers/conversations_controller_spec.rb b/spec/controllers/conversations_controller_spec.rb index a1287d166..6ee8b1d59 100644 --- a/spec/controllers/conversations_controller_spec.rb +++ b/spec/controllers/conversations_controller_spec.rb @@ -40,8 +40,12 @@ describe ConversationsController do end it 'retrieves all conversations for a user' do - hash = {:author => alice.person, :participant_ids => [alice.contacts.first.person.id, alice.person.id], - :subject => 'not spam', :text => 'cool stuff'} + hash = { + :author => alice.person, + :participant_ids => [alice.contacts.first.person.id, alice.person.id], + :subject => 'not spam', + :messages_attributes => [ {:author => alice.person, :text => 'cool stuff'} ] + } 3.times { Conversation.create(hash) } get :index @@ -80,8 +84,13 @@ describe ConversationsController do it 'dispatches the conversation' do cnv = Conversation.create( - @hash[:conversation].merge({:author => alice.person, :participant_ids => [alice.contacts.first.person.id]})) - + { + :author => alice.person, + :participant_ids => [alice.contacts.first.person.id, alice.person.id], + :subject => 'not spam', + :messages_attributes => [ {:author => alice.person, :text => 'cool stuff'} ] + } + ) p = Postzord::Dispatch.new(alice, cnv) Postzord::Dispatch.stub!(:new).and_return(p) p.should_receive(:post) @@ -91,8 +100,12 @@ describe ConversationsController do describe '#show' do before do - hash = {:author => alice.person, :participant_ids => [alice.contacts.first.person.id, alice.person.id], - :subject => 'not spam', :text => 'cool stuff'} + hash = { + :author => alice.person, + :participant_ids => [alice.contacts.first.person.id, alice.person.id], + :subject => 'not spam', + :messages_attributes => [ {:author => alice.person, :text => 'cool stuff'} ] + } @conversation = Conversation.create(hash) end diff --git a/spec/controllers/messages_controller_spec.rb b/spec/controllers/messages_controller_spec.rb index 90ab7259c..6a120effd 100644 --- a/spec/controllers/messages_controller_spec.rb +++ b/spec/controllers/messages_controller_spec.rb @@ -17,8 +17,12 @@ describe MessagesController do describe '#create' do before do - @create_hash = { :author => @user1.person, :participant_ids => [@user1.contacts.first.person.id, @user1.person.id], - :subject => "cool stuff", :text => "stuff"} + @create_hash = { + :author => @user1.person, + :participant_ids => [@user1.contacts.first.person.id, @user1.person.id], + :subject => 'cool stuff', + :messages_attributes => [ {:author => @user1.person, :text => 'stuff'} ] + } end context "on my own post" do diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index 5640c4963..17326f582 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -134,8 +134,12 @@ describe Notifier do @user2 = bob @participant_ids = @user2.contacts.map{|c| c.person.id} + [ @user2.person.id] - @create_hash = { :author => @user2.person, :participant_ids => @participant_ids , - :subject => "cool stuff", :text => 'hey'} + @create_hash = { + :author => @user2.person, + :participant_ids => @participant_ids, + :subject => "cool stuff", + :messages_attributes => [ {:author => @user2.person, :text => 'hey'} ] + } @cnv = Conversation.create(@create_hash) diff --git a/spec/models/conversation_spec.rb b/spec/models/conversation_spec.rb index 147efbd3c..f81357df2 100644 --- a/spec/models/conversation_spec.rb +++ b/spec/models/conversation_spec.rb @@ -10,8 +10,12 @@ describe Conversation do @user2 = bob @participant_ids = [@user1.contacts.first.person.id, @user1.person.id] - @create_hash = { :author => @user1.person, :participant_ids => @participant_ids , - :subject => "cool stuff", :text => 'hey'} + @create_hash = { + :author => @user1.person, + :participant_ids => @participant_ids, + :subject => "cool stuff", + :messages_attributes => [ {:author => @user1.person, :text => 'hey'} ] + } end it 'creates a message on create' do @@ -60,8 +64,8 @@ describe Conversation do describe '#receive' do before do - Conversation.destroy_all Message.destroy_all + Conversation.destroy_all end it 'creates a message' do diff --git a/spec/models/message_spec.rb b/spec/models/message_spec.rb index 859900f4b..00aacfb10 100644 --- a/spec/models/message_spec.rb +++ b/spec/models/message_spec.rb @@ -10,8 +10,12 @@ describe Message do @user1 = alice @user2 = bob - @create_hash = { :author => @user1.person, :participant_ids => [@user1.contacts.first.person.id, @user1.person.id], - :subject => "cool stuff", :text => "stuff"} + @create_hash = { + :author => @user1.person, + :participant_ids => [@user1.contacts.first.person.id, @user1.person.id], + :subject => "cool stuff", + :messages_attributes => [ {:author => @user1.person, :text => 'stuff'} ] + } @cnv = Conversation.create(@create_hash) @message = @cnv.messages.first @@ -64,8 +68,12 @@ describe Message do before do @local_luke, @local_leia, @remote_raphael = set_up_friends - cnv_hash = {:author => @remote_raphael, :participant_ids => [@local_luke.person, @local_leia.person, @remote_raphael].map(&:id), - :subject => 'cool story, bro', :text => 'hey'} + cnv_hash = { + :author => @remote_raphael, + :participant_ids => [@local_luke.person, @local_leia.person, @remote_raphael].map(&:id), + :subject => 'cool story, bro', + :messages_attributes => [ {:author => @remote_raphael, :text => 'hey'} ] + } @remote_parent = Conversation.create(cnv_hash.dup) diff --git a/spec/models/notifications/private_message_spec.rb b/spec/models/notifications/private_message_spec.rb index 42b05f9ec..82bfde6b3 100644 --- a/spec/models/notifications/private_message_spec.rb +++ b/spec/models/notifications/private_message_spec.rb @@ -9,8 +9,12 @@ describe Notifications::PrivateMessage do @user1 = alice @user2 = bob - @create_hash = { :author => @user1.person, :participant_ids => [@user1.contacts.first.person.id, @user1.person.id], - :subject => "cool stuff", :text => "stuff"} + @create_hash = { + :author => @user1.person, + :participant_ids => [@user1.contacts.first.person.id, @user1.person.id], + :subject => 'cool stuff', + :messages_attributes => [ {:author => @user1.person, :text => 'stuff'} ] + } @cnv = Conversation.create(@create_hash) @msg = @cnv.messages.first From 9c99331bb7df3647c2c3a0425b8db47d61a20e54 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Sat, 13 Aug 2011 04:36:26 +0200 Subject: [PATCH 049/133] Improve the conversation test a bit --- features/conversations.feature | 11 ++++++----- features/step_definitions/conversations_steps.rb | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 features/step_definitions/conversations_steps.rb diff --git a/features/conversations.feature b/features/conversations.feature index d25cfd35d..2fe01e1de 100644 --- a/features/conversations.feature +++ b/features/conversations.feature @@ -15,12 +15,13 @@ Feature: private messages Scenario: send a message Given I follow "New Message" And I wait for the ajax to finish - And I fill in "contact_autocomplete" with "Alice" - And I press the first ".as-result-item" within ".as-results" - And I fill in "conversation_subject" with "Greetings" - And I fill in "conversation_text" with "hello, alice!" - And I press "Send" + And I fill in "contact_autocomplete" with "Alice" in the modal window + And I press the first ".as-result-item" within ".as-results" in the modal window + And I fill in "conversation_subject" with "Greetings" in the modal window + And I fill in "conversation_text" with "hello, alice!" in the modal window + And I press "Send" in the modal window And I wait for the ajax to finish Then I should see "Greetings" within "#conversation_inbox" And I should see "Greetings" within "#conversation_show" + And "Alice Awesome" should be part of active conversation And I should see "hello, alice!" within ".stream" diff --git a/features/step_definitions/conversations_steps.rb b/features/step_definitions/conversations_steps.rb new file mode 100644 index 000000000..a5b53e752 --- /dev/null +++ b/features/step_definitions/conversations_steps.rb @@ -0,0 +1,5 @@ +Then /^"([^"]*)" should be part of active conversation$/ do |name| + within(".conversation_participants") do + find("img.avatar[title^='#{name} ']").should_not be_nil + end +end From 48282e3402e849afbc8cfb7a3dc057082d229fa5 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Sat, 13 Aug 2011 05:03:27 +0200 Subject: [PATCH 050/133] Make and use a single cucumber step to send a private message --- features/conversations.feature | 11 +---------- features/step_definitions/conversations_steps.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/features/conversations.feature b/features/conversations.feature index 2fe01e1de..55626aa03 100644 --- a/features/conversations.feature +++ b/features/conversations.feature @@ -10,17 +10,8 @@ Feature: private messages When I sign in as "bob@bob.bob" And a user with username "bob" is connected with "Alice_Awesome" - And I am on the conversations page - Scenario: send a message - Given I follow "New Message" - And I wait for the ajax to finish - And I fill in "contact_autocomplete" with "Alice" in the modal window - And I press the first ".as-result-item" within ".as-results" in the modal window - And I fill in "conversation_subject" with "Greetings" in the modal window - And I fill in "conversation_text" with "hello, alice!" in the modal window - And I press "Send" in the modal window - And I wait for the ajax to finish + Given I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome" Then I should see "Greetings" within "#conversation_inbox" And I should see "Greetings" within "#conversation_show" And "Alice Awesome" should be part of active conversation diff --git a/features/step_definitions/conversations_steps.rb b/features/step_definitions/conversations_steps.rb index a5b53e752..49ca7f4cf 100644 --- a/features/step_definitions/conversations_steps.rb +++ b/features/step_definitions/conversations_steps.rb @@ -3,3 +3,15 @@ Then /^"([^"]*)" should be part of active conversation$/ do |name| find("img.avatar[title^='#{name} ']").should_not be_nil end end + +Then /^I send a message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/ do |subject, text, person| + Given %(I am on the conversations page) + And %(I follow "New Message") + And %(I wait for the ajax to finish) + And %(I fill in "contact_autocomplete" with "#{person}" in the modal window) + And %(I press the first ".as-result-item" within ".as-results" in the modal window) + And %(I fill in "conversation_subject" with "#{subject}" in the modal window) + And %(I fill in "conversation_text" with "#{text}" in the modal window) + And %(I press "Send" in the modal window) + And %(I wait for the ajax to finish) +end From b85df7303befad55df9201d40f7c4b49324f23c7 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Sat, 13 Aug 2011 05:27:54 +0200 Subject: [PATCH 051/133] After opening a conversation, remove its unread message count from inbox --- app/views/conversations/show.js.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/conversations/show.js.erb b/app/views/conversations/show.js.erb index 36df45da9..b20453679 100644 --- a/app/views/conversations/show.js.erb +++ b/app/views/conversations/show.js.erb @@ -2,5 +2,6 @@ $('#conversation_show').html("<%= escape_javascript(render('conversations/show', $(".stream_element", "#conversation_inbox").removeClass('selected'); $(".stream_element[data-guid='<%= @conversation.id %>']", "#conversation_inbox").addClass('selected'); +$(".stream_element[data-guid='<%= @conversation.id %>']", "#conversation_inbox").find(".unread_message_count").remove() Diaspora.widgets.timeago.updateTimeAgo(); From f0583de36c2d07987a8331baca9856fdf457d296 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Sat, 13 Aug 2011 09:40:31 -0700 Subject: [PATCH 052/133] Some optimizations to ServicesController#finder. Apparently setting an association on an unsaved record to an empty array hits the database. --- app/helpers/aspect_global_helper.rb | 2 +- app/helpers/services_helper.rb | 3 +- app/models/contact.rb | 10 ++++++ app/models/services/facebook.rb | 2 +- app/views/services/_remote_friend.html.haml | 34 +++++++++++++-------- app/views/services/finder.html.haml | 30 +----------------- 6 files changed, 36 insertions(+), 45 deletions(-) diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index 8798ddf12..0545d60f1 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -66,7 +66,7 @@ module AspectGlobalHelper end def aspect_dropdown_list_item(aspect, contact, person) - checked = (contact.persisted? && contact.aspect_memberships.detect{ |am| am.aspect_id == aspect.id}) + checked = (contact.persisted? && contact.in_aspect?(aspect)) klass = checked ? "selected" : "" str = < []) def contact_proxy(friend) - friend.contact || Contact.new(:person => friend.person, :aspects => []) + friend.contact || @@contact_proxy.dup.tap{|c| c.person = friend.person} end end diff --git a/app/models/contact.rb b/app/models/contact.rb index 46cbf8317..64512044d 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -73,6 +73,16 @@ class Contact < ActiveRecord::Base self.sharing && self.receiving end + def in_aspect? aspect + if aspect_memberships.loaded? + aspect_memberships.detect{ |am| am.aspect_id == aspect.id } + elsif aspects.loaded? + aspects.detect{ |a| a.id == aspect.id } + else + AspectMembership.exists?(:contact_id => self.id, :aspect_id => aspect.id) + end + end + private def not_contact_for_self if person_id && person.owner == user diff --git a/app/models/services/facebook.rb b/app/models/services/facebook.rb index b77e68809..3a208039a 100644 --- a/app/models/services/facebook.rb +++ b/app/models/services/facebook.rb @@ -29,7 +29,7 @@ class Services::Facebook < Service else self.service_users end - result.order('service_users.person_id DESC, service_users.name') + result.includes(:contact => :aspects, :person => :profile).order('service_users.person_id DESC, service_users.name') end def save_friends diff --git a/app/views/services/_remote_friend.html.haml b/app/views/services/_remote_friend.html.haml index 927755da1..9d2450aa4 100644 --- a/app/views/services/_remote_friend.html.haml +++ b/app/views/services/_remote_friend.html.haml @@ -1,20 +1,28 @@ -%li.remote_friend{:id => "uid_" + friend.uid, :uid => friend.uid} +.stream_element.contact{:id => friend.id} + .right + + - if friend.already_invited? + = link_to t('services.index.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id) + - elsif friend.on_diaspora? + = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left' + - else + = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left', :extra_class => 'inviter', :service_uid => friend.uid + - if friend.on_diaspora? = person_image_link(friend.person, :size => :thumb_small) - else = image_tag(friend.photo_url, :class => 'avatar') - %h4.name - - if friend.on_diaspora? - = link_to friend.name, person_path(friend.person) - - else - = friend.name - - - if friend.already_invited? - = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id) - - elsif friend.on_diaspora? - = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left' - - else - = facebook_invite_form(friend) + .content + %span.from.name + - if friend.on_diaspora? + = link_to friend.name, person_path(friend.person) + - else + = friend.name + .info + - if friend.person + = friend.person.diaspora_handle + - else + not yet on diaspora diff --git a/app/views/services/finder.html.haml b/app/views/services/finder.html.haml index cb6f4c252..53d86ab95 100644 --- a/app/views/services/finder.html.haml +++ b/app/views/services/finder.html.haml @@ -17,35 +17,7 @@ = t('.service_friends', :service => params[:provider].titleize) #people_stream.stream.contacts - if @friends.size > 0 - - for friend in @friends - .stream_element.contact{:id => friend.id} - .right - - - if friend.already_invited? - = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id) - - elsif friend.on_diaspora? - = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left' - - else - = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left', :extra_class => 'inviter', :service_uid => friend.uid - - - if friend.on_diaspora? - = person_image_link(friend.person, :size => :thumb_small) - - else - = image_tag(friend.photo_url, :class => 'avatar') - - .content - %span.from.name - - if friend.on_diaspora? - = link_to friend.name, person_path(friend.person) - - else - = friend.name - - - .info - - if friend.person - = friend.person.diaspora_handle - - else - not yet on diaspora + = render :partial => 'remote_friend', :collection => @friends, :as => :friend /= will_paginate @friends - else From f60ce932b1967d419f519af04473c159b80a7c0d Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Sat, 13 Aug 2011 09:44:40 -0700 Subject: [PATCH 053/133] Localize string --- app/views/services/_remote_friend.html.haml | 4 ++-- config/locales/diaspora/en.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/services/_remote_friend.html.haml b/app/views/services/_remote_friend.html.haml index 9d2450aa4..09d5fce2f 100644 --- a/app/views/services/_remote_friend.html.haml +++ b/app/views/services/_remote_friend.html.haml @@ -2,7 +2,7 @@ .right - if friend.already_invited? - = link_to t('services.index.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id) + = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id) - elsif friend.on_diaspora? = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left' - else @@ -25,4 +25,4 @@ - if friend.person = friend.person.diaspora_handle - else - not yet on diaspora + =t('.not_on_diaspora') diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index d3a5eceb4..43eceebb2 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -647,6 +647,7 @@ en: remote_friend: resend: "resend" invite: "invite" + not_on_diaspora: "Not yet on Diaspora" shared: publisher: From 3a180448215519b361bbbe277cf89d5babd3f898 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Sat, 13 Aug 2011 09:59:17 -0700 Subject: [PATCH 054/133] Fix infinite scroll on search... some kind of weird thing with rails responding with json even when request.format is html, with a mime type of html --- app/controllers/people_controller.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 95aabbf1b..0277fa88f 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -30,7 +30,18 @@ class PeopleController < ApplicationController render :json => @people end - format.all do + format.html do + #only do it if it is an email address + if params[:q].try(:match, Devise.email_regexp) + people = Person.where(:diaspora_handle => params[:q]) + webfinger(params[:q]) if people.empty? + else + people = Person.search(params[:q], current_user) + end + @people = people.paginate( :page => params[:page], :per_page => 15) + @hashes = hashes_for_people(@people, @aspects) + end + format.mobile do #only do it if it is an email address if params[:q].try(:match, Devise.email_regexp) people = Person.where(:diaspora_handle => params[:q]) @@ -68,7 +79,7 @@ class PeopleController < ApplicationController @person = Person.find_from_id_or_username(params) if remote_profile_with_no_user_session? - raise ActiveRecord::RecordNotFound + raise ActiveRecord::RecordNotFound end @post_type = :all From d228f50557adaea85e1791a53f2de85f7c06732a Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Sat, 13 Aug 2011 12:45:17 -0700 Subject: [PATCH 055/133] Acceptable ajax loader for the aspect dropdown. --- public/images/ajax-loader_inverted.gif | Bin 0 -> 1487 bytes public/javascripts/contact-edit.js | 7 +++++-- public/stylesheets/sass/ui.sass | 12 ++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 public/images/ajax-loader_inverted.gif diff --git a/public/images/ajax-loader_inverted.gif b/public/images/ajax-loader_inverted.gif new file mode 100644 index 0000000000000000000000000000000000000000..31a6f54482a911c2ff15bb2026404500882b329a GIT binary patch literal 1487 zcmaLW$y1tV90zbC2(l<3n^uJ&D#$J%JIEpkqF@w>3nHSRLEO-|RrA{CdEaM}F@3X4 zqLaxnhh{QN#*Sv33>T+|OfS9m*4}&QwAY@}q+>1}+wWiSneX@a>yLzN_E~Nfx9Y<| z)u+68@uIo8+2`|RGMSByjrH~Q@$qrH-7XS|tX3T&`3qrPXTJ*4CaqduA{gyk76o(b4hoF^9vU)9E84BhhG-MxzZ54)*l)P^nZ3 zg`!X>WHMPzO-)l%Q+IbalgVspY2opBLZMJ1k;vupuC6XVpWoQn$Y3zUV)5|suuiAb z>-EKAadB~Retv#tW~NjsZEbC}x3`auj_&X8*VWY>9v%jR!CWqfVc7lq_Z<$$($dnS zM~}kca5|md+uLhvYm-W)TrO9wR>xv7zu)h4I`jE_AP`tyUS3&QAqc`^u{?hK`03N9 zCX?ypS)%#%wNhi0^w=-{_~!oGu@)goo_Yp>O1P^AK$58U>sX~mDhrfl>oH)^Gw4waWAhaiyBo<~P$wrwQt|H5IJvdGlG09;8sE$Bu-FUVU0zZB6Ng5xt^EFv;l{r{^^3vk2nmHDgj-A@LAI}tBn3ey zQKuslJ`a?uVkZpIF&1q<0RcN;rQTu#bAYXVCsl)miFcDckYn9F;c0v@I=+rX;#y*O d(})*kV)ACZFgTQ^OWxLYHz~x*cb^Q-zX8X3#N7Y@ literal 0 HcmV?d00001 diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index 8066892e3..76795ba3d 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -11,6 +11,7 @@ var ContactEdit = { processClick: function(li, evt){ var dropdown = li.closest('.dropdown'); + li.addClass('loading'); if (dropdown.hasClass('inviter')) { ContactEdit.inviteFriend(li, evt); } @@ -22,8 +23,9 @@ var ContactEdit = { inviteFriend: function(li, evt) { $.post('/services/inviter/facebook.json', { "aspect_id" : li.data("aspect_id"), - "uid" : li.parent().data("service_uid") + "uid" : li.parent().data("service_uid") }, function(data){ + li.removeClass('loading') window.location = data.url; }); }, @@ -41,6 +43,7 @@ var ContactEdit = { "person_id": li.parent().data("person_id"), "_method": (selected) ? "DELETE" : "POST" }, function(aspectMembership) { + li.removeClass('loading') li.toggleClass("selected"); ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length); Diaspora.widgets.publish("aspectDropdown/updated", [li.parent().data("person_id"), li.parents(".dropdown").parent(".right").html()]); @@ -54,7 +57,7 @@ var ContactEdit = { if (number == 0) { button.removeClass("in_aspects"); replacement = Diaspora.widgets.i18n.t("aspect_dropdown.toggle.zero"); - }else if (number == 1) { + }else if (number == 1) { button.addClass("in_aspects"); replacement = dropdown.find(".selected").first().text(); }else if (number < 3) { diff --git a/public/stylesheets/sass/ui.sass b/public/stylesheets/sass/ui.sass index 2d3a25a15..853019ac9 100644 --- a/public/stylesheets/sass/ui.sass +++ b/public/stylesheets/sass/ui.sass @@ -148,6 +148,18 @@ /* bump top position up 1px to compensate for the 1px added top border */ :position 3px 0px + &.loading + :background + :image url('/images/ajax-loader.gif') + :repeat no-repeat + :position 4px 2px + + &.loading:hover + :background + :image url('/images/ajax-loader_inverted.gif') + /* bump top position up 1px to compensate for the 1px added top border */ + :position 4px 1px + &.newItem a :color #999 From 7e59193e2cf22af8aba7ea71b7d7dcefc954420c Mon Sep 17 00:00:00 2001 From: MrZYX Date: Sat, 13 Aug 2011 23:54:14 +0200 Subject: [PATCH 056/133] updated locales --- config/locales/diaspora/ar.yml | 12 ++---- config/locales/diaspora/bg.yml | 12 ++---- config/locales/diaspora/br.yml | 12 ++---- config/locales/diaspora/cs.yml | 12 ++---- config/locales/diaspora/cy.yml | 12 ++---- config/locales/diaspora/da.yml | 12 ++---- config/locales/diaspora/de.yml | 12 ++---- config/locales/diaspora/el.yml | 12 ++---- config/locales/diaspora/en_pirate.yml | 12 ++---- config/locales/diaspora/en_shaw.yml | 12 ++---- config/locales/diaspora/eo.yml | 58 ++++++++++++--------------- config/locales/diaspora/es-AR.yml | 12 ++---- config/locales/diaspora/es-CL.yml | 12 ++---- config/locales/diaspora/es.yml | 32 ++++++--------- config/locales/diaspora/eu.yml | 12 ++---- config/locales/diaspora/fi.yml | 12 ++---- config/locales/diaspora/fr.yml | 12 ++---- config/locales/diaspora/ga.yml | 12 ++---- config/locales/diaspora/he.yml | 12 ++---- config/locales/diaspora/hu.yml | 12 ++---- config/locales/diaspora/id.yml | 12 ++---- config/locales/diaspora/is.yml | 12 ++---- config/locales/diaspora/it.yml | 32 ++++++--------- config/locales/diaspora/ja.yml | 12 ++---- config/locales/diaspora/ko.yml | 28 +++++-------- config/locales/diaspora/lt.yml | 12 ++---- config/locales/diaspora/mk.yml | 12 ++---- config/locales/diaspora/nb.yml | 12 ++---- config/locales/diaspora/nl.yml | 12 ++---- config/locales/diaspora/pa.yml | 12 ++---- config/locales/diaspora/pl.yml | 12 ++---- config/locales/diaspora/pt-BR.yml | 12 ++---- config/locales/diaspora/pt-PT.yml | 12 ++---- config/locales/diaspora/ro.yml | 12 ++---- config/locales/diaspora/ru.yml | 12 ++---- config/locales/diaspora/sk.yml | 12 ++---- config/locales/diaspora/sl.yml | 12 ++---- config/locales/diaspora/sv.yml | 12 ++---- config/locales/diaspora/tr.yml | 12 ++---- config/locales/diaspora/zh-CN.yml | 12 ++---- config/locales/diaspora/zh-TW.yml | 12 ++---- 41 files changed, 174 insertions(+), 420 deletions(-) diff --git a/config/locales/diaspora/ar.yml b/config/locales/diaspora/ar.yml index 477538260..949913327 100644 --- a/config/locales/diaspora/ar.yml +++ b/config/locales/diaspora/ar.yml @@ -279,7 +279,6 @@ ar: to: "إلى" layouts: application: - have_a_problem: "واجهت مشكلة؟ اعثر على حل هنا" powered_by: "بدعم DIASPORA*" public_feed: "ملقم دياسبرا العام لـ %{name}" toggle: "حَوِّل لموقع الهواتف المحمولة" @@ -601,14 +600,8 @@ ar: failure: error: "خطأ خلال محاولة الإتصال بالخدمة" finder: - friends: - few: "%{count} أصدقاء" - many: "%{count} أصدقاء" - one: "1 أصدقاء" - other: "%{count} أصدقاء" - zero: "لا أصدقاء" - invite_your_friends_from: "دعوة أصدقائك من %{service}" - not_connected: "غير متصل" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "إتصل بـ فيسبوك" connect_to_tumblr: "صل حسابك بـ Tumblr" @@ -623,6 +616,7 @@ ar: join_me_on_diaspora: "انضم إلي في DIASPORA*" remote_friend: invite: "دعوة" + not_on_diaspora: "Not yet on Diaspora" resend: "إعادة إرسال" settings: "إعدادات" shared: diff --git a/config/locales/diaspora/bg.yml b/config/locales/diaspora/bg.yml index 063b7644a..9c1702865 100644 --- a/config/locales/diaspora/bg.yml +++ b/config/locales/diaspora/bg.yml @@ -279,7 +279,6 @@ bg: to: "До" layouts: application: - have_a_problem: "Имате проблем? Открийте решението тук" powered_by: "Благодарение на DIASPORA*" public_feed: "Публична емисия от Diaspora за %{name}" toggle: "вкл./изкл. на мобилния изглед" @@ -601,14 +600,8 @@ bg: failure: error: "възникна грешка при свързването с услугата" finder: - friends: - few: "%{count} приятеля" - many: "%{count} приятеля" - one: "1 приятел" - other: "%{count} приятеля" - zero: "няма приятели" - invite_your_friends_from: "Поканете приятелите си от %{service}" - not_connected: "не съществува връзка" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Свързване с facebook" connect_to_tumblr: "Свързване с tumblr" @@ -623,6 +616,7 @@ bg: join_me_on_diaspora: "Присъединете се към мен в DIASPORA*" remote_friend: invite: "покани" + not_on_diaspora: "Not yet on Diaspora" resend: "повторно изпращане" settings: "Настройки" shared: diff --git a/config/locales/diaspora/br.yml b/config/locales/diaspora/br.yml index ae076027a..a1076a802 100644 --- a/config/locales/diaspora/br.yml +++ b/config/locales/diaspora/br.yml @@ -279,7 +279,6 @@ br: to: "Da" layouts: application: - have_a_problem: "Ur gudenn? Klaskit respontoù amañ" powered_by: "DEGASET GANT DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ br: failure: error: "there was an error connecting that service" finder: - friends: - few: "%{count} friends" - many: "%{count} friends" - one: "1 mignon" - other: "%{count} mignon" - zero: "mignon ebet" - invite_your_friends_from: "Kasit pedadennoù d'ho mignoned diwar %{service}" - not_connected: "not connected" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Connect to facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ br: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "invite" + not_on_diaspora: "Not yet on Diaspora" resend: "resend" settings: "Settings" shared: diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 4728ff2c1..211b63d1f 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -279,7 +279,6 @@ cs: to: "Pro" layouts: application: - have_a_problem: "Máte problém? Zde najdete odpověď" powered_by: "POWERED BY DIASPORA*" public_feed: "Veřejný Diaspora feed %{name}" toggle: "přepnout mobilní stránku" @@ -601,14 +600,8 @@ cs: failure: error: "nastala chyba při připojení ke službě" finder: - friends: - few: "%{count} přátele" - many: "%{count} přátel" - one: "1 přítel" - other: "%{count} přátel" - zero: "žádní přátelé" - invite_your_friends_from: "Pozvěte vaše přátele z %{service}" - not_connected: "nepřipojen" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Připojit na Facebook" connect_to_tumblr: "Připojit na Tumblr" @@ -623,6 +616,7 @@ cs: join_me_on_diaspora: "Připoj se ke mě na DIASPORU*" remote_friend: invite: "pozvat" + not_on_diaspora: "Not yet on Diaspora" resend: "přeposlat" settings: "Nastavení" shared: diff --git a/config/locales/diaspora/cy.yml b/config/locales/diaspora/cy.yml index b222cdcba..970be678b 100644 --- a/config/locales/diaspora/cy.yml +++ b/config/locales/diaspora/cy.yml @@ -279,7 +279,6 @@ cy: to: "To" layouts: application: - have_a_problem: "Have a problem? Find an answer here" powered_by: "POWERED BY DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ cy: failure: error: "there was an error connecting that service" finder: - friends: - few: "%{count} friends" - many: "%{count} friends" - one: "1 friend" - other: "%{count} friends" - zero: "no friends" - invite_your_friends_from: "Invite your friends from %{service}" - not_connected: "not connected" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Connect to facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ cy: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "invite" + not_on_diaspora: "Not yet on Diaspora" resend: "resend" settings: "Settings" shared: diff --git a/config/locales/diaspora/da.yml b/config/locales/diaspora/da.yml index 1e4ae5490..7dad7e8c0 100644 --- a/config/locales/diaspora/da.yml +++ b/config/locales/diaspora/da.yml @@ -279,7 +279,6 @@ da: to: "Til" layouts: application: - have_a_problem: "Har du et problem? Find svaret her" powered_by: "POWERED BY DIASPORA*" public_feed: "Offentligt Diaspora nyheds feed for %{name}" toggle: "skift mobil side" @@ -601,14 +600,8 @@ da: failure: error: "der opstod en fejl i at forbinde til den service" finder: - friends: - few: "%{count} venner" - many: "%{count} venner" - one: "1 ven" - other: "%{count} venner" - zero: "ingen venner" - invite_your_friends_from: "inviter dine venner fra %{service}" - not_connected: "ikke forbundet" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Tilslut til Facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ da: join_me_on_diaspora: "Kom over til mig på DIASPORA*" remote_friend: invite: "inviter" + not_on_diaspora: "Not yet on Diaspora" resend: "Send igen" settings: "Indstillinger" shared: diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 654f6be17..ea290b8d7 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -279,7 +279,6 @@ de: to: "An" layouts: application: - have_a_problem: "Du hast ein Problem? Finde hier eine Antwort (Englisch)" powered_by: "BETRIEBEN MIT DIASPORA*" public_feed: "Öffentlicher Diaspora Feed von %{name}" toggle: "Mobile Ansicht umschalten" @@ -601,14 +600,8 @@ de: failure: error: "es gab einen Fehler beim Verbinden mit diesem Dienst" finder: - friends: - few: "%{count} Freunde" - many: "%{count} Freunde" - one: "Ein Freund" - other: "%{count} Freunde" - zero: "Keine Freunde" - invite_your_friends_from: "Lade deine Freunde von %{service} ein" - not_connected: "nicht verbunden" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Mit Facebook verbinden" connect_to_tumblr: "Mit Tumblr verbinden" @@ -623,6 +616,7 @@ de: join_me_on_diaspora: "Folge mir auf DIASPORA*" remote_friend: invite: "Einladen" + not_on_diaspora: "Not yet on Diaspora" resend: "Erneut senden" settings: "Einstellungen" shared: diff --git a/config/locales/diaspora/el.yml b/config/locales/diaspora/el.yml index eefca1033..8cf3c38b6 100644 --- a/config/locales/diaspora/el.yml +++ b/config/locales/diaspora/el.yml @@ -279,7 +279,6 @@ el: to: "Στον" layouts: application: - have_a_problem: "Έχετε κάποιο πρόβλημα; Βρείτε την απάντηση εδώ!" powered_by: "POWERED BY DIASPORA*" public_feed: "Δημόσια ανατροφοδότηση (feed) του Diaspora για τον χρήστη %{name}" toggle: "εναλλαγή ιστοσελίδας κινητού" @@ -601,14 +600,8 @@ el: failure: error: "εμφανίστηκε ένα σφάλμα κατά τη σύνδεση με αυτή την υπηρεσία" finder: - friends: - few: "%{count} φίλοι" - many: "%{count} φίλοι" - one: "1 φίλος" - other: "%{count} φίλοι" - zero: "κανένας φίλος" - invite_your_friends_from: "Προσκαλέστε τους φίλους σας απο %{service}" - not_connected: "δεν είναι συνδεδεμένο" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Σύνδεση με Facebook" connect_to_tumblr: "Σύνδεση με το Tumblr" @@ -623,6 +616,7 @@ el: join_me_on_diaspora: "Συνδεθείτε μαζί μου στο DIASPORA*" remote_friend: invite: "πρόσκληση" + not_on_diaspora: "Not yet on Diaspora" resend: "αποστολή ξανά" settings: "Ρυθμίσεις" shared: diff --git a/config/locales/diaspora/en_pirate.yml b/config/locales/diaspora/en_pirate.yml index f2bbc4bf1..e44cb4c25 100644 --- a/config/locales/diaspora/en_pirate.yml +++ b/config/locales/diaspora/en_pirate.yml @@ -279,7 +279,6 @@ en_pirate: to: "To" layouts: application: - have_a_problem: "Have a problem? Find an answer here" powered_by: "POWERED BY DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ en_pirate: failure: error: "there was an error connecting that service" finder: - friends: - few: "%{count} friends" - many: "%{count} friends" - one: "1 friend" - other: "%{count} friends" - zero: "no friends" - invite_your_friends_from: "Invite your friends from %{service}" - not_connected: "not connected" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Connect to Facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ en_pirate: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "invite" + not_on_diaspora: "Not yet on Diaspora" resend: "resend" settings: "Settings" shared: diff --git a/config/locales/diaspora/en_shaw.yml b/config/locales/diaspora/en_shaw.yml index 3de548884..4981a57b7 100644 --- a/config/locales/diaspora/en_shaw.yml +++ b/config/locales/diaspora/en_shaw.yml @@ -279,7 +279,6 @@ en_shaw: to: "𐑑" layouts: application: - have_a_problem: "𐑣𐑨𐑝 𐑩 𐑐𐑮𐑪𐑚𐑤𐑩𐑥, 𐑓𐑲𐑯𐑛 𐑩𐑯 𐑨𐑯𐑕𐑼 𐑣𐑽" powered_by: "𐑐𐑬𐑮𐑛 𐑚𐑲 ·𐑛𐑦𐑨𐑕𐑐𐑹𐑩*" public_feed: "𐑐𐑳𐑚𐑤𐑦𐑒 ·𐑛𐑦𐑨𐑕𐑐𐑹𐑩 𐑓𐑰𐑛 𐑓𐑹 %{name}" toggle: "𐑑𐑪𐑜𐑩𐑤 𐑥𐑴𐑚𐑩𐑤 𐑕𐑲𐑑" @@ -601,14 +600,8 @@ en_shaw: failure: error: "𐑞𐑺 𐑢𐑪𐑟 𐑩𐑯 𐑺𐑼 𐑒𐑩𐑯𐑧𐑒𐑑𐑦𐑙 𐑞𐑨𐑑 𐑕𐑻𐑝𐑩𐑕" finder: - friends: - few: "%{count} 𐑓𐑮𐑧𐑯𐑛𐑟" - many: "%{count} 𐑓𐑮𐑧𐑯𐑛𐑟" - one: "1 𐑓𐑮𐑧𐑯𐑛" - other: "%{count} 𐑓𐑮𐑧𐑯𐑛𐑟" - zero: "𐑯𐑴 𐑓𐑮𐑧𐑯𐑛𐑟" - invite_your_friends_from: "𐑦𐑯𐑝𐑲𐑑 𐑿𐑼 𐑓𐑮𐑧𐑯𐑛𐑟 𐑓𐑮𐑪𐑥 %{service}" - not_connected: "𐑯𐑪𐑑 𐑒𐑩𐑯𐑧𐑒𐑑𐑩𐑛" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "𐑒𐑩𐑯𐑧𐑒𐑑 𐑑 Facebook" connect_to_tumblr: "𐑒𐑩𐑯𐑧𐑒𐑑 𐑑 Tumblr" @@ -623,6 +616,7 @@ en_shaw: join_me_on_diaspora: "𐑡𐑶𐑯 𐑥𐑰 𐑪𐑯 ·𐑛𐑦𐑨𐑕𐑐𐑹𐑩*" remote_friend: invite: "𐑦𐑯𐑝𐑲𐑑" + not_on_diaspora: "Not yet on Diaspora" resend: "𐑮𐑦𐑕𐑧𐑯𐑛" settings: "𐑕𐑧𐑑𐑦𐑙𐑟" shared: diff --git a/config/locales/diaspora/eo.yml b/config/locales/diaspora/eo.yml index 2c37c46a6..82e0873b8 100644 --- a/config/locales/diaspora/eo.yml +++ b/config/locales/diaspora/eo.yml @@ -176,7 +176,7 @@ eo: create: failure: "Ne povis krei kontakton" featured: - featured_users: "Mojosaj Uzantoj" + featured_users: "Prezentataj Uzantoj" few: "%{count} kontaktoj" index: add_a_new_aspect: "Aldoni novan aspekton" @@ -279,7 +279,6 @@ eo: to: "Al" layouts: application: - have_a_problem: "Ĉu vi havas problemon? Trovu riparon tie ĉi." powered_by: "FUNKCIAS PER DIASPORA*" public_feed: "Publika DIASPORA* Afiŝostrio de %{name}" toggle: "inversigi al poŝtelefona retpaĝaro" @@ -601,17 +600,11 @@ eo: failure: error: "estis eraro, kiam ni provis konektigi tiun servon" finder: - friends: - few: "%{count} amikoj" - many: "%{count} amikoj" - one: "1 amiko" - other: "%{count} amikoj" - zero: "nul amikoj" - invite_your_friends_from: "Invitu viajn amikojn el %{service}" - not_connected: "ne ligita" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Ligi al Facebook" - connect_to_tumblr: "Konekti al Tumblr" + connect_to_tumblr: "Ligi al Tumblr" connect_to_twitter: "Ligi al Twitter" disconnect: "malkonekti" edit_services: "Redakti servojn" @@ -623,6 +616,7 @@ eo: join_me_on_diaspora: "Kuniĝu kun mi ĉe DIASPORA*" remote_friend: invite: "inviti" + not_on_diaspora: "Not yet on Diaspora" resend: "resendi" settings: "Agordoj" shared: @@ -753,31 +747,31 @@ eo: your_handle: "Via DIASPORA* uzantnomo" getting_started: aspects: "aspects" - connect_to: "Connect to" - connect_to_your_other_social_networks: "Connect to your other social networks" - connect_with_people: "Connect with cool people" + connect_to: "Ligi al" + connect_to_your_other_social_networks: "Ligi al viaj aliaj sociaj retoj" + connect_with_people: "Koniĝi kun mojosaj homoj" connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." - featured_tags: "Featured tags" - featured_users: "Featured users" - fill_out_your_profile: "Fill out your profile" - find_friends: "Find friends" - find_friends_from_facebook: "find friends from Facebook" - finished: "Finita!" - follow_your_interests: "Follow your interests" - hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." + featured_tags: "Prezentataj etikedoj" + featured_users: "Prezentataj uzantoj" + fill_out_your_profile: "Kompletigu vian profilon" + find_friends: "Trovi amikojn" + find_friends_from_facebook: "trovi amikojn per Facebook" + finished: "Finita" + follow_your_interests: "Aboni viajn interesigojn" + hashtag_explanation: "Etikedoj lasu vin pridiri kaj aboni viajn interesigojn. Ili ankaŭ estas bona metodo trovi novajn homojn ĉe DIASPORA*." profile_description: "Make it easier for people to find you by filling out your profile information." profile_fields: - bio: "Bio" - birthday: "Birthday" - gender: "Gender" - location: "Location" - name: "Name" - photo: "Photo" - tags: "Tags" - see_all_featured_users: "See all featured users" - welcome: "Bonvenon al DIASPORA*!" - welcome_with_name: "Welcome, %{name}!" + bio: "Pri vi" + birthday: "Naskiĝtago" + gender: "Sekso" + location: "Loko" + name: "Nomo" + photo: "Profilbildo" + tags: "Etikedoj" + see_all_featured_users: "Vidi ĉiujn prezentatajn uzantojn" + welcome: "Bonvenon!" + welcome_with_name: "Bonvenon, %{name}!" public: does_not_exist: "Uzanto %{username} ne ekzistas!" update: diff --git a/config/locales/diaspora/es-AR.yml b/config/locales/diaspora/es-AR.yml index ed5441dd4..0eb526af6 100644 --- a/config/locales/diaspora/es-AR.yml +++ b/config/locales/diaspora/es-AR.yml @@ -279,7 +279,6 @@ es-AR: to: "Para" layouts: application: - have_a_problem: "¿Tenés un problema? Encontrá una respuesta acá" powered_by: "IMPULSADO POR DIÁSPORA*" public_feed: "Canal público para %{name}" toggle: "cambiar al sitio para móviles" @@ -601,14 +600,8 @@ es-AR: failure: error: "hubo un error al conectar al servicio" finder: - friends: - few: "%{count} amigos" - many: "%{count} amigos" - one: "1 amigo" - other: "%{count} amigos" - zero: "ningún amigo" - invite_your_friends_from: "Invitá a tus amigos de %{service}" - not_connected: "sin conexión" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Conectar a Facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ es-AR: join_me_on_diaspora: "Unite, estoy en DIÁSPORA*" remote_friend: invite: "invitar" + not_on_diaspora: "Not yet on Diaspora" resend: "reenviar" settings: "Configuración" shared: diff --git a/config/locales/diaspora/es-CL.yml b/config/locales/diaspora/es-CL.yml index 297ce24c9..572643859 100644 --- a/config/locales/diaspora/es-CL.yml +++ b/config/locales/diaspora/es-CL.yml @@ -279,7 +279,6 @@ es-CL: to: "A" layouts: application: - have_a_problem: "¿Tienes un problema? Encuentra la respuesta aquí" powered_by: "POWERED BY DIASPORA*" public_feed: "Canal publico de %{name}" toggle: "cambiar sitio móvil" @@ -601,14 +600,8 @@ es-CL: failure: error: "ocurrió un error al conectarse con ese servicio" finder: - friends: - few: "%{count} amigo/s" - many: "%{count} amigos" - one: "1 Amigo" - other: "%{count} Amigos" - zero: "No tiene amigos" - invite_your_friends_from: "Invita a tus amigos de %{service}" - not_connected: "No Conectado" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Conectar a facebook" connect_to_tumblr: "Conectar a Tumblr" @@ -623,6 +616,7 @@ es-CL: join_me_on_diaspora: "Únete a mi en DIASPORA*" remote_friend: invite: "invitar" + not_on_diaspora: "Not yet on Diaspora" resend: "reenviar" settings: "Configuración" shared: diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index c44023865..1f887d3e0 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -37,7 +37,7 @@ es: person: invalid: "no es válido." username: - invalid: "is invalid. We only allow letters, numbers, and underscores" + invalid: "no es válido. Solo se permiten letras, números y guiones bajos" taken: "ya está ocupado." ago: "hace %{time} " all_aspects: "Todos los aspectos" @@ -118,7 +118,7 @@ es: content: "Ahora puedes enlazar los siguientes servicios a Diaspora*:" heading: "Servicios enlazados" tags_following: "Etiquetas" - unfollow_tag: "Stop following #%{tag}" + unfollow_tag: "Dejar de seguir a #%{tag}" your_aspects: "Tus Aspectos" many: "%{count} aspectos" move_contact: @@ -253,7 +253,7 @@ es: tagline_first_half: "Comparte lo que quieras, " tagline_second_half: "con quien te gustaría" invitations: - a_facebook_user: "A Facebook user" + a_facebook_user: "Un usuario de Facebook" check_token: not_found: "Identificación de invitación no encontrada" create: @@ -279,7 +279,6 @@ es: to: "Para" layouts: application: - have_a_problem: "¿Algún problema? Encuentra una solución aquí" powered_by: "IMPULSADO POR DIASPORA*" public_feed: "Canal público de %{name} " toggle: "cambiar al sitio móvil" @@ -393,7 +392,7 @@ es: other: "%{actors} comenzaron a compartir contigo." zero: "%{actors} comenzó a compartir contigo." notifier: - a_post_you_shared: "a post." + a_post_you_shared: "una publicación." click_here: "pulsa aquí" comment_on_post: reply: "Responder o ver los comentarios de %{name} >" @@ -474,7 +473,7 @@ es: fail: "Perdona, no pudimos encontrar %{handle}" zero: "ninguna persona" photos: - comment_email_subject: "%{name}'s photo" + comment_email_subject: "fotografía de %{name}" create: integrity_error: "Error subiendo la foto. ¿Seguro que era una imagen?" runtime_error: "Error subiendo la foto. ¿Alguna restricción de seguridad?" @@ -502,7 +501,7 @@ es: edit: "editar" edit_delete_photo: "Editar pie de foto / eliminar foto" make_profile_photo: "convertir en foto de perfil" - show_original_post: "Show original post" + show_original_post: "Muestra el comentario original" update_photo: "Actualizar foto" update: error: "Error editando la foto." @@ -578,7 +577,7 @@ es: new_request_to_person: sent: "¡Enviado!" reshares: - comment_email_subject: "%{resharer}'s reshare of %{author}'s post" + comment_email_subject: "%{resharer} a vuelto a compartir la publicación de %{author}" create: failure: "Ocurrió un error al volver a compartir este comentario." reshare: @@ -601,14 +600,8 @@ es: failure: error: "hubo un error conectando ese servicio" finder: - friends: - few: "%{count} amigos" - many: "%{count} amigos" - one: "1 amigo" - other: "%{count} amigos" - zero: "no hay amigos" - invite_your_friends_from: "Invita a tus amigos desde %{service}" - not_connected: "no conectado" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Conecta con Facebook" connect_to_tumblr: "Conecta con Tumblr" @@ -623,6 +616,7 @@ es: join_me_on_diaspora: "Comparte conmigo en DIASPORA*." remote_friend: invite: "invitar" + not_on_diaspora: "Not yet on Diaspora" resend: "reenviar" settings: "Configuración" shared: @@ -752,12 +746,12 @@ es: your_email: "Tu email" your_handle: "Tu dirección Diaspora*" getting_started: - aspects: "aspects" + aspects: "aspectos" connect_to: "Conectar a" connect_to_your_other_social_networks: "Conéctate a tus otras redes sociales" connect_with_people: "Conectate con gente interesante" - connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" - connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Comparte con gente añadiéndola en uno o más de tus" + connect_with_people_explanation_pt2: "Los Aspectos son una manera intuitiva de agrupar contactos nuevos o caras familiares, de forma privada, permitiéndote el filtrado o compartir cosas con subgrupos de entre tus contactos muy fácilmente." featured_tags: "Etiquetas ofrecidas" featured_users: "Usuarios ofrecidos" fill_out_your_profile: "" diff --git a/config/locales/diaspora/eu.yml b/config/locales/diaspora/eu.yml index 0e75a5e78..d3e501ee7 100644 --- a/config/locales/diaspora/eu.yml +++ b/config/locales/diaspora/eu.yml @@ -279,7 +279,6 @@ eu: to: "Jasotzailea:" layouts: application: - have_a_problem: "Arazoren bat? Aurkitu erantzuna hemen" powered_by: "DIASPORAK ESKAINIA" public_feed: "%{name}(r)en Diaspora Feed publikoa" toggle: "aldatu mugikorreko orrialdera" @@ -601,14 +600,8 @@ eu: failure: error: "huts zerbitzu hori konektatzean" finder: - friends: - few: "%{count} adiskide" - many: "%{count} adiskide" - one: "adiskide 1" - other: "%{count} adiskide" - zero: "adiskiderik ez" - invite_your_friends_from: "Gonbidatu lagunak %{service}(e)tik" - not_connected: "harremanik ez" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Facebookera lotu" connect_to_tumblr: "Tumblrera lotu" @@ -623,6 +616,7 @@ eu: join_me_on_diaspora: "Bat egin nirekin DIASPORAN" remote_friend: invite: "gonbidapena" + not_on_diaspora: "Not yet on Diaspora" resend: "berbidali" settings: "Lehentasunak" shared: diff --git a/config/locales/diaspora/fi.yml b/config/locales/diaspora/fi.yml index 89dc3f1e6..884df5c55 100644 --- a/config/locales/diaspora/fi.yml +++ b/config/locales/diaspora/fi.yml @@ -279,7 +279,6 @@ fi: to: "Vastaanottaja" layouts: application: - have_a_problem: "Ongelmia? Löydä ratkaisu täältä" powered_by: "PALVELUN TARJOAA DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "vaihda mobiili sivustoon" @@ -601,14 +600,8 @@ fi: failure: error: "palvelun yhdistämisessä tapahtui virhe" finder: - friends: - few: "%{count} ystävää" - many: "%{count} kaveria" - one: "1 ystävä" - other: "%{count} ystävää" - zero: "ei ystäviä" - invite_your_friends_from: "Kutsu ystäväsi palvelusta %{service}" - not_connected: "ei yhdistetty" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Yhdistä palveluun facebook" connect_to_tumblr: "Yhdistä Tumblr:iin" @@ -623,6 +616,7 @@ fi: join_me_on_diaspora: "DIASPORA* kutsuu!" remote_friend: invite: "kutsu" + not_on_diaspora: "Not yet on Diaspora" resend: "lähetä uudelleen" settings: "Asetukset" shared: diff --git a/config/locales/diaspora/fr.yml b/config/locales/diaspora/fr.yml index 7da48a69f..edb0d71d1 100644 --- a/config/locales/diaspora/fr.yml +++ b/config/locales/diaspora/fr.yml @@ -279,7 +279,6 @@ fr: to: "À" layouts: application: - have_a_problem: "Un problème ? Trouvez une réponse ici" powered_by: "PROPULSÉ PAR DIASPORA*" public_feed: "Flux Diaspora public pour %{name}" toggle: "activer/désactiver le site mobile" @@ -601,14 +600,8 @@ fr: failure: error: "une erreur s'est produite lors de la connexion avec ce service" finder: - friends: - few: "%{count} amis" - many: "%{count} amis" - one: "1 ami" - other: "%{count} amis" - zero: "aucun ami" - invite_your_friends_from: "Inviter vos amis depuis %{service}" - not_connected: "non connecté" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Connecter à Facebook" connect_to_tumblr: "Connecter à Tumblr" @@ -623,6 +616,7 @@ fr: join_me_on_diaspora: "Rejoignez-moi sur DIASPORA*" remote_friend: invite: "inviter" + not_on_diaspora: "Not yet on Diaspora" resend: "envoyer à nouveau" settings: "Options" shared: diff --git a/config/locales/diaspora/ga.yml b/config/locales/diaspora/ga.yml index 3fa00c603..ea2d747a4 100644 --- a/config/locales/diaspora/ga.yml +++ b/config/locales/diaspora/ga.yml @@ -279,7 +279,6 @@ ga: to: "Go dtí" layouts: application: - have_a_problem: "Have a problem? Find an answer here" powered_by: "AG ÚSÁID DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ ga: failure: error: "bhí earráid ag nasc leis an seirbhís sin" finder: - friends: - few: "%{count} friends" - many: "%{count} friends" - one: "1 friend" - other: "%{count} friends" - zero: "no friends" - invite_your_friends_from: "Invite your friends from %{service}" - not_connected: "not connected" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Nasc le facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ ga: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "invite" + not_on_diaspora: "Not yet on Diaspora" resend: "resend" settings: "Socraithe" shared: diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 79a3f5efc..20f729748 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -279,7 +279,6 @@ he: to: "אל" layouts: application: - have_a_problem: "נתקלת בבעיות? ניתן למצוא את התשובה להלן" powered_by: "מופעל על גבי דיאספורה*" public_feed: "הזנת דיאספורה ציבורית עבור %{name}" toggle: "הפעלה/נטרול האתר לניידים" @@ -601,14 +600,8 @@ he: failure: error: "אירעה שגיאה בעת ההתחברות לשירות זה" finder: - friends: - few: "%{count} חברים" - many: "%{count} חברים" - one: "חבר אחד" - other: "%{count} חברים" - zero: "אין חברים" - invite_your_friends_from: "הזמנת החברים שלך מ־%{service}" - not_connected: "לא מחובר" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "התחברות לפייסבוק" connect_to_tumblr: "התחברות ל־Tumblr" @@ -623,6 +616,7 @@ he: join_me_on_diaspora: "למה שלא להצטרף אלי ב־DIASPORA*" remote_friend: invite: "הזמנה" + not_on_diaspora: "Not yet on Diaspora" resend: "שליחה שוב" settings: "הגדרות" shared: diff --git a/config/locales/diaspora/hu.yml b/config/locales/diaspora/hu.yml index f0ccd4664..adf661cc8 100644 --- a/config/locales/diaspora/hu.yml +++ b/config/locales/diaspora/hu.yml @@ -279,7 +279,6 @@ hu: to: "Címzett" layouts: application: - have_a_problem: "Problémád van?" powered_by: "DIASPORA* fordította ADAMEX" public_feed: "Nyílvános Diaspora hírfolyam neki: %{name}" toggle: "mobil változat" @@ -601,14 +600,8 @@ hu: failure: error: "Hiba történt a szolgáltatáshoz kapcsolódás közben" finder: - friends: - few: "%{count} barát" - many: "%{count} barát" - one: "1 barát" - other: "%{count} barát" - zero: "itt nincs barátod" - invite_your_friends_from: "Hívd meg a barátaidat innen: %{service}" - not_connected: "nem kapcsolódik" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Csatlakozás facebook-hoz" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ hu: join_me_on_diaspora: "Találkozzunk a DIASPORA*-n" remote_friend: invite: "meghív" + not_on_diaspora: "Not yet on Diaspora" resend: "újraküld" settings: "Beállítások" shared: diff --git a/config/locales/diaspora/id.yml b/config/locales/diaspora/id.yml index 9c49f6840..bcc7c391a 100644 --- a/config/locales/diaspora/id.yml +++ b/config/locales/diaspora/id.yml @@ -279,7 +279,6 @@ id: to: "To" layouts: application: - have_a_problem: "Have a problem? Find an answer here" powered_by: "POWERED BY DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ id: failure: error: "there was an error connecting that service" finder: - friends: - few: "%{count} friends" - many: "%{count} friends" - one: "1 friend" - other: "%{count} friends" - zero: "no friends" - invite_your_friends_from: "Invite your friends from %{service}" - not_connected: "not connected" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Connect to facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ id: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "invite" + not_on_diaspora: "Not yet on Diaspora" resend: "resend" settings: "Settings" shared: diff --git a/config/locales/diaspora/is.yml b/config/locales/diaspora/is.yml index 07de3151f..e1c7bb8b3 100644 --- a/config/locales/diaspora/is.yml +++ b/config/locales/diaspora/is.yml @@ -279,7 +279,6 @@ is: to: "Til" layouts: application: - have_a_problem: "Have a problem? Find an answer here" powered_by: "DÍASPORA* STJÓRNAR HÉR" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ is: failure: error: "villa kom upp við að tengjast þeirri þjónustu" finder: - friends: - few: "%{count} vinir" - many: "%{count} friends" - one: "1 vinur" - other: "%{count} vinir" - zero: "engir vinir" - invite_your_friends_from: "Bjóddu vinum þínum frá %{service}" - not_connected: "ekki tengt" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Tengja við facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ is: join_me_on_diaspora: "Tengstu mér á DIASPORA*" remote_friend: invite: "bjóða" + not_on_diaspora: "Not yet on Diaspora" resend: "endursenda" settings: "Stillingar" shared: diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index d3fbfe163..c00999fe5 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -37,7 +37,7 @@ it: person: invalid: "non è valido." username: - invalid: "is invalid. We only allow letters, numbers, and underscores" + invalid: "non è valido. Sono permessi solamente lettere, numeri e underscore" taken: "è già stato preso." ago: "%{time} fa" all_aspects: "Tutti gli aspetti" @@ -118,7 +118,7 @@ it: content: "Puoi abbinare a Diaspora i seguenti servizi:" heading: "Servizi connessi" tags_following: "Tag che segui" - unfollow_tag: "Stop following #%{tag}" + unfollow_tag: "Smetti di seguire #%{tag}" your_aspects: "I tuoi aspetti" many: "%{count} aspetti" move_contact: @@ -253,7 +253,7 @@ it: tagline_first_half: "Condividi ciò che desideri," tagline_second_half: "con chi vuoi." invitations: - a_facebook_user: "A Facebook user" + a_facebook_user: "Un utente Facebook" check_token: not_found: "Token di invito non trovato" create: @@ -279,7 +279,6 @@ it: to: "A" layouts: application: - have_a_problem: "Hai un problema? Trova qui la soluzione" powered_by: "CREATO CON DIASPORA*" public_feed: "Feed pubblici Diaspora di %{name}" toggle: "attiva/disattiva sito mobile" @@ -393,7 +392,7 @@ it: other: "%{actors} hanno iniziato a condividere con te." zero: "%{actors} ha iniziato a condividere con te." notifier: - a_post_you_shared: "a post." + a_post_you_shared: "un post." click_here: "clicca qui" comment_on_post: reply: "Rispondi o leggi il post di %{name} >" @@ -474,7 +473,7 @@ it: fail: "Spiacenti, non possiamo trovare %{handle}." zero: "nessuna persona" photos: - comment_email_subject: "%{name}'s photo" + comment_email_subject: "La foto di %{name}" create: integrity_error: "Il caricamento della foto non è riuscito. Sei sicuro che fosse un'immagine?" runtime_error: "La fotografia non si è caricata. Hai dimenticato forse di allacciare la cintura?" @@ -502,7 +501,7 @@ it: edit: "modifica" edit_delete_photo: "Modifica descrizione della foto / elimina foto" make_profile_photo: "usa come immagine del profilo" - show_original_post: "Show original post" + show_original_post: "Mostra il post originale" update_photo: "Aggiorna Foto" update: error: "Modifica della foto fallita." @@ -578,7 +577,7 @@ it: new_request_to_person: sent: "richiesta inviata!" reshares: - comment_email_subject: "%{resharer}'s reshare of %{author}'s post" + comment_email_subject: "La condivisione di %{resharer} del post di %{author}" create: failure: "C'è stato un errore nel condividere questo post." reshare: @@ -601,14 +600,8 @@ it: failure: error: "si è verificato un errore durante la connessione a quel servizio" finder: - friends: - few: "%{count} amici" - many: "%{count} amici" - one: "1 amico" - other: "%{count} amici" - zero: "nessun amico" - invite_your_friends_from: "Invita i tuoi amici da %{service}" - not_connected: "non connesso" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Connettiti a Facebook" connect_to_tumblr: "Connettiti a Tumblr" @@ -623,6 +616,7 @@ it: join_me_on_diaspora: "Vieni anche tu su DIASPORA*" remote_friend: invite: "invita" + not_on_diaspora: "Not yet on Diaspora" resend: "reinvia" settings: "Impostazioni" shared: @@ -752,12 +746,12 @@ it: your_email: "La tua email" your_handle: "Il tuo ID" getting_started: - aspects: "aspects" + aspects: "aspetti" connect_to: "Connettiti a" connect_to_your_other_social_networks: "Connetti altri social network" connect_with_people: "Connettiti con gente speciale" - connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" - connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Stai in contatto con le persone mettendole in uno o più dei tuoi " + connect_with_people_explanation_pt2: "Gli aspetti sono un sistema intuitivo per raggruppare vecchie e nuove conoscenze in modo riservato, così potrai filtrare o condividere i contenuti con chi vuoi e con facilità." featured_tags: "Tag consigliati" featured_users: "Utenti consigliati" fill_out_your_profile: "Riempi il tuo profilo" diff --git a/config/locales/diaspora/ja.yml b/config/locales/diaspora/ja.yml index 6fde4f542..c1e66a757 100644 --- a/config/locales/diaspora/ja.yml +++ b/config/locales/diaspora/ja.yml @@ -279,7 +279,6 @@ ja: to: "宛先:" layouts: application: - have_a_problem: "質問がありましたら、ここからアンサーを" powered_by: "POWERED BY DIASPORA*" public_feed: "%{name}さんの公開ダイアスポラフィード" toggle: "携帯サイトを切替える" @@ -601,14 +600,8 @@ ja: failure: error: "サービスへ接続中にエラーが発生しました。" finder: - friends: - few: "%{count}人の連絡先" - many: "%{count}人の連絡先" - one: "1人の連絡先" - other: "%{count}人の連絡先" - zero: "連絡先無し" - invite_your_friends_from: "%{service}の連絡先を招待する" - not_connected: "未接続" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Facebookに接続する" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ ja: join_me_on_diaspora: "ダイアスポラ*に参加しませんか。" remote_friend: invite: "招待" + not_on_diaspora: "Not yet on Diaspora" resend: "再送" settings: "設定" shared: diff --git a/config/locales/diaspora/ko.yml b/config/locales/diaspora/ko.yml index 4f2c50137..d7eda5caf 100644 --- a/config/locales/diaspora/ko.yml +++ b/config/locales/diaspora/ko.yml @@ -37,7 +37,7 @@ ko: person: invalid: "유효하지 않습니다." username: - invalid: "is invalid. We only allow letters, numbers, and underscores" + invalid: ": 유효하지 않은 사용자명입니다. 로마자, 아라비아 숫자, 언더스코어만 쓸 수 있습니다" taken: "이미 쓰이고 있습니다." ago: "%{time} 전" all_aspects: "모든 애스펙" @@ -118,7 +118,7 @@ ko: content: "다음의 여러 서비스를 디아스포라에 연결할 수 있습니다" heading: "서비스 연결" tags_following: "팔로우된 태그들" - unfollow_tag: "Stop following #%{tag}" + unfollow_tag: "#%{tag} 태그 팔로우 멈추기" your_aspects: "내 애스펙" many: "애스펙 %{count}개" move_contact: @@ -253,7 +253,7 @@ ko: tagline_first_half: "Share what you want," tagline_second_half: "with whom you want." invitations: - a_facebook_user: "A Facebook user" + a_facebook_user: "페이스북 사욤자" check_token: not_found: "초대장 토큰을 찾을 수 없습니다" create: @@ -279,7 +279,6 @@ ko: to: "받는이" layouts: application: - have_a_problem: "문제가 있습니까? 여기서 해결하세요" powered_by: "디아스포라* 제공" public_feed: "%{name}님의 공개 디아스포라 피드" toggle: "모바일 사이트 전환" @@ -393,7 +392,7 @@ ko: other: "%{actors}님이 나와 공유를 시작했습니다." zero: "%{actors}님이 나와 공유를 시작했습니다." notifier: - a_post_you_shared: "a post." + a_post_you_shared: "공유물" click_here: "여기를 클릭하세요" comment_on_post: reply: "%{name}님의 공유물에 댓글달기 >" @@ -474,7 +473,7 @@ ko: fail: "%{handle} 핸들을 찾을 수 없습니다." zero: "없음" photos: - comment_email_subject: "%{name}'s photo" + comment_email_subject: "%{name}님의 사진" create: integrity_error: "사진 업로드할 수 없습니다. 이미지가 맞습니까?" runtime_error: "사진을 업로드할 수 없습니다. 안전벨트를 확인하셨습니까?" @@ -502,7 +501,7 @@ ko: edit: "고치기" edit_delete_photo: "사진 설명 고치기 / 사진 지우기" make_profile_photo: "프로필 사진 만들기" - show_original_post: "Show original post" + show_original_post: "원래 공유물 보기" update_photo: "사진 갱신" update: error: "사진 고치기 실패." @@ -578,7 +577,7 @@ ko: new_request_to_person: sent: "보냈습니다." reshares: - comment_email_subject: "%{resharer}'s reshare of %{author}'s post" + comment_email_subject: "%{resharer}님이 재공유한 %{author}님의 공유물" create: failure: "이 공유물을 재공유하는데 오류가 발생했습니다." reshare: @@ -601,14 +600,8 @@ ko: failure: error: "서비스 연결중 에러가 발생했습니다." finder: - friends: - few: "친구 %{count}명" - many: "친구 %{count}명" - one: "친구 한 명" - other: "친구 %{count}명" - zero: "친구 없음" - invite_your_friends_from: "%{service} 서비스에서 친구 초대하기" - not_connected: "연결 없음" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "페이스북에 연결" connect_to_tumblr: "Tumblr에 연결하기" @@ -623,6 +616,7 @@ ko: join_me_on_diaspora: "디아스포라*에서 만나요!" remote_friend: invite: "초대하기" + not_on_diaspora: "Not yet on Diaspora" resend: "다시 보내기" settings: "설정" shared: @@ -752,7 +746,7 @@ ko: your_email: "이메일 주소" your_handle: "디아스포라 핸들" getting_started: - aspects: "aspects" + aspects: "애스펙" connect_to: "연결하기:" connect_to_your_other_social_networks: "내 다른 소셜네트워크와 연결하기" connect_with_people: "멋진 사람들과 연결하기" diff --git a/config/locales/diaspora/lt.yml b/config/locales/diaspora/lt.yml index 9650002d0..651fae359 100644 --- a/config/locales/diaspora/lt.yml +++ b/config/locales/diaspora/lt.yml @@ -279,7 +279,6 @@ lt: to: "Kam" layouts: application: - have_a_problem: "Have a problem? Find an answer here" powered_by: "TINKLAPĮ LEIDŽIA DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ lt: failure: error: "there was an error connecting that service" finder: - friends: - few: "%{count} friends" - many: "%{count} friends" - one: "1 friend" - other: "%{count} friends" - zero: "no friends" - invite_your_friends_from: "Invite your friends from %{service}" - not_connected: "not connected" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Prijungti facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ lt: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "invite" + not_on_diaspora: "Not yet on Diaspora" resend: "resend" settings: "Nustatymai" shared: diff --git a/config/locales/diaspora/mk.yml b/config/locales/diaspora/mk.yml index d7fff01bb..cb9000274 100644 --- a/config/locales/diaspora/mk.yml +++ b/config/locales/diaspora/mk.yml @@ -279,7 +279,6 @@ mk: to: "До" layouts: application: - have_a_problem: "Have a problem? Find an answer here" powered_by: "POWERED BY DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ mk: failure: error: "there was an error connecting that service" finder: - friends: - few: "%{count} friends" - many: "%{count} friends" - one: "1 friend" - other: "%{count} friends" - zero: "no friends" - invite_your_friends_from: "Invite your friends from %{service}" - not_connected: "not connected" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Конектирај се со facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ mk: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "invite" + not_on_diaspora: "Not yet on Diaspora" resend: "resend" settings: "Подесувања" shared: diff --git a/config/locales/diaspora/nb.yml b/config/locales/diaspora/nb.yml index 385d7a68a..d58c8126c 100644 --- a/config/locales/diaspora/nb.yml +++ b/config/locales/diaspora/nb.yml @@ -279,7 +279,6 @@ nb: to: "Til" layouts: application: - have_a_problem: "Har du et problem? Få svar her" powered_by: "DREVET AV DIASPORA*" public_feed: "Offentlig Diaspora feed for %{name}" toggle: "vis mobilsiden" @@ -601,14 +600,8 @@ nb: failure: error: "feil under tilkobling av tjenesten" finder: - friends: - few: "%{count} venner" - many: "%{count} venner" - one: "1 venn" - other: "%{count} venner" - zero: "ingen venner" - invite_your_friends_from: "Inviter dine venner fra %{service}" - not_connected: "ikke tilkoblet" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Koble til facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ nb: join_me_on_diaspora: "Bli med meg på DIASPORA*" remote_friend: invite: "inviter" + not_on_diaspora: "Not yet on Diaspora" resend: "send på nytt" settings: "Innstillinger" shared: diff --git a/config/locales/diaspora/nl.yml b/config/locales/diaspora/nl.yml index 6564cac29..d3fa545ab 100644 --- a/config/locales/diaspora/nl.yml +++ b/config/locales/diaspora/nl.yml @@ -279,7 +279,6 @@ nl: to: "Aan" layouts: application: - have_a_problem: "Probleem? Vind hier een antwoord" powered_by: "POWERED BY DIASPORA*" public_feed: "Publieke Diaspora Feed van %{name}" toggle: "switch mobiele versie" @@ -601,14 +600,8 @@ nl: failure: error: "er ging iets mis bij het verbinden met die service" finder: - friends: - few: "%{count} contacten" - many: "%{count} vrienden" - one: "1 contact" - other: "%{count} contacten" - zero: "geen contacten" - invite_your_friends_from: "Nodig je %{service} contacten uit" - not_connected: "niet verbonden" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Verbind met Facebook" connect_to_tumblr: "Verbind met Tumblr" @@ -623,6 +616,7 @@ nl: join_me_on_diaspora: "Volg me op DIASPORA*" remote_friend: invite: "uitnodigen" + not_on_diaspora: "Not yet on Diaspora" resend: "herstuur" settings: "Instellingen" shared: diff --git a/config/locales/diaspora/pa.yml b/config/locales/diaspora/pa.yml index ed09ce5e7..acbfdc92d 100644 --- a/config/locales/diaspora/pa.yml +++ b/config/locales/diaspora/pa.yml @@ -279,7 +279,6 @@ pa: to: "To" layouts: application: - have_a_problem: "ਕੋਈ ਸਮੱਸਿਆ ਹੈ? ਹੱਲ਼ ਇੱਥੇ ਲੱਭੋ।" powered_by: "POWERED BY DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ pa: failure: error: "there was an error connecting that service" finder: - friends: - few: "%{count} friends" - many: "%{count} friends" - one: "1 friend" - other: "%{count} friends" - zero: "no friends" - invite_your_friends_from: "Invite your friends from %{service}" - not_connected: "not connected" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "ਫੇਸਬੁੱਕ ਨਾਲ ਕੁਨੈਕਟ ਕਰੋ" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ pa: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "ਸੱਦਾ" + not_on_diaspora: "Not yet on Diaspora" resend: "ਮੁੜ-ਭੇਜੋ" settings: "Settings" shared: diff --git a/config/locales/diaspora/pl.yml b/config/locales/diaspora/pl.yml index 6311ab7ed..9f6990eb7 100644 --- a/config/locales/diaspora/pl.yml +++ b/config/locales/diaspora/pl.yml @@ -279,7 +279,6 @@ pl: to: "Do" layouts: application: - have_a_problem: "Masz problem? Tu znajdziesz rozwiązanie" powered_by: "POWERED BY DIASPORA*" public_feed: "Publiczny kanał Diaspory użytkownika %{name}" toggle: "przełącz widok mobilny" @@ -601,14 +600,8 @@ pl: failure: error: "wystąpił błąd podczas łączenia z tą usługą" finder: - friends: - few: "%{count} znajomych" - many: "%{count} znajomych" - one: "1 znajomy" - other: "%{count} znajomych" - zero: "żadnych znajomych" - invite_your_friends_from: "Zaproś swoich znajomych z serwisu %{service}" - not_connected: "nie połączono" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Połącz z Facebookiem" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ pl: join_me_on_diaspora: "Dołącz do mnie w serwisie DIASPORA*" remote_friend: invite: "zaproś" + not_on_diaspora: "Not yet on Diaspora" resend: "wyślij ponownie" settings: "Ustawienia" shared: diff --git a/config/locales/diaspora/pt-BR.yml b/config/locales/diaspora/pt-BR.yml index 148aed6f9..a1d866b60 100644 --- a/config/locales/diaspora/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -279,7 +279,6 @@ pt-BR: to: "Para" layouts: application: - have_a_problem: "Problemas? Encontre sua resposta aqui." powered_by: "POWERED BY DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ pt-BR: failure: error: "Ocorreu um erro ao conectar a esse serviço" finder: - friends: - few: "%{count} amigos" - many: "%{count} friends" - one: "1 amigo" - other: "%{count} amigos" - zero: "nenhum amigo" - invite_your_friends_from: "Convide seus amigos de %{service}" - not_connected: "desconectado" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Conectar com o Facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ pt-BR: join_me_on_diaspora: "Junte-se a mim na DIASPORA*" remote_friend: invite: "Convidar" + not_on_diaspora: "Not yet on Diaspora" resend: "Reenviar" settings: "Configurações" shared: diff --git a/config/locales/diaspora/pt-PT.yml b/config/locales/diaspora/pt-PT.yml index 19ec8b7fe..40d992571 100644 --- a/config/locales/diaspora/pt-PT.yml +++ b/config/locales/diaspora/pt-PT.yml @@ -279,7 +279,6 @@ pt-PT: to: "Para" layouts: application: - have_a_problem: "Tem um problema? Encontre uma resposta aqui" powered_by: "POWERED BY DIASPORA*" public_feed: "Fonte Pública do Diaspora para %{name}" toggle: "ligar site móvel" @@ -601,14 +600,8 @@ pt-PT: failure: error: "ocorreu um erro ao ligar a esse serviço" finder: - friends: - few: "%{count} amigos" - many: "%{count} amigos" - one: "1 amigo" - other: "%{count} amigos" - zero: "nenhum amigo" - invite_your_friends_from: "Convide os seus amigos do %{service}" - not_connected: "desligado" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Ligar ao Facebook" connect_to_tumblr: "Ligar ao Tumblr" @@ -623,6 +616,7 @@ pt-PT: join_me_on_diaspora: "Junte-se a mim no DIASPORA*" remote_friend: invite: "convite" + not_on_diaspora: "Not yet on Diaspora" resend: "reenviar" settings: "Definições" shared: diff --git a/config/locales/diaspora/ro.yml b/config/locales/diaspora/ro.yml index 9e37b28b8..459610042 100644 --- a/config/locales/diaspora/ro.yml +++ b/config/locales/diaspora/ro.yml @@ -279,7 +279,6 @@ ro: to: "Pentru" layouts: application: - have_a_problem: "Ai o problemă? Găseşte un răspuns aici" powered_by: "POWERED BY DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ ro: failure: error: "there was an error connecting that service" finder: - friends: - few: "%{count} prieteni" - many: "%{count} friends" - one: "1 prieten" - other: "%{count} prieteni" - zero: "nici un prieten" - invite_your_friends_from: "Invite your friends from %{service}" - not_connected: "nu este conectat" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Conectează cu Facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ ro: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "invite" + not_on_diaspora: "Not yet on Diaspora" resend: "resend" settings: "Setări" shared: diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index e462b6422..4100519db 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -279,7 +279,6 @@ ru: to: "Для" layouts: application: - have_a_problem: "Столкнулись с проблемой? Попробуйте найти ответ здесь" powered_by: "ПОДДЕРЖИВАЕТСЯ ДИАСПОРОЙ*" public_feed: "Общественный канал диаспоры для %{name}" toggle: "переключить на мобильный сайт" @@ -601,14 +600,8 @@ ru: failure: error: "Произошла ошибка при подключении этого сервиса" finder: - friends: - few: "%{count} друг[-а, -зей]" - many: "%{count} друга[-зей]" - one: "1 друг" - other: "%{count} друг[-а, -зей]" - zero: "нет друзей" - invite_your_friends_from: "Пригласить своих друзей из %{service}" - not_connected: "не соединён" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Подключение к Facebook" connect_to_tumblr: "Подключение к Tumblr" @@ -623,6 +616,7 @@ ru: join_me_on_diaspora: "Присоединяйтесь ко мне в DIASPORЕ*" remote_friend: invite: "приглашение" + not_on_diaspora: "Not yet on Diaspora" resend: "отправить повторно" settings: "Настройки" shared: diff --git a/config/locales/diaspora/sk.yml b/config/locales/diaspora/sk.yml index d874c6335..6c0793d88 100644 --- a/config/locales/diaspora/sk.yml +++ b/config/locales/diaspora/sk.yml @@ -279,7 +279,6 @@ sk: to: "Komu" layouts: application: - have_a_problem: "Máte problém? Nájdite odpoveď tu" powered_by: "POWERED BY DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "Zapnúť mobilné zobrazenie" @@ -601,14 +600,8 @@ sk: failure: error: "Pripojenie k službe zlyhalo." finder: - friends: - few: "Počet priateľov %{count}" - many: "%{count} friends" - one: "1 priateľ" - other: "Počet priateľov : %{count} " - zero: "žiadni priatelia" - invite_your_friends_from: "Pozvite svojich priateľov z %{service}" - not_connected: "nepripojený" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Pripojiť k Facebooku" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ sk: join_me_on_diaspora: "Pridať sa k službe DIASPORA*" remote_friend: invite: "pozvať" + not_on_diaspora: "Not yet on Diaspora" resend: "preposlať" settings: "Nastavenia" shared: diff --git a/config/locales/diaspora/sl.yml b/config/locales/diaspora/sl.yml index ae2e7a4d8..56a09e64c 100644 --- a/config/locales/diaspora/sl.yml +++ b/config/locales/diaspora/sl.yml @@ -279,7 +279,6 @@ sl: to: "Za" layouts: application: - have_a_problem: "Ste naleteli na težavo? Tukaj poiščite odgovor" powered_by: "STRAN POGANJA DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ sl: failure: error: "pri povezovanju s servisom je prišlo do napake" finder: - friends: - few: "%{count} prijateljev" - many: "%{count} friends" - one: "1 prijatelj" - other: "%{count} prijateljev" - zero: "brez prijateljev" - invite_your_friends_from: "Povabi prijatelje iz %{service}" - not_connected: "ni povezano" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Poveži se s facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ sl: join_me_on_diaspora: "Pridruži se mi na DIASPORI*" remote_friend: invite: "povabi" + not_on_diaspora: "Not yet on Diaspora" resend: "pošlji ponovno" settings: "Nastavitve" shared: diff --git a/config/locales/diaspora/sv.yml b/config/locales/diaspora/sv.yml index 9c538674f..fca6707bc 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -279,7 +279,6 @@ sv: to: "Till" layouts: application: - have_a_problem: "Stött på problem? Hitta lösningen här" powered_by: "POWERED BY DIASPORA*" public_feed: "Offentligt Diaspora flöde för %{name}" toggle: "byt till mobil version" @@ -601,14 +600,8 @@ sv: failure: error: "Det blev ett fel vid anslutning till tjänsten" finder: - friends: - few: "%{count} vänner" - many: "%{count} vänner" - one: "1 vän" - other: "%{count} vänner" - zero: "inga vänner" - invite_your_friends_from: "Bjud in dina vänner från %{service}" - not_connected: "inte ansluten" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "Anslut till facebook" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ sv: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "bjud in" + not_on_diaspora: "Not yet on Diaspora" resend: "skicka igen" settings: "Inställningar" shared: diff --git a/config/locales/diaspora/tr.yml b/config/locales/diaspora/tr.yml index 9542135b4..009a31aa5 100644 --- a/config/locales/diaspora/tr.yml +++ b/config/locales/diaspora/tr.yml @@ -279,7 +279,6 @@ tr: to: "To" layouts: application: - have_a_problem: "Have a problem? Find an answer here" powered_by: "POWERED BY DIASPORA*" public_feed: "Public Diaspora Feed for %{name}" toggle: "toggle mobile site" @@ -601,14 +600,8 @@ tr: failure: error: "there was an error connecting that service" finder: - friends: - few: "%{count} friends" - many: "%{count} friends" - one: "1 friend" - other: "%{count} friends" - zero: "no friends" - invite_your_friends_from: "Invite your friends from %{service}" - not_connected: "not connected" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "facebook bağlan" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ tr: join_me_on_diaspora: "Join me on DIASPORA*" remote_friend: invite: "invite" + not_on_diaspora: "Not yet on Diaspora" resend: "resend" settings: "Ayarlar" shared: diff --git a/config/locales/diaspora/zh-CN.yml b/config/locales/diaspora/zh-CN.yml index 10c774ab6..5e50b455c 100644 --- a/config/locales/diaspora/zh-CN.yml +++ b/config/locales/diaspora/zh-CN.yml @@ -279,7 +279,6 @@ zh-CN: to: "收件人" layouts: application: - have_a_problem: "遇到问题?在这里可以找到解决方案" powered_by: "Powered by DIASPORA*" public_feed: "%{name} 的 Diaspora RSS Feed" toggle: "切换为手机网页" @@ -601,14 +600,8 @@ zh-CN: failure: error: "与该服务连接时有错误" finder: - friends: - few: "%{count}个朋友" - many: "%{count}个朋友" - one: "1个朋友" - other: "%{count}个朋友" - zero: "没有朋友" - invite_your_friends_from: "邀请您在 %{service} 的朋友" - not_connected: "未连接" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "与 facebook 连接" connect_to_tumblr: "Connect to Tumblr" @@ -623,6 +616,7 @@ zh-CN: join_me_on_diaspora: "跟我一起加入 DIASPORA*" remote_friend: invite: "邀请" + not_on_diaspora: "Not yet on Diaspora" resend: "重新发送" settings: "设置" shared: diff --git a/config/locales/diaspora/zh-TW.yml b/config/locales/diaspora/zh-TW.yml index 391ebf9d1..2d72f75b2 100644 --- a/config/locales/diaspora/zh-TW.yml +++ b/config/locales/diaspora/zh-TW.yml @@ -279,7 +279,6 @@ zh-TW: to: "收件人" layouts: application: - have_a_problem: "有問題嗎? 這裡有解答" powered_by: "強力配置 DIASPORA*" public_feed: "%{name} 的 Diaspora 公開資訊源" toggle: "行動網站切換" @@ -601,14 +600,8 @@ zh-TW: failure: error: "與該服務連結時有錯誤" finder: - friends: - few: "%{count}個朋友" - many: "%{count}個朋友" - one: "1個朋友" - other: "%{count}個朋友" - zero: "沒有朋友" - invite_your_friends_from: "邀請你在 %{service} 的朋友" - not_connected: "未連結" + no_friends: "No Facebook friends found." + service_friends: "%{service} Friends" index: connect_to_facebook: "與 Facebook 連結" connect_to_tumblr: "與 Tumblr 連結" @@ -623,6 +616,7 @@ zh-TW: join_me_on_diaspora: "跟我一起加入 DIASPORA*" remote_friend: invite: "邀請" + not_on_diaspora: "Not yet on Diaspora" resend: "重送" settings: "設定" shared: From 4fe61892e1c2a7ec30c75f87ec46348935f8afd7 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Sun, 14 Aug 2011 21:34:56 +0200 Subject: [PATCH 057/133] Added list of followed tags also to tags view, as suggested in issue #1632 --- app/views/tags/show.haml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/tags/show.haml b/app/views/tags/show.haml index fd7867d75..1febca2c2 100644 --- a/app/views/tags/show.haml +++ b/app/views/tags/show.haml @@ -41,6 +41,11 @@ .side_stream.stream = render :partial => 'people/index', :locals => {:people => @people} + %br + + .section + = render "tags/followed_tags_listings" + .span-15.last .stream_container #author_info From 657a9f96efbf8ad36660975a2a51e99c2e79c2cb Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Sun, 14 Aug 2011 23:51:53 +0200 Subject: [PATCH 058/133] Fix error when accessing a tag page without being signed in. --- app/views/tags/_followed_tags_listings.haml | 31 +++++++++++---------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/app/views/tags/_followed_tags_listings.haml b/app/views/tags/_followed_tags_listings.haml index d288c1a3b..06514b76a 100644 --- a/app/views/tags/_followed_tags_listings.haml +++ b/app/views/tags/_followed_tags_listings.haml @@ -2,18 +2,19 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%ul.left_nav - %li - %div.root_element - = t('aspects.index.tags_following') - - %ul.sub_nav - - if current_user.followed_tags.size > 0 - - for tg in current_user.followed_tags - %li.unfollow{:id => tg.name} - .unfollow_icon.hidden - = link_to image_tag("icons/monotone_close_exit_delete.png", :height => 16, :title => t('aspects.index.unfollow_tag', :tag => tg.name)), tag_tag_followings_path(:name => tg.name, :remote => true), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :id => "unfollow_" + tg.name - =link_to "##{tg.name}", tag_path(:name => tg.name), :class => "tag_selector" - - else - %li - = link_to t('aspects.index.no_tags'), tags_path, :class => "new_aspect" +- if user_signed_in? + %ul.left_nav + %li + %div.root_element + = t('aspects.index.tags_following') + + %ul.sub_nav + - if current_user.followed_tags.size > 0 + - for tg in current_user.followed_tags + %li.unfollow{:id => tg.name} + .unfollow_icon.hidden + = link_to image_tag("icons/monotone_close_exit_delete.png", :height => 16, :title => t('aspects.index.unfollow_tag', :tag => tg.name)), tag_tag_followings_path(:name => tg.name, :remote => true), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :id => "unfollow_" + tg.name + =link_to "##{tg.name}", tag_path(:name => tg.name), :class => "tag_selector" + - else + %li + = link_to t('aspects.index.no_tags'), tags_path, :class => "new_aspect" From ba11bb6d890708061bb7ebdb3e37003efc215080 Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Sun, 14 Aug 2011 15:38:12 -0700 Subject: [PATCH 059/133] you are now able to invite friends from the mobile site --- app/controllers/invitations_controller.rb | 6 ++++- app/views/invitations/new.mobile.haml | 28 +++++++++++++++++++++++ app/views/layouts/application.mobile.haml | 8 ++++++- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 app/views/invitations/new.mobile.haml diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 3296a98a2..145bb2660 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -8,7 +8,11 @@ class InvitationsController < Devise::InvitationsController def new @sent_invitations = current_user.invitations_from_me.includes(:recipient) - render :layout => false + respond_to do |format| + format.html do + render :layout => false + end + end end def create diff --git a/app/views/invitations/new.mobile.haml b/app/views/invitations/new.mobile.haml new file mode 100644 index 000000000..8debbdd71 --- /dev/null +++ b/app/views/invitations/new.mobile.haml @@ -0,0 +1,28 @@ +:javascript + $(function() { + $("#user_email").focus(); + }); + +%h2 + = t('.invite_someone_to_join') + +#email_invitation + = form_for User.new, :url => invitation_path(User) do |invite| + %h4 + = t('email') + = invite.text_field :email, :title => t('.comma_seperated_plz') + %br + + %h4 + = t('.aspect') + = invite.select(:aspects, options_from_collection_for_select(all_aspects, 'id', 'name')) + + %br + %br + + %h4 + = t('.personal_message') + = invite.text_area :invite_messages, :rows => 3, :value => "" + + %p + = invite.submit t('.send_an_invitation') diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 75b06767a..69be14a6f 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -85,7 +85,13 @@ = link_to t('conversations.index.message_inbox'), conversations_path .ui-li-count = @unread_message_count - + + + %h4 + = t('shared.invitations.invite_your_friends') + %ul{:data => {:role => 'listview', :inset => 'true'}} + %li + = link_to t('.by_email'), new_user_invitation_path %h4 = t('.your_aspects') From 8dc1b70621a733a1cb783c5f2fa2988cd74caf13 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Mon, 15 Aug 2011 00:54:27 +0200 Subject: [PATCH 060/133] Use tipsy for post scope tooltip --- app/views/shared/_stream_element.html.haml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index 2fd74b23c..3c55eb299 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -2,6 +2,11 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +:javascript + $(function() { + $("span.post_scope").tipsy({trigger: 'hover', gravity: 'n'}); + }); + .stream_element{:id => post.guid} - if user_signed_in? - if post.author.owner_id == current_user.id From 3f1e8f0b6ea733f4b88e1b56edbdb6ad82c0460d Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Sun, 14 Aug 2011 16:05:44 -0700 Subject: [PATCH 061/133] added the check for open invitations --- app/views/layouts/application.mobile.haml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 69be14a6f..499a83eca 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -87,11 +87,14 @@ = @unread_message_count - %h4 - = t('shared.invitations.invite_your_friends') - %ul{:data => {:role => 'listview', :inset => 'true'}} - %li - = link_to t('.by_email'), new_user_invitation_path + + - if AppConfig[:open_invitations] + %h4 + = t('shared.invitations.invite_your_friends') + %ul{:data => {:role => 'listview', :inset => 'true'}} + %li + = link_to t('.by_email'), new_user_invitation_path + %h4 = t('.your_aspects') From b7b20b241f22ab00151ee18767c03eff87508e70 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Mon, 15 Aug 2011 01:39:55 +0200 Subject: [PATCH 062/133] Do not mangle href in the show/hide comment toggle link when posting new comment. --- public/javascripts/web-socket-receiver.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/public/javascripts/web-socket-receiver.js b/public/javascripts/web-socket-receiver.js index 6869a12bc..8f94b29e0 100644 --- a/public/javascripts/web-socket-receiver.js +++ b/public/javascripts/web-socket-receiver.js @@ -108,12 +108,7 @@ var WebSocketReceiver = { ); } - var toggler = $('.toggle_post_comments', post).parent(); - - if(toggler.length > 0){ - toggler.html( - toggler.html().replace(/\d+/,$('.comments', post).find('li').length) - ); + var toggler = $('.toggle_post_comments', post); if( !$(".comments", post).is(':visible') ) { toggler.click(); From a2f7fed8f488d581fa81f3256f991eb74956dbcc Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Sun, 14 Aug 2011 17:45:50 -0700 Subject: [PATCH 063/133] Fix syntax error in WSR, move tipsy from views into stream.js, fix stream element delete tipsy. --- app/views/shared/_stream_element.html.haml | 4 ---- public/javascripts/stream.js | 8 +++++--- public/javascripts/web-socket-receiver.js | 3 ++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index 3c55eb299..16c58d7ea 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -2,10 +2,6 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -:javascript - $(function() { - $("span.post_scope").tipsy({trigger: 'hover', gravity: 'n'}); - }); .stream_element{:id => post.guid} - if user_signed_in? diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index ae0880a91..f0c810026 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -10,9 +10,11 @@ var Stream = { Diaspora.widgets.timeago.updateTimeAgo(); Diaspora.widgets.directionDetector.updateBinds(); - $(".status_message_delete").tipsy({ - trigger: "hover", - gravity: "n" + $.each([".stream_element_delete", "span.post_scope"], function(idx, el){ + $(el).tipsy({ + trigger: "hover", + gravity: "n" + }); }); //audio links Stream.setUpAudioLinks(); diff --git a/public/javascripts/web-socket-receiver.js b/public/javascripts/web-socket-receiver.js index 8f94b29e0..4f34ca60b 100644 --- a/public/javascripts/web-socket-receiver.js +++ b/public/javascripts/web-socket-receiver.js @@ -108,8 +108,9 @@ var WebSocketReceiver = { ); } - var toggler = $('.toggle_post_comments', post); + var toggler = $('.toggle_post_comments', post).parent(); + if(toggler.length > 0){ if( !$(".comments", post).is(':visible') ) { toggler.click(); } From a3ac384aa5840cdbc5dd02396209366d1ea7b62c Mon Sep 17 00:00:00 2001 From: Anish A Date: Mon, 15 Aug 2011 11:00:19 +0530 Subject: [PATCH 064/133] malayalam localization restarted. devise.ml.yml completed --- config/locales/devise/devise.ml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise/devise.ml.yml b/config/locales/devise/devise.ml.yml index 844da4d0f..705664e6b 100644 --- a/config/locales/devise/devise.ml.yml +++ b/config/locales/devise/devise.ml.yml @@ -34,7 +34,7 @@ ml: no_account_till: "മുകളില്‍ കാണുന്ന കണ്ണി ഉപയോഗിച്ച് താകളള്‍ ചേരുന്നതുവരെ താങ്കളുടെ പേരില്‍ അക്കൗണ്ട് സൃഷ്ടിക്കപ്പെടുകയില്ല." subject: "ഡയസ്പോറയില്‍ ചേരാന്‍ താങ്കളെ ക്ഷണിച്ചിരിക്കുന്നു!" inviters: - accept_at: ", at %{url}, താഴെ കാണുന്ന കണ്ണി ഉപയോഗിച്ച് താങ്കള്‍ക്ക് ക്ഷണം സ്വീകരിക്കാവുന്നതാണ്." + accept_at: "%{url} -ല്‍, താഴെ കാണുന്ന കണ്ണി ഉപയോഗിച്ച് താങ്കള്‍ക്ക് ക്ഷണം സ്വീകരിക്കാവുന്നതാണ്." has_invited_you: "%{name} താങ്കളെ ഡയാസ്പോറയില്‍ ചേരാന്‍ ക്ഷണിച്ചിരിക്കുന്നു." have_invited_you: "%{names} എന്നിവര്‍ താങ്കളെ ഡയാസ്പോറയില്‍ ചേരാന്‍ ക്ഷണിച്ചിരിക്കുന്നു." reset_password_instructions: From 2cea39672ef749023950a54004867b165746c701 Mon Sep 17 00:00:00 2001 From: Anish A Date: Mon, 15 Aug 2011 11:11:03 +0530 Subject: [PATCH 065/133] malayalam localization stage 2. javascript completed --- config/locales/javascript/javascript.ml.yml | 31 +++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/config/locales/javascript/javascript.ml.yml b/config/locales/javascript/javascript.ml.yml index 8db2e5f76..9abc7da46 100644 --- a/config/locales/javascript/javascript.ml.yml +++ b/config/locales/javascript/javascript.ml.yml @@ -6,14 +6,6 @@ ml: javascripts: confirm_dialog: "താങ്കള്‍ക്ക് ഉറപ്പാണോ?" - infinite_scroll: - no_more: "കൂടുതല്‍ പോസ്റ്റുകളൊന്നുമില്ല." - publisher: - at_least_one_aspect: "താങ്കള്‍ ഒരു പരിചയത്തിമെങ്കിലും തിരഞ്ഞെടുക്കേണ്ടതാണ്." - search_for: "{{name}}നായി തിരയുക" - shared: - contact_list: - cannot_remove: "ക്ഷമിക്കണം, വ്യക്തിയെ പരിചയത്തില്‍ നിന്ന് നീക്കം ചെയ്യാന്‍ സാധിക്കില്ല. (താങ്കള്‍ക്ക് ഈ വ്യക്തിയുമായുള്ള ബന്ധം വിച്ഛേദിക്കണമെങ്കില്‍ സമ്പര്‍ക്കം നീക്കം ചെയ്യേണ്ടതാണ്" timeago: day: "ഒരു ദിവസം" days: "%d ദിവസങ്ങള്‍" @@ -33,7 +25,30 @@ ml: videos: unknown: "അജ്ഞാതമായ തരം വീഡിയോ" watch: "ഈ വീഡിയോ {{provider}}ല്‍ കാണുക" + search_for: "{{name}}നായി തിരയുക" + infinite_scroll: + no_more: "കൂടുതല്‍ പോസ്റ്റുകളൊന്നുമില്ല." + publisher: + at_least_one_aspect: "താങ്കള്‍ ഒരു പരിചയത്തിമെങ്കിലും തിരഞ്ഞെടുക്കേണ്ടതാണ്." + limited: "Limited - your post will only be seen by people you are sharing with" + public: "Public - your post will be visible to everyone and found by search engines" web_sockets: disconnected: body: "പോസ്റ്റൂകള്‍ തത്സമയമായി കാണിക്കുന്നതല്ല." title: "താങ്കള്‍ വിച്ഛേദിക്കപ്പെട്ടിരിക്കുന്നു." + aspect_dropdown: + add_to_aspect: "Add to aspect" + toggle: + zero: "Add to aspect" + one: "In {{count}} aspect" + few: "In {{count}} aspects" + many: "In {{count}} aspects" + other: "In {{count}} aspects" + show_more: "show more" + failed_to_like: "Failed to like!" + failed_to_post_message: "Failed to post message!" + comments: + show: "show all comments" + hide: "hide comments" + reshares: + duplicate: "You've already reshared that post!" From e7f1c3d25110d00e20f56525902e0d29f343ee3b Mon Sep 17 00:00:00 2001 From: Anish A Date: Mon, 15 Aug 2011 13:40:41 +0530 Subject: [PATCH 066/133] malayalam localization stage 3. diaspora completed --- config/locales/diaspora/ml.yml | 418 +++++++++++++++++++++++---------- 1 file changed, 295 insertions(+), 123 deletions(-) diff --git a/config/locales/diaspora/ml.yml b/config/locales/diaspora/ml.yml index c2c99fdf6..9f59c8d30 100644 --- a/config/locales/diaspora/ml.yml +++ b/config/locales/diaspora/ml.yml @@ -8,6 +8,7 @@ ml: _home: "പൂമുഖം" _photos: "ചിത്രങ്ങള്‍" _services: "സേവനങ്ങള്‍" + _applications: "Applications" account: "അക്കൗണ്ട്" activerecord: errors: @@ -24,6 +25,10 @@ ml: attributes: from_id: taken: "നിലവിലുള്ള ഒരു അപേക്ഷയുടെ പകര്‍പ്പാണ്." + reshare: + attributes: + root_guid: + taken: "You've already reshared that post!" user: attributes: email: @@ -32,6 +37,7 @@ ml: invalid: "സാധുവല്ല." username: taken: "നേരത്തേ എടുത്തിട്ടുണ്ട്." + invalid: "is invalid. We only allow letters, numbers, and underscores" ago: "%{time} മുന്‍പ്" all_aspects: "എല്ലാം" application: @@ -45,6 +51,14 @@ ml: failure: "ഈ വ്യക്തിയെ പരിചയത്തില്‍ നിന്ന് മാറ്റാന്‍ കഴിഞ്ഞില്ല" no_membership: "തെരഞ്ഞെടുത്ത വ്യക്തി ഈ പരിചയത്തില്‍ ഇല്ല" success: "വ്യക്തിയെ വിജയകരമായി പരിചയത്തില്‍ നിന്നും നീക്കം ചെയ്തു" + aspect_dropdown: + add_to_aspect: "Add to aspect" + toggle: + zero: "Add to aspect" + one: "In %{count} aspect" + few: "In %{count} aspects" + many: "In %{count} aspects" + other: "In %{count} aspects" aspects: add_to_aspect: failure: "സമ്പര്‍ക്കം പരിചയത്തിലേക്ക് കൂട്ടിചേര്‍ക്കുന്നതില്‍ പരാജയപ്പെട്ടു." @@ -52,9 +66,10 @@ ml: aspect_contacts: done_editing: "മാറ്റം വരുത്തി കഴിഞ്ഞു" aspect_stream: - activity: "പ്രവര്‍ത്തനം" - post_time: "കുറിപ്പ് ചേര്‍ത്ത സമയം" - sort_by: "ഇപ്രകാരം ക്രമീകരിക്കുക:" + stream: "Stream" + recently: "recently:" + commented_on: "commented on" + posted: "posted" contacts_not_visible: "ഈ പരിചയത്തില്‍പ്പെട്ട സമ്പര്‍ക്കങ്ങള്‍ക്ക് പരസ്പരം കാണാന്‍ സാധിക്കുകയില്ല " contacts_visible: "ഈ പരിചയത്തിലുള്ള സമ്പര്‍ക്കങ്ങള്‍ക്ക് പരസ്പരം കാണാന്‍ സാധിക്കുന്നതാണ്." create: @@ -80,31 +95,56 @@ ml: aspect_not_empty: "പരിചയം ശൂന്യമല്ല " remove: "നീക്കം ചെയ്യു" index: - handle_explanation: "ഇത് താങ്കളുടെ ഡയസ്പോറ ഹാന്റിലാണ്. അളുകള്‍ക്ക് താങ്കളെ ബന്ധപെടാന്‍ ഇത് ഇമെയില്‍ പോലെ കൊടുക്കാം." + handle_explanation: "ഇത് താങ്കളുടെ ഡയസ്പോറ ഐഡിയാണ്. അളുകള്‍ക്ക് താങ്കളെ ബന്ധപെടാന്‍ ഇത് ഇമെയില്‍ പോലെ കൊടുക്കാം." + donate: "Donate" + keep_us_running: "Keep %{pod} running fast, buy our servers their monthly coffee fix!" + your_aspects: "Your Aspects" + tags_following: "Followed Tags" + no_tags: "+ Find a tag to follow" + unfollow_tag: "Stop following #%{tag}" no_contacts: "സമ്പര്‍ക്കങ്ങളില്ല" post_a_message: "ഒരു കത്തയക്കുക >>" - manage: - add_a_new_aspect: "പുതിയ പരിചയം ചേര്‍ക്കുക" - add_a_new_contact: "പുതിയ സമ്പര്‍ക്കം ചേര്‍ക്കുക" - drag_to_add: "ആളുകളെ ചേര്‍ക്കാന്‍ വലിച്ചിടുക" - manage_aspects: "പരിചയങ്ങള്‍ കൈകാര്യം ചെയ്യുക" - no_requests: "പുതിയ അഭ്യര്‍ത്ഥനകള്‍ ഇല്ല" - requests: "അഭ്യര്‍ത്ഥനകള്‍" + people_sharing_with_you: "People sharing with you" + cubbies: + heading: "Connect to Cubbi.es" + explanation: "Cubbi.es is the first Diaspora application under development." + learn_more: "Learn more" + diaspora_id: + heading: "Diaspora ID" + content_1: "Your Diaspora ID is:" + content_2: "Give it to anyone and they'll be able to find you on Diaspora." + services: + heading: "Connect Services" + content: "You can connect the following services to Diaspora:" many: "%{count} പരിചയങ്ങള്‍" move_contact: error: "സമ്പര്‍ക്കം മാറ്റാന്‍ സാധിക്കുന്നില്ല : %{inspect}" failure: "ശരിയായില്ല. %{inspect}" success: "വ്യക്തിയെ പുതിയ പരിചയത്തിലേക്ക് മാറ്റിയിരിക്കുന്നു" - new_aspect: + new: create: "ഉണ്ടാക്കു" name: "പേര്" no_posts_message: - start_talking: "ആരും ഒന്നും പറയുന്നില്ല. സംഭാഷണം തുടങ്ങിവെയ്ക്കു!" + start_talking: "ആരും ഇതുവരെ ഒന്നും പറഞ്ഞില്ല!" + no_contacts_message: + 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." + or_featured: "Or you can share with %{link}" + featured_users: "featured users" + aspect_listings: + add_an_aspect: "+ Add an aspect" + + selected_contacts: + view_all_contacts: "View all contacts" + no_contacts: "You don't have any contacts here yet." + manage_your_aspects: "Manage your aspects." one: "ഒരു പരിചയം" other: "%{count} പരിചയങ്ങള്‍" seed: family: "കുടുംബം" work: "ജോലി" + acquaintances: "Acquaintances" + friends: "Friends" show: edit_aspect: "പരിചയം ചിട്ടപെടുത്തുക" update: @@ -112,9 +152,10 @@ ml: success: "നിങ്ങളുടെ പരിചയം, %{name}, വിജയകരമായി ചിട്ടപ്പെടുത്തി." zero: "പരിചയങ്ങള്‍ ഇല്ല" back: "പിന്നോട്ട്" - bookmarklet: - explanation: "%{link} ഡയാസ്പോറയില്‍ എവിടെനിന്നും കുറിക്കാന്‍ ഈ കണ്ണി ബുക്ക്മാര്‍ക്ക് ചെയ്യുക" - explanation_link_text: "ഡയസ്പോറയിലേക്ക് കുറിക്കുക" + bookmarklet: + heading: "Bookmarklet" + explanation: "Post to Diaspora from anywhere by bookmarking %{link}." + explanation_link_text: "this link" post_something: "ഡയസ്പോറയിലേക്ക് എന്തെങ്കിലും കുറിക്കുക" post_success: "കുറിച്ചു! അടയ്ക്കുന്നു!" cancel: "റദ്ദാക്കുക" @@ -130,17 +171,26 @@ ml: contacts: create: failure: "സമ്പര്‍ക്കം ഉണ്ടാക്കാനാകുന്നില്ല" - destroy: - failure: "%{name} -ല്‍ നിന്ന് വിച്ഛേദിക്കാന്‍ കഴിയുന്നില്ല." - success: "%{name} -ല്‍ നിന്ന് വിച്ഛേദിച്ചു." + sharing: + people_sharing: "People sharing with you:" + index: + edit_aspect: "Edit %{name}" + start_a_conversation: "Start a conversation" + add_a_new_aspect: "Add a new aspect" + title: "Contacts" + your_contacts: "Your Contacts" + no_contacts: "No contacts." + my_contacts: "My Contacts" + all_contacts: "All Contacts" + only_sharing_with_me: "Only sharing with me" + remove_person_from_aspect: "Remove %{person_name} from \"%{aspect_name}\"" + many_people_are_you_sure: "Are you sure you want to start a private conversation with more than %{suggested_limit} contacts? Posting to this aspect may be a better way to contact them." + featured: + featured_users: "Featured Users" few: "%{count} സമ്പര്‍ക്കങ്ങള്‍" many: "%{count} സമ്പര്‍ക്കങ്ങള്‍" one: "ഒരു സമ്പര്‍ക്കം" other: "%{count} മറ്റു സമ്പര്‍ക്കങ്ങള്‍" - share_with_pane: - accepts: "%{name} താങ്കളുടെ ക്ഷണം സ്വീകരിച്ചതിനു ശേഷം ഡയാസ്പോറയില്‍ ചേര്‍ക്കുന്ന കുറിപ്പുകള്‍ ദൃശ്യമാവുന്നതാണ്." - add_new_aspect: "പുതിയ പരിചയത്തിലേയ്ക്ക് ചേര്‍ക്കുക" - share_with: "%{name} നോട് പങ്കിട്ട് തുടങ്ങുക" zero: "സമ്പര്‍ക്കമൊന്നുമില്ല" conversations: create: @@ -165,6 +215,8 @@ ml: send: "അയക്കു" subject: "വിഷയം" to: "സ്വീകര്‍ത്താവ്" + sending: "Sending..." + abandon_changes: "Abandon changes?" show: delete: "സംഭാഷണം തടഞ്ഞ് നീക്കം ചെയ്യുക." reply: "മറുപടി" @@ -201,13 +253,17 @@ ml: create: already_contacts: "താങ്കള്‍ ഇതിനകം തന്നെ ഈ വ്യക്തിയുമായി ബന്ധിപ്പിച്ചിരിക്കുകയാണ്" already_sent: "താങ്കള്‍ ഇതിനകം തന്നെ ഈ വ്യക്തിയെ ക്ഷണിച്ചു." + own_address: "You can't send an invitation to your own address." no_more: "താങ്കള്‍ക്ക് ഇനി ക്ഷണങ്ങളൊന്നും ബാക്കിയില്ല." rejected: "ഈ ഇമെയില്‍ വിലാസങ്ങള്‍ക്ക് പ്രശ്നങ്ങളുണ്ട്: " sent: "ക്ഷണങ്ങള്‍ അയച്ചിരിക്കുന്നു: " edit: - sign_up: "ചേരുക" + sign_up: "sign_up" + your_account_awaits: "Your account awaits!" + accept_your_invitation: "Accept your invitation" + a_facebook_user: "A Facebook user" new: - already_invited: "ഇതിനകം തന്നെ ക്ഷണിച്ചു" + already_invited: "The following people have not accepted your invitation:" aspect: "പരിചയം" comma_seperated_plz: "താങ്കള്‍ക്ക് കോമാ ഉപയോഗിച്ച് ഒന്നില്‍ കൂടൂതല്‍ ഇമെയില്‍ വിലാസങ്ങള്‍ ചേര്‍ക്കാം." if_they_accept_info: "അവര്‍ അംഗീകരിക്കുകയാണെങ്കില്‍, അവരെ താങ്കള്‍ ക്ഷണിച്ച പരിചയത്തിലേയ്ക്ക് ചേര്‍ക്കും." @@ -219,7 +275,6 @@ ml: to: "സ്വീകര്‍ത്താവ്" layouts: application: - have_a_problem: "പ്രശ്നമുണ്ടോ?" powered_by: "ഡയസ്പോറയാല്‍* ശക്തമാക്കിയത്" public_feed: "%{name} -ന്റെ പൊതു ഡയസ്പോറ ഫീഡ്" toggle: "മൊബൈല്‍ സൈറ്റിലേക്ക് മാറുക" @@ -232,6 +287,9 @@ ml: logout: "പുറത്ത് കടക്കു" profile: "പ്രൊഫൈല്‍" settings: "ക്രമീകരണങ്ങള്‍" + admin: "admin" + view_all: "View all" + recent_notifications: "Recent notifications" likes: likes: people_dislike_this: @@ -240,6 +298,12 @@ ml: one: "ഒരാള്‍ ഇതിഷ്ടപ്പെടുന്നില്ല." other: "%{count} പേര്‍ ഇത് ഇഷ്ടപ്പെടുന്നില്ല" zero: "ആരും ഇത് ഇഷ്ടപ്പെടുന്നില്ല" + people_like_this_comment: + zero: "no likes" + one: "%{count} like" + few: "%{count} likes" + many: "%{count} likes" + other: "%{count} likes" people_like_this: few: "%{count} ആളുകള്‍ ഇത് ഇഷ്ടപ്പെടുന്നു" many: "%{count} ആളുകള്‍ ഇത് ഇഷ്ട്പ്പെടുന്നു" @@ -249,64 +313,100 @@ ml: more: "കൂടുതല്‍" next: "അടുത്തത്" no_results: "ഫലങ്ങളൊന്നും കണ്ടെത്താനായില്ല." + _contacts: "Contacts" notifications: - also_commented: "സമ്പര്‍ക്കത്തിന്റെ അഭിപ്രായം രേഖപെടുത്തി" - also_commented_deleted: "നീക്കം ചെയ്ത കുറിപ്പില്‍ അഭിപ്രായം രേഖപ്പെടുത്തി" - comment_on_post: "അഭിപ്രായം രേഖപെടുത്തി" - deleted: "നീക്കം ചെയ്തു" helper: - new_notifications: - few: "%{count} പുതിയ അറിയിപ്പുകള്‍" - many: "%{count} പുതിയ അറിയിപ്പുകള്‍" - one: "ഒരു പുതിയ അറിയിപ്പ്" - other: "%{count} പുതിയ അറിയിപ്പുകള്‍" - zero: "പുതിയ അറിയിപ്പൊന്നുമില്ല" + new_notifications: + zero: "No new notifications" + one: "1 new notifications" + few: "%{count} new notifications" + many: "%{count} new notifications" + other: "%{count} new notifications" index: and: "കൂടാതെ" - and_others: - zero: "ഉം %{count} മറ്റുള്ളവരും" - one: "ഉം %{count} മറ്റുള്ളവരും" - few: "ഉം %{count} മറ്റുള്ളവരും" - many: "ഉം %{count} മറ്റുള്ളവരും" - other: "ഉം %{count} മറ്റുള്ളവരും" + and_others: + zero: "and nobody else" + one: "and one more" + few: "and %{count} others" + many: "and %{count} others" + other: "and %{count} others" mark_all_as_read: "എല്ലാം വായിച്ചതായി അടയാളപ്പെടുത്തുക" notifications: "അറിയിപ്പുകള്‍" - mentioned: "താങ്കളെ സൂചിപ്പിച്ചിരിക്കുന്നു" - new_request: "താങ്കളുമായി പങ്കുവയ്ക്കാന്‍ തയ്യാറായിരിക്കുന്നു." - post: "കുറിപ്പ്" - private_message: "താങ്കള്‍ക്ക് ഒരു സന്ദേശം അയച്ചിരിക്കുന്നു." - request_accepted: "താങ്കളുടെ പങ്കിടല്‍ അഭ്യര്‍ത്ഥന അംഗീകരിച്ചു." + started_sharing: + zero: "%{actors} started sharing with you." + one: "%{actors} started sharing with you." + few: "%{actors} started sharing with you." + many: "%{actors} started sharing with you." + other: "%{actors} started sharing with you." + private_message: + zero: "%{actors} sent you a message." + one: "%{actors} sent you a message." + few: "%{actors} sent you a message." + many: "%{actors} sent you a message." + other: "%{actors} sent you a message." + comment_on_post: + zero: "%{actors} commented on your %{post_link}." + one: "%{actors} commented on your %{post_link}." + few: "%{actors} commented on your %{post_link}." + many: "%{actors} commented on your %{post_link}." + other: "%{actors} commented on your %{post_link}." + also_commented: + zero: "%{actors} also commented on %{post_author}'s %{post_link}." + one: "%{actors} also commented on %{post_author}'s %{post_link}." + few: "%{actors} also commented on %{post_author}'s %{post_link}." + many: "%{actors} also commented on %{post_author}'s %{post_link}." + other: "%{actors} also commented on %{post_author}'s %{post_link}." + mentioned: + zero: "%{actors} has mentioned you in a %{post_link}." + one: "%{actors} has mentioned you in a %{post_link}." + few: "%{actors} has mentioned you in a %{post_link}." + many: "%{actors} has mentioned you in a %{post_link}." + other: "%{actors} has mentioned you in a %{post_link}." + liked: + zero: "%{actors} has just liked your %{post_link}." + one: "%{actors} has just liked your %{post_link}." + few: "%{actors} has just liked your %{post_link}." + many: "%{actors} has just liked your %{post_link}." + other: "%{actors} has just liked your %{post_link}." + post: "post" + also_commented_deleted: + zero: "%{actors} commented on a deleted post." + one: "%{actors} commented on a deleted post." + few: "%{actors} commented on a deleted post." + many: "%{actors} commented on a deleted post." + other: "%{actors} commented on a deleted post." + liked_post_deleted: + zero: "%{actors} liked your deleted post." + one: "%{actors} liked your deleted post." + few: "%{actors} liked your deleted post." + many: "%{actors} liked your deleted post." + other: "%{actors} liked your deleted post." + mentioned_deleted: + zero: "%{actors} mentioned you in a deleted post." + one: "%{actors} mentioned you in a deleted post." + few: "%{actors} mentioned you in a deleted post." + many: "%{actors} mentioned you in a deleted post." + other: "%{actors} mentioned you in a deleted post." notifier: - also_commented: - commented: "കൂടി %{post_author} ന്റെ പോസ്റ്റില്‍ അഭിപ്രായം രേഖപ്പെടുത്തിയിട്ടുണ്ട്." - sign_in: "അത് കാണുവാന്‍ അകത്തുകയറുക." - subject: "%{name} കൂടി അഭിപ്രായം രേഖപ്പെടുത്തിയിട്ടുണ്ട്." comment_on_post: - commented: "നിങ്ങളുടെ പോസ്റ്റില്‍ അഭിപ്രായം രേഖപ്പെടുത്തിയിട്ടുണ്ട്!" - sign_in: "അത് കാണുവാന്‍ അകത്തുകയറുക." - subject: "നിങ്ങളുടെ കുറിപ്പില്‍ %{name} അഭിപ്രായം രേഖപ്പെടുത്തിയിട്ടുണ്ട്." - diaspora: "ഡയസ്പോറ ഇമെയില്‍ ചാത്തന്‍" + reply: "Reply or view %{name}'s post >" hello: "നമസ്‌കാരം %{name}!" - love: "സ്നേഹപൂര്‍വ്വം," - manage_your_email_settings: "ഈ-മെയില്‍ ക്രമീകരിക്കുക." + to_change_your_notification_settings: "to change your notification settings" mentioned: mentioned: "താങ്കളെ ഒരു കുറിപ്പില്‍ സൂചിപ്പിച്ചു:" - sign_in: "കാണാനായി അകത്ത് കയറുക." subject: "%{name} താങ്കളെ ഡയസ്പോറയില്‍* സൂചിപ്പിച്ചു" - new_request: - just_sent_you: "താങ്കള്‍ക്ക് ഡയസ്പോറയില്‍* ഇപ്പോള്‍ ഒരു സമ്പര്‍ക്ക അഭ്യര്‍ഥന അയച്ചു" - sign_in: "ഇതു വഴി അകത്ത് കയറുക" - subject: "%{from} ല്‍ നിന്നും പുതിയ ഡയസ്പോറ* സമ്പര്‍ക്ക അഭ്യര്‍ത്ഥന" - try_it_out: "താങ്കള്‍ അത് നോക്കുമെന്ന് വിചാരിക്കുന്നു." + liked: + liked: "%{name} just liked your post" + view_post: "View post >" + confirm_email: + subject: "Please activate your new email address %{unconfirmed_email}" + click_link: "To activate your new email address %{unconfirmed_email}, please click this link:" private_message: - message_subject: "വിഷയം: %{subject}" - private_message: "ഒരു സ്വകാര്യ സന്ദേശം അയച്ചു:" - sign_in: "ഇതു വഴി അകത്ത് കയറുക." - subject: "%{name} ഡയസ്പോറയില്‍* നിങ്ങള്‍ക്ക് ഒരു സ്വകാര്യ സന്ദേശം അയച്ചു" - request_accepted: - accepted: "നിങ്ങളുടെ സമ്പര്‍ക്ക അഭ്യര്‍ത്ഥന സ്വീകരിച്ചിട്ടുണ്ട്!" - sign_in: "ഇതു വഴി അകത്ത് കയറുക" - subject: "%{name} ഡയസ്പോറയിലെ* നിങ്ങളുടെ സമ്പര്‍ക്ക അപേക്ഷ അംഗീകരിച്ചു" + reply_to_or_view: "Reply to or view this conversation >" + started_sharing: + subject: "%{name} started sharing with you on Diaspora*" + sharing: "has started sharing with you!" + view_profile: "View %{name}'s profile" single_admin: admin: "നിങ്ങളുടെ ഡയസ്പോറ മേല്‍നോട്ടക്കാരന്‍" subject: "നിങ്ങളുടെ ഡയസ്പോറ അക്കൌണ്ടിനെ സംബന്ധിച്ച് ഒരു സന്ദേശം:" @@ -340,7 +440,6 @@ ml: profile_sidebar: bio: "സ്വയം വിവരണം" born: "ജന്മദിനം" - cannot_remove: "%{name}നെ പരിചയത്തില്‍നിന്ന് നീക്കം ചെയ്യാന്‍ സാധിക്കുന്നതല്ല.(ബന്ധം വിച്ഛേദിക്കണമെങ്കില്‍ താങ്കള്‍ %{name}-നെ സമ്പര്‍ക്കങ്ങളില്‍നിന്നും നീക്കം ചെയ്യേണ്ടതാണ്.)" edit_my_profile: "എന്റെ പ്രൊഫൈല്‍ തിരുത്തുക" gender: "ലിംഗം" in_aspects: "പരിചയത്തില്‍" @@ -354,7 +453,7 @@ ml: incoming_request: "%{name} നിങ്ങളുമായി പങ്കിടാന്‍ ആഗ്രഹിക്കുന്നു" mention: "സൂചിപ്പിച്ചു" message: "സന്ദേശം" - no_posts: "കുറിപ്പൊന്നും കാണിക്കാനില്ല!" + has_not_shared_with_you_yet: "%{name} has not shared any posts with you yet!" not_connected: "താങ്കള്‍ %{name} യുമായി പങ്കുവെയ്ക്കുന്നില്ല" recent_posts: "സമീപകാല കുറിപ്പുകള്‍" recent_public_posts: "സമീപകാല പൊതു കുറിപ്പുകള്‍" @@ -386,18 +485,17 @@ ml: new_profile_photo: or_select_one: "അല്ലെങ്കില്‍ ഇപ്പോഴുള്ളതില്‍ നിന്ന് തിരഞ്ഞെടുക്കുക" upload: "പുതിയ പ്രൊഫൈല്‍ ചിത്രം ചേര്‍ക്കുക!" + comment_email_subject: "%{name}'s photo" photo: view_all: "%{name}യുടെ എല്ലാ ചിത്രങ്ങളും കാണുക" show: collection_permalink: "ശേഖരണത്തിന്റെ സ്ഥിരംകണ്ണി" + show_original_post: "Show original post" delete_photo: "ചിത്രം നീക്കുക" edit: "തിരുത്തുക" edit_delete_photo: "ചിത്രത്തിന്റെ വിവരണം തിരുത്തുക / ചിത്രം നീക്കം ചെയ്യുക" make_profile_photo: "പ്രൊഫൈല്‍ ചിത്രം ഉണ്ടാക്കുക" - original_post: "യഥാര്‍ത്ഥ കുറിപ്പ്" - permalink: "സ്ഥിരം കണ്ണി" update_photo: "ചിത്രം പുതുക്കുക" - view: "കാണു" update: error: "ചിത്രം പുതുക്കാന്‍ പറ്റുന്നില്ല.." notice: "ചിത്രം വിജയകരമായി പുതുക്കി." @@ -405,7 +503,10 @@ ml: update: post_hidden: "%{name}ന്റെ കുറിപ്പ് മറച്ചിരിക്കുന്നു." posts: - doesnt_exist: "ഈ കുറിപ്പ് നിലവിലില്ല!" + show: + destroy: "Delete" + permalink: "permalink" + not_found: "Sorry, we couldn't find that post." previous: "മുന്‍‌പത്തെ" profile: "പ്രൊഫൈല്‍" profiles: @@ -423,8 +524,8 @@ ml: your_photo: "താങ്കളുടെ ചിത്രം" your_private_profile: "താങ്കളുടെ സ്വകാര്യ പ്രൊഫൈല്‍ " your_public_profile: "താങ്കളുടെ പൊതു പ്രൊഫൈല്‍ " - your_tags: "താങ്കളെക്കുറിച്ച്: 5 #ടാഗുകളില്‍" - your_tags_placeholder: "ഉദാ. #ഡയസ്പോറ #സംഗീതം #മലയാളം #പൂച്ചകള്‍" + your_tags: "Describe yourself in 5 words" + your_tags_placeholder: "like #movies #kittens #travel #teacher #newyork" update: failed: "പ്രൊഫൈല്‍ തിരുത്തുന്നത് പരാജയപ്പെട്ടിരിക്കുന്നു." updated: "പ്രൊഫൈല്‍ വിജയകരമായൊ തിരുത്തിയിരിക്കുന്നു." @@ -440,12 +541,13 @@ ml: unhappy: "സന്തോഷമായില്ല?" update: "പുതുക്കു" new: - enter_email: "ഒരു ഇമെയില്‍ നല്‍കുക" + create_my_account: "Create my account" + join_the_movement: "Join the movement!" + sign_up_today: "Sign up today" + enter_email: "Enter an email" enter_password: "അടയാളവാക്ക് നല്‍കുക" enter_password_again: "അടയാളവാക്ക് വീണ്ടും നല്‍കുക" enter_username: "ഉപഭാക്തൃ നാമം തിരഞ്ഞെടുക്കുക (അക്ഷരങ്ങളും സംഖ്യകളും അണ്ടര്‍ സ്കോറും മാത്രം)" - sign_up: "അംഗത്വം എടുക്കുക" - sign_up_for_diaspora: "ഡയസ്പോറയ്ക്കു വേണ്ടി അംഗത്വം എടുക്കുക" requests: create: sending: "അയയ്ക്കുന്നു" @@ -466,7 +568,23 @@ ml: manage_within: "ഉള്ളിലുള്ള സമ്പര്‍ക്കങ്ങളെ നിയന്ത്രിക്കുക" new_request_to_person: sent: "അയച്ചു!" + reshares: + reshare: + reshare_original: "Reshare original" + reshare: + zero: "Reshare" + one: "1 reshare" + few: "%{count} reshares" + many: "%{count} reshares" + other: "%{count} reshares" + show_original: "Show original" + reshare_confirmation: "Reshare %{author}'s post?" + deleted: "Original post deleted by author." + create: + failure: "There was an error resharing this post." + comment_email_subject: "%{resharer}'s reshare of %{author}'s post" search: "തിരയുക" + find_people: "Find people or #tags" services: create: success: "തിരിച്ചറിയല്‍ വിജയകരം." @@ -475,19 +593,15 @@ ml: failure: error: "അ സേവനവുമായി ബന്ധിപ്പിക്കുന്നതില്‍ അവിടെ ഒരു തെറ്റുണ്ട്" finder: - friends: - few: "%{count} സുഹൃത്തുക്കള്‍" - many: "%{count} സുഹൃത്തുക്കള്‍" - one: "ഒരു സുഹൃത്ത്" - other: "%{count} സുഹൃത്തുക്കള്‍" - zero: "സുഹൃത്തുക്കളില്ല" - invite_your_friends_from: "%{service} ല്‍ നിന്ന് നിങ്ങളുടെ സുഹൃത്തുക്കളെ ക്ഷണിക്കുക." - not_connected: "ബന്ധിപ്പിച്ചിട്ടില്ല" + service_friends: "%{service} Friends" + no_friends: "No Facebook friends found." index: connect_to_facebook: "ഫേസ്ബുക്കുമായി ബന്ധിപ്പിക്കു" connect_to_twitter: "ട്വിറ്ററുമായി ബന്ധിപ്പിക്കു" + connect_to_tumblr: "Connect to Tumblr" disconnect: "വിച്ഛേദിക്കു" edit_services: "സേവനങ്ങളില്‍ മാറ്റം വരുത്തുക" + no_services: 'You have not connected any services yet.' logged_in_as: "ആയി പ്രവേശിച്ചിരിക്കുന്നു" really_disconnect: "%{service} വിച്ഛേദിക്കണോ?" inviter: @@ -499,14 +613,14 @@ ml: settings: "ക്രമീകരണങ്ങള്‍" shared: add_contact: - create_request: "ഡയസ്പോറ ഹാന്‍ഡില്‍ വെച്ച് കണ്ട് പിടിക്കുക" - diaspora_handle: "diaspora@handle.org" + create_request: "ഡയസ്പോറ ഐഡി വെച്ച് കണ്ട് പിടിക്കുക" + diaspora_handle: "diaspora@pod.org" enter_a_diaspora_username: "ഒരു ഡയസ്പോറ ഉപയോക്തനാമം നല്‍കുക :" know_email: "ആളിന്റെ ഇമെയില്‍ വിലാസം അറിയാമോ? നിങ്ങള്‍ക്ക് ആ വ്യക്തിയെ ക്ഷണിക്കാം." your_diaspora_username_is: "താങ്കളുടെ ഡയസ്പോറ ഉപയോക്തൃ നാമം: %{diaspora_handle}" + add_new_contact: "Add a new contact" contact_list: all_contacts: "എല്ലാ സമ്പര്‍ക്കവും" - cannot_remove: "അവസാനത്തെ പരിചയത്തില്‍ നിന്ന് വ്യക്തിയെ മാറ്റാന്‍ പറ്റുന്നില്ല. (താങ്കള്‍ക്ക് ഈ വ്യക്തിയില്‍ നിന്നും ഒഴിവാകണമെങ്കില്‍ സമ്പര്‍ക്കത്തില്‍ നിന്നും നീക്കം ചെയ്യണം.)" footer: logged_in_as: "%{name} ആയി പ്രവേശിച്ചിരിക്കുന്നു." your_aspects: "നിങ്ങളുടെ പരിചയങ്ങള്‍" @@ -514,7 +628,7 @@ ml: by_email: "ഇമെയില്‍ വഴി" dont_have_now: "താങ്കള്‍ക്ക് ക്ഷണമൊന്നും ബാക്കിയില്ല, പക്ഷേ കൂടുതല്‍ വരുന്നുണ്ട്!" from_facebook: "ഫേസ്ബുക്കില്‍ നിന്ന്" - invitations_left: "(%{count}ക്ഷണങ്ങള്‍ ബാക്കി)" + invitations_left: "%{count}ക്ഷണങ്ങള്‍ ബാക്കി" invite_someone: "ആരെയെങ്കിലും ക്ഷണിക്കുക" invite_your_friends: "നിങ്ങളുടെ കൂട്ടുകാരെ ക്ഷണിക്കു." invites: "ക്ഷണങ്ങള്‍" @@ -527,14 +641,14 @@ ml: outside: "പൊതു സന്ദേശങ്ങള്‍ ഡയസ്പോറയ്ക്ക് വെളിയിലുള്ളവര്‍ക്കും കാണാനാകും." title: "നിങ്ങള്‍ ഒരു പൊതു സന്ദേശം കുറിക്കുവാന്‍ പോകുന്നു!" publisher: - add_photos: "ചിത്രങ്ങള്‍ ചേര്‍ക്കുക" + upload_photos: "Upload photos" all: "എല്ലാം" all_contacts: "എല്ലാ സമ്പര്‍ക്കവും" click_to_share_with: "പങ്കിടാന്‍ ക്ളിക്ക് ചെയ്യുക: " + discard_post: "Discard post" make_public: "പൊതുവാക്കുക" post_a_message_to: "%{aspect}ല്‍ ഒരു സന്ദേശം പ്രസിദ്ധീകരിക്കുക" posting: "കുറിക്കുന്നു..." - public: "പൊതുവായ" publishing_to: "പ്രസിദ്ധീകരിക്കുന്നു: " share: "പങ്കുവെയ്ക്കുക" share_with: "പങ്കുവെയ്ക്കുക" @@ -542,42 +656,79 @@ ml: reshare: reshare: "വീണ്ടും പങ്കിടുക" stream_element: + viewable_to_anyone: "This post is viewable to anyone on the web" + via: "via %{link}" dislike: "ഇഷ്ടപ്പെടുന്നില്ല" like: "ഇഷ്ടപ്പെടുന്നു" + shared_with: "Shared with: %{aspect_names}" status_messages: create: success: "വിജയകരമായി സൂചിപ്പിച്ചു: %{names}" destroy: failure: "കുറിപ്പ് നീക്കം ചെയ്യാന്‍ സാധിക്കുന്നില്ല" + too_long: + zero: "please make your status messages less than %{count} characters" + one: "please make your status messages less than %{count} character" + few: "please make your status messages less than %{count} characters" + many: "please make your status messages less than %{count} characters" + other: "please make your status messages less than %{count} characters" helper: no_message_to_display: "സന്ദേശമൊന്നും കാണിക്കാനില്ല." new: mentioning: "സൂചിപ്പിക്കുന്നു: %{person}" - show: - destroy: "നീക്കം ചെയ്യുക" - not_found: "ക്ഷമിക്കണം, താങ്കള്‍ അന്വേഷിച്ച കുറിപ്പ് കണ്ടെത്താനായില്ല" - permalink: "സ്ഥിരം കണ്ണി" stream_helper: - hide_comments: "അഭിപ്രായങ്ങള്‍ മറയ്ക്കുക" - show_comments: "എല്ലാ അഭിപ്രായവും കാണിക്കുക" + show_more_comments: "Show %{number} more comments" + hide_comments: "Hide all comments" tags: show: nobody_talking: "നിലവില്‍ ആരും %{tag}-നെ കുറിച്ച് സംസാരിക്കുന്നില്ല." people_tagged_with: "%{tag} ചേര്‍ത്തിട്ടുള്ള ആളുകള്‍" posts_tagged_with: "#%{tag} ചേര്‍ത്തിട്ടുള്ള കുറിപ്പുകള്‍" - the_world: "ലോകം മുഴുവന്‍" + follow: "Follow #%{tag}" + following: "Following #%{tag}" + stop_following: "Stop Following #%{tag}" + + tag_followings: + create: + success: "Successfully following: #%{name}" + failure: "Failed to follow: #%{name}" + destroy: + success: "Successfully stopped following: #%{name}" + failure: "Failed to stop following: #%{name}" + + tokens: + show: + connect_to_cubbies: "Connect to Cubbi.es" + what_is_cubbies: "Cubbi.es is the world's first Diaspora application. It's also the best way to collect photos online." + love_to_try: "We'd love for you to try it out." + sign_up_today: "Sign up today!" + screenshot_explanation: "%{link1}. This particular cubby is linked to %{link2}." + typical_userpage: "A typical cubbi.es userpage" + daniels_account: "Daniel's Diaspora account" + making_the_connection: "Making the Connection" + connecting_is_simple: "Connecting your Diaspora account is simple! Just enter your Diaspora ID (%{diaspora_id}) from your cubbies settings page and hit connect." + log_in_with_diaspora_is_comming: "Pretty soon, you'll be able to connect to a new application without creating an account separate from your one on Diaspora." + via: "(via %{link})" + + authorizations: + index: + revoke_access: "Revoke Access" + public: "Public" + limited: "Limited" undo: "പൂര്‍വരൂപത്തിലാക്കണോ?" username: "ഉപയോക്തൃനാമം" users: - destroy: "അക്കൌണ്ട് വിജയകരമായി അവസാനിപ്പിച്ചു." + destroy: "Your account has been locked. It may take 20 minutes for us to finish closing your account. Thank you for trying Diaspora." edit: also_commented: "...താങ്കളുടെ സമ്പര്‍ക്കത്തിന്റെ പോസ്റ്റില്‍ ആരെങ്കിലും അഭിപ്രായമിടുമ്പോള്‍?" change: "മാറ്റുക" change_language: "ഭാഷ മാറ്റു" change_password: "അടയാളവാക്ക് മാറ്റു" + change_email: "Change email" close_account: "അക്കൌണ്ട് അവസാനിപ്പിക്കു" comment_on_post: "...താങ്കളുടെ പോസ്റ്റില്‍ ആരെങ്കിലും അഭിപ്രായമിടുമ്പോള്‍?" current_password: "ഇപ്പോഴത്തെ അടയാളവാക്ക്" + new_password: "New password" download_photos: "എന്റെ ചിത്രങ്ങള്‍ ഇറക്കു" download_xml: "എന്റെ എക്സ് എം എല്‍ ഇറക്കു" edit_account: "അക്കൌണ്ട് തിരുത്തു" @@ -586,33 +737,54 @@ ml: new_password: "പുതിയ അടയാളവാക്ക്" private_message: "...ഒരു സ്വകാര്യ സന്ദേശം കിട്ടുമ്പോള്‍?" receive_email_notifications: "ഇമെയില്‍ അറിയിപ്പുകള്‍ വേണോ?" - request_acceptence: "...പങ്കിടല്‍ അഭ്യര്‍ഥന അംഗീകരിക്കുമ്പോള്‍?" - request_received: "...പുതിയ പങ്കിടല്‍ അഭ്യര്‍ഥന കിട്ടുമ്പോള്‍?" + started_sharing: "...someone starts sharing with you?" your_email: "താങ്കളുടെ ഈമെയില്‍" - your_handle: "താങ്കളുടെ ഡയസ്പോറ ഹാന്റില്‍" + your_handle: "താങ്കളുടെ ഡയസ്പോറ ഐഡി" getting_started: - connect_on_diaspora: "ഡയസ്പോറയില്‍ ബന്ധിപ്പിക്കു" - connect_services: "താങ്കളുടെ മറ്റുള്ള സേവനങ്ങള്‍ ബന്ധിപ്പിക്കു" - could_not_find_anyone: "താങ്കള്‍ക്ക് ഡയസ്പോറയില്‍ സുഹൃത്തുക്കളാരും തന്നെ ഇല്ല , അവരെ ഫ്രണ്ട് ഫൈന്റര്‍ ഉപയോഗിച്ച് ക്ഷണിക്കാവുന്നതാണ്." - edit_profile: "താങ്കളുടെ പ്രൊഫൈല്‍ തിരുത്തുക" - finished: "തീര്‍ന്നു!" - save_and_continue: "സൂക്ഷിച്ച ശേഷം തുടരു" - signup_steps: "ഈ മൂന്ന് കാര്യങ്ങള്‍ കൂടി ചെയ്ത് താങ്കള്‍ ഡയസ്പോറയില്‍ കയറുന്നത് പൂര്‍ത്തിയാക്കു:" - skip: "തുടക്കമിടല്‍ മറികടക്കുക" - step_2: - find_your_friends_on_diaspora: "നിങ്ങളുടെ ഫേസ്ബുക്ക് സുഹൃത്തുക്കളെ ഡയസ്പോറയില്‍ കാണാന്‍ താല്പര്യം ഉണ്ടോ?" - skip: "മറികടക്കു" - step_3: - finish: "പൂര്‍ത്തിയാക്കു" - people_already_on_diaspora: "ഡയസ്പോറയില്‍ നേരത്തേയുള്ള ആളുകള്‍" - welcome: "ഡയസ്പോറയിലേയ്ക്ക് സ്വാഗതം!" + welcome: "സ്വാഗതം!" + welcome_with_name: "Welcome, %{name}!" + + finished: "Finished" + + fill_out_your_profile: "Fill out your profile" + profile_description: "Make it easier for people to find you by filling out your profile information." + profile_fields: + name: "Name" + birthday: "Birthday" + bio: "Bio" + tags: "Tags" + photo: "Photo" + gender: "Gender" + location: "Location" + + connect_to_your_other_social_networks: "Connect to your other social networks" + connect_with_people: "Connect with cool people" + connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + aspects: 'aspects' + connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." + featured_users: "Featured users" + + follow_your_interests: "Follow your interests" + connect_to: "Connect to" + + find_friends_from_facebook: "find friends from Facebook" + featured_tags: "Featured tags" + find_friends: "Find friends" + see_all_featured_users: "See all featured users" + + hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." public: does_not_exist: "%{username} ഉപയോക്താവ് നിലവിലില്ല!" + confirm_email: + email_confirmed: "Email %{email} activated" + email_not_confirmed: "Email could not be activated. Wrong link?" update: email_notifications_changed: "ഇമെയില്‍ അറിയിപ്പുകള്‍ മാറ്റി" + unconfirmed_email_changed: "Email changed. Needs activation." + unconfirmed_email_not_changed: "Email change failed" language_changed: "ഭാഷ മാറ്റി" language_not_changed: "ഭാഷ മാറ്റാനാകുന്നില്ല" - password_changed: "അടയാളവാക്ക് മാറ്റി" + password_changed: "Password changed. You can now log in with your new password." password_not_changed: "അടയാളവാക്ക് മാറ്റാനാകുന്നില്ല" webfinger: fetch_failed: "%{profile_url} -ന്റെ വെബ്ഫിംഗര്‍ പ്രൊഫൈല്‍ എടുക്കുന്നതില്‍ പരാജയം" From a9312daf6995f50900a65da3293fb447cced2f28 Mon Sep 17 00:00:00 2001 From: MrZYX Date: Mon, 15 Aug 2011 13:50:05 +0200 Subject: [PATCH 067/133] fixed syntax error in ml.yml --- config/locales/diaspora/ml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/diaspora/ml.yml b/config/locales/diaspora/ml.yml index 9f59c8d30..2ac6c7a42 100644 --- a/config/locales/diaspora/ml.yml +++ b/config/locales/diaspora/ml.yml @@ -395,7 +395,7 @@ ml: mentioned: mentioned: "താങ്കളെ ഒരു കുറിപ്പില്‍ സൂചിപ്പിച്ചു:" subject: "%{name} താങ്കളെ ഡയസ്പോറയില്‍* സൂചിപ്പിച്ചു" - liked: + liked: liked: "%{name} just liked your post" view_post: "View post >" confirm_email: From 78aa6d0943950abe12f468f7ca33f29ddfee13d8 Mon Sep 17 00:00:00 2001 From: MrZYX Date: Mon, 15 Aug 2011 14:01:36 +0200 Subject: [PATCH 068/133] updated locales --- config/locales/devise/devise.cs.yml | 4 +- config/locales/diaspora/bg.yml | 18 ++--- config/locales/diaspora/cs.yml | 74 ++++++++++----------- config/locales/diaspora/es.yml | 6 +- config/locales/diaspora/fr.yml | 4 +- config/locales/diaspora/sk.yml | 4 +- config/locales/diaspora/zh-TW.yml | 22 +++--- config/locales/javascript/javascript.cs.yml | 6 +- config/locales/javascript/javascript.sk.yml | 2 +- 9 files changed, 70 insertions(+), 70 deletions(-) diff --git a/config/locales/devise/devise.cs.yml b/config/locales/devise/devise.cs.yml index e7a006afc..46d2f995d 100644 --- a/config/locales/devise/devise.cs.yml +++ b/config/locales/devise/devise.cs.yml @@ -12,7 +12,7 @@ cs: send_instructions: "Během několika minut obdržíte email s instrukcemi k potvrzení vašeho účtu." failure: inactive: "Váš účet ještě nebyl aktivován." - invalid: "Neplatný email nebo heslo." + invalid: "Neplatné uživatelské jméno nebo heslo." invalid_token: "Neplatný autentizační token." locked: "Váš účet je uzamčen." timeout: "Vaše sezení vypršelo, pro pokračování se prosím přihlašte znovu." @@ -34,7 +34,7 @@ cs: no_account_till: "Váš účet nebude vytvořen dokud nepřistoupíte na uvedený odkaz a zaregistrujete se." subject: "Byli jste pozváni na Diasporu!" inviters: - accept_at: ", na %{url}, akceptujte kliknutím na odkaz." + accept_at: ", na %{url}, pozvánku můžete přijmout kliknutím na odkaz níže.\n" has_invited_you: "%{name} Vás pozval na Diasporu" have_invited_you: "%{names} Vás pozvali na Diasporu" reset_password_instructions: diff --git a/config/locales/diaspora/bg.yml b/config/locales/diaspora/bg.yml index 9c1702865..943995275 100644 --- a/config/locales/diaspora/bg.yml +++ b/config/locales/diaspora/bg.yml @@ -118,7 +118,7 @@ bg: content: "Можете да свържете следните услуги към Diaspora:" heading: "Свързване към услуги" tags_following: "Тагове, които следите" - unfollow_tag: "Stop following #%{tag}" + unfollow_tag: "Прекратяване следенето на #%{tag}" your_aspects: "Вашите аспекти" many: "%{count} аспекта" move_contact: @@ -253,7 +253,7 @@ bg: tagline_first_half: "Споделете каквото желаете," tagline_second_half: "с когото пожелаете." invitations: - a_facebook_user: "A Facebook user" + a_facebook_user: "Потребител на Facebook" check_token: not_found: "Данните за поканата не са намерени" create: @@ -501,7 +501,7 @@ bg: edit: "редактиране" edit_delete_photo: "Редактиране на описанието / изтриване" make_profile_photo: "ползване като профилна снимка" - show_original_post: "Show original post" + show_original_post: "Оригиналната публикация" update_photo: "Update Photo" update: error: "Снимката не бе изтрита." @@ -600,8 +600,8 @@ bg: failure: error: "възникна грешка при свързването с услугата" finder: - no_friends: "No Facebook friends found." - service_friends: "%{service} Friends" + no_friends: "Няма намерени приятели от Facebook." + service_friends: "Приятели от %{service}" index: connect_to_facebook: "Свързване с facebook" connect_to_tumblr: "Свързване с tumblr" @@ -616,7 +616,7 @@ bg: join_me_on_diaspora: "Присъединете се към мен в DIASPORA*" remote_friend: invite: "покани" - not_on_diaspora: "Not yet on Diaspora" + not_on_diaspora: "Все още не е в Diaspora" resend: "повторно изпращане" settings: "Настройки" shared: @@ -746,12 +746,12 @@ bg: your_email: "Вашата ел. поща" your_handle: "Вашият адрес в Diaspora" getting_started: - aspects: "aspects" + aspects: "аспекти" connect_to: "Свържете профила си с" connect_to_your_other_social_networks: "Свържете профила си с други социални мрежи" connect_with_people: "Свържете се с интересни хора" - connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" - connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Свържете се с хора поставяйки ги в един или няколко от вашите" + connect_with_people_explanation_pt2: "Групирането на контактите в аспекти ще ви позволи да споделяте/филрирате информация само с/от определена подгрупа от контактите ви." featured_tags: "Отличени тагове" featured_users: "Отличени потребители" fill_out_your_profile: "Попълнете профила си" diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 211b63d1f..8c36106f0 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -29,7 +29,7 @@ cs: reshare: attributes: root_guid: - taken: "You've already reshared that post!" + taken: "Toto zprávu už sdílíte." user: attributes: email: @@ -37,7 +37,7 @@ cs: person: invalid: "je neplatný." username: - invalid: "is invalid. We only allow letters, numbers, and underscores" + invalid: "je neplatné. Povolené znaky jsou pouze písmena, číslice a podtržítko" taken: "je již obsazeno." ago: "před %{time}" all_aspects: "Všechny aspekty" @@ -107,9 +107,9 @@ cs: content_1: "Vaše Diaspora ID je:" content_2: "Dejte to někomu a bude vás moci najít na Diaspoře." heading: "Diaspora ID" - donate: "Donate" + donate: "Přispět" handle_explanation: "Toto je vaše Diaspora ID. Podobně jako e-mailovou adresu ho můžete dál lidem a budete na něm dostupní." - keep_us_running: "Keep %{pod} running fast, buy our servers their monthly coffee fix!" + keep_us_running: "Pomozte %{pod} udržet rychlý, kupte našim serverům dávku kávy." no_contacts: "Žádné kontakty" no_tags: "No tags" people_sharing_with_you: "Lidé, kteří s vámi sdílí" @@ -118,7 +118,7 @@ cs: content: "Můžete připojit následující služby na Diasporu:" heading: "Připojit služby" tags_following: "Následované značky" - unfollow_tag: "Stop following #%{tag}" + unfollow_tag: "Přestat sledovat #%{tag}" your_aspects: "Vaše aspekty" many: "%{count} aspektů" move_contact: @@ -130,7 +130,7 @@ cs: name: "Název" no_contacts_message: featured_users: "featured users" - or_featured: "Or you can share with %{link}" + or_featured: "Nebo můžete sdílet s %{link}" try_adding_some_more_contacts: "You can search (top) or invite (right) more contacts." you_should_add_some_more_contacts: "You should add some more contacts!" no_posts_message: @@ -140,7 +140,7 @@ cs: seed: acquaintances: "Acquaintances" family: "Rodina" - friends: "Friends" + friends: "Přátelé" work: "Práce" selected_contacts: manage_your_aspects: "Spravovat vaše aspekty." @@ -218,7 +218,7 @@ cs: new: abandon_changes: "Zamítnout změny?" send: "Poslat" - sending: "Sending..." + sending: "Posílám..." subject: "předmět" to: "pro" show: @@ -253,7 +253,7 @@ cs: tagline_first_half: "Sdílejte co chcete," tagline_second_half: "s kým chcete." invitations: - a_facebook_user: "A Facebook user" + a_facebook_user: "Uživatel Facebooku" check_token: not_found: "Pozvánkový tiket nebyl nalezen" create: @@ -264,8 +264,8 @@ cs: rejected: "Následující emailové adresy mají problémy: " sent: "Pozvánky byly poslány pro:" edit: - accept_your_invitation: "Accept your invitation" - your_account_awaits: "Your account awaits!" + accept_your_invitation: "Přijměte pozvání" + your_account_awaits: "Váš účet čeká!" new: already_invited: "Následující lidé nepřijali vaše pozvání:" aspect: "Aspekt" @@ -393,31 +393,31 @@ cs: zero: "%{actors} s vámi začali sdílet." notifier: a_post_you_shared: "a post." - click_here: "click here" + click_here: "klikněte zde" comment_on_post: - reply: "Reply or view %{name}'s post >" + reply: "Zobrazit zprávu od %{name} nebo na ni odpovědět >" confirm_email: click_link: "To activate your new e-mail address %{unconfirmed_email}, please click this link:" subject: "Please activate your new e-mail address %{unconfirmed_email}" - email_sent_by_diaspora: "This email was sent by Diaspora. If you'd like to stop getting emails like this," + email_sent_by_diaspora: "Tento email odeslala Diaspora. Pokud si nepřejete nadále dostávat takovéto emaily," hello: "Vítej %{name}!" liked: liked: "%{name} si právě oblíbil váš příspěvek: " - view_post: "View post >" + view_post: "Zobrazit zprávu >" mentioned: mentioned: "zmínil jste v příspěvku:" subject: "%{name} vás zmínil na Diaspoře*" private_message: - reply_to_or_view: "Reply to or view this conversation >" + reply_to_or_view: "Zobrazit konverzaci nebo na ni odpovědět >" single_admin: admin: "Váš Diaspora administrátor" subject: "Zpráva o vašem účtu na Diaspoře:" started_sharing: sharing: "s vámi začal sdílet!" subject: "%{name} s vámi začal sdílet na Diaspoře*" - view_profile: "View %{name}'s profile" + view_profile: "Zobrazit profil %{name}" thanks: "Díky," - to_change_your_notification_settings: "to change your notification settings" + to_change_your_notification_settings: "upravte si nastavení oznámení." ok: "OK" or: "nebo" password: "Heslo" @@ -457,7 +457,7 @@ cs: add_some: "přidat nějaké" does_not_exist: "Osoba neexistuje!" edit: "upravit" - has_not_shared_with_you_yet: "%{name} has not shared any posts with you yet!" + has_not_shared_with_you_yet: "%{name} s vámi zatím žádnou zprávu nesdílí!" incoming_request: "%{name} s vámi chce sdílet" mention: "Zmínka" message: "Zpráva" @@ -501,7 +501,7 @@ cs: edit: "upravit" edit_delete_photo: "Upravit popis fotky / smazat fotku" make_profile_photo: "vytvořit profilovou fotku" - show_original_post: "Show original post" + show_original_post: "Zobrazit původní zprávu" update_photo: "Aktualizovat fotku" update: error: "Nepodařilo se upravit fotku." @@ -581,7 +581,7 @@ cs: create: failure: "There was an error resharing this post." reshare: - deleted: "Original post deleted by author." + deleted: "Původní zpráva byla autorem odstraněna." reshare: few: "%{count} Reshares" many: "%{count} Reshares" @@ -600,7 +600,7 @@ cs: failure: error: "nastala chyba při připojení ke službě" finder: - no_friends: "No Facebook friends found." + no_friends: "Žádní přátelé z Facebooku nenalezeni." service_friends: "%{service} Friends" index: connect_to_facebook: "Připojit na Facebook" @@ -616,7 +616,7 @@ cs: join_me_on_diaspora: "Připoj se ke mě na DIASPORU*" remote_friend: invite: "pozvat" - not_on_diaspora: "Not yet on Diaspora" + not_on_diaspora: "Ještě není na Diaspoře" resend: "přeposlat" settings: "Nastavení" shared: @@ -746,32 +746,32 @@ cs: your_email: "Váš email" your_handle: "Vaše Diaspora ID" getting_started: - aspects: "aspects" - connect_to: "Connect to" - connect_to_your_other_social_networks: "Connect to your other social networks" + aspects: "aspektů" + connect_to: "Připojit k" + connect_to_your_other_social_networks: "Připojit k dalším sociálním sítím" connect_with_people: "Connect with cool people" - connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" - connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "Spojte se s lidmi jejich umístěním do jednoho nebo více z vašich" + connect_with_people_explanation_pt2: "Apekty jsou snadný způsob, jak seskupovat nové a známé tváře. Dovolují jednoduše sdílet s podmnožinami vašich kontaktů." featured_tags: "Featured tags" featured_users: "Featured users" - fill_out_your_profile: "Fill out your profile" + fill_out_your_profile: "Vyplňte si svůj profil" find_friends: "Find friends" - find_friends_from_facebook: "find friends from Facebook" + find_friends_from_facebook: "najít přátele z Facebooku" finished: "Dokončeno!" follow_your_interests: "Follow your interests" hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." - profile_description: "Make it easier for people to find you by filling out your profile information." + profile_description: "Zjednodušte ostatním vás najít vyplněním informací ve vašem profilu." profile_fields: bio: "Bio" - birthday: "Birthday" - gender: "Gender" - location: "Location" - name: "Name" - photo: "Photo" + birthday: "Datum narození" + gender: "Pohlaví" + location: "Bydliště" + name: "Jméno" + photo: "Fotografie" tags: "Tags" see_all_featured_users: "See all featured users" welcome: "Vítejte na Diaspoře!" - welcome_with_name: "Welcome, %{name}!" + welcome_with_name: "Vítej, %{name}!" public: does_not_exist: "Uživatel %{username} neexistuje!" update: diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index 1f887d3e0..8d591cb53 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -600,8 +600,8 @@ es: failure: error: "hubo un error conectando ese servicio" finder: - no_friends: "No Facebook friends found." - service_friends: "%{service} Friends" + no_friends: "No se han encontrados amigos de Facebook." + service_friends: "%{service} Amigos" index: connect_to_facebook: "Conecta con Facebook" connect_to_tumblr: "Conecta con Tumblr" @@ -616,7 +616,7 @@ es: join_me_on_diaspora: "Comparte conmigo en DIASPORA*." remote_friend: invite: "invitar" - not_on_diaspora: "Not yet on Diaspora" + not_on_diaspora: "Aún no en Diaspora*" resend: "reenviar" settings: "Configuración" shared: diff --git a/config/locales/diaspora/fr.yml b/config/locales/diaspora/fr.yml index edb0d71d1..ea3ba4c1f 100644 --- a/config/locales/diaspora/fr.yml +++ b/config/locales/diaspora/fr.yml @@ -669,7 +669,7 @@ fr: shared_with: "Shared with: %{aspect_names}" unlike: "Je n'aime pas" via: "via %{link}" - viewable_to_anyone: "This post is viewable to anyone on the web" + viewable_to_anyone: "Publication visible par n'importe qui sur le web" status_messages: create: success: "Mention de : %{names}" @@ -697,7 +697,7 @@ fr: success: "Successfully stopped following: #%{name}" tags: show: - follow: "Follow #%{tag}" + follow: "Suivre #%{tag}" following: "Following #%{tag}" nobody_talking: "Personne ne parle encore de %{tag}." people_tagged_with: "Personnes taguées avec %{tag}" diff --git a/config/locales/diaspora/sk.yml b/config/locales/diaspora/sk.yml index 6c0793d88..f7e88010a 100644 --- a/config/locales/diaspora/sk.yml +++ b/config/locales/diaspora/sk.yml @@ -81,7 +81,7 @@ sk: success: "Váš nový aspekt %{name} bol vytvorený" destroy: failure: "%{name} is not empty and could not be removed." - success: "Užívateľ %{name} bol úspešne odstránený." + success: "%{name} bol úspešne odstránený." edit: add_existing: "Pridať existujúci kontakt" aspect_list_is_not_visible: "aspect list is hidden to others in aspect" @@ -145,7 +145,7 @@ sk: selected_contacts: manage_your_aspects: "Manage your aspects." no_contacts: "You don't have any contacts here yet." - view_all_contacts: "View all contacts" + view_all_contacts: "Zobraziť všetky kontakty" show: edit_aspect: "upraviť aspekt" update: diff --git a/config/locales/diaspora/zh-TW.yml b/config/locales/diaspora/zh-TW.yml index 2d72f75b2..7554b7b05 100644 --- a/config/locales/diaspora/zh-TW.yml +++ b/config/locales/diaspora/zh-TW.yml @@ -37,7 +37,7 @@ zh-TW: person: invalid: "不合格." username: - invalid: "is invalid. We only allow letters, numbers, and underscores" + invalid: "不被接受. 只能夠使用字母, 數字, 以及底線符號" taken: "已被使用." ago: "%{time}前" all_aspects: "所有面向" @@ -118,7 +118,7 @@ zh-TW: content: "你可以連結以下服務至 Diaspora:" heading: "連結服務" tags_following: "追蹤的標籤" - unfollow_tag: "Stop following #%{tag}" + unfollow_tag: "停止追隨#%{tag}" your_aspects: "你的面向" many: "%{count}個面向" move_contact: @@ -253,7 +253,7 @@ zh-TW: tagline_first_half: "分享你想分享的東西," tagline_second_half: "給你想分享的人." invitations: - a_facebook_user: "A Facebook user" + a_facebook_user: "Facebook 使用者" check_token: not_found: "找不到該邀請信物" create: @@ -392,7 +392,7 @@ zh-TW: other: "%{actors}開始跟你分享了." zero: "%{actors}開始跟你分享了." notifier: - a_post_you_shared: "a post." + a_post_you_shared: "一則貼文." click_here: "按這裡" comment_on_post: reply: "回或看 %{name} 的貼文 >" @@ -473,7 +473,7 @@ zh-TW: fail: "抱歉, 找不到 %{handle}." zero: "沒有聯絡人" photos: - comment_email_subject: "%{name}'s photo" + comment_email_subject: "%{name} 的相片" create: integrity_error: "相片上傳失敗. 你確定它是圖片嗎?" runtime_error: "相片上傳失敗. 你確定有扣安全帶嗎?" @@ -501,7 +501,7 @@ zh-TW: edit: "編輯" edit_delete_photo: "編輯相片敘述或刪除相片" make_profile_photo: "選為個人照" - show_original_post: "Show original post" + show_original_post: "顯示原文" update_photo: "更新相片" update: error: "相片編輯失敗." @@ -577,7 +577,7 @@ zh-TW: new_request_to_person: sent: "已送出!" reshares: - comment_email_subject: "%{resharer}'s reshare of %{author}'s post" + comment_email_subject: "%{resharer} 轉貼了 %{author} 的貼文" create: failure: "轉貼這篇貼文時發生錯誤." reshare: @@ -600,8 +600,8 @@ zh-TW: failure: error: "與該服務連結時有錯誤" finder: - no_friends: "No Facebook friends found." - service_friends: "%{service} Friends" + no_friends: "沒有 Facebook 朋友." + service_friends: "%{service} 朋友" index: connect_to_facebook: "與 Facebook 連結" connect_to_tumblr: "與 Tumblr 連結" @@ -616,7 +616,7 @@ zh-TW: join_me_on_diaspora: "跟我一起加入 DIASPORA*" remote_friend: invite: "邀請" - not_on_diaspora: "Not yet on Diaspora" + not_on_diaspora: "還沒來 Diaspora" resend: "重送" settings: "設定" shared: @@ -746,7 +746,7 @@ zh-TW: your_email: "你的電子郵件" your_handle: "你的 diaspora 識別碼" getting_started: - aspects: "aspects" + aspects: "面向" connect_to: "連結至" connect_to_your_other_social_networks: "與其他社交網站連結" connect_with_people: "與酷咖連結" diff --git a/config/locales/javascript/javascript.cs.yml b/config/locales/javascript/javascript.cs.yml index e0da5012b..69e3ce3dd 100644 --- a/config/locales/javascript/javascript.cs.yml +++ b/config/locales/javascript/javascript.cs.yml @@ -23,10 +23,10 @@ cs: no_more: "Žádné další příspěvky." publisher: at_least_one_aspect: "Musíte publikovat alespoň do jednoho aspektu" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "Omezený - váše zpráva bude přístupná pouze lidem z vybraných aspektů" + public: "Veřejné - váši zprávu si bude moci přečíst kdokoliv a může být nalezena vyhledávači" reshares: - duplicate: "You've already reshared that post!" + duplicate: "Tato zprávu už sdílíte!" search_for: "Hledat {{name}}" show_more: "zobrazit více" timeago: diff --git a/config/locales/javascript/javascript.sk.yml b/config/locales/javascript/javascript.sk.yml index 661d5d3a4..44686308e 100644 --- a/config/locales/javascript/javascript.sk.yml +++ b/config/locales/javascript/javascript.sk.yml @@ -14,7 +14,7 @@ sk: other: "In {{count}} aspects" zero: "Add to aspect" comments: - hide: "hide comments" + hide: "skyť komentáre" show: "show all comments" confirm_dialog: "Ste si istý?" failed_to_like: "Failed to like!" From 669cd8578e86d75e3c140cfc46cfcba57dfe8d83 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Mon, 15 Aug 2011 12:35:32 -0700 Subject: [PATCH 069/133] scoped invite_user_by_email job into Mail module --- app/controllers/invitations_controller.rb | 2 +- app/models/job/invite_user_by_email.rb | 14 -------------- app/models/job/mail/invite_user_by_email.rb | 16 ++++++++++++++++ .../jobs/{ => mail}/invite_user_by_email_spec.rb | 4 ++-- 4 files changed, 19 insertions(+), 17 deletions(-) delete mode 100644 app/models/job/invite_user_by_email.rb create mode 100644 app/models/job/mail/invite_user_by_email.rb rename spec/models/jobs/{ => mail}/invite_user_by_email_spec.rb (76%) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 145bb2660..d063ef839 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -38,7 +38,7 @@ class InvitationsController < Devise::InvitationsController end end - good_emails.each{|e| Resque.enqueue(Job::InviteUserByEmail, current_user.id, e, aspect, message)} + good_emails.each{|e| Resque.enqueue(Job::Mail::InviteUserByEmail, current_user.id, e, aspect, message)} if bad_emails.any? flash[:error] = I18n.t('invitations.create.sent') + good_emails.join(', ') + " "+ I18n.t('invitations.create.rejected') + bad_emails.join(', ') diff --git a/app/models/job/invite_user_by_email.rb b/app/models/job/invite_user_by_email.rb deleted file mode 100644 index 7f5c0eed5..000000000 --- a/app/models/job/invite_user_by_email.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - - -module Job - class InviteUserByEmail < Base - @queue = :mail - def self.perform(sender_id, email, aspect_id, invite_message) - user = User.find(sender_id) - user.invite_user(aspect_id, 'email', email, invite_message) - end - end -end diff --git a/app/models/job/mail/invite_user_by_email.rb b/app/models/job/mail/invite_user_by_email.rb new file mode 100644 index 000000000..6e4275f60 --- /dev/null +++ b/app/models/job/mail/invite_user_by_email.rb @@ -0,0 +1,16 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3 or later. See +# the COPYRIGHT file. + + +module Job + module Mail + class InviteUserByEmail < Base + @queue = :mail + def self.perform(sender_id, email, aspect_id, invite_message) + user = User.find(sender_id) + user.invite_user(aspect_id, 'email', email, invite_message) + end + end + end +end diff --git a/spec/models/jobs/invite_user_by_email_spec.rb b/spec/models/jobs/mail/invite_user_by_email_spec.rb similarity index 76% rename from spec/models/jobs/invite_user_by_email_spec.rb rename to spec/models/jobs/mail/invite_user_by_email_spec.rb index a1d04de22..8f3181737 100644 --- a/spec/models/jobs/invite_user_by_email_spec.rb +++ b/spec/models/jobs/mail/invite_user_by_email_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Job::InviteUserByEmail do +describe Job::Mail::InviteUserByEmail do before do @sender = alice @email = 'bob@bob.com' @@ -18,6 +18,6 @@ describe Job::InviteUserByEmail do it 'calls invite_user with email param' do @sender.should_receive(:invite_user).with(@aspect_id, 'email', @email, @message) - Job::InviteUserByEmail.perform(@sender.id, @email, @aspect_id, @message) + Job::Mail::InviteUserByEmail.perform(@sender.id, @email, @aspect_id, @message) end end From 32ae21a213b3c9fb713e8ceb202416aede355300 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Mon, 15 Aug 2011 15:15:43 -0700 Subject: [PATCH 070/133] removed user invite counter, as it was already depricated --- app/controllers/admins_controller.rb | 12 --- app/controllers/invitations_controller.rb | 50 ++++++------- app/controllers/registrations_controller.rb | 1 - app/models/invitation.rb | 9 +-- app/models/user.rb | 3 +- app/views/admins/user_search.html.haml | 1 - config/routes.rb | 1 - ...5210933_remove_invite_counter_from_user.rb | 9 +++ db/schema.rb | 3 +- spec/controllers/admins_controller_spec.rb | 28 +------ .../invitations_controller_spec.rb | 18 +---- spec/controllers/services_controller_spec.rb | 10 ++- spec/models/invitation_spec.rb | 18 ----- spec/models/user/invite_spec.rb | 73 ++++++++----------- 14 files changed, 80 insertions(+), 156 deletions(-) create mode 100644 db/migrate/20110815210933_remove_invite_counter_from_user.rb diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index 07459baac..5a6256221 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -8,18 +8,6 @@ class AdminsController < ApplicationController @users = params[:user].empty? ? [] : User.where(params[:user]) end - def add_invites - user = User.find(params[:user_id]) - - if user.increment(:invites, 10).save - flash[:notice] = "Great Job!" - else - flash[:alert] = "there was a problem adding invites" - end - - redirect_to user_search_path(:user => { :id => user.id }) - end - def admin_inviter opts = {:service => 'email', :identifier => params[:identifier]} existing_user = Invitation.find_existing_user('email', params[:identifier]) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index d063ef839..be2993777 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -16,35 +16,35 @@ class InvitationsController < Devise::InvitationsController end def create - if !AppConfig[:open_invitations] && current_user.invites == 0 - flash[:error] = I18n.t 'invitations.create.no_more' + unless AppConfig[:open_invitations] + flash[:error] = I18n.t 'invitations.create.no_more' + redirect_to :back + return + end + aspect = params[:user].delete(:aspects) + message = params[:user].delete(:invite_messages) + emails = params[:user][:email].to_s.gsub(/\s/, '').split(/, */) + + good_emails, bad_emails = emails.partition{|e| e.try(:match, Devise.email_regexp)} + + if good_emails.include?(current_user.email) + if good_emails.length == 1 + flash[:error] = I18n.t 'invitations.create.own_address' redirect_to :back return - end - aspect = params[:user].delete(:aspects) - message = params[:user].delete(:invite_messages) - emails = params[:user][:email].to_s.gsub(/\s/, '').split(/, */) - - good_emails, bad_emails = emails.partition{|e| e.try(:match, Devise.email_regexp)} - - if good_emails.include?(current_user.email) - if good_emails.length == 1 - flash[:error] = I18n.t 'invitations.create.own_address' - redirect_to :back - return - else - bad_emails.push(current_user.email) - good_emails.delete(current_user.email) - end - end - - good_emails.each{|e| Resque.enqueue(Job::Mail::InviteUserByEmail, current_user.id, e, aspect, message)} - - if bad_emails.any? - flash[:error] = I18n.t('invitations.create.sent') + good_emails.join(', ') + " "+ I18n.t('invitations.create.rejected') + bad_emails.join(', ') else - flash[:notice] = I18n.t('invitations.create.sent') + good_emails.join(', ') + bad_emails.push(current_user.email) + good_emails.delete(current_user.email) end + end + + good_emails.each{|e| Resque.enqueue(Job::Mail::InviteUserByEmail, current_user.id, e, aspect, message)} + + if bad_emails.any? + flash[:error] = I18n.t('invitations.create.sent') + good_emails.join(', ') + " "+ I18n.t('invitations.create.rejected') + bad_emails.join(', ') + else + flash[:notice] = I18n.t('invitations.create.sent') + good_emails.join(', ') + end redirect_to :back end diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 013fd820c..7385e90b5 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -7,7 +7,6 @@ class RegistrationsController < Devise::RegistrationsController def create @user = User.build(params[:user]) - @user.invites = 20 if @user.save flash[:notice] = I18n.t 'registrations.create.success' @user.seed_aspects diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 49e172c50..6ba61efcf 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -12,6 +12,7 @@ class Invitation < ActiveRecord::Base def self.invite(opts = {}) opts[:identifier].downcase! if opts[:identifier] + # return if the current user is trying to invite himself via email return false if opts[:identifier] == opts[:from].email existing_user = self.find_existing_user(opts[:service], opts[:identifier]) @@ -51,10 +52,11 @@ class Invitation < ActiveRecord::Base result end - def self.create_invitee(opts = {}) + # @params opts [Hash] Takes :from, :existing_user, :service, :identifier, :message + # @return [User] + def self.create_invitee(opts={}) invitee = opts[:existing_user] || new_user_by_service_and_identifier(opts[:service], opts[:identifier]) return invitee if opts[:service] == 'email' && !opts[:identifier].match(Devise.email_regexp) - invitee.invites = opts[:invites] || 10 if invitee.new_record? invitee.errors.clear invitee.serialized_private_key = User.generate_key if invitee.serialized_private_key.blank? @@ -69,9 +71,6 @@ class Invitation < ActiveRecord::Base :recipient => invitee, :aspect => opts[:into], :message => opts[:message]) - - opts[:from].invites -= 1 unless opts[:from].invites == 0 - opts[:from].save! invitee.reload end invitee.skip_invitation = (opts[:service] != 'email') diff --git a/app/models/user.rb b/app/models/user.rb index ec38e9392..ce408d7df 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -269,8 +269,7 @@ class User < ActiveRecord::Base ###Invitations############ def invite_user(aspect_id, service, identifier, invite_message = "") - aspect = aspects.find(aspect_id) - if aspect + if aspect = aspects.find(aspect_id) Invitation.invite(:service => service, :identifier => identifier, :from => self, diff --git a/app/views/admins/user_search.html.haml b/app/views/admins/user_search.html.haml index feb80da2c..2dbca64a7 100644 --- a/app/views/admins/user_search.html.haml +++ b/app/views/admins/user_search.html.haml @@ -37,7 +37,6 @@ = user.person.profile.inspect %br = "invite token: #{accept_invitation_url(user, :invitation_token => user.invitation_token)}" if user.invitation_token - = link_to "add 10 invites for this user", add_invites_path(:user_id => user.id) %br %br %br diff --git a/config/routes.rb b/config/routes.rb index 49ef87a95..bbdec44f0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -90,7 +90,6 @@ Diaspora::Application.routes.draw do scope 'admins', :controller => :admins do match :user_search get :admin_inviter - get :add_invites, :as => 'add_invites' get :stats, :as => 'pod_stats' end diff --git a/db/migrate/20110815210933_remove_invite_counter_from_user.rb b/db/migrate/20110815210933_remove_invite_counter_from_user.rb new file mode 100644 index 000000000..819216353 --- /dev/null +++ b/db/migrate/20110815210933_remove_invite_counter_from_user.rb @@ -0,0 +1,9 @@ +class RemoveInviteCounterFromUser < ActiveRecord::Migration + def self.up + remove_column :users, :invites + end + + def self.down + add_column :users, :invites, :integer, :default => 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index a4ab4ab6e..0f485397a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110812175614) do +ActiveRecord::Schema.define(:version => 20110815210933) do create_table "aspect_memberships", :force => true do |t| t.integer "aspect_id", :null => false @@ -386,7 +386,6 @@ ActiveRecord::Schema.define(:version => 20110812175614) do create_table "users", :force => true do |t| t.string "username" t.text "serialized_private_key" - t.integer "invites", :default => 0, :null => false t.boolean "getting_started", :default => true, :null => false t.boolean "disable_mail", :default => false, :null => false t.string "language" diff --git a/spec/controllers/admins_controller_spec.rb b/spec/controllers/admins_controller_spec.rb index 5585f8898..5dfd068ae 100644 --- a/spec/controllers/admins_controller_spec.rb +++ b/spec/controllers/admins_controller_spec.rb @@ -60,33 +60,6 @@ describe AdminsController do end end - describe '#add_invites' do - context 'admin not signed in' do - it 'is behind redirect_unless_admin' do - get :add_invites - response.should redirect_to root_url - end - end - - context 'admin signed in' do - before do - AppConfig[:admins] = [@user.username] - end - - it "redirects to :back with user id" do - get :add_invites, :user_id => @user.id - response.should redirect_to user_search_path(:user => { :id => @user.id }) - end - - it "increases user's invite by 10" do - expect { - get :add_invites, :user_id => @user.id - }.to change { @user.reload.invites }.by(10) - flash.notice.should include('Great Job') - end - end - end - describe '#admin_inviter' do context 'admin not signed in' do it 'is behind redirect_unless_admin' do @@ -110,6 +83,7 @@ describe AdminsController do get :admin_inviter, :identifier => 'bob@moms.com' response.should be_redirect end + it 'invites a new user' do Invitation.should_receive(:create_invitee).with(:service => 'email', :identifier => 'bob@moms.com') get :admin_inviter, :identifier => 'bob@moms.com' diff --git a/spec/controllers/invitations_controller_spec.rb b/spec/controllers/invitations_controller_spec.rb index 58855a550..460917783 100644 --- a/spec/controllers/invitations_controller_spec.rb +++ b/spec/controllers/invitations_controller_spec.rb @@ -8,6 +8,7 @@ describe InvitationsController do include Devise::TestHelpers before do + AppConfig[:open_invitations] = true @user = alice @aspect = @user.aspects.first @@ -17,8 +18,6 @@ describe InvitationsController do describe "#create" do before do - @user.invites = 5 - sign_in :user, @user @invite = {:invite_message=>"test", :aspect_id=> @aspect.id.to_s, :email=>"abc@example.com"} @controller.stub!(:current_user).and_return(@user) @@ -50,19 +49,9 @@ describe InvitationsController do flash[:error].should =~ /lala@foo/ end - it "doesn't invite anyone if you have 0 invites" do - @user.invites = 0 - @user.save! - - Resque.should_not_receive(:enqueue) - post :create, :user => @invite.merge(:email => "mbs@gmail.com, foo@bar.com, foo.com, lala@foo, cool@bar.com") - end - - it "allows invitations without limit if invitations are open" do + it "allows invitations without if invitations are open" do open_bit = AppConfig[:open_invitations] AppConfig[:open_invitations] = true - @user.invites = 0 - @user.save! Resque.should_receive(:enqueue).once post :create, :user => @invite @@ -87,7 +76,6 @@ describe InvitationsController do describe "#update" do before do - @user.invites = 5 @invited_user = @user.invite_user(@aspect.id, 'email', "a@a.com") @accept_params = {:user=> {:password_confirmation =>"password", @@ -145,8 +133,6 @@ describe InvitationsController do describe '#resend' do before do - @user.invites = 5 - sign_in :user, @user @controller.stub!(:current_user).and_return(@user) request.env["HTTP_REFERER"]= 'http://test.host/cats/foo' diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index 11d161dd0..e7674e675 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -18,8 +18,6 @@ describe ServicesController do before do @user = alice @aspect = @user.aspects.first - @user.invites = 100 - @user.save sign_in :user, @user @controller.stub!(:current_user).and_return(@user) @@ -114,6 +112,13 @@ describe ServicesController do @invite_params = {:provider => 'facebook', :uid => @uid, :aspect_id => @user.aspects.first.id} end + it 'enqueues an invite job if the fb user has a username' do + pending + @invite_params[:provider] = "email" + @invite_params[:uid] = "username@facebook.com" + put :inviter, @invite_params + end + it 'sets the subject' do put :inviter, @invite_params assigns[:subject].should_not be_nil @@ -152,7 +157,6 @@ describe ServicesController do it 'disregares the amount of invites if open_invitations are enabled' do open_bit = AppConfig[:open_invitations] AppConfig[:open_invitations] = true - @user.invites = 0 lambda { put :inviter, @invite_params diff --git a/spec/models/invitation_spec.rb b/spec/models/invitation_spec.rb index 19c37ffb3..8a3b3bb67 100644 --- a/spec/models/invitation_spec.rb +++ b/spec/models/invitation_spec.rb @@ -9,8 +9,6 @@ describe Invitation do let(:aspect) { user.aspects.first } before do - user.invites = 20 - user.save @email = 'maggie@example.com' Devise.mailer.deliveries = [] end @@ -165,22 +163,6 @@ describe Invitation do Invitation.invite(:from => user, :service => 'email', :identifier => eve.email, :into => aspect) end - it 'decrements the invite count of the from user' do - message = "How've you been?" - lambda { - new_user = Invitation.invite(:from => user, :service => 'email', :identifier => @email, :into => aspect, :message => message) - }.should change(user, :invites).by(-1) - end - - it "doesn't decrement counter past zero" do - user.invites = 0 - user.save! - message = "How've you been?" - lambda { - Invitation.invite(:from => user, :service => 'email', :identifier => @email, :into => aspect, :message => message) - }.should_not change(user, :invites) - end - context 'invalid email' do it 'return a user with errors' do new_user = Invitation.invite(:service => 'email', :identifier => "fkjlsdf", :from => user, :into => aspect) diff --git a/spec/models/user/invite_spec.rb b/spec/models/user/invite_spec.rb index 8756a485e..41ce0e6c7 100644 --- a/spec/models/user/invite_spec.rb +++ b/spec/models/user/invite_spec.rb @@ -5,97 +5,84 @@ require 'spec_helper' describe User do - let(:inviter) {new_user = eve; new_user.invites = 5; new_user.save; new_user;} - let(:aspect) {inviter.aspects.create(:name => "awesome")} - let(:another_user) {alice} - let(:wrong_aspect) {another_user.aspects.create(:name => "super")} - let(:inviter_with_3_invites) { new_user = Factory.create(:user); new_user.invites = 3; new_user.save; new_user;} - let(:aspect2) {inviter_with_3_invites.aspects.create(:name => "Jersey Girls")} - - before do - @email = "bob@bob.com" - end - context "creating invites" do + before do + @aspect = eve.aspects.first + @email = "bob@bob.com" + end + it 'requires your aspect' do lambda { - inviter.invite_user(wrong_aspect.id, "email", "maggie@example.com") + eve.invite_user(alice.aspects.first.id, "email", "maggie@example.com") }.should raise_error ActiveRecord::RecordNotFound end it 'takes a service parameter' do @invite_params = {:service => 'email'} Invitation.should_receive(:invite).with(hash_including(@invite_params)) - inviter.invite_user(aspect.id, 'email', @email) + eve.invite_user(@aspect.id, 'email', @email) end it 'takes an indentifier parameter' do @invite_params = {:identifier => @email} Invitation.should_receive(:invite).with(hash_including(@invite_params)) - inviter.invite_user(aspect.id, 'email', @email) + eve.invite_user(@aspect.id, 'email', @email) end it 'calls Invitation.invite' do Invitation.should_receive(:invite) - inviter.invite_user(aspect.id, 'email', @email) + eve.invite_user(@aspect.id, 'email', @email) end it 'has an invitation' do - inviter.invite_user(aspect.id, 'email', @email).invitations_to_me.count.should == 1 + eve.invite_user(@aspect.id, 'email', @email).invitations_to_me.count.should == 1 end it 'creates it with an email' do - inviter.invite_user(aspect.id, 'email', @email).email.should == @email + eve.invite_user(@aspect.id, 'email', @email).email.should == @email end it "throws if you try to add someone you're connected to" do - connect_users(inviter, aspect, another_user, wrong_aspect) - proc{ - inviter.invite_user(aspect.id, 'email', another_user.email) + connect_users(eve, @aspect, alice, alice.aspects.first) + lambda { + eve.invite_user(@aspect.id, 'email', alice.email) }.should raise_error ActiveRecord::RecordNotUnique end - end - - context "limit on invites" do - it 'does not invite people I already invited' do - inviter_with_3_invites.invite_user(aspect2.id, 'email', "email1@example.com") - proc{ - inviter_with_3_invites.invite_user(aspect2.id, 'email', "email1@example.com") + eve.invite_user(@aspect.id, 'email', "email1@example.com") + lambda { + eve.invite_user(@aspect.id, 'email', "email1@example.com") }.should raise_error /You already invited this person/ end end - describe "#accept_invitation!" do - let(:invited_user) {@invited_user_pre.accept_invitation!(:invitation_token => "abc", - :email => "a@a.com", - :username => "user", - :password => "secret", - :password_confirmation => "secret", - :person => {:profile => {:first_name => "Bob", - :last_name => "Smith"}} )} - before do - @invited_user_pre = Invitation.invite(:from => inviter, :service => 'email', :identifier => 'invitee@example.org', :into => aspect).reload + invite_pre = Invitation.invite(:from => eve, :service => 'email', :identifier => 'invitee@example.org', :into => eve.aspects.first).reload @person_count = Person.count + @invited_user = invite_pre.accept_invitation!(:invitation_token => "abc", + :email => "a@a.com", + :username => "user", + :password => "secret", + :password_confirmation => "secret", + :person => {:profile => {:first_name => "Bob", + :last_name => "Smith"}} ) + end context 'after invitation acceptance' do - before do - invited_user.reload - end it 'destroys the invitations' do - invited_user.invitations_to_me.count.should == 0 + @invited_user.invitations_to_me.count.should == 0 end + it "should create the person with the passed in params" do Person.count.should == @person_count + 1 - invited_user.person.profile.first_name.should == "Bob" + @invited_user.person.profile.first_name.should == "Bob" end it 'resolves incoming invitations into contact requests' do - inviter.contacts.where(:person_id => invited_user.person.id).count.should == 1 + eve.contacts.where(:person_id => @invited_user.person.id).count.should == 1 end end end From 511517b3c7415287db4ba4c48ef023333c116f62 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Mon, 15 Aug 2011 16:44:37 -0700 Subject: [PATCH 071/133] cleaned up and documented Invitation. moved an action into a User before_create callback --- app/models/invitation.rb | 79 ++++++++++++++++++++++------------ app/models/user.rb | 34 ++++++++++++--- spec/models/invitation_spec.rb | 26 ----------- spec/models/user_spec.rb | 36 ++++++++++++++++ 4 files changed, 116 insertions(+), 59 deletions(-) diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 6ba61efcf..04c29b4b7 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -1,62 +1,78 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. -# + class Invitation < ActiveRecord::Base belongs_to :sender, :class_name => 'User' belongs_to :recipient, :class_name => 'User' belongs_to :aspect - validates_presence_of :sender, :recipient, :aspect + validates_presence_of :sender, + :recipient, + :aspect - def self.invite(opts = {}) + # @param opts [Hash] Takes :identifier, :service, :idenfitier, :from, :message + # @return [User] + def self.invite(opts={}) opts[:identifier].downcase! if opts[:identifier] # return if the current user is trying to invite himself via email return false if opts[:identifier] == opts[:from].email - existing_user = self.find_existing_user(opts[:service], opts[:identifier]) - - if existing_user + if existing_user = self.find_existing_user(opts[:service], opts[:identifier]) + # If the sender of the invitation is already connected to the person + # he is inviting, raise an error. if opts[:from].contact_for(opts[:from].person) raise "You are already connceted to this person" + + # Check whether or not the existing User has already been invited; + # and if so, start sharing with the Person. elsif not existing_user.invited? opts[:from].share_with(existing_user.person, opts[:into]) return + + # If the sender has already invited the recipient, raise an error. elsif Invitation.where(:sender_id => opts[:from].id, :recipient_id => existing_user.id).first raise "You already invited this person" + + # When everything checks out, we merge the existing user into the + # options hash to pass on to self.create_invitee. + else + opts.merge(:existing_user => existing_user) end end - opts[:existing_user] = existing_user + create_invitee(opts) end + # @param service [String] String representation of the service invitation provider (i.e. facebook, email) + # @param identifier [String] String representation of the reciepients identity on the provider (i.e. 'bob.smith', bob@aol.com) + # @return [User] def self.find_existing_user(service, identifier) - existing_user = User.where(:invitation_service => service, - :invitation_identifier => identifier).first - if service == 'email' - existing_user ||= User.where(:email => identifier).first - else - existing_user ||= User.joins(:services).where(:services => {:type => "Services::#{service.titleize}", :uid => identifier}).first + unless existing_user = User.where(:invitation_service => service, + :invitation_identifier => identifier).first + if service == 'email' + existing_user ||= User.where(:email => identifier).first + else + existing_user ||= User.joins(:services).where(:services => {:type => "Services::#{service.titleize}", :uid => identifier}).first + end end existing_user end - def self.new_user_by_service_and_identifier(service, identifier) - result = User.new() - result.invitation_service = service - result.invitation_identifier = identifier - result.email = identifier if service == 'email' - result.valid? - result - end - # @params opts [Hash] Takes :from, :existing_user, :service, :identifier, :message # @return [User] def self.create_invitee(opts={}) - invitee = opts[:existing_user] || new_user_by_service_and_identifier(opts[:service], opts[:identifier]) + invitee = opts[:existing_user] + invitee ||= User.new(:invitation_service => opts[:service], :invitation_identifier => opts[:identifier]) + + # (dan) I'm not sure why, but we need to call .valid? on our User. + invitee.valid? + + # Return a User immediately if an invalid email is passed in return invitee if opts[:service] == 'email' && !opts[:identifier].match(Devise.email_regexp) + if invitee.new_record? invitee.errors.clear invitee.serialized_private_key = User.generate_key if invitee.serialized_private_key.blank? @@ -65,6 +81,7 @@ class Invitation < ActiveRecord::Base return invitee end + # Logic if there is an explicit sender if opts[:from] invitee.save(:validate => false) Invitation.create!(:sender => opts[:from], @@ -75,9 +92,12 @@ class Invitation < ActiveRecord::Base end invitee.skip_invitation = (opts[:service] != 'email') invitee.invite! - log_string = "event=invitation_sent to=#{opts[:identifier]} service=#{opts[:service]} " - log_string << "inviter=#{opts[:from].diaspora_handle} inviter_uid=#{opts[:from].id} inviter_created_at_unix=#{opts[:from].created_at.to_i}" if opts[:from] - Rails.logger.info(log_string) + + # Logging the invitation action + log_hash = {:event => :invitation_sent, :to => opts[:identifier], :service => opts[:service]} + log_hash.merge({:inviter => opts[:from].diaspora_handle, :invitier_uid => opts[:from].id, :inviter_created_at_unix => opts[:from].created_at.to_i}) if opts[:from] + Rails.logger.info(log_hash) + invitee end @@ -85,12 +105,15 @@ class Invitation < ActiveRecord::Base recipient.invite! end + # @return Contact def share_with! - contact = sender.share_with(recipient.person, aspect) - destroy if contact + if contact = sender.share_with(recipient.person, aspect) + self.destroy + end contact end + # @return [String] def recipient_identifier if recipient.invitation_service == 'email' recipient.invitation_identifier diff --git a/app/models/user.rb b/app/models/user.rb index ce408d7df..9206d0f77 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -46,12 +46,36 @@ class User < ActiveRecord::Base has_many :authorizations, :class_name => 'OAuth2::Provider::Models::ActiveRecord::Authorization', :foreign_key => :resource_owner_id has_many :applications, :through => :authorizations, :source => :client - before_save do - person.save if person && person.changed? - end - before_save :guard_unconfirmed_email + before_save :guard_unconfirmed_email, + :save_person! - attr_accessible :getting_started, :password, :password_confirmation, :language, :disable_mail + before_create :infer_email_from_invitation_provider + + attr_accessible :getting_started, + :password, + :password_confirmation, + :language, + :disable_mail, + :invitation_service, + :invitation_identifier + + # Sometimes we access the person in a strange way and need to do this + # @note we should make this method depricated. + # + # @return [Person] + def save_person! + self.person.save if self.person && self.person.changed? + self.person + end + + # Set the User's email to the one they've been invited at, if the user + # is being created via an invitation. + # + # @return [User] + def infer_email_from_invitation_provider + self.email = self.invitation_identifier if self.invitation_service == 'email' + self + end def update_user_preferences(pref_hash) if self.disable_mail diff --git a/spec/models/invitation_spec.rb b/spec/models/invitation_spec.rb index 8a3b3bb67..71c27b7a8 100644 --- a/spec/models/invitation_spec.rb +++ b/spec/models/invitation_spec.rb @@ -43,32 +43,6 @@ describe Invitation do @invitation.message.should == "!" end - describe '.new_user_by_service_and_identifier' do - let(:inv) { Invitation.new_user_by_service_and_identifier(@type, @identifier) } - - it 'returns User.new for a non-existent user for email' do - @type = "email" - @identifier = "maggie@example.org" - inv.invitation_identifier.should == @identifier - inv.invitation_service.should == 'email' - inv.should_not be_persisted - lambda { - inv.reload - }.should raise_error ActiveRecord::RecordNotFound - end - - it 'returns User.new for a non-existent user' do - @type = "facebook" - @identifier = "1234892323" - inv.invitation_identifier.should == @identifier - inv.invitation_service.should == @type - inv.persisted?.should be_false - lambda { - inv.reload - }.should raise_error ActiveRecord::RecordNotFound - end - end - describe '.find_existing_user' do let(:inv) { Invitation.find_existing_user(@type, @identifier) } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 821ea7a5b..f34193fd5 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -20,6 +20,42 @@ describe User do end + context 'callbacks' do + describe '#save_person!' do + it 'saves the corresponding user if it has changed' do + alice.person.url = "http://stuff.com" + Person.any_instance.should_receive(:save) + alice.save + end + + it 'does not save the corresponding user if it has not changed' do + Person.any_instance.should_not_receive(:save) + alice.save + end + end + + describe '#infer_email_from_invitation_provider' do + it 'sets corresponding email if invitation_service is email' do + addr = '12345@alice.com' + alice.invitation_service = 'email' + alice.invitation_identifier = addr + + lambda { + alice.infer_email_from_invitation_provider + }.should change(alice, :email) + end + + it 'does not set an email if invitation_service is not email' do + addr = '1233123' + alice.invitation_service = 'facebook' + alice.invitation_identifier = addr + + lambda { + alice.infer_email_from_invitation_provider + }.should_not change(alice, :email) + end + end + end describe 'overwriting people' do it 'does not overwrite old users with factory' do From 1e53261606c0539ed39ec8ff4e77c14cd0f0b546 Mon Sep 17 00:00:00 2001 From: MrZYX Date: Tue, 16 Aug 2011 19:43:57 +0200 Subject: [PATCH 072/133] updated locales --- config/locales/devise/devise.fr.yml | 2 +- config/locales/diaspora/cs.yml | 80 ++++++++++----------- config/locales/diaspora/de.yml | 18 ++--- config/locales/diaspora/fr.yml | 78 ++++++++++---------- config/locales/diaspora/it.yml | 6 +- config/locales/diaspora/ko.yml | 6 +- config/locales/javascript/javascript.fr.yml | 6 +- 7 files changed, 98 insertions(+), 98 deletions(-) diff --git a/config/locales/devise/devise.fr.yml b/config/locales/devise/devise.fr.yml index 712cfbe57..bb3c28b71 100644 --- a/config/locales/devise/devise.fr.yml +++ b/config/locales/devise/devise.fr.yml @@ -34,7 +34,7 @@ fr: no_account_till: "Votre compte ne sera pas que lorsque vous irez sur le lien ci-dessus et que vous vous inscrirez." subject: "Vous avez été invité à rejoindre Diaspora!" inviters: - accept_at: ", sur %{url}, vous pouvez accepter à travers le lien ci-dessous." + accept_at: "sur %{url}, vous pouvez accepter à travers le lien ci-dessous." has_invited_you: "%{name} vous a invité à rejoindre Diaspora" have_invited_you: "%{names} vous ont invité à rejoindre Diaspora" reset_password_instructions: diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 8c36106f0..0c2a9f251 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -70,7 +70,7 @@ cs: aspect_listings: add_an_aspect: "+ Přidat aspekt" aspect_stream: - commented_on: "komentoval" + commented_on: "komentováno" posted: "publikováno" recently: "v poslední době:" stream: "Stream" @@ -107,17 +107,17 @@ cs: content_1: "Vaše Diaspora ID je:" content_2: "Dejte to někomu a bude vás moci najít na Diaspoře." heading: "Diaspora ID" - donate: "Přispět" + donate: "Přispějte" handle_explanation: "Toto je vaše Diaspora ID. Podobně jako e-mailovou adresu ho můžete dál lidem a budete na něm dostupní." keep_us_running: "Pomozte %{pod} udržet rychlý, kupte našim serverům dávku kávy." no_contacts: "Žádné kontakty" - no_tags: "No tags" + no_tags: "+ najít nějaký štítek ke sledování" people_sharing_with_you: "Lidé, kteří s vámi sdílí" post_a_message: "odeslat příspěvek >>" services: content: "Můžete připojit následující služby na Diasporu:" heading: "Připojit služby" - tags_following: "Následované značky" + tags_following: "Sledované štítky" unfollow_tag: "Přestat sledovat #%{tag}" your_aspects: "Vaše aspekty" many: "%{count} aspektů" @@ -131,14 +131,14 @@ cs: no_contacts_message: featured_users: "featured users" or_featured: "Nebo můžete sdílet s %{link}" - try_adding_some_more_contacts: "You can search (top) or invite (right) more contacts." - you_should_add_some_more_contacts: "You should add some more contacts!" + try_adding_some_more_contacts: "Nové kontakty můžete vyhledávat (nahoře) nebo někoho pozvat (vpravo)." + you_should_add_some_more_contacts: "Přidejte si více kontaktů!" no_posts_message: start_talking: "Nikdo zatím ještě nic nesdělil!" one: "1 aspekt" other: "%{count} aspektů" seed: - acquaintances: "Acquaintances" + acquaintances: "Známí" family: "Rodina" friends: "Přátelé" work: "Práce" @@ -230,7 +230,7 @@ cs: birthday_with_year: "%B %d %Y" fullmonth_day: "%B %d" delete: "Smazat" - email: "Email" + email: "E-mail" error_messages: helper: correct_the_following_errors_and_try_again: "Opravte následující chyby a zkuste to znovu." @@ -261,7 +261,7 @@ cs: already_sent: "Již jste pozval tuto osobu." no_more: "Nemáte žádné další pozvánky." own_address: "Nemůžete poslat pozvánku na Vaši vlastní adresu." - rejected: "Následující emailové adresy mají problémy: " + rejected: "Následující e-mailové adresy mají problémy: " sent: "Pozvánky byly poslány pro:" edit: accept_your_invitation: "Přijměte pozvání" @@ -269,7 +269,7 @@ cs: new: already_invited: "Následující lidé nepřijali vaše pozvání:" aspect: "Aspekt" - comma_seperated_plz: "Můžete zadat více emailových adres oddělených čárkami." + comma_seperated_plz: "Můžete zadat více e-mailových adres oddělených čárkami." if_they_accept_info: "pokud přijmou, budou přidáni do aspektu, do kterého byly pozváni." invite_someone_to_join: "Pozvěte někoho na Diasporu!" personal_message: "Osobní zpráva" @@ -291,7 +291,7 @@ cs: login: "přihlásit" logout: "odhlásit" profile: "profil" - recent_notifications: "Recent notifications" + recent_notifications: "Nejnovější oznámení" settings: "nastavení" view_all: "Zobrazit všechno" likes: @@ -399,7 +399,7 @@ cs: confirm_email: click_link: "To activate your new e-mail address %{unconfirmed_email}, please click this link:" subject: "Please activate your new e-mail address %{unconfirmed_email}" - email_sent_by_diaspora: "Tento email odeslala Diaspora. Pokud si nepřejete nadále dostávat takovéto emaily," + email_sent_by_diaspora: "Tento e-mail odeslala Diaspora. Pokud si nepřejete nadále dostávat takovéto e-maily," hello: "Vítej %{name}!" liked: liked: "%{name} si právě oblíbil váš příspěvek: " @@ -435,7 +435,7 @@ cs: couldnt_find_them_send_invite: "Nemůžete je najít? Pošlete pozvánku!" no_one_found: "... a nikdo nebyl nalezen." no_results: "Hej! Musíte něco hledat." - results_for: "výsledky hledání pro" + results_for: "výsledky hledání" many: "%{count} lidí" one: "1 osoba" other: "%{count} lidí" @@ -445,7 +445,7 @@ cs: pending_request: "Nevyřízená žádost" thats_you: "To jste vy!" profile_sidebar: - bio: "životopis" + bio: "něco o vás" born: "datum narození" edit_my_profile: "Upravit můj profil" gender: "pohlaví" @@ -468,7 +468,7 @@ cs: see_all: "Zobrazit všechno" start_sharing: "začít sdílet" to_accept_or_ignore: "přijmout nebo ignorovat." - you_have_no_tags: "nemáte žádné značky!" + you_have_no_tags: "nemáte žádné štítky!" webfinger: fail: "Omlouváme se, ale %{handle} nebyl nalezen." zero: "žádní lidé" @@ -523,7 +523,7 @@ cs: first_name: "Jméno" last_name: "Příjmení" update_profile: "Aktualizovat profil" - your_bio: "Váš životopis" + your_bio: "Něco o vás" your_birthday: "Vaše narozeniny" your_gender: "Vaše pohlaví" your_location: "Vaše poloha" @@ -549,13 +549,13 @@ cs: unhappy: "Nešťastný?" update: "Aktualizovat" new: - create_my_account: "Create my account" + create_my_account: "Vytvořit účet" enter_email: "Zadejte e-mail" enter_password: "Zadejte heslo" enter_password_again: "Zadejte stejné heslo jako předtím" enter_username: "Vyberte si uživatelské jméno (pouze písmena, číslice a podtržítka)" - join_the_movement: "Join the movement!" - sign_up_today: "Sign up today" + join_the_movement: "Připojte se k nám!" + sign_up_today: "Zaregistrujte se ještě dnes" requests: create: sending: "Odesílání" @@ -625,7 +625,7 @@ cs: create_request: "Hledat podle Diaspora ID" diaspora_handle: "diaspora@pod.org" enter_a_diaspora_username: "Zadejte uživatelské jméno na Diaspoře:" - know_email: "Znáte jejich emailové adresy? Můžete je pozvat" + know_email: "Znáte jejich e-mailové adresy? Můžete je pozvat" your_diaspora_username_is: "Vaše uživatelské jméno na Diaspoře: %{diaspora_handle}" contact_list: all_contacts: "Všechny kontakty" @@ -693,16 +693,16 @@ cs: failure: "Nepodařilo se následovat: #%{name}" success: "Úspěšně následujete: #%{name}" destroy: - failure: "Nepodařilo se zastavit následování: #%{name}" - success: "Úspěšně zastaveno následování: #%{name}" + failure: "Nepodařilo se ukončit sledování: #%{name}" + success: "Sledování #%{name} bylo úspěšně ukončeno" tags: show: - follow: "Následovat #%{tag}" - following: "Následující #%{tag}" + follow: "Sledovat #%{tag}" + following: "Sledujete #%{tag}" nobody_talking: "Nikdo dosud nemluví o %{tag}." - people_tagged_with: "Lidé označeni %{tag}" + people_tagged_with: "Lidé označení %{tag}" posts_tagged_with: "Příspěvky označené #%{tag}" - stop_following: "Přestat následovat #%{tag}" + stop_following: "Přestat sledovat #%{tag}" tokens: show: connect_to_cubbies: "Připojit na Cubbi.es" @@ -726,7 +726,7 @@ cs: edit: also_commented: "...někdo komentoval váš příspěvek?" change: "Změnit" - change_email: "Change E-Mail" + change_email: "Změnit e-mail" change_language: "Změnit jazyk" change_password: "Změnit heslo" close_account: "Uzavřít účet" @@ -741,47 +741,47 @@ cs: mentioned: "...jste zmíněn v příspěvku?" new_password: "Nové heslo" private_message: "...obdržíte soukromou zprávu?" - receive_email_notifications: "Přijímat oznámení emailem když..." + receive_email_notifications: "Přijímat oznámení e-mailem když..." started_sharing: "...někdo začne sdílet s vámi?" - your_email: "Váš email" + your_email: "Váš e-mail" your_handle: "Vaše Diaspora ID" getting_started: aspects: "aspektů" - connect_to: "Připojit k" + connect_to: "Připojit ke" connect_to_your_other_social_networks: "Připojit k dalším sociálním sítím" - connect_with_people: "Connect with cool people" + connect_with_people: "Spojte se s lidmi" connect_with_people_explanation_pt1: "Spojte se s lidmi jejich umístěním do jednoho nebo více z vašich" connect_with_people_explanation_pt2: "Apekty jsou snadný způsob, jak seskupovat nové a známé tváře. Dovolují jednoduše sdílet s podmnožinami vašich kontaktů." featured_tags: "Featured tags" - featured_users: "Featured users" + featured_users: "Sledujte, co vás zajímá" fill_out_your_profile: "Vyplňte si svůj profil" - find_friends: "Find friends" + find_friends: "Najít přátele" find_friends_from_facebook: "najít přátele z Facebooku" finished: "Dokončeno!" - follow_your_interests: "Follow your interests" - hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." + follow_your_interests: "Sledujte, co vás zajímá" + hashtag_explanation: "Štítky vám dovolují sledovat, o co se zajímáte, a diskutovat. Je to také skvělý způsob, jak najít nové lidi na Diaspoře." profile_description: "Zjednodušte ostatním vás najít vyplněním informací ve vašem profilu." profile_fields: - bio: "Bio" + bio: "Něco o vás" birthday: "Datum narození" gender: "Pohlaví" location: "Bydliště" name: "Jméno" photo: "Fotografie" - tags: "Tags" + tags: "Štítky" see_all_featured_users: "See all featured users" welcome: "Vítejte na Diaspoře!" - welcome_with_name: "Vítej, %{name}!" + welcome_with_name: "Vítejte, %{name}!" public: does_not_exist: "Uživatel %{username} neexistuje!" update: - email_notifications_changed: "Oznámení emailem změněno" + email_notifications_changed: "Oznámení e-mailem změněno" language_changed: "Jazyk změněn" language_not_changed: "Změna jazyka selhala" password_changed: "Heslo bylo změněno. Nyní se můžete přihlásit s novým heslem." password_not_changed: "Změna hesla selhala" unconfirmed_email_changed: "E-Mail Changed. Needs activation." - unconfirmed_email_not_changed: "E-Mail Change Failed" + unconfirmed_email_not_changed: "Změna e-mailu selhala" webfinger: fetch_failed: "Selhalo načtení webfinger profilu pro %{profile_url}" hcard_fetch_failed: "Nepodařilo se získat hcard pro %{@account}" diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index ea290b8d7..dd0764da9 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -37,7 +37,7 @@ de: person: invalid: "ist nicht gültig." username: - invalid: "is invalid. We only allow letters, numbers, and underscores" + invalid: "ist ungültig. Wir erlauben nur Buchstaben, Zahlen und Unterstriche" taken: "wird schon benutzt." ago: "Vor %{time}" all_aspects: "Alle Aspekte" @@ -253,7 +253,7 @@ de: tagline_first_half: "Teile was du willst," tagline_second_half: "mit wem du willst." invitations: - a_facebook_user: "A Facebook user" + a_facebook_user: "Ein Facebook-Nutzer" check_token: not_found: "Einladungstoken nicht gefunden" create: @@ -392,7 +392,7 @@ de: other: "%{actors} haben angefangen mit dir zu teilen." zero: "Niemand hat angefangen mit dir zu teilen." notifier: - a_post_you_shared: "a post." + a_post_you_shared: "ein Beitrag." click_here: "hier klicken" comment_on_post: reply: "Antworte oder schau dir %{name}s Beitrag an >" @@ -473,7 +473,7 @@ de: fail: "Entschuldigung, wir konnten %{handle} nicht finden." zero: "Keine Personen" photos: - comment_email_subject: "%{name}'s photo" + comment_email_subject: "%{name}s Foto" create: integrity_error: "Hochladen des Fotos fehlgeschlagen. Bist du sicher, dass es eine Bilddatei war?" runtime_error: "Hochladen des Fotos fehlgeschlagen. Bist du sicher, dass du deinen Morgenkaffee hattest?" @@ -501,7 +501,7 @@ de: edit: "Bearbeiten" edit_delete_photo: "Fotobeschreibung bearbeiten / Foto löschen" make_profile_photo: "Als Profilbild verwenden" - show_original_post: "Show original post" + show_original_post: "Zeige ursprünglichen Beitrag" update_photo: "Foto aktualisieren" update: error: "Bearbeiten des Fotos fehlgeschlagen." @@ -600,8 +600,8 @@ de: failure: error: "es gab einen Fehler beim Verbinden mit diesem Dienst" finder: - no_friends: "No Facebook friends found." - service_friends: "%{service} Friends" + no_friends: "Keine Facebook-Freunde gefunden." + service_friends: "%{service} Freunde" index: connect_to_facebook: "Mit Facebook verbinden" connect_to_tumblr: "Mit Tumblr verbinden" @@ -616,7 +616,7 @@ de: join_me_on_diaspora: "Folge mir auf DIASPORA*" remote_friend: invite: "Einladen" - not_on_diaspora: "Not yet on Diaspora" + not_on_diaspora: "Noch nicht auf Diaspora" resend: "Erneut senden" settings: "Einstellungen" shared: @@ -746,7 +746,7 @@ de: your_email: "Deine E-Mail-Adresse" your_handle: "Deine Diaspora ID" getting_started: - aspects: "aspects" + aspects: "Aspekte" connect_to: "Verbinde dich zu" connect_to_your_other_social_networks: "Verbinde dich zu deinen anderen sozialen Netzwerken" connect_with_people: "Kontaktiere tolle Leute" diff --git a/config/locales/diaspora/fr.yml b/config/locales/diaspora/fr.yml index ea3ba4c1f..a22058b57 100644 --- a/config/locales/diaspora/fr.yml +++ b/config/locales/diaspora/fr.yml @@ -29,7 +29,7 @@ fr: reshare: attributes: root_guid: - taken: "You've already reshared that post!" + taken: "Vous avez déjà repartagé ce post !" user: attributes: email: @@ -115,9 +115,9 @@ fr: people_sharing_with_you: "Personnes partageant avec vous" post_a_message: "publier un message >>" services: - content: "You can connect the following services to Diaspora:" - heading: "Connect Services" - tags_following: "Followed Tags" + content: "Vous pouvez connecter les services suivants à Diaspora :" + heading: "Services connectés" + tags_following: "Tags Suivis" unfollow_tag: "Stop following #%{tag}" your_aspects: "Vos aspects" many: "%{count} aspects" @@ -182,7 +182,7 @@ fr: add_a_new_aspect: "Ajouter un nouvel aspect" all_contacts: "Tous les contacts" edit_aspect: "Modifier %{name}" - many_people_are_you_sure: "Are you sure you want to start a private conversation with more than %{suggested_limit} contacts? Posting to this aspect may be a better way to contact them." + many_people_are_you_sure: "Êtes-vous sûr de vouloir commencer une conversation privée avec plus de %{suggested_limit} contacts? Envoyer des messages à cet aspect peut être un meilleur moyen de les contacter." my_contacts: "Mes Contacts" no_contacts: "Pas de contacts." only_sharing_with_me: "Partage uniquement avec moi" @@ -216,9 +216,9 @@ fr: no_conversation_selected: "aucune conversation sélectionnée" no_messages: "aucun message" new: - abandon_changes: "Abandon changes?" + abandon_changes: "Abandonner les changements ?" send: "Envoyer" - sending: "Sending..." + sending: "Envoi ..." subject: "sujet" to: "pour" show: @@ -291,7 +291,7 @@ fr: login: "connexion" logout: "déconnexion" profile: "profil" - recent_notifications: "Recent notifications" + recent_notifications: "Notifications récentes" settings: "paramètres" view_all: "Tout afficher" likes: @@ -309,12 +309,12 @@ fr: other: "%{count} personnes aiment" zero: "Personne n'aime ça" people_like_this_comment: - few: "%{count} likes" - many: "%{count} likes" - one: "%{count} like" - other: "%{count} likes" - zero: "no likes" - limited: "Limited" + few: "%{count} aiment" + many: "%{count} aiment" + one: "%{count} aime" + other: "%{count} aiment" + zero: "personne n'aime" + limited: "Limité" more: "Plus" next: "suivant" no_results: "Aucun résultat trouvé" @@ -393,31 +393,31 @@ fr: zero: "%{actors} a/ont commencé à partager avec vous." notifier: a_post_you_shared: "a post." - click_here: "click here" + click_here: "cliquez ici" comment_on_post: - reply: "Reply or view %{name}'s post >" + reply: "Répondre ou voir le post de %{name} >" confirm_email: click_link: "To activate your new e-mail address %{unconfirmed_email}, please click this link:" subject: "Please activate your new e-mail address %{unconfirmed_email}" - email_sent_by_diaspora: "This email was sent by Diaspora. If you'd like to stop getting emails like this," + email_sent_by_diaspora: "Ce courriel a été envoyé par Diaspora. Si vous souhaitez cesser de recevoir des courriels de ce genre," hello: "Bonjour %{name} !" liked: liked: "%{name} vient juste d'aimer votre message : " - view_post: "View post >" + view_post: "Voir le post >" mentioned: mentioned: "vous a mentionné(e) dans un message :" subject: "%{name} vous a mentionné(e) sur Diaspora*" private_message: - reply_to_or_view: "Reply to or view this conversation >" + reply_to_or_view: "Répondre ou voir cette conversation >" single_admin: admin: "Votre administrateur Diaspora" subject: "Un message concernant votre compte Diaspora :" started_sharing: sharing: "a commencé à partager avec vous !" subject: "%{name} a commencé à partager avec vous sur Diaspora*" - view_profile: "View %{name}'s profile" + view_profile: "Voir le profil de %{name}" thanks: "Merci," - to_change_your_notification_settings: "to change your notification settings" + to_change_your_notification_settings: "pour changer vos paramètres de notification" ok: "OK" or: "ou" password: "Mot de passe" @@ -511,9 +511,9 @@ fr: post_hidden: "Le message de %{name} à été masqué." posts: show: - destroy: "Delete" - not_found: "Sorry, we couldn't find that post." - permalink: "permalink" + destroy: "Supprimer" + not_found: "Désolé, nous n'avons pas pu trouver ce post." + permalink: "lien permanent" previous: "précédent" profile: "Profil" profiles: @@ -579,15 +579,15 @@ fr: reshares: comment_email_subject: "%{resharer}'s reshare of %{author}'s post" create: - failure: "There was an error resharing this post." + failure: "Une erreur a été rencontrée lors du repartage de ce post." reshare: - deleted: "Original post deleted by author." + deleted: "Le post original a été supprimé par l'auteur." reshare: few: "%{count} Reshares" many: "%{count} Reshares" one: "1 Reshare" other: "%{count} Reshares" - zero: "Reshare" + zero: "Repartager" reshare_confirmation: "Reshare %{author} - %{text}?" reshare_original: "Reshare orignial" show_original: "Show Original" @@ -609,7 +609,7 @@ fr: disconnect: "déconnecter" edit_services: "Modifier les services" logged_in_as: "connecté(e) en tant que" - no_services: "You have not connected any services yet." + no_services: "Vous n'êtes connectés à aucun service pour le moment." really_disconnect: "déconnecter %{service} ?" inviter: click_link_to_accept_invitation: "Cliquer sur ce lien pour accepter l'invitation" @@ -666,7 +666,7 @@ fr: stream_element: dislike: "Je n'aime pas" like: "J'aime" - shared_with: "Shared with: %{aspect_names}" + shared_with: "Partagé avec : %{aspect_names}" unlike: "Je n'aime pas" via: "via %{link}" viewable_to_anyone: "Publication visible par n'importe qui sur le web" @@ -690,25 +690,25 @@ fr: show_more_comments: "Afficher %{number} commentaires supplémentaires" tag_followings: create: - failure: "Failed to follow: #%{name}" - success: "Successfully following: #%{name}" + failure: "Erreur lors de la demande de suivi de : #%{name}" + success: "Le suivi de #%{name} est un succès" destroy: - failure: "Failed to stop following: #%{name}" - success: "Successfully stopped following: #%{name}" + failure: "Erreur lors de la demande d'arrêt du suivit de : #%{name}" + success: "L'arrêt du suivit de #%{name} est un succès" tags: show: follow: "Suivre #%{tag}" - following: "Following #%{tag}" + following: "Suivre #%{tag}" nobody_talking: "Personne ne parle encore de %{tag}." people_tagged_with: "Personnes taguées avec %{tag}" posts_tagged_with: "Publications taguées avec #%{tag}" - stop_following: "Stop Following #%{tag}" + stop_following: "Arrêter de suivre #%{tag}" tokens: show: connect_to_cubbies: "Se connecter à Cubbi.es" connecting_is_simple: "La connexion de votre compte Diaspora est assez simple puisqu'il suffit de saisir deux champs sur votre page de compte Cubbi.es." daniels_account: "Le compte Diaspora de Daniel" - log_in_with_diaspora_is_comming: "Pretty soon, you'll be able to connect to a new application without creating an account separate from your one on Diaspora." + log_in_with_diaspora_is_comming: "Très bientôt, vous serez en mesure de vous connecter à une nouvelle application sans créer un compte séparé du votre autre sur Diaspora." love_to_try: "Nous aimerions beaucoup que vous essayiez." making_the_connection: "Créez la connexion" screenshot_explanation: "%{link1}. Cette page cubbi est liée à %{link2}." @@ -759,11 +759,11 @@ fr: find_friends_from_facebook: "find friends from Facebook" finished: "Terminé !" follow_your_interests: "Follow your interests" - hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." + hashtag_explanation: "Les tags vous permettre de parler et de suivre vos intérêts. Ils sont aussi un excellent moyen de trouver de nouvelles personnes sur Diaspora." profile_description: "Make it easier for people to find you by filling out your profile information." profile_fields: bio: "Bio" - birthday: "Birthday" + birthday: "Anniversaire" gender: "Gender" location: "Location" name: "Name" @@ -771,7 +771,7 @@ fr: tags: "Tags" see_all_featured_users: "See all featured users" welcome: "Bienvenue sur Diaspora !" - welcome_with_name: "Welcome, %{name}!" + welcome_with_name: "Bienvenue, %{name} !" public: does_not_exist: "L'utilisateur %{username} n'existe pas !" update: diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index c00999fe5..84ae6056b 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -600,8 +600,8 @@ it: failure: error: "si è verificato un errore durante la connessione a quel servizio" finder: - no_friends: "No Facebook friends found." - service_friends: "%{service} Friends" + no_friends: "Non ho trovato amici su Facebook." + service_friends: "Amici su %{service}" index: connect_to_facebook: "Connettiti a Facebook" connect_to_tumblr: "Connettiti a Tumblr" @@ -616,7 +616,7 @@ it: join_me_on_diaspora: "Vieni anche tu su DIASPORA*" remote_friend: invite: "invita" - not_on_diaspora: "Not yet on Diaspora" + not_on_diaspora: "Non ancora su Diaspora" resend: "reinvia" settings: "Impostazioni" shared: diff --git a/config/locales/diaspora/ko.yml b/config/locales/diaspora/ko.yml index d7eda5caf..a834e0e40 100644 --- a/config/locales/diaspora/ko.yml +++ b/config/locales/diaspora/ko.yml @@ -600,8 +600,8 @@ ko: failure: error: "서비스 연결중 에러가 발생했습니다." finder: - no_friends: "No Facebook friends found." - service_friends: "%{service} Friends" + no_friends: "페이스북 친구를 찾을 수 없습니다." + service_friends: "%{service} 친구" index: connect_to_facebook: "페이스북에 연결" connect_to_tumblr: "Tumblr에 연결하기" @@ -616,7 +616,7 @@ ko: join_me_on_diaspora: "디아스포라*에서 만나요!" remote_friend: invite: "초대하기" - not_on_diaspora: "Not yet on Diaspora" + not_on_diaspora: "아직 디아스포라에 없습니다" resend: "다시 보내기" settings: "설정" shared: diff --git a/config/locales/javascript/javascript.fr.yml b/config/locales/javascript/javascript.fr.yml index aa2ba6553..565b7ab3a 100644 --- a/config/locales/javascript/javascript.fr.yml +++ b/config/locales/javascript/javascript.fr.yml @@ -23,10 +23,10 @@ fr: no_more: "Pas d'autre messages." publisher: at_least_one_aspect: "Vous devez créer au moins un aspect" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "Limité - votre message ne sera vu par des gens avec qui vous partagez" + public: "Public - votre message sera visible de tous et trouvé par les moteurs de recherche" reshares: - duplicate: "You've already reshared that post!" + duplicate: "Vous avez déjà repartagé ce post !" search_for: "Chercher {{name}}" show_more: "voir plus" timeago: From 1bd7e1314f6b9e97b7d4bd0afe480901f0dc6974 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 11:34:24 -0700 Subject: [PATCH 073/133] Make the signs up feature more robust --- features/signs_up.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/signs_up.feature b/features/signs_up.feature index e43c93a7f..564fe2fdc 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -23,7 +23,7 @@ Feature: new user registration And I fill in "tags" with "#tags" And I press "Update Profile" And I wait for the ajax to finish - Then I should see "Profile updated" + Then I should see "O Hai" within "#user_menu" And I should see "Welcome" And I follow "Finished" From 25752e9f93a48bdeb292438208bba0e51f6fed0c Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 12:26:57 -0700 Subject: [PATCH 074/133] Move the include of splunklogging into the appconfig check --- config/initializers/_splunk_logger.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/_splunk_logger.rb b/config/initializers/_splunk_logger.rb index 5cb075836..3c13a8c5a 100644 --- a/config/initializers/_splunk_logger.rb +++ b/config/initializers/_splunk_logger.rb @@ -1,5 +1,5 @@ if AppConfig[:enable_splunk_logging] require File.expand_path('../../../lib/log_overrider', __FILE__) + Rails.logger.class.send(:include, SplunkLogging) end -Rails.logger.class.send(:include, SplunkLogging) From 140268365cf2dae0b854cd71865ff5454da9ab78 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 12:43:08 -0700 Subject: [PATCH 075/133] Simplify aspect dropdown views --- app/helpers/aspect_global_helper.rb | 16 +++++++--------- app/views/aspects/_aspect_stream.haml | 2 +- app/views/aspects/index.mobile.haml | 2 +- app/views/shared/_aspect_dropdown.html.haml | 7 ++----- app/views/shared/_publisher.html.haml | 2 +- app/views/status_messages/bookmarklet.html.haml | 6 +++--- app/views/status_messages/new.haml | 4 ++-- 7 files changed, 17 insertions(+), 22 deletions(-) diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index 77428b8fb..9bf1ad7d7 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -66,20 +66,14 @@ module AspectGlobalHelper end def aspect_membership_dropdown(contact, person, hang, aspect=nil) - @selected_aspects = [] - if contact.persisted? - @selected_aspects = all_aspects.find_all{|aspect| contact.aspect_memberships.detect{ |am| am.aspect_id == aspect.id}} - end - @selected_aspects = [@selected_aspects] if @selected_aspects.kind_of? Aspect + selected_aspects = all_aspects.select{|aspect| contact.aspect_memberships.detect{ |am| am.aspect_id == aspect.id } } render "shared/aspect_dropdown", :contact => @contact, - :selected_aspects => @selected_aspects, + :selected_aspects => selected_aspects, :person => person, :hang => hang, - :dropdown_class => "aspect_membership", - :button_class => ("in_aspects" if @selected_aspects.size > 0), - :may_create_new_aspect => ( @aspect == :profile || @aspect == :tag || @aspect == :search || @aspect == :notification) + :dropdown_class => "aspect_membership" end def aspect_dropdown_list_item(aspect, checked) @@ -94,4 +88,8 @@ module AspectGlobalHelper LISTITEM str.html_safe end + + def dropdown_may_create_new_aspect + @aspect == :profile || @aspect == :tag || @aspect == :search || @aspect == :notification + end end diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index c727f32fc..b086f3127 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -16,7 +16,7 @@ - else = @aspects.to_sentence -= render 'shared/publisher', :aspect => aspect, :aspect_ids => aspect_ids += render 'shared/publisher', :selected_aspects => @aspects, :aspect_ids => aspect_ids, :aspect => @aspect - if posts.length == 0 = render 'aspects/no_posts_message' diff --git a/app/views/aspects/index.mobile.haml b/app/views/aspects/index.mobile.haml index caea84c34..e7e22f20a 100644 --- a/app/views/aspects/index.mobile.haml +++ b/app/views/aspects/index.mobile.haml @@ -17,4 +17,4 @@ %a.more-link.paginate{:href => next_page_path} %h2= t("more") - content_for :subpages do - = render 'shared/publisher', :aspect_ids => @aspect_ids + = render 'shared/publisher', :aspect_ids => @aspect_ids, :selected_aspects => @aspects, :aspect => @aspect diff --git a/app/views/shared/_aspect_dropdown.html.haml b/app/views/shared/_aspect_dropdown.html.haml index 13ddfa5c8..6018db69f 100644 --- a/app/views/shared/_aspect_dropdown.html.haml +++ b/app/views/shared/_aspect_dropdown.html.haml @@ -3,10 +3,7 @@ -# the COPYRIGHT file. .dropdown{:class => ["hang_#{hang}", defined?(dropdown_class) && dropdown_class]} - - selected_aspects = [selected_aspects] if selected_aspects.kind_of? Aspect - - if !selected_aspects.kind_of? Array - - selected_aspects = all_aspects - .button.toggle{:class => (button_class if defined?(button_class))} + .button.toggle{:class => ("in_aspects" if selected_aspects.size > 0)} - if selected_aspects.size == 1 = selected_aspects.first.name - else @@ -18,7 +15,7 @@ - for aspect in all_aspects = aspect_dropdown_list_item(aspect, selected_aspects.include?(aspect) ) - - if (defined?may_create_new_aspect && may_create_new_aspect) && (defined?person && person) + - if (dropdown_may_create_new_aspect && defined?(person) && person) %li.newItem .add_aspect = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id), :rel => 'facebox' diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index 0261c4ef0..3b534281a 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -39,7 +39,7 @@ - for service in current_user.services = image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider.titleize, :class => "service_icon dim", :id =>"#{service.provider}", :maxchar => "#{service.class::MAX_CHARACTERS}" = link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage') - = render "shared/aspect_dropdown", :selected_aspects => Aspect.find(aspect_ids), :hang => 'left' + = render "shared/aspect_dropdown", :selected_aspects => selected_aspects, :hang => 'left' = status.submit t('.share'), :disable_with => t('.posting'), :class => 'button creation', :tabindex => 2 .facebox_content diff --git a/app/views/status_messages/bookmarklet.html.haml b/app/views/status_messages/bookmarklet.html.haml index 134d01303..3854a9255 100644 --- a/app/views/status_messages/bookmarklet.html.haml +++ b/app/views/status_messages/bookmarklet.html.haml @@ -10,7 +10,7 @@ :javascript Diaspora.widgets.i18n.loadLocale(#{get_javascript_strings_for(current_user.language).to_json}, "#{current_user.language}"); - $(document).ready(function() + $(document).ready(function() { Publisher.open(); $("#publisher").bind('ajax:success', function(){ @@ -24,7 +24,7 @@ if ("#{params[:notes]}".length > 0){ contents = contents + " - #{params[:notes]}"; } - + $("#publisher #status_message_fake_text").val(contents); $("#publisher #status_message_text").val(contents); $('input.button')[0].removeAttribute('disabled'); @@ -34,5 +34,5 @@ .span-15.last %h4 =t('bookmarklet.post_something') - = render :partial => 'shared/publisher', :locals => { :aspect => :profile, :aspects_with_person => @aspects, :aspect_ids => @aspect_ids} + = render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids } diff --git a/app/views/status_messages/new.haml b/app/views/status_messages/new.haml index acc8b1677..003073df1 100644 --- a/app/views/status_messages/new.haml +++ b/app/views/status_messages/new.haml @@ -6,7 +6,7 @@ = javascript_include_tag "publisher.js" :javascript - $(document).ready(function() + $(document).ready(function() { var person = {name: '#{@person.name}', handle: '#{@person.diaspora_handle}' }; Publisher.autocompletion.onSelect($("#status_message_fake_text"),person,'#{@person.name}'); @@ -21,5 +21,5 @@ %h3 = t('.mentioning', :person => @person.name) - = render :partial => 'shared/publisher', :locals => { :aspect => @aspect, :aspect_ids => @aspect_ids, :aspects_with_person => @aspects_with_person, :person => @person} + = render :partial => 'shared/publisher', :locals => { :aspect => @aspect, :aspect_ids => @aspect_ids, :selected_aspects => @aspects_with_person, :person => @person} From 89639edb3aa3f7430a0b0f8b590bad5bba50dabe Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 15:01:48 -0700 Subject: [PATCH 076/133] Use the Contact#in_aspect? helper in aspect_membership_dropdown --- app/helpers/aspect_global_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index c9aefcfe1..cf509e6d4 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -66,7 +66,7 @@ module AspectGlobalHelper end def aspect_membership_dropdown(contact, person, hang, aspect=nil) - selected_aspects = all_aspects.select{|aspect| contact.aspect_memberships.detect{ |am| am.aspect_id == aspect.id } } + selected_aspects = all_aspects.select{|aspect| contact.in_aspect?(aspect.id) } render "shared/aspect_dropdown", :selected_aspects => selected_aspects, From f2e079f53240a406650c8d0fdd21ff7abec1408b Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 15:04:51 -0700 Subject: [PATCH 077/133] Revert "Move the include of splunklogging into the appconfig check" This reverts commit 25752e9f93a48bdeb292438208bba0e51f6fed0c. --- config/initializers/_splunk_logger.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/_splunk_logger.rb b/config/initializers/_splunk_logger.rb index 3c13a8c5a..5cb075836 100644 --- a/config/initializers/_splunk_logger.rb +++ b/config/initializers/_splunk_logger.rb @@ -1,5 +1,5 @@ if AppConfig[:enable_splunk_logging] require File.expand_path('../../../lib/log_overrider', __FILE__) - Rails.logger.class.send(:include, SplunkLogging) end +Rails.logger.class.send(:include, SplunkLogging) From a5d9d6d212d5793af21b13587e5c895f6016b628 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 15:07:25 -0700 Subject: [PATCH 078/133] Remove reference to invites counter from db seeds, close #1778 --- db/seeds.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 53e29fd9a..1800ec806 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -15,9 +15,9 @@ require 'factory_girl_rails' require File.join(File.dirname(__FILE__), "..", "spec", "helper_methods") include HelperMethods -alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth', :invites => 10) -bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth', :invites => 10) -eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth', :invites => 10) +alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth') +bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth') +eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth') print "Creating seeded users... " alice.person.profile.update_attributes(:first_name => "Alice", :last_name => "Smith", From 97ab077e04a11765c6dbc849d44922ea2c65f20a Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 15:31:02 -0700 Subject: [PATCH 079/133] Abort old aspectFilters requests, close issue 1759. --- public/javascripts/aspect-filters.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/public/javascripts/aspect-filters.js b/public/javascripts/aspect-filters.js index 4d14c82a8..35134a89e 100644 --- a/public/javascripts/aspect-filters.js +++ b/public/javascripts/aspect-filters.js @@ -5,7 +5,7 @@ var AspectFilters = { selectedGUIDS: [], - requests: 0, + activeRequest: null, initialize: function(){ AspectFilters.initializeSelectedGUIDS(); AspectFilters.interceptAspectLinks(); @@ -39,8 +39,6 @@ var AspectFilters = { $('html, body').animate({scrollTop:0}, 'fast'); }, switchToAspect: function(aspectLi){ - AspectFilters.requests++; - var guid = aspectLi.attr('data-guid'); // select correct aspect in filter list & deselect others @@ -55,8 +53,6 @@ var AspectFilters = { $("#aspect_nav a.aspect_selector").click(function(e){ e.preventDefault(); - AspectFilters.requests++; - // loading animation AspectFilters.fadeOut(); @@ -128,11 +124,15 @@ var AspectFilters = { history.pushState(null, document.title, newURL); } - $.ajax({ + try { + AspectFilters.activeRequest.abort(); + } catch(e) {} finally { + AspectFilters.activeRequest = null; + } + AspectFilters.activeRequest = $.ajax({ url : newURL, dataType : 'script', success : function(data){ - AspectFilters.requests--; // fill in publisher // (not cached because this element changes) @@ -155,9 +155,7 @@ var AspectFilters = { Diaspora.widgets.publish("stream/reloaded"); // fade contents back in - if(AspectFilters.requests === 0){ - AspectFilters.fadeIn(); - } + AspectFilters.fadeIn(); } }); }, From 88b317f0c132373abbe7852918b8638a4326d383 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Wed, 17 Aug 2011 10:17:14 -0700 Subject: [PATCH 080/133] Fix jasmine spec for aspectFilters --- spec/javascripts/aspect-filters-spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/javascripts/aspect-filters-spec.js b/spec/javascripts/aspect-filters-spec.js index 5f955e41a..89bed4ced 100644 --- a/spec/javascripts/aspect-filters-spec.js +++ b/spec/javascripts/aspect-filters-spec.js @@ -7,7 +7,7 @@ describe('AspectFilters', function(){ it('initializes selectedGUIDS', function(){ expect(AspectFilters.selectedGUIDS).toEqual([]); }); - it('initializes requests', function(){ - expect(AspectFilters.requests).toEqual(0); + it('initializes activeRequest', function(){ + expect(AspectFilters.activeRequest).toEqual(null); }); }); From 1da481d3628427b33677aae94e3c3879092264af Mon Sep 17 00:00:00 2001 From: MrZYX Date: Wed, 17 Aug 2011 21:26:59 +0200 Subject: [PATCH 081/133] updated locales --- config/locales/devise/devise.el.yml | 2 +- config/locales/devise/devise.pt-PT.yml | 2 +- config/locales/diaspora/el.yml | 22 +++++----- config/locales/diaspora/pt-PT.yml | 44 +++++++++---------- config/locales/diaspora/zh-TW.yml | 4 +- config/locales/javascript/javascript.el.yml | 4 +- .../locales/javascript/javascript.pt-PT.yml | 6 +-- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/config/locales/devise/devise.el.yml b/config/locales/devise/devise.el.yml index abdfe4f8d..583e81369 100644 --- a/config/locales/devise/devise.el.yml +++ b/config/locales/devise/devise.el.yml @@ -34,7 +34,7 @@ el: no_account_till: "Ο λογαριασμός σας δεν θα δημιουργηθεί μέχρι να μεταβείτε στον παρακάτω σύνδεσμο και συνδεθείτε. " subject: "Έχετε προσκληθεί να συμμετάσχετε στο Diaspora!" inviters: - accept_at: ", στο %{url}, μπορείτε να το αποδεχτείτε, μέσω του επόμενου συνδέσμου." + accept_at: "στο %{url}, μπορείτε να το αποδεχτείτε, μέσω του παρακάτω συνδέσμου." has_invited_you: "Ο χρήστης %{name} σας προσκάλεσε να γίνετε μέλος του Diaspora" have_invited_you: "Ο χρήστης %{names} σας κάλεσε να γίνετε μέλος του Diaspora" reset_password_instructions: diff --git a/config/locales/devise/devise.pt-PT.yml b/config/locales/devise/devise.pt-PT.yml index 2ab7b3e40..1a3032c52 100644 --- a/config/locales/devise/devise.pt-PT.yml +++ b/config/locales/devise/devise.pt-PT.yml @@ -34,7 +34,7 @@ pt-PT: no_account_till: "A sua conta não será criada até que aceda à hiperligação acima e se registe." subject: "Foi convidado para se juntar ao Diaspora!" inviters: - accept_at: ", em %{url}, pode aceitar através da seguinte hiperligação:" + accept_at: "em %{url}, pode aceitar através da seguinte hiperligação:" has_invited_you: "%{name} convidou-o para se juntar ao Diaspora" have_invited_you: "%{names} convidaram-no para se juntar ao Diaspora" reset_password_instructions: diff --git a/config/locales/diaspora/el.yml b/config/locales/diaspora/el.yml index 8cf3c38b6..465f2be7f 100644 --- a/config/locales/diaspora/el.yml +++ b/config/locales/diaspora/el.yml @@ -37,7 +37,7 @@ el: person: invalid: "είναι άκυρη." username: - invalid: "is invalid. We only allow letters, numbers, and underscores" + invalid: "μη έγκυρο. Επιτρέπονται μόνο γράμματα, νούμερα και \"κάτω παύλες\" (_)" taken: "είναι ήδη σε χρήση." ago: "%{time} πριν" all_aspects: "Όλες οι πτυχές" @@ -253,7 +253,7 @@ el: tagline_first_half: "Μοιραστείτε ό,τι θέλετε," tagline_second_half: "με όποιον θέλετε." invitations: - a_facebook_user: "A Facebook user" + a_facebook_user: "Ένας χρήστης του Facebook" check_token: not_found: "Το σύμβολο της πρόσκλησης δεν βρέθηκε" create: @@ -392,7 +392,7 @@ el: other: "Οι χρήστες %{actors} άρχισαν να διαμοιράζονται μαζί σας." zero: "Οι χρήστες %{actors} άρχισαν να διαμοιράζονται μαζί σας." notifier: - a_post_you_shared: "a post." + a_post_you_shared: "μια δημοσίευση." click_here: "πατήστε εδώ" comment_on_post: reply: "Απαντήστε ή δείτε τη δημοσίευση του χρήστη %{name} >" @@ -473,7 +473,7 @@ el: fail: "Λυπούμαστε, δεν ήταν δυνατή η εύρεση του %{handle}." zero: "κανένα άτομο" photos: - comment_email_subject: "%{name}'s photo" + comment_email_subject: "φωτογραφία του χρήστη %{name}" create: integrity_error: "Η μεταφόρτωση της φωτογραφίας απέτυχε. Είστε σίγουρος/η ότι ήταν φωτογραφία;" runtime_error: "Η μεταφόρτωση της φωτογραφίας απέτυχε. Είστε σίγουρος/η πως φορέσατε ζώνη ασφαλείας πριν ξεκινήσετε;" @@ -501,7 +501,7 @@ el: edit: "Επεξεργασία" edit_delete_photo: "Επεξεργασία περιγραφής φωτογραφίας / διαγραφή φωτογραφίας" make_profile_photo: "ορισμός ως φωτογραφίας προφίλ" - show_original_post: "Show original post" + show_original_post: "Προβολή αρχικής δημοσίευσης" update_photo: "Ενημέρωση Φωτογραφίας" update: error: "Αποτυχία επεξεργασίας φωτογραφίας." @@ -577,7 +577,7 @@ el: new_request_to_person: sent: "εστάλη!" reshares: - comment_email_subject: "%{resharer}'s reshare of %{author}'s post" + comment_email_subject: "κοινοποίηση της δημοσίευσης του %{author} από τον %{resharer}" create: failure: "Υπήρξε κάποιο σφάλμα κατά την κοινοποίηση αυτής της δημοσίευσης." reshare: @@ -600,8 +600,8 @@ el: failure: error: "εμφανίστηκε ένα σφάλμα κατά τη σύνδεση με αυτή την υπηρεσία" finder: - no_friends: "No Facebook friends found." - service_friends: "%{service} Friends" + no_friends: "Δεν βρέθηκαν φίλοι στο Facebook. " + service_friends: "%{service} Φίλοι" index: connect_to_facebook: "Σύνδεση με Facebook" connect_to_tumblr: "Σύνδεση με το Tumblr" @@ -616,7 +616,7 @@ el: join_me_on_diaspora: "Συνδεθείτε μαζί μου στο DIASPORA*" remote_friend: invite: "πρόσκληση" - not_on_diaspora: "Not yet on Diaspora" + not_on_diaspora: "Όχι ακόμα στο Diaspora" resend: "αποστολή ξανά" settings: "Ρυθμίσεις" shared: @@ -746,11 +746,11 @@ el: your_email: "Το email σας" your_handle: "Το αναγνωριστικό σας στο diaspora" getting_started: - aspects: "aspects" + aspects: "πτυχές" connect_to: "Συνδεθείτε με" connect_to_your_other_social_networks: "Συνδεθείτε με άλλα κοινωνικά δίκτυα" connect_with_people: "Συνδεθείτε με ενδιαφέροντα άτομα" - connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" + connect_with_people_explanation_pt1: "Συνδεθείτε με άτομα τοποθετώντας τα σε μια ή περισσότερες από τις " connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." featured_tags: "Αξιόλογες ετικέτες" featured_users: "Αξιόλογοι χρήστες" diff --git a/config/locales/diaspora/pt-PT.yml b/config/locales/diaspora/pt-PT.yml index 40d992571..e1f3e697f 100644 --- a/config/locales/diaspora/pt-PT.yml +++ b/config/locales/diaspora/pt-PT.yml @@ -108,7 +108,7 @@ pt-PT: content_2: "Give it to anyone and they'll be able to find you on Diaspora." heading: "Diaspora ID" donate: "Donate" - handle_explanation: "Este é o seu endereço do Diaspora. Tal como um endereço de email, pode dá-lo a quem deseja que o contacte." + handle_explanation: "Esta é a sua identificação do Diaspora. Tal como um endereço de email, pode dá-la a quem deseja que o contacte." keep_us_running: "Keep %{pod} running fast, buy our servers their monthly coffee fix!" no_contacts: "Não há contactos" no_tags: "No tags" @@ -134,7 +134,7 @@ pt-PT: try_adding_some_more_contacts: "You can search (top) or invite (right) more contacts." you_should_add_some_more_contacts: "You should add some more contacts!" no_posts_message: - start_talking: "Ainda ninguém disse nada. Dê início à conversa!" + start_talking: "Ainda ninguém disse nada!" one: "1 aspecto" other: "%{count} aspectos" seed: @@ -207,7 +207,7 @@ pt-PT: many: "%{count} novas mensagens" one: "1 nova mensagem" other: "%{count} novas mensagens" - zero: "não há novas mensagens" + zero: "Não há novas mensagens" index: create_a_new_message: "criar uma nova mensagem" inbox: "Caixa de Entrada" @@ -267,7 +267,7 @@ pt-PT: accept_your_invitation: "Accept your invitation" your_account_awaits: "Your account awaits!" new: - already_invited: "Já foi convidado" + already_invited: "As pessoas seguintes não aceitaram o seu convite:" aspect: "Aspecto" comma_seperated_plz: "Pode inserir vários endereços de email separados por vírgulas." if_they_accept_info: "se aceitarem, serão adicionados ao aspecto para o qual os convidou." @@ -343,7 +343,7 @@ pt-PT: many: "%{count} novas notificações" one: "1 nova notificação" other: "%{count} novas notificações" - zero: "não há novas notificações" + zero: "Não há novas notificações" index: and: "e" and_others: @@ -531,8 +531,8 @@ pt-PT: your_photo: "A sua fotografia" your_private_profile: "O seu perfil privado" your_public_profile: "O seu perfil público" - your_tags: "Você: em 5 #tags" - your_tags_placeholder: "p.ex. #diaspora #varrer #gatos #música" + your_tags: "Descreva-se em 5 palavras" + your_tags_placeholder: "como #filmes #gatos #viagens #professor #novaiorque" update: failed: "Falhou ao actualizar o perfil" updated: "Perfil actualizado" @@ -550,7 +550,7 @@ pt-PT: update: "Actualizar" new: create_my_account: "Create my account" - enter_email: "Introduza um endereço de e-mail" + enter_email: "Introduza um endereço de email" enter_password: "Introduza uma palavra-passe" enter_password_again: "Introduza de novo a mesma palavra-passe" enter_username: "Escolha um nome de utilizador (apenas letras, números e underscores)" @@ -622,8 +622,8 @@ pt-PT: shared: add_contact: add_new_contact: "Add a new contact" - create_request: "Encontrar através do endereço do Diaspora" - diaspora_handle: "diaspora@handle.org" + create_request: "Encontrar através da identificação do Diaspora" + diaspora_handle: "diaspora@pod.org" enter_a_diaspora_username: "Introduza um nome de utilizador do Diaspora:" know_email: "Sabe os seus endereços de email? Deveria convidá-los" your_diaspora_username_is: "O seu nome de utilizador do Diaspora é: %{diaspora_handle}" @@ -633,7 +633,7 @@ pt-PT: logged_in_as: "iniciou sessão como %{name}" your_aspects: "os seus aspectos" invitations: - by_email: "Por Email" + by_email: "Por email" dont_have_now: "Não tem nenhum agora, mas terá mais convites brevemente!" from_facebook: "do Facebook" invitations_left: "ainda tem %{count}" @@ -660,7 +660,7 @@ pt-PT: share: "Partilhar" share_with: "partilhar com" upload_photos: "Upload photos" - whats_on_your_mind: "em que está a pensar?" + whats_on_your_mind: "Em que está a pensar?" reshare: reshare: "Voltar a partilhar" stream_element: @@ -686,7 +686,7 @@ pt-PT: other: "por favor não utilize mais de %{count} caracteres ao escrever as suas mensagens de estado" zero: "por favor não utilize mais de %{count} caracteres ao escrever as suas mensagens de estado" stream_helper: - hide_comments: "ocultar comentários" + hide_comments: "Ocultar todos comentários" show_more_comments: "Show %{number} more comments" tag_followings: create: @@ -727,8 +727,8 @@ pt-PT: also_commented: "...alguém também comenta na publicação do seu contacto?" change: "Alterar" change_email: "Change E-Mail" - change_language: "Mudar de Idioma" - change_password: "Alterar a Palavra-passe" + change_language: "Mudar de idioma" + change_password: "Alterar a palavra-passe" close_account: "Encerrar a Conta" comment_on_post: "...alguém comenta as suas publicações?" current_password: "Palavra-passe actual" @@ -739,12 +739,12 @@ pt-PT: export_data: "Exportar Dados" liked: "...alguém gosta da sua publicação?" mentioned: "...é mencionado numa publicação?" - new_password: "Nova Palavra-passe" + new_password: "Nova palavra-passe" private_message: "...recebe uma mensagem privada?" receive_email_notifications: "Receber notificações por email quando..." started_sharing: "...alguém começa a partilhar consigo?" your_email: "O seu endereço de email" - your_handle: "O seu endereço do Diaspora" + your_handle: "A sua identificação do Diaspora" getting_started: aspects: "aspects" connect_to: "Connect to" @@ -757,7 +757,7 @@ pt-PT: fill_out_your_profile: "Fill out your profile" find_friends: "Find friends" find_friends_from_facebook: "find friends from Facebook" - finished: "Terminado!" + finished: "Terminado" follow_your_interests: "Follow your interests" hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." profile_description: "Make it easier for people to find you by filling out your profile information." @@ -770,17 +770,17 @@ pt-PT: photo: "Photo" tags: "Tags" see_all_featured_users: "See all featured users" - welcome: "Bem-vindo(a) ao Diaspora!" + welcome: "Bem-vindo(a)!" welcome_with_name: "Welcome, %{name}!" public: does_not_exist: "O utilizador %{username} não existe!" update: email_notifications_changed: "As notificações por email foram alteradas" - language_changed: "O Idioma Foi Alterado" - language_not_changed: "Falha ao Alterar o Idioma" + language_changed: "O idioma foi alterado" + language_not_changed: "Falha ao alterar o idioma" password_changed: "A palavra-passe foi alterada. Já pode iniciar sessão com a sua nova palavra-passe." password_not_changed: "Falhou ao alterar a palavra-passe" - unconfirmed_email_changed: "E-Mail Changed. Needs activation." + unconfirmed_email_changed: "O endereço de email foi alterado. É necessária activação." unconfirmed_email_not_changed: "E-Mail Change Failed" webfinger: fetch_failed: "erro a obter perfil webfinger profile para %{profile_url}" diff --git a/config/locales/diaspora/zh-TW.yml b/config/locales/diaspora/zh-TW.yml index 7554b7b05..c6c59fb2a 100644 --- a/config/locales/diaspora/zh-TW.yml +++ b/config/locales/diaspora/zh-TW.yml @@ -750,8 +750,8 @@ zh-TW: connect_to: "連結至" connect_to_your_other_social_networks: "與其他社交網站連結" connect_with_people: "與酷咖連結" - connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" - connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "為了和別人聯繫, 將他們放入你的任何一個或多個" + connect_with_people_explanation_pt2: "面向是區分新人或熟人的直覺方式, 並且只有你自己知道, 讓你可以輕易過濾他們, 或只和部份聯絡人分享." featured_tags: "特色標籤" featured_users: "特色使用者" fill_out_your_profile: "填寫個人檔案" diff --git a/config/locales/javascript/javascript.el.yml b/config/locales/javascript/javascript.el.yml index 18a9be648..88c7cf51a 100644 --- a/config/locales/javascript/javascript.el.yml +++ b/config/locales/javascript/javascript.el.yml @@ -23,8 +23,8 @@ el: no_more: "Δεν υπάρχουν άλλες δημοσιεύσεις." publisher: at_least_one_aspect: "Πρέπει να κάνετε δημοσίευση σε τουλάχιστον μια πτυχή" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "Περιορισμένο - οι δημοσιεύσεις σας θα είναι ορατές μόνο από τα άτομα με τα οποία διαμοιράζεστε. " + public: "Δημόσιο - οι δημοσιεύσεις σας θα είναι ορατές στον καθένα και θα μπορούν να βρεθούν από τις μηχανές αναζήτησης." reshares: duplicate: "Έχετε ήδη κοινοποιήσει αυτή τη δημοσίευση!" search_for: "Αναζήτηση για {{name}}" diff --git a/config/locales/javascript/javascript.pt-PT.yml b/config/locales/javascript/javascript.pt-PT.yml index 194ec6034..27a26e0cf 100644 --- a/config/locales/javascript/javascript.pt-PT.yml +++ b/config/locales/javascript/javascript.pt-PT.yml @@ -23,10 +23,10 @@ pt-PT: no_more: "Não há mais publicações." publisher: at_least_one_aspect: "Tem de publicar para pelo menos um aspecto" - limited: "Limited - your post will only be seen by people you are sharing with" - public: "Public - your post will be visible to everyone and found by search engines" + limited: "Limitado - a sua publicação só será vista pelas pessoas com as quais a está partilhar" + public: "Público - A sua publicação vai ser visível para todos e encontrada por motores de busca" reshares: - duplicate: "You've already reshared that post!" + duplicate: "Já republicou essa publicação!" search_for: "Procurar por {{name}}" show_more: "mostrar mais" timeago: From 4d4d11b90b0225f6b3af1f683482d46d3548df8a Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 17 Aug 2011 12:48:52 -0700 Subject: [PATCH 082/133] upgrade selenium-webdriver to 2.4 for FF6 support --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 3a8199dd7..91c15f150 100644 --- a/Gemfile +++ b/Gemfile @@ -103,7 +103,7 @@ end group :test do gem 'factory_girl_rails' gem 'fixture_builder', '0.2.2' - gem 'selenium-webdriver', '0.2.2' + gem 'selenium-webdriver', '2.4' gem 'capybara', '~> 0.3.9' gem 'cucumber-rails', '0.3.2' gem 'rspec', '>= 2.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index 15d2b5f03..0aa586894 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -143,7 +143,7 @@ GEM ohai (>= 0.5.7) rest-client (< 1.7.0, >= 1.0.4) uuidtools - childprocess (0.2.0) + childprocess (0.2.1) ffi (~> 1.0.6) closure-compiler (1.1.1) cloudfiles (1.4.10) @@ -399,8 +399,8 @@ GEM rubyntlm (0.1.1) rubyzip (0.9.4) sass (3.1.4) - selenium-webdriver (0.2.2) - childprocess (>= 0.1.9) + selenium-webdriver (2.4.0) + childprocess (>= 0.2.1) ffi (>= 1.0.7) json_pure rubyzip @@ -511,7 +511,7 @@ DEPENDENCIES ruby-debug ruby-debug19 sass (= 3.1.4) - selenium-webdriver (= 0.2.2) + selenium-webdriver (= 2.4) settingslogic (= 2.0.6) sod! sqlite3 From bf0eb3dac3c0d1aae94c025777ba10bcc3c5acb7 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 17 Aug 2011 14:18:51 -0700 Subject: [PATCH 083/133] 4 failures left in postgres --- app/controllers/comments_controller.rb | 2 +- app/models/job/receive_local_batch.rb | 17 ++++++++++++++--- app/models/person.rb | 16 +++++----------- app/models/services/facebook.rb | 11 ++++++++++- db/migrate/20110707234802_likes_on_comments.rb | 10 ++++++---- .../20110729045734_add_full_name_to_profile.rb | 9 ++++++++- spec/helpers/getting_started_helper_spec.rb | 4 ++-- spec/integration/receiving_spec.rb | 1 - 8 files changed, 46 insertions(+), 24 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index b111c5736..0272ccd73 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -57,7 +57,7 @@ class CommentsController < ApplicationController def index @post = current_user.find_visible_post_by_id(params[:post_id]) if @post - @comments = @post.comments.includes(:author => :profile) + @comments = @post.comments.includes(:author => :profile).order('created_at ASC') render :layout => false else raise ActiveRecord::RecordNotFound.new diff --git a/app/models/job/receive_local_batch.rb b/app/models/job/receive_local_batch.rb index ceca8f807..cc42d1cfa 100644 --- a/app/models/job/receive_local_batch.rb +++ b/app/models/job/receive_local_batch.rb @@ -14,12 +14,23 @@ module Job socket_to_users(post, recipient_user_ids) if post.respond_to?(:socket_to_user) notify_mentioned_users(post) end + def self.create_visibilities(post, recipient_user_ids) contacts = Contact.where(:user_id => recipient_user_ids, :person_id => post.author_id) - new_post_visibilities = contacts.map do |contact| - PostVisibility.new(:contact_id => contact.id, :post_id => post.id) + + if postgres? + # Take the naive approach to inserting our new visibilities for now. + contacts.each do |contact| + PostVisibility.find_or_create_by_contact_id_and_post_id(contact.id, post.id) + end + else + # Use a batch insert on mySQL. + new_post_visibilities = contacts.map do |contact| + PostVisibility.new(:contact_id => contact.id, :post_id => post.id) + end + PostVisibility.import(new_post_visibilities) end - PostVisibility.import new_post_visibilities + end def self.socket_to_users(post, recipient_user_ids) recipient_user_ids.each do |id| diff --git a/app/models/person.rb b/app/models/person.rb index 84f9b41e0..dbd17c6e1 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -67,18 +67,12 @@ class Person < ActiveRecord::Base def self.search_query_string(query) query = query.downcase + like_operator = postgres? ? "ILIKE" : "LIKE" - if postgres? - where_clause = <<-SQL - profiles.full_name ILIKE ? OR - profiles.diaspora_handle ILIKE ? - SQL - else - where_clause = <<-SQL - profiles.full_name LIKE ? OR - people.diaspora_handle LIKE ? - SQL - end + where_clause = <<-SQL + profiles.full_name #{like_operator} ? OR + people.diaspora_handle #{like_operator} ? + SQL q_tokens = query.to_s.strip.gsub(/(\s|$|^)/) { "%#{$1}" } [where_clause, [q_tokens, q_tokens]] diff --git a/app/models/services/facebook.rb b/app/models/services/facebook.rb index 3a208039a..2252dd01f 100644 --- a/app/models/services/facebook.rb +++ b/app/models/services/facebook.rb @@ -42,7 +42,16 @@ class Services::Facebook < Service su.attach_local_models su } - ServiceUser.import(data, :on_duplicate_key_update => [:updated_at, :contact_id, :person_id, :request_id, :invitation_id, :photo_url, :name, :username]) + + + if postgres? + # Take the naive approach to inserting our new visibilities for now. + data.each do |su| + su.save + end + else + ServiceUser.import(data, :on_duplicate_key_update => [:updated_at, :contact_id, :person_id, :request_id, :invitation_id, :photo_url, :name, :username]) + end end private diff --git a/db/migrate/20110707234802_likes_on_comments.rb b/db/migrate/20110707234802_likes_on_comments.rb index 78a2fa272..67b039332 100644 --- a/db/migrate/20110707234802_likes_on_comments.rb +++ b/db/migrate/20110707234802_likes_on_comments.rb @@ -18,10 +18,12 @@ SQL SQL #There are some duplicate likes. - keeper_likes = Like.group(:target_id, :author_id, :target_type).having('COUNT(*) > 1') - keeper_likes.each do |like| - l = Like.arel_table - Like.where(:target_id => like.target_id, :author_id => like.author_id, :target_type => like.target_type).where(l[:id].not_eq(like.id)).delete_all + if Like.count > 0 + keeper_likes = Like.group(:target_id, :author_id, :target_type).having('COUNT(*) > 1') + keeper_likes.each do |like| + l = Like.arel_table + Like.where(:target_id => like.target_id, :author_id => like.author_id, :target_type => like.target_type).where(l[:id].not_eq(like.id)).delete_all + end end add_index :likes, [:target_id, :author_id, :target_type], :unique => true end diff --git a/db/migrate/20110729045734_add_full_name_to_profile.rb b/db/migrate/20110729045734_add_full_name_to_profile.rb index 047eed869..6096b3447 100644 --- a/db/migrate/20110729045734_add_full_name_to_profile.rb +++ b/db/migrate/20110729045734_add_full_name_to_profile.rb @@ -1,4 +1,5 @@ class AddFullNameToProfile < ActiveRecord::Migration + class Profile < ActiveRecord::Base; end def self.up add_column :profiles, :full_name, :string, :limit => 70 @@ -8,7 +9,13 @@ class AddFullNameToProfile < ActiveRecord::Migration remove_index :profiles, [:first_name, :searchable] remove_index :profiles, [:last_name, :searchable] - execute("UPDATE profiles SET full_name=LOWER(CONCAT(first_name, ' ', last_name))") + if Profile.count > 0 + if postgres? + execute("UPDATE profiles SET full_name=LOWER(first_name || ' ' || last_name)") + else + execute("UPDATE profiles SET full_name=LOWER(CONCAT(first_name, ' ', last_name))") + end + end end def self.down diff --git a/spec/helpers/getting_started_helper_spec.rb b/spec/helpers/getting_started_helper_spec.rb index 0223b9230..1176300b4 100644 --- a/spec/helpers/getting_started_helper_spec.rb +++ b/spec/helpers/getting_started_helper_spec.rb @@ -16,7 +16,7 @@ describe GettingStartedHelper do it 'returns true if the current user has filled out all 7 suggested fields (from getting started)' do profile = @current_user.person.profile profile.update_attributes!( - {:first_name => "alice", :last_name => "smith", :image_url => "abcd.jpg", :birthday => Date.new, + {:first_name => "alice", :last_name => "smith", :image_url => "abcd.jpg", :birthday => Time.now, :gender => "cow", :location => "san fran", :tag_string => "#sup", :bio => "holler" }) has_completed_profile?.should be_true end @@ -59,7 +59,7 @@ describe GettingStartedHelper do end it 'returns false if the current_user has less than 2 contacts (inclusive)' do - @current_user.contacts.delete_all + @current_user.contacts.destroy_all has_few_contacts?.should be_false end end diff --git a/spec/integration/receiving_spec.rb b/spec/integration/receiving_spec.rb index 4e6d9315d..a4ea66f3e 100644 --- a/spec/integration/receiving_spec.rb +++ b/spec/integration/receiving_spec.rb @@ -272,7 +272,6 @@ describe 'a user receives a post' do post_in_db.comments.should == [] receive_with_zord(bob, alice.person, @xml) - post_in_db.comments(true).first.author.should == remote_person end end From 159fce3ef2955234d500ed56b8fdb6d800e69535 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Mon, 15 Aug 2011 23:05:14 -0700 Subject: [PATCH 084/133] refactor wip --- app/models/invitation.rb | 121 +++++++++++++++++++++++++++------------ app/models/user.rb | 85 ++++++++++++++++++++------- 2 files changed, 149 insertions(+), 57 deletions(-) diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 04c29b4b7..9a2ea2f5e 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -10,21 +10,98 @@ class Invitation < ActiveRecord::Base validates_presence_of :sender, :recipient, - :aspect + :aspect, + :identifier, + :service + + attr_accessible :sender, :recipient, :aspect, :service, :identifier + + before_validation :attach_recipent, :on => :create + before_create :ensure_not_inviting_self + + validate :valid_identifier? + validates_uniqueness_of :sender, :scope => :recipient + + + def identifier=(ident) + ident.downcase! if ident + ident + end + + def not_inviting_yourself + if self.identifier == self.sender.email + errors[:base] << 'You can not invite yourself' + end + end + + def attach_recipient + self.recipient = User.find_or_create_by_invitation(self) + end + + def skip_invitation? + + end + + def valid_identifier? + if self.service == 'email' + unless self.identifier.match(Devise.email_regexp) + errors[:base] << 'You can not invite yourself' + end + end + end +end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # @param opts [Hash] Takes :identifier, :service, :idenfitier, :from, :message # @return [User] def self.invite(opts={}) - opts[:identifier].downcase! if opts[:identifier] # return if the current user is trying to invite himself via email return false if opts[:identifier] == opts[:from].email if existing_user = self.find_existing_user(opts[:service], opts[:identifier]) - # If the sender of the invitation is already connected to the person - # he is inviting, raise an error. - if opts[:from].contact_for(opts[:from].person) - raise "You are already connceted to this person" - # Check whether or not the existing User has already been invited; # and if so, start sharing with the Person. elsif not existing_user.invited? @@ -48,18 +125,6 @@ class Invitation < ActiveRecord::Base # @param service [String] String representation of the service invitation provider (i.e. facebook, email) # @param identifier [String] String representation of the reciepients identity on the provider (i.e. 'bob.smith', bob@aol.com) # @return [User] - def self.find_existing_user(service, identifier) - unless existing_user = User.where(:invitation_service => service, - :invitation_identifier => identifier).first - if service == 'email' - existing_user ||= User.where(:email => identifier).first - else - existing_user ||= User.joins(:services).where(:services => {:type => "Services::#{service.titleize}", :uid => identifier}).first - end - end - - existing_user - end # @params opts [Hash] Takes :from, :existing_user, :service, :identifier, :message # @return [User] @@ -71,25 +136,9 @@ class Invitation < ActiveRecord::Base invitee.valid? # Return a User immediately if an invalid email is passed in - return invitee if opts[:service] == 'email' && !opts[:identifier].match(Devise.email_regexp) - - if invitee.new_record? - invitee.errors.clear - invitee.serialized_private_key = User.generate_key if invitee.serialized_private_key.blank? - invitee.send(:generate_invitation_token) - elsif invitee.invitation_token.nil? - return invitee - end # Logic if there is an explicit sender - if opts[:from] - invitee.save(:validate => false) - Invitation.create!(:sender => opts[:from], - :recipient => invitee, - :aspect => opts[:into], - :message => opts[:message]) - invitee.reload - end + invitee.skip_invitation = (opts[:service] != 'email') invitee.invite! diff --git a/app/models/user.rb b/app/models/user.rb index 9206d0f77..7263f787a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -59,24 +59,40 @@ class User < ActiveRecord::Base :invitation_service, :invitation_identifier - # Sometimes we access the person in a strange way and need to do this - # @note we should make this method depricated. - # - # @return [Person] - def save_person! - self.person.save if self.person && self.person.changed? - self.person + + + def self.find_or_create_by_invitation(invitation) + service = invitation.service + identifier = invitation.identifier + + unless existing_user = User.joins(:invitations) + .where(:invitation_service => service, + :invitation_identifier => identifier).first + if service == 'email' + existing_user = User.where(:email => identifier).first + else + existing_user = User.joins(:services).where(:services => {:type => "Services::#{service.titleize}", :uid => identifier}).first + end + end + + if existing_user + return existing_user + else + + end end - # Set the User's email to the one they've been invited at, if the user - # is being created via an invitation. - # - # @return [User] - def infer_email_from_invitation_provider - self.email = self.invitation_identifier if self.invitation_service == 'email' - self + def self.create_from_invitation! + user = User.new + user.generate_keys + user.generate_invitation_token + + # we need to make a custom validator here to make this safer + user.save(:validate => false) + user end + def update_user_preferences(pref_hash) if self.disable_mail UserPreference::VALID_EMAIL_TYPES.each{|x| self.user_preferences.find_or_create_by_email_type(x)} @@ -291,6 +307,8 @@ class User < ActiveRecord::Base end end + + ###Invitations############ def invite_user(aspect_id, service, identifier, invite_message = "") if aspect = aspects.find(aspect_id) @@ -355,13 +373,12 @@ class User < ActiveRecord::Base opts[:person][:profile] = Profile.new(opts[:person][:profile]) end + #TODO make this User#person= self.person = Person.new(opts[:person]) self.person.diaspora_handle = "#{opts[:username]}@#{AppConfig[:pod_uri].authority}" self.person.url = AppConfig[:pod_url] - - self.serialized_private_key = User.generate_key if self.serialized_private_key.blank? - self.person.serialized_public_key = OpenSSL::PKey::RSA.new(self.serialized_private_key).public_key + self.generate_keys self end @@ -379,10 +396,6 @@ class User < ActiveRecord::Base aq end - def self.generate_key - key_size = (Rails.env == 'test' ? 512 : 4096) - OpenSSL::PKey::RSA::generate(key_size) - end def encryption_key OpenSSL::PKey::RSA.new(serialized_private_key) @@ -433,4 +446,34 @@ class User < ActiveRecord::Base i += 1 end end + + + # Generate public/private keys for User and associated Person + def generate_keys + key_size = (Rails.env == 'test' ? 512 : 4096) + + self.serialized_private_key = OpenSSL::PKey::RSA::generate(key_size) if self.serialized_private_key.blank? + + if self.person && self.person.serialized_public_key.blank? + self.person.serialized_public_key = OpenSSL::PKey::RSA.new(self.serialized_private_key).public_key + end + end + + # Sometimes we access the person in a strange way and need to do this + # @note we should make this method depricated. + # + # @return [Person] + def save_person! + self.person.save if self.person && self.person.changed? + self.person + end + + # Set the User's email to the one they've been invited at, if the user + # is being created via an invitation. + # + # @return [User] + def infer_email_from_invitation_provider + self.email = self.invitation_identifier if self.invitation_service == 'email' + self + end end From cc6618d294741b267345c19599a9c09dfb7f67c8 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Mon, 15 Aug 2011 23:51:39 -0700 Subject: [PATCH 085/133] some progress --- app/models/invitation.rb | 154 ++++-------------- app/models/user.rb | 27 +-- ...0110816061820_add_fields_to_invitations.rb | 11 ++ db/schema.rb | 4 +- 4 files changed, 64 insertions(+), 132 deletions(-) create mode 100644 db/migrate/20110816061820_add_fields_to_invitations.rb diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 9a2ea2f5e..ca8fcc0db 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -16,16 +16,20 @@ class Invitation < ActiveRecord::Base attr_accessible :sender, :recipient, :aspect, :service, :identifier - before_validation :attach_recipent, :on => :create + before_validation :set_email_as_default_service + before_validation :attach_recipient, :on => :create before_create :ensure_not_inviting_self validate :valid_identifier? validates_uniqueness_of :sender, :scope => :recipient + def set_email_as_default_service + self.service ||='email' + end def identifier=(ident) ident.downcase! if ident - ident + super end def not_inviting_yourself @@ -39,119 +43,7 @@ class Invitation < ActiveRecord::Base end def skip_invitation? - - end - - def valid_identifier? - if self.service == 'email' - unless self.identifier.match(Devise.email_regexp) - errors[:base] << 'You can not invite yourself' - end - end - end -end - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # @param opts [Hash] Takes :identifier, :service, :idenfitier, :from, :message - # @return [User] - def self.invite(opts={}) - # return if the current user is trying to invite himself via email - return false if opts[:identifier] == opts[:from].email - - if existing_user = self.find_existing_user(opts[:service], opts[:identifier]) - # Check whether or not the existing User has already been invited; - # and if so, start sharing with the Person. - elsif not existing_user.invited? - opts[:from].share_with(existing_user.person, opts[:into]) - return - - # If the sender has already invited the recipient, raise an error. - elsif Invitation.where(:sender_id => opts[:from].id, :recipient_id => existing_user.id).first - raise "You already invited this person" - - # When everything checks out, we merge the existing user into the - # options hash to pass on to self.create_invitee. - else - opts.merge(:existing_user => existing_user) - end - end - - create_invitee(opts) - end - - # @param service [String] String representation of the service invitation provider (i.e. facebook, email) - # @param identifier [String] String representation of the reciepients identity on the provider (i.e. 'bob.smith', bob@aol.com) - # @return [User] - - # @params opts [Hash] Takes :from, :existing_user, :service, :identifier, :message - # @return [User] - def self.create_invitee(opts={}) - invitee = opts[:existing_user] - invitee ||= User.new(:invitation_service => opts[:service], :invitation_identifier => opts[:identifier]) - - # (dan) I'm not sure why, but we need to call .valid? on our User. - invitee.valid? - - # Return a User immediately if an invalid email is passed in - - # Logic if there is an explicit sender - - invitee.skip_invitation = (opts[:service] != 'email') - invitee.invite! - - # Logging the invitation action - log_hash = {:event => :invitation_sent, :to => opts[:identifier], :service => opts[:service]} - log_hash.merge({:inviter => opts[:from].diaspora_handle, :invitier_uid => opts[:from].id, :inviter_created_at_unix => opts[:from].created_at.to_i}) if opts[:from] - Rails.logger.info(log_hash) - - invitee - end - - def resend - recipient.invite! + self.service != 'email' end # @return Contact @@ -162,16 +54,40 @@ end contact end + def invite! + recipient.skip_invitation = self.skip_invitation? + recipient.invite! + + # Logging the invitation action + log_hash = {:event => :invitation_sent, :to => self[:identifier], :service => self[:service]} + log_hash.merge({:inviter => self.sender.diaspora_handle, :invitier_uid => self.sender.id, :inviter_created_at_unix => self.sender.created_at.to_i}) if self.sender + Rails.logger.info(log_hash) + + recipient + end + + def resend + self.invite! + end + # @return [String] def recipient_identifier - if recipient.invitation_service == 'email' - recipient.invitation_identifier - elsif recipient.invitation_service == 'facebook' - if su = ServiceUser.where(:uid => recipient.invitation_identifier).first + if self.service == 'email' + self.identifier + elsif self.service == 'facebook' + if su = ServiceUser.where(:uid => self.identifier).first su.name else I18n.t('invitations.a_facebook_user') end end end + + def valid_identifier? + if self.service == 'email' + unless self.identifier.match(Devise.email_regexp) + errors[:base] << 'invalid email' + end + end + end end diff --git a/app/models/user.rb b/app/models/user.rb index 7263f787a..76470547b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -65,28 +65,31 @@ class User < ActiveRecord::Base service = invitation.service identifier = invitation.identifier - unless existing_user = User.joins(:invitations) - .where(:invitation_service => service, - :invitation_identifier => identifier).first - if service == 'email' - existing_user = User.where(:email => identifier).first - else - existing_user = User.joins(:services).where(:services => {:type => "Services::#{service.titleize}", :uid => identifier}).first - end + #find users that may already exsist + #1. + if service == 'email' + existing_user = User.where(:email => identifier).first + else + existing_user = User.joins(:services).where(:services => {:type => "Services::#{service.titleize}", :uid => identifier}).first end + + if existing_user.nil? + i = Invitation.where(:service => service, :identifier => identifier).first + existing_user = i.recipient if i + end if existing_user return existing_user else - + self.create_from_invitation!(invitation) end end - def self.create_from_invitation! + def self.create_from_invitation!(invitation) user = User.new user.generate_keys - user.generate_invitation_token - + user.send(:generate_invitation_token) + #user.invitations << invitation # we need to make a custom validator here to make this safer user.save(:validate => false) user diff --git a/db/migrate/20110816061820_add_fields_to_invitations.rb b/db/migrate/20110816061820_add_fields_to_invitations.rb new file mode 100644 index 000000000..45b36952d --- /dev/null +++ b/db/migrate/20110816061820_add_fields_to_invitations.rb @@ -0,0 +1,11 @@ +class AddFieldsToInvitations < ActiveRecord::Migration + def self.up + add_column :invitations, :service, :string + add_column :invitations, :identifier, :string + end + + def self.down + remove_column :invitations, :service + remove_column :invitations, :identifier + end +end diff --git a/db/schema.rb b/db/schema.rb index 0f485397a..1bc0eae57 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110815210933) do +ActiveRecord::Schema.define(:version => 20110816061820) do create_table "aspect_memberships", :force => true do |t| t.integer "aspect_id", :null => false @@ -104,6 +104,8 @@ ActiveRecord::Schema.define(:version => 20110815210933) do t.integer "aspect_id" t.datetime "created_at" t.datetime "updated_at" + t.string "service" + t.string "identifier" end add_index "invitations", ["aspect_id"], :name => "index_invitations_on_aspect_id" From eb8c540ac116d96880cff29d6b54d64413db441a Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 16 Aug 2011 19:26:39 -0700 Subject: [PATCH 086/133] MS DG IZ major invite refactor. all tests are green minus weird stuff on dans computer, need to checkout this out on pivots --- app/controllers/admins_controller.rb | 12 +- app/controllers/invitations_controller.rb | 61 ++-- app/controllers/services_controller.rb | 3 +- app/models/invitation.rb | 102 ++++-- app/models/job/mail/invite_user_by_email.rb | 6 +- app/models/job/resend_invitation.rb | 2 +- app/models/service_user.rb | 6 +- app/models/user.rb | 71 ++--- .../mailer/invitation_instructions.haml | 2 +- ...0110816061820_add_fields_to_invitations.rb | 6 + db/schema.rb | 5 +- features/step_definitions/user_steps.rb | 6 +- lib/rake_helpers.rb | 12 +- spec/controllers/admins_controller_spec.rb | 10 +- .../invitations_controller_spec.rb | 71 +++-- spec/controllers/services_controller_spec.rb | 2 +- spec/factories.rb | 9 + spec/lib/rake_helper_spec.rb | 5 +- spec/models/invitation_spec.rb | 300 ++++-------------- .../jobs/mail/invite_user_by_email_spec.rb | 16 +- spec/models/jobs/resend_invitation_spec.rb | 14 +- spec/models/user/invite_spec.rb | 90 ------ spec/models/user_spec.rb | 99 +++++- 23 files changed, 391 insertions(+), 519 deletions(-) delete mode 100644 spec/models/user/invite_spec.rb diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb index 5a6256221..fbd1ed0a5 100644 --- a/app/controllers/admins_controller.rb +++ b/app/controllers/admins_controller.rb @@ -8,12 +8,12 @@ class AdminsController < ApplicationController @users = params[:user].empty? ? [] : User.where(params[:user]) end - def admin_inviter - opts = {:service => 'email', :identifier => params[:identifier]} - existing_user = Invitation.find_existing_user('email', params[:identifier]) - opts.merge!(:existing_user => existing_user) if existing_user - Invitation.create_invitee(opts) - flash[:notice] = "invitation sent to #{params[:identifier]}" + def admin_inviter + user = User.find_by_email params[:idenitifer] + unless user + Invitation.create(:service => 'email', :identifer => params[:identifier], :admin => true) + flash[:notice] = "invitation sent to #{params[:identifier]}" + end redirect_to user_search_path end diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index be2993777..0bfab60c5 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -5,6 +5,7 @@ class InvitationsController < Devise::InvitationsController before_filter :check_token, :only => [:edit] + before_filter :check_if_invites_open, :only =>[:create] def new @sent_invitations = current_user.invitations_from_me.includes(:recipient) @@ -16,35 +17,14 @@ class InvitationsController < Devise::InvitationsController end def create - unless AppConfig[:open_invitations] - flash[:error] = I18n.t 'invitations.create.no_more' - redirect_to :back - return - end - aspect = params[:user].delete(:aspects) + aspect_id = params[:user].delete(:aspect_id) message = params[:user].delete(:invite_messages) emails = params[:user][:email].to_s.gsub(/\s/, '').split(/, */) + #NOTE should we try and find users by email here? probs + aspect = Aspect.find(aspect_id) + invites = Invitation.batch_build(:sender => current_user, :aspect => aspect, :emails => emails, :service => 'email') - good_emails, bad_emails = emails.partition{|e| e.try(:match, Devise.email_regexp)} - - if good_emails.include?(current_user.email) - if good_emails.length == 1 - flash[:error] = I18n.t 'invitations.create.own_address' - redirect_to :back - return - else - bad_emails.push(current_user.email) - good_emails.delete(current_user.email) - end - end - - good_emails.each{|e| Resque.enqueue(Job::Mail::InviteUserByEmail, current_user.id, e, aspect, message)} - - if bad_emails.any? - flash[:error] = I18n.t('invitations.create.sent') + good_emails.join(', ') + " "+ I18n.t('invitations.create.rejected') + bad_emails.join(', ') - else - flash[:notice] = I18n.t('invitations.create.sent') + good_emails.join(', ') - end + flash[:notice] = extract_messages(invites) redirect_to :back end @@ -59,7 +39,7 @@ class InvitationsController < Devise::InvitationsController user.accept_invitation!(params[:user]) user.seed_aspects rescue Exception => e #What exception is this trying to rescue? If it is ActiveRecord::NotFound, we should say so. - raise e unless e.respond_to?(:record) + raise e user = nil record = e.record record.errors.delete(:person) @@ -90,12 +70,37 @@ class InvitationsController < Devise::InvitationsController @resource = User.find_by_invitation_token(params[:invitation_token]) render 'devise/mailer/invitation_instructions', :layout => false end - protected + protected def check_token if User.find_by_invitation_token(params[:invitation_token]).nil? flash[:error] = I18n.t 'invitations.check_token.not_found' redirect_to root_url end end + + def check_if_invites_open + unless AppConfig[:open_invitations] + flash[:error] = I18n.t 'invitations.create.no_more' + redirect_to :back + return + end + end + + # @param invites [Array] Invitations to be sent. + # @return [String] A full list of success and error messages. + def extract_messages(invites) + success_message = "Invites Successfully Sent to: " + failure_message = "There was a problem with: " + successes, failures = invites.partition{|x| x.persisted? } + + success_message += successes.map{|k| k.identifier }.join(', ') + failure_message += failures.map{|k| k.identifier }.join(', ') + + messages = [] + messages << success_message if successes.present? + messages << failure_message if failures.present? + + messages.join('\n') + end end diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index c9a332399..9c3386944 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -59,7 +59,8 @@ class ServicesController < ApplicationController if i_id = params[:invitation_id] invited_user = Invitation.find(i_id).recipient else - invited_user = current_user.invite_user(params[:aspect_id], params[:provider], @uid) + invite = Invitation.create(:service => params[:provider], :identifier => @uid, :sender => current_user, :aspect => current_user.aspects.find(params[:aspect_id])) + invited_user = invite.attach_recipient! end @subject = t('services.inviter.join_me_on_diaspora') diff --git a/app/models/invitation.rb b/app/models/invitation.rb index ca8fcc0db..553a4d54b 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -8,54 +8,73 @@ class Invitation < ActiveRecord::Base belongs_to :recipient, :class_name => 'User' belongs_to :aspect - validates_presence_of :sender, - :recipient, - :aspect, - :identifier, - :service + validates_presence_of :identifier, :service - attr_accessible :sender, :recipient, :aspect, :service, :identifier + validates_presence_of :sender, :aspect, :unless => :admin? + attr_accessible :sender, :recipient, :aspect, :service, :identifier, :admin before_validation :set_email_as_default_service - before_validation :attach_recipient, :on => :create - before_create :ensure_not_inviting_self + validate :ensure_not_inviting_self, :on => :create validate :valid_identifier? - validates_uniqueness_of :sender, :scope => :recipient + validates_uniqueness_of :sender_id, :scope => [:identifier, :service], :unless => :admin? - def set_email_as_default_service - self.service ||='email' + after_create :queue_send! #TODO make this after_commit :queue_saved!, :on => :create + + + # @note options hash is passed through to [Invitation.new] + # @see [Invitation.new] + # + # @option opts [Array] :emails + # @return [Array] An array of initialized [Invitation] models. + def self.batch_build(opts) + emails = opts.delete(:emails) + emails.map! do |e| + Invitation.create(opts.merge(:identifier => e)) + end + emails end + # Downcases the incoming service identifier and assigns it + # + # @param ident [String] Service identifier + # @see super def identifier=(ident) ident.downcase! if ident super end - def not_inviting_yourself - if self.identifier == self.sender.email - errors[:base] << 'You can not invite yourself' - end - end - - def attach_recipient - self.recipient = User.find_or_create_by_invitation(self) - end - - def skip_invitation? + # Determine if we want to skip emailing the recipient. + # + # @return [Boolean] + # @return [void] + def skip_email? self.service != 'email' end - # @return Contact - def share_with! - if contact = sender.share_with(recipient.person, aspect) - self.destroy + # Attach a recipient [User] to the [Invitation] unless + # there is one already present. + # + # @return [User] The recipient. + def attach_recipient! + unless self.recipient.present? + self.recipient = User.find_or_create_by_invitation(self) + self.save end - contact + self.recipient end - def invite! - recipient.skip_invitation = self.skip_invitation? + # Find or create user, and send that resultant User an + # invitation. + # + # @return [Invitation] self + def send! + self.attach_recipient! + + # Sets an instance variable in User (set by devise invitable) + # This determines whether an email should be sent to the recipient. + recipient.skip_invitation = self.skip_email? + recipient.invite! # Logging the invitation action @@ -63,11 +82,12 @@ class Invitation < ActiveRecord::Base log_hash.merge({:inviter => self.sender.diaspora_handle, :invitier_uid => self.sender.id, :inviter_created_at_unix => self.sender.created_at.to_i}) if self.sender Rails.logger.info(log_hash) - recipient + self end + # @return [Invitation] self def resend - self.invite! + self.send! end # @return [String] @@ -83,7 +103,27 @@ class Invitation < ActiveRecord::Base end end + def queue_send! + unless self.recipient.present? + Resque.enqueue(Job::Mail::InviteUserByEmail, self.id) + end + end + + # @note before_save + def set_email_as_default_service + self.service ||= 'email' + end + + # @note Validation + def ensure_not_inviting_self + if !self.admin? && self.identifier == self.sender.email + errors[:base] << 'You can not invite yourself' + end + end + + # @note Validation def valid_identifier? + return false unless self.identifier if self.service == 'email' unless self.identifier.match(Devise.email_regexp) errors[:base] << 'invalid email' diff --git a/app/models/job/mail/invite_user_by_email.rb b/app/models/job/mail/invite_user_by_email.rb index 6e4275f60..2864798e4 100644 --- a/app/models/job/mail/invite_user_by_email.rb +++ b/app/models/job/mail/invite_user_by_email.rb @@ -7,9 +7,9 @@ module Job module Mail class InviteUserByEmail < Base @queue = :mail - def self.perform(sender_id, email, aspect_id, invite_message) - user = User.find(sender_id) - user.invite_user(aspect_id, 'email', email, invite_message) + def self.perform(invite_id) + invite = Invitation.find(invite_id) + invite.send! end end end diff --git a/app/models/job/resend_invitation.rb b/app/models/job/resend_invitation.rb index 12cf073b4..c4d2d79a8 100644 --- a/app/models/job/resend_invitation.rb +++ b/app/models/job/resend_invitation.rb @@ -7,7 +7,7 @@ module Job class ResendInvitation < Base @queue = :mail def self.perform(invitation_id) - inv = Invitation.where(:id => invitation_id).first + inv = Invitation.find(invitation_id) inv.resend end end diff --git a/app/models/service_user.rb b/app/models/service_user.rb index a721ae505..7157d26c1 100644 --- a/app/models/service_user.rb +++ b/app/models/service_user.rb @@ -30,8 +30,8 @@ class ServiceUser < ActiveRecord::Base self.contact = self.service.user.contact_for(self.person) end - self.invitation = Invitation.joins(:recipient).where(:sender_id => self.service.user_id, - :users => {:invitation_service => self.service.provider, - :invitation_identifier => self.uid}).first + self.invitation = Invitation.where(:sender_id => self.service.user_id, + :service => self.service.provider, + :identifier => self.uid).first end end diff --git a/app/models/user.rb b/app/models/user.rb index 76470547b..b8e8ed6d7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -60,13 +60,11 @@ class User < ActiveRecord::Base :invitation_identifier - - def self.find_or_create_by_invitation(invitation) + # @return [User] + def self.find_by_invitation(invitation) service = invitation.service identifier = invitation.identifier - #find users that may already exsist - #1. if service == 'email' existing_user = User.where(:email => identifier).first else @@ -78,8 +76,13 @@ class User < ActiveRecord::Base existing_user = i.recipient if i end - if existing_user - return existing_user + existing_user + end + + # @return [User] + def self.find_or_create_by_invitation(invitation) + if existing_user = self.find_by_invitation(invitation) + existing_user else self.create_from_invitation!(invitation) end @@ -89,7 +92,7 @@ class User < ActiveRecord::Base user = User.new user.generate_keys user.send(:generate_invitation_token) - #user.invitations << invitation + #user.invitations_to_me << invitation # we need to make a custom validator here to make this safer user.save(:validate => false) user @@ -310,21 +313,6 @@ class User < ActiveRecord::Base end end - - - ###Invitations############ - def invite_user(aspect_id, service, identifier, invite_message = "") - if aspect = aspects.find(aspect_id) - Invitation.invite(:service => service, - :identifier => identifier, - :from => self, - :into => aspect, - :message => invite_message) - else - false - end - end - # This method is called when an invited user accepts his invitation # # @param [Hash] opts the options to accept the invitation with @@ -333,25 +321,29 @@ class User < ActiveRecord::Base # @option opts [String] :password_confirmation def accept_invitation!(opts = {}) log_hash = {:event => :invitation_accepted, :username => opts[:username], :uid => self.id} - log_hash[:inviter] = invitations_to_me.first.sender.diaspora_handle if invitations_to_me.first - begin - if self.invited? - self.setup(opts) - self.invitation_token = nil - self.password = opts[:password] - self.password_confirmation = opts[:password_confirmation] - self.save! - invitations_to_me.each{|invitation| invitation.share_with!} - log_hash[:status] = "success" - Rails.logger.info log_hash + log_hash[:inviter] = invitations_to_me.first.sender.diaspora_handle if invitations_to_me.first && invitations_to_me.first.sender - self.reload # Because to_request adds a request and saves elsewhere - self + if self.invited? + self.setup(opts) + self.invitation_token = nil + self.password = opts[:password] + self.password_confirmation = opts[:password_confirmation] + self.save! + + # moved old Invitation#share_with! logic into here, + # but i don't think we want to destroy the invitation + # anymore. we may want to just call self.share_with + invitations_to_me.each do |invitation| + if !invitation.admin? && invitation.sender.share_with(self.person, invitation.aspect) + invitation.destroy + end end - rescue Exception => e - log_hash[:status] = "failure" - Rails.logger.info log_hash - raise e + + log_hash[:status] = "success" + Rails.logger.info(log_hash) + + self.reload # Because to_request adds a request and saves elsewhere + self end end @@ -365,6 +357,7 @@ class User < ActiveRecord::Base def setup(opts) self.username = opts[:username] self.email = opts[:email] + self.language ||= 'en' self.valid? errors = self.errors errors.delete :person diff --git a/app/views/devise/mailer/invitation_instructions.haml b/app/views/devise/mailer/invitation_instructions.haml index fc24f2d92..b945d898f 100644 --- a/app/views/devise/mailer/invitation_instructions.haml +++ b/app/views/devise/mailer/invitation_instructions.haml @@ -1,5 +1,5 @@ - @invs = @resource.invitations_to_me --if @invs.count > 0 +-unless @invs.first.admin? !!! %html %head diff --git a/db/migrate/20110816061820_add_fields_to_invitations.rb b/db/migrate/20110816061820_add_fields_to_invitations.rb index 45b36952d..f8005ef0c 100644 --- a/db/migrate/20110816061820_add_fields_to_invitations.rb +++ b/db/migrate/20110816061820_add_fields_to_invitations.rb @@ -2,10 +2,16 @@ class AddFieldsToInvitations < ActiveRecord::Migration def self.up add_column :invitations, :service, :string add_column :invitations, :identifier, :string + add_column :invitations, :admin, :boolean, :default => false + change_column :invitations, :recipient_id, :integer, :null => true + change_column :invitations, :sender_id, :integer, :null => true end def self.down remove_column :invitations, :service remove_column :invitations, :identifier + remove_column :invitations, :admin + change_column :invitations, :recipient_id, :integer, :null => false + change_column :invitations, :sender_id, :integer, :null => false end end diff --git a/db/schema.rb b/db/schema.rb index 1bc0eae57..b94110f5f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -99,13 +99,14 @@ ActiveRecord::Schema.define(:version => 20110816061820) do create_table "invitations", :force => true do |t| t.text "message" - t.integer "sender_id", :null => false - t.integer "recipient_id", :null => false + t.integer "sender_id" + t.integer "recipient_id" t.integer "aspect_id" t.datetime "created_at" t.datetime "updated_at" t.string "service" t.string "identifier" + t.boolean "admin", :default => false end add_index "invitations", ["aspect_id"], :name => "index_invitations_on_aspect_id" diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 951b255c1..25f0aa54f 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -35,13 +35,15 @@ Given /^a user named "([^\"]*)" with email "([^\"]*)"$/ do |name, email| end Given /^I have been invited by an admin$/ do - @me = Invitation.create_invitee(:service => 'email', :identifier => "new_invitee@example.com") + i = Invitation.create!(:admin => true, :service => 'email', :identifier => "new_invitee@example.com") + @me = i.attach_recipient! end Given /^I have been invited by a user$/ do @inviter = Factory(:user) aspect = @inviter.aspects.create(:name => "Rocket Scientists") - @me = @inviter.invite_user(aspect.id, 'email', "new_invitee@example.com", "Hey, tell me about your rockets!") + i = Invitation.create!(:aspect => aspect, :sender => @inviter, :service => 'email', :identifier => "new_invitee@example.com", :message =>"Hey, tell me about your rockets!") + @me = i.attach_recipient! end When /^I click on my name$/ do diff --git a/lib/rake_helpers.rb b/lib/rake_helpers.rb index 2e842c750..b796ae5f2 100644 --- a/lib/rake_helpers.rb +++ b/lib/rake_helpers.rb @@ -21,9 +21,17 @@ module RakeHelpers churn_through = n backer_name = backers[n+offset][1].to_s.strip backer_email = backers[n+offset][0].to_s.strip - unless User.find_by_email(backer_email) || User.find_by_invitation_identifier(backer_email) + + possible_user = User.find_by_email(backer_email) + possible_invite = Invitation.find_by_identifier(backer_email) + possible_user ||= possible_invite.recipient if possible_invite.present? + + unless possible_user puts "#{n}: sending email to: #{backer_name} #{backer_email}" unless Rails.env == 'test' - Invitation.create_invitee(:service => 'email', :identifier => backer_email, :name => backer_name ) unless test + unless test + i = Invitation.new(:service => 'email', :identifier => backer_email, :admin => true) + i.send! + end else puts "user with the email exists: #{backer_email} , #{backer_name} " unless Rails.env == 'test' end diff --git a/spec/controllers/admins_controller_spec.rb b/spec/controllers/admins_controller_spec.rb index 5dfd068ae..d9cca8040 100644 --- a/spec/controllers/admins_controller_spec.rb +++ b/spec/controllers/admins_controller_spec.rb @@ -85,19 +85,11 @@ describe AdminsController do end it 'invites a new user' do - Invitation.should_receive(:create_invitee).with(:service => 'email', :identifier => 'bob@moms.com') + Invitation.should_receive(:create) get :admin_inviter, :identifier => 'bob@moms.com' response.should redirect_to user_search_path flash.notice.should include("invitation sent") end - - it 'passes an existing user to create_invitee' do - Factory.create(:user, :email => 'bob@moms.com') - bob = User.where(:email => 'bob@moms.com').first - Invitation.should_receive(:find_existing_user).with('email', 'bob@moms.com').and_return(bob) - Invitation.should_receive(:create_invitee).with(:service => 'email', :identifier => 'bob@moms.com', :existing_user => bob) - get :admin_inviter, :identifier => 'bob@moms.com' - end end end diff --git a/spec/controllers/invitations_controller_spec.rb b/spec/controllers/invitations_controller_spec.rb index 460917783..a2256366e 100644 --- a/spec/controllers/invitations_controller_spec.rb +++ b/spec/controllers/invitations_controller_spec.rb @@ -11,6 +11,7 @@ describe InvitationsController do AppConfig[:open_invitations] = true @user = alice @aspect = @user.aspects.first + @invite = {:invite_message=>"test", :aspect_id=> @aspect.id.to_s, :email=>"abc@example.com"} request.env["devise.mapping"] = Devise.mappings[:user] Webfinger.stub_chain(:new, :fetch).and_return(Factory(:person)) @@ -19,43 +20,37 @@ describe InvitationsController do describe "#create" do before do sign_in :user, @user - @invite = {:invite_message=>"test", :aspect_id=> @aspect.id.to_s, :email=>"abc@example.com"} @controller.stub!(:current_user).and_return(@user) request.env["HTTP_REFERER"]= 'http://test.host/cats/foo' end - it 'calls the resque job Job::InviteUser' do - Resque.should_receive(:enqueue) - post :create, :user => @invite + it 'saves and invitation' do + expect { + post :create, :user => @invite + }.should change(Invitation, :count).by(1) end it 'handles a comma seperated list of emails' do - Resque.should_receive(:enqueue).twice() - post :create, :user => @invite.merge( + expect{ + post :create, :user => @invite.merge( :email => "foofoofoofoo@example.com, mbs@gmail.com") + }.should change(Invitation, :count).by(2) end it 'handles a comma seperated list of emails with whitespace' do - Resque.should_receive(:enqueue).twice() - post :create, :user => @invite.merge( - :email => "foofoofoofoo@example.com , mbs@gmail.com") - end - - it 'displays a message that tells the user how many invites were sent, and which REJECTED' do - post :create, :user => @invite.merge( - :email => "mbs@gmail.com, foo@bar.com, foo.com, lala@foo, cool@bar.com") - flash[:error].should_not be_empty - flash[:error].should =~ /foo\.com/ - flash[:error].should =~ /lala@foo/ + expect { + post :create, :user => @invite.merge( + :email => "foofoofoofoo@example.com , mbs@gmail.com") + }.should change(Invitation, :count).by(2) end it "allows invitations without if invitations are open" do open_bit = AppConfig[:open_invitations] AppConfig[:open_invitations] = true - Resque.should_receive(:enqueue).once - post :create, :user => @invite - + expect{ + post :create, :user => @invite + }.to change(Invitation, :count).by(1) AppConfig[:open_invitations] = open_bit end @@ -67,16 +62,19 @@ describe InvitationsController do it 'strips out your own email' do lambda { post :create, :user => @invite.merge(:email => @user.email) - }.should_not change(User, :count) + }.should_not change(Invitation, :count) - Resque.should_receive(:enqueue).once - post :create, :user => @invite.merge(:email => "hello@example.org, #{@user.email}") + expect{ + post :create, :user => @invite.merge(:email => "hello@example.org, #{@user.email}") + }.should change(Invitation, :count).by(1) end end describe "#update" do before do - @invited_user = @user.invite_user(@aspect.id, 'email', "a@a.com") + invite = Factory(:invitation, :sender => @user, :service => 'email', :identifier => "a@a.com") + @invited_user = invite.attach_recipient! + @accept_params = {:user=> {:password_confirmation =>"password", :email => "a@a.com", @@ -137,7 +135,8 @@ describe InvitationsController do @controller.stub!(:current_user).and_return(@user) request.env["HTTP_REFERER"]= 'http://test.host/cats/foo' - @invited_user = @user.invite_user(@aspect.id, 'email', "a@a.com", "") + invite = Factory(:invitation, :sender => @user, :service => 'email', :identifier => "a@a.com") + @invited_user = invite.attach_recipient! end it 'calls resend invitation if one exists' do @@ -148,12 +147,24 @@ describe InvitationsController do end it 'does not send an invitation for a different user' do - @user2 = bob - @aspect2 = @user2.aspects.create(:name => "cats") - @user2.invite_user(@aspect2.id, 'email', "b@b.com", "") - invitation2 = @user2.reload.invitations_from_me.first + invitation2 = Factory(:invitation, :sender => bob, :service => 'email', :identifier => "a@a.com") + Resque.should_not_receive(:enqueue) - put :resend, :id => invitation2.id + put :resend, :id => invitation2.id + end + end + + + describe '#extract_messages' do + before do + sign_in alice + end + it 'displays a message that tells the user how many invites were sent, and which REJECTED' do + post :create, :user => @invite.merge( + :email => "mbs@gmail.com, foo@bar.com, foo.com, lala@foo, cool@bar.com") + flash[:notice].should_not be_empty + flash[:notice].should =~ /foo\.com/ + flash[:notice].should =~ /lala@foo/ end end end diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index e7674e675..1333262f4 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -146,7 +146,7 @@ describe ServicesController do end it 'does not create a duplicate invitation' do - inv = Invitation.create!(:sender_id => @user.id, :recipient_id => eve.id, :aspect_id => @user.aspects.first.id) + inv = Invitation.create!(:sender => @user, :recipient => eve, :aspect => @user.aspects.first, :identifier => eve.email) @invite_params[:invitation_id] = inv.id lambda { diff --git a/spec/factories.rb b/spec/factories.rb index e5bca7665..e90ab36d3 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -96,6 +96,15 @@ Factory.define :reshare do |r| r.association(:author, :factory => :person) end +Factory.define :invitation do |i| + i.service "email" + i.identifier "bob.smith@smith.com" + i.association :sender, :factory => :user_with_aspect + i.after_build do |i| + i.aspect = i.sender.aspects.first + end +end + Factory.define :service do |service| service.nickname "sirrobertking" service.type "Services::Twitter" diff --git a/spec/lib/rake_helper_spec.rb b/spec/lib/rake_helper_spec.rb index 6f2b6d40b..f511065d6 100644 --- a/spec/lib/rake_helper_spec.rb +++ b/spec/lib/rake_helper_spec.rb @@ -14,8 +14,9 @@ describe RakeHelpers do Devise.mailer.deliveries = [] end it 'should send emails to each backer' do - Invitation.should_receive(:create_invitee).exactly(3).times - process_emails(@csv, 100, 1, false) + expect{ + process_emails(@csv, 100, 1, false) + }.to change(User, :count).by(3) end it 'should not send the email to the same email twice' do diff --git a/spec/models/invitation_spec.rb b/spec/models/invitation_spec.rb index 71c27b7a8..30b081737 100644 --- a/spec/models/invitation_spec.rb +++ b/spec/models/invitation_spec.rb @@ -6,7 +6,6 @@ require 'spec_helper' describe Invitation do let(:user) { alice } - let(:aspect) { user.aspects.first } before do @email = 'maggie@example.com' @@ -14,292 +13,101 @@ describe Invitation do end describe 'validations' do before do - aspect - @invitation = Invitation.new(:sender => user, :recipient => eve, :aspect => aspect) + @invitation = Factory.build(:invitation, :sender => user, :recipient => eve, :aspect => user.aspects.first) end + it 'is valid' do @invitation.sender.should == user @invitation.recipient.should == eve - @invitation.aspect.should == aspect + @invitation.aspect.should == user.aspects.first @invitation.should be_valid end - it 'is from a user' do - @invitation.sender = nil - @invitation.should_not be_valid - end - it 'is to a user' do - @invitation.recipient = nil - @invitation.should_not be_valid - end - it 'is into an aspect' do - @invitation.aspect = nil - @invitation.should_not be_valid + + it 'ensures the sender is placing the recipient into one of his aspects' do + pending end end it 'has a message' do - @invitation = Invitation.new(:sender => user, :recipient => eve, :aspect => aspect) + @invitation = Factory.build(:invitation, :sender => user, :recipient => eve, :aspect => user.aspects.first) @invitation.message = "!" @invitation.message.should == "!" end - describe '.find_existing_user' do - let(:inv) { Invitation.find_existing_user(@type, @identifier) } - context 'send a request to an existing' do - context 'active user' do - it 'by email' do - @identifier = alice.email - @type = 'email' - inv.should == alice - end - - it 'by service' do - uid = '123324234' - alice.services << Services::Facebook.new(:uid => uid) - alice.save - - @type = 'facebook' - @identifier = uid - - inv.should == alice - end - end - - context 'invited user' do - it 'by email' do - @identifier = alice.email - @type = 'email' - - alice.invitation_identifier = @identifier - alice.invitation_service = @type - alice.save - inv.should == alice - end - - it 'by service' do - fb_id = 'abc123' - alice.invitation_service = 'facebook' - alice.invitation_identifier = fb_id - alice.save - - @identifier = fb_id - @type = 'facebook' - inv.should == alice - end - end + describe 'the invite process' do + before do end - end - describe '.invite' do - it 'creates an invitation' do + it 'works for a new user' do + invite = Invitation.new(:sender => alice, :aspect => alice.aspects.first, :service => 'email', :identifier => 'foo@bar.com') lambda { - Invitation.invite(:service => 'email', :identifier => @email, :from => user, :into => aspect) - }.should change(Invitation, :count).by(1) - end - - it 'associates the invitation with the inviter' do - lambda { - Invitation.invite(:service => 'email', :identifier => @email, :from => user, :into => aspect) - }.should change { user.reload.invitations_from_me.count }.by(1) - end - - it 'associates the invitation with the invitee' do - new_user = Invitation.invite(:service => 'email', :identifier => @email, :from => user, :into => aspect) - new_user.invitations_to_me.count.should == 1 - end - - it 'creates a user' do - lambda { - Invitation.invite(:from => user, :service => 'email', :identifier => @email, :into => aspect) + invite.save + invite.send! }.should change(User, :count).by(1) end - it 'returns the new user' do - new_user = Invitation.invite(:from => user, :service => 'email', :identifier => @email, :into => aspect) - new_user.is_a?(User).should be_true - new_user.email.should == @email + it 'works for a current user(with the right email)' do + invite = Invitation.create(:sender => alice, :aspect => alice.aspects.first, :service => 'email', :identifier => bob.email) + lambda { + invite.send! + }.should_not change(User, :count) end - it 'adds the inviter to the invited_user' do - new_user = Invitation.invite(:from => user, :service => 'email', :identifier => @email, :into => aspect) - new_user.invitations_to_me.first.sender.should == user + it 'works for a current user(with the same fb id)' do + bob.services << Factory.build(:service, :type => "Services::Facebook") + invite = Invitation.create(:sender => alice, :aspect => alice.aspects.first, :service => 'facebook', :identifier => bob.services.first.uid) + lambda { + invite.send! + }.should_not change(User, :count) + end + it 'is able to resend an invite' do end - it 'adds an optional message' do - message = "How've you been?" - new_user = Invitation.invite(:from => user, :service => 'email', :identifier => @email, :into => aspect, :message => message) - new_user.invitations_to_me.first.message.should == message + it 'handles the case when that user has an invite but not a user' do end - it 'sends a contact request to a user with that email into the aspect' do - user.should_receive(:share_with).with(eve.person, aspect) - Invitation.invite(:from => user, :service => 'email', :identifier => eve.email, :into => aspect) - end - - context 'invalid email' do - it 'return a user with errors' do - new_user = Invitation.invite(:service => 'email', :identifier => "fkjlsdf", :from => user, :into => aspect) - new_user.should have(1).errors_on(:email) - new_user.should_not be_persisted - end + it 'handles the case where that user has an invite but has not yet accepted' do end end - - describe '.create_invitee' do - context "when we're resending an invitation" do - before do - @valid_params = {:from => user, - :service => 'email', - :identifier => @email, - :into => aspect, - :message => @message} - @invitee = Invitation.create_invitee(:service => 'email', :identifier => @email) - @valid_params[:existing_user] = @invitee - end - - it "does not create a user" do - expect { Invitation.create_invitee(@valid_params) }.should_not change(User, :count) - end - - it "sends mail" do - expect { - Invitation.create_invitee(@valid_params) - }.should change { Devise.mailer.deliveries.size }.by(1) - end - - it "does not set the key" do - expect { - Invitation.create_invitee(@valid_params) - }.should_not change { @invitee.reload.serialized_private_key } - end - - it "does not change the invitation token" do - old_token = @invitee.invitation_token - Invitation.create_invitee(@valid_params) - @invitee.reload.invitation_token.should == old_token - end - end - context 'with an inviter' do - before do - @message = "whatever" - @valid_params = {:from => user, :service => 'email', :identifier => @email, :into => aspect, :message => @message} - end - - it "sends mail" do - expect { - Invitation.create_invitee(@valid_params) - }.should change { Devise.mailer.deliveries.size }.by(1) - end - - it "includes the message in the email" do - Invitation.create_invitee(@valid_params) - Devise.mailer.deliveries.last.to_s.should include(@message) - end - - it "has no translation missing" do - Invitation.create_invitee(@valid_params) - Devise.mailer.deliveries.last.body.raw_source.should_not match(/(translation_missing.+)/) - end - - it "doesn't create a user if the email is invalid" do - new_user = Invitation.create_invitee(@valid_params.merge(:identifier => 'fdfdfdfdf')) - new_user.should_not be_persisted - new_user.should have(1).error_on(:email) - end - - it "does not save a user with an empty string email" do - @valid_params[:service] = 'facebook' - @valid_params[:identifier] = '3423423' - Invitation.create_invitee(@valid_params) - @valid_params[:identifier] = 'dfadsfdas' - expect { Invitation.create_invitee(@valid_params) }.should_not raise_error - end - end - - context 'with no inviter' do - it 'sends an email that includes the right things' do - Invitation.create_invitee(:service => 'email', :identifier => @email) - Devise.mailer.deliveries.first.to_s.should include("Email not displaying correctly?") - end - it 'creates a user' do - expect { - Invitation.create_invitee(:service => 'email', :identifier => @email) - }.should change(User, :count).by(1) - end - it 'sends email to the invited user' do - expect { - Invitation.create_invitee(:service => 'email', :identifier => @email) - }.should change { Devise.mailer.deliveries.size }.by(1) - end - it 'does not create an invitation' do - expect { - Invitation.create_invitee(:service => 'email', :identifier => @email) - }.should_not change(Invitation, :count) - end - end - end - + describe '.resend' do before do - aspect - user.invite_user(aspect.id, 'email', "a@a.com", "") - @invitation = user.reload.invitations_from_me.first + @invitation = Factory(:invitation, :sender => alice, :aspect => alice.aspects.first, :service => 'email', :identifier => 'a@a.com') end it 'sends another email' do - lambda { @invitation.resend }.should change(Devise.mailer.deliveries, :count).by(1) - end - end - - describe '#share_with!' do - before do - @new_user = Invitation.invite(:from => user, :service => 'email', :identifier => @email, :into => aspect) - acceptance_params = {:invitation_token => "abc", - :username => "user", - :email => @email, - :password => "secret", - :password_confirmation => "secret", - :person => {:profile => {:first_name => "Bob", :last_name => "Smith"}}} - @new_user.setup(acceptance_params) - @new_user.person.save - @new_user.save - @invitation = @new_user.invitations_to_me.first - end - - it 'destroys the invitation' do lambda { - @invitation.share_with! - }.should change(Invitation, :count).by(-1) - end - - it 'creates a contact for the inviter and invitee' do - lambda { - @invitation.share_with! - }.should change(Contact, :count).by(2) + @invitation.resend + }.should change(Devise.mailer.deliveries, :count).by(1) end end describe '#recipient_identifier' do it 'calls email if the invitation_service is email' do - alice.invite_user(aspect.id, 'email', "a@a.com", "") - invitation = alice.reload.invitations_from_me.first - invitation.recipient_identifier.should == 'a@a.com' + email = 'abc@abc.com' + invitation = Factory(:invitation, :sender => alice, :service => 'email', :identifier => email, :aspect => alice.aspects.first) + invitation.recipient_identifier.should == email end - it 'gets the name if the invitation_service is facebook' do - alice.services << Services::Facebook.new(:uid => "13234895") - alice.reload.services(true).first.service_users.create(:uid => "23526464", :photo_url => 'url', :name => "Remote User") - alice.invite_user(aspect.id, 'facebook', "23526464", '') - invitation = alice.reload.invitations_from_me.first - invitation.recipient_identifier.should == "Remote User" - end - it 'does not error if the facebook user is not recorded' do - alice.services << Services::Facebook.new(:uid => "13234895") - alice.reload.services(true).first.service_users.create(:uid => "23526464", :photo_url => 'url', :name => "Remote User") - alice.invite_user(aspect.id, 'facebook', "23526464", '') - alice.services.first.service_users.delete_all - invitation = alice.reload.invitations_from_me.first - invitation.recipient_identifier.should == "A Facebook user" + + context 'facebook' do + before do + @uid = '23526464' + @service = "facebook" + alice.services << Services::Facebook.new(:uid => "13234895") + alice.reload.services(true).first.service_users.create(:uid => @uid, :photo_url => 'url', :name => "Remote User") + end + + it 'gets the name if the invitation_service is facebook' do + invitation = Factory(:invitation, :sender => alice, :identifier => @uid, :service => @service, :aspect => alice.aspects.first) + invitation.recipient_identifier.should == "Remote User" + end + + it 'does not error if the facebook user is not recorded' do + invitation = Factory(:invitation, :sender => alice, :identifier => @uid, :service => @service, :aspect => alice.aspects.first) + alice.services.first.service_users.delete_all + invitation.recipient_identifier.should == "A Facebook user" + end end end end diff --git a/spec/models/jobs/mail/invite_user_by_email_spec.rb b/spec/models/jobs/mail/invite_user_by_email_spec.rb index 8f3181737..0bc8beb0e 100644 --- a/spec/models/jobs/mail/invite_user_by_email_spec.rb +++ b/spec/models/jobs/mail/invite_user_by_email_spec.rb @@ -4,20 +4,14 @@ describe Job::Mail::InviteUserByEmail do before do @sender = alice @email = 'bob@bob.com' - @aspect_id = alice.aspects.first.id + @aspect = alice.aspects.first @message = 'invite message' - - User.stub(:find){ |id| - if id == @sender.id - @sender - else - nil - end - } end it 'calls invite_user with email param' do - @sender.should_receive(:invite_user).with(@aspect_id, 'email', @email, @message) - Job::Mail::InviteUserByEmail.perform(@sender.id, @email, @aspect_id, @message) + invitation = Invitation.create(:sender => @sender, :identifier => @email, :service => "email", :aspect => @aspect, :message => @message) + invitation.should_receive(:send!) + Invitation.stub(:find).and_return(invitation) + Job::Mail::InviteUserByEmail.perform(invitation.id) end end diff --git a/spec/models/jobs/resend_invitation_spec.rb b/spec/models/jobs/resend_invitation_spec.rb index de7f54074..25969047e 100644 --- a/spec/models/jobs/resend_invitation_spec.rb +++ b/spec/models/jobs/resend_invitation_spec.rb @@ -5,17 +5,13 @@ require 'spec_helper' describe Job::ResendInvitation do - describe '#perfom_delegate' do + describe '#perfom' do it 'should call .resend on the object' do - user = alice - aspect = user.aspects.create(:name => "cats") - user.invite_user(aspect.id, 'email', "a@a.com", "") - invitation = user.reload.invitations_from_me.first + invite = Factory(:invitation, :service => 'email', :identifier => 'foo@bar.com') - #Notification.should_receive(:notify).with(instance_of(User), instance_of(StatusMessage), instance_of(Person)) - Invitation.stub(:where).with(:id => invitation.id ).and_return([invitation]) - invitation.should_receive(:resend) - Job::ResendInvitation.perform(invitation.id) + Invitation.stub(:find).and_return(invite) + invite.should_receive(:resend) + Job::ResendInvitation.perform(invite.id) end end end diff --git a/spec/models/user/invite_spec.rb b/spec/models/user/invite_spec.rb deleted file mode 100644 index 41ce0e6c7..000000000 --- a/spec/models/user/invite_spec.rb +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -require 'spec_helper' - -describe User do - context "creating invites" do - before do - @aspect = eve.aspects.first - @email = "bob@bob.com" - end - - it 'requires your aspect' do - lambda { - eve.invite_user(alice.aspects.first.id, "email", "maggie@example.com") - }.should raise_error ActiveRecord::RecordNotFound - end - - it 'takes a service parameter' do - @invite_params = {:service => 'email'} - Invitation.should_receive(:invite).with(hash_including(@invite_params)) - eve.invite_user(@aspect.id, 'email', @email) - end - - it 'takes an indentifier parameter' do - @invite_params = {:identifier => @email} - Invitation.should_receive(:invite).with(hash_including(@invite_params)) - eve.invite_user(@aspect.id, 'email', @email) - end - - it 'calls Invitation.invite' do - Invitation.should_receive(:invite) - eve.invite_user(@aspect.id, 'email', @email) - end - - it 'has an invitation' do - eve.invite_user(@aspect.id, 'email', @email).invitations_to_me.count.should == 1 - end - - it 'creates it with an email' do - eve.invite_user(@aspect.id, 'email', @email).email.should == @email - end - - it "throws if you try to add someone you're connected to" do - connect_users(eve, @aspect, alice, alice.aspects.first) - lambda { - eve.invite_user(@aspect.id, 'email', alice.email) - }.should raise_error ActiveRecord::RecordNotUnique - end - - it 'does not invite people I already invited' do - eve.invite_user(@aspect.id, 'email', "email1@example.com") - lambda { - eve.invite_user(@aspect.id, 'email', "email1@example.com") - }.should raise_error /You already invited this person/ - end - end - - describe "#accept_invitation!" do - before do - invite_pre = Invitation.invite(:from => eve, :service => 'email', :identifier => 'invitee@example.org', :into => eve.aspects.first).reload - @person_count = Person.count - @invited_user = invite_pre.accept_invitation!(:invitation_token => "abc", - :email => "a@a.com", - :username => "user", - :password => "secret", - :password_confirmation => "secret", - :person => {:profile => {:first_name => "Bob", - :last_name => "Smith"}} ) - - end - - context 'after invitation acceptance' do - it 'destroys the invitations' do - @invited_user.invitations_to_me.count.should == 0 - end - - it "should create the person with the passed in params" do - Person.count.should == @person_count + 1 - @invited_user.person.profile.first_name.should == "Bob" - end - - it 'resolves incoming invitations into contact requests' do - eve.contacts.where(:person_id => @invited_user.person.id).count.should == 1 - end - end - end -end - diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index f34193fd5..7c472fd6c 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -318,6 +318,55 @@ describe User do end end + describe '.find_by_invitation' do + let(:invited_user) { + inv = Factory.build(:invitation, :recipient => @recipient, :service => @type, :identifier => @identifier) + User.find_by_invitation(inv) + } + + context 'send a request to an existing' do + before do + @recipient = alice + end + + context 'active user' do + it 'by service' do + @type = 'facebook' + @identifier = '123456' + + @recipient.services << Services::Facebook.new(:uid => @identifier) + @recipient.save + + invited_user.should == @recipient + end + + it 'by email' do + @type = 'email' + @identifier = alice.email + + invited_user.should == @recipient + end + end + + context 'invited user' do + it 'by service and identifier' do + @identifier = alice.email + @type = 'email' + invited_user.should == alice + end + end + + context 'not on server (not yet invited)' do + it 'returns nil' do + @recipient = nil + @identifier = 'foo@bar.com' + @type = 'email' + invited_user.should be_nil + end + end + end + end + describe 'update_user_preferences' do before do @pref_count = UserPreference::VALID_EMAIL_TYPES.count @@ -484,14 +533,14 @@ describe User do describe '#destroy' do it 'removes invitations from the user' do - alice.invite_user alice.aspects.first.id, 'email', 'blah@blah.blah' + Factory(:invitation, :sender => alice) lambda { alice.destroy }.should change {alice.invitations_from_me(true).count }.by(-1) end it 'removes invitations to the user' do - Invitation.create(:sender_id => eve.id, :recipient_id => alice.id, :aspect_id => eve.aspects.first.id) + Invitation.create!(:sender => eve, :recipient => alice, :identifier => alice.email, :aspect => eve.aspects.first) lambda { alice.destroy }.should change {alice.invitations_to_me(true).count }.by(-1) @@ -810,6 +859,52 @@ describe User do end end + describe "#accept_invitation!" do + before do + fantasy_resque do + @invitation = Factory.create(:invitation, :sender => eve, :identifier => 'invitee@example.org', :aspect => eve.aspects.first) + end + @invitation.reload + @form_params = {:invitation_token => "abc", + :email => "a@a.com", + :username => "user", + :password => "secret", + :password_confirmation => "secret", + :person => {:profile => {:first_name => "Bob", + :last_name => "Smith"}}} + + end + + context 'after invitation acceptance' do + it 'destroys the invitations' do + user = @invitation.recipient.accept_invitation!(@form_params) + user.invitations_to_me.count.should == 0 + end + + it "should create the person with the passed in params" do + lambda { + @invitation.recipient.accept_invitation!(@form_params) + }.should change(Person, :count).by(1) + end + + it 'resolves incoming invitations into contact requests' do + user = @invitation.recipient.accept_invitation!(@form_params) + eve.contacts.where(:person_id => user.person.id).count.should == 1 + end + end + + context 'from an admin' do + it 'should work' do + i = nil + fantasy_resque do + i = Invitation.create!(:admin => true, :service => 'email', :identifier => "new_invitee@example.com") + end + i.reload + i.recipient.accept_invitation!(@form_params) + end + end + end + describe '#retract' do before do @retraction = mock From e039aabeeffc3c7cce6f6808915d5875fb33a9c0 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Wed, 17 Aug 2011 11:00:14 -0700 Subject: [PATCH 087/133] senders must now own aspects --- app/models/invitation.rb | 9 +++++++++ spec/models/invitation_spec.rb | 12 +++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 553a4d54b..a60e3c0fe 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -17,6 +17,7 @@ class Invitation < ActiveRecord::Base validate :ensure_not_inviting_self, :on => :create validate :valid_identifier? + validate :sender_owns_aspect? validates_uniqueness_of :sender_id, :scope => [:identifier, :service], :unless => :admin? after_create :queue_send! #TODO make this after_commit :queue_saved!, :on => :create @@ -121,6 +122,14 @@ class Invitation < ActiveRecord::Base end end + # @note Validation + def sender_owns_aspect? + unless(self.sender && (self.sender_id == self.aspect.user_id)) + errors[:base] << 'You do not own that aspect' + end + end + + # @note Validation def valid_identifier? return false unless self.identifier diff --git a/spec/models/invitation_spec.rb b/spec/models/invitation_spec.rb index 30b081737..54f1800db 100644 --- a/spec/models/invitation_spec.rb +++ b/spec/models/invitation_spec.rb @@ -24,7 +24,8 @@ describe Invitation do end it 'ensures the sender is placing the recipient into one of his aspects' do - pending + @invitation.aspect = Factory(:aspect) + @invitation.should_not be_valid end end @@ -35,6 +36,7 @@ describe Invitation do end + describe 'the invite process' do before do end @@ -61,13 +63,17 @@ describe Invitation do invite.send! }.should_not change(User, :count) end - it 'is able to resend an invite' do - end it 'handles the case when that user has an invite but not a user' do + pending end it 'handles the case where that user has an invite but has not yet accepted' do + pending + end + + it 'generate the invitation token and pass it to the user' do + end end From 19eb5498893b91688d4920167de2d326779d2a9e Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Wed, 17 Aug 2011 13:37:39 -0700 Subject: [PATCH 088/133] fixed up update controller action and building users #scary #gladsofaerisstillhere --- app/controllers/invitations_controller.rb | 27 +++++++++-------------- app/models/invitation.rb | 14 ++++++------ app/models/person.rb | 17 +++++++++++++- app/models/user.rb | 26 +++++++++------------- spec/factories.rb | 2 +- spec/models/invitation_spec.rb | 2 +- spec/models/person_spec.rb | 11 ++++++++- 7 files changed, 55 insertions(+), 44 deletions(-) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 0bfab60c5..1e7463afd 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -21,7 +21,7 @@ class InvitationsController < Devise::InvitationsController message = params[:user].delete(:invite_messages) emails = params[:user][:email].to_s.gsub(/\s/, '').split(/, */) #NOTE should we try and find users by email here? probs - aspect = Aspect.find(aspect_id) + aspect = current_user.aspects.find(aspect_id) invites = Invitation.batch_build(:sender => current_user, :aspect => aspect, :emails => emails, :service => 'email') flash[:notice] = extract_messages(invites) @@ -30,29 +30,22 @@ class InvitationsController < Devise::InvitationsController end def update - begin invitation_token = params[:user][:invitation_token] + if invitation_token.nil? || invitation_token.blank? raise I18n.t('invitations.check_token.not_found') end - user = User.find_by_invitation_token(params[:user][:invitation_token]) + + user = User.find_by_invitation_token!(invitation_token) + user.accept_invitation!(params[:user]) - user.seed_aspects - rescue Exception => e #What exception is this trying to rescue? If it is ActiveRecord::NotFound, we should say so. - raise e - user = nil - record = e.record - record.errors.delete(:person) - flash[:error] = record.errors.full_messages.join(", ") - end - - if user - flash[:notice] = I18n.t 'registrations.create.success' - sign_in_and_redirect(:user, user) + if user.persisted? && user.person && user.person.persisted? + user.seed_aspects + flash[:notice] = I18n.t 'registrations.create.success' + sign_in_and_redirect(:user, user) else - redirect_to accept_user_invitation_path( - :invitation_token => params[:user][:invitation_token]) + redirect_to accept_user_invitation_path(:invitation_token => params[:user][:invitation_token]), :error => user.errors.full_messages.join(", ") end end diff --git a/app/models/invitation.rb b/app/models/invitation.rb index a60e3c0fe..992e3f6be 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -1,4 +1,4 @@ -# Copyright (c) 2010, Diaspora Inc. This file is +# Copyright (c) 2011, Diaspora Inc. This file is # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. @@ -14,10 +14,10 @@ class Invitation < ActiveRecord::Base attr_accessible :sender, :recipient, :aspect, :service, :identifier, :admin before_validation :set_email_as_default_service - validate :ensure_not_inviting_self, :on => :create + validate :ensure_not_inviting_self, :on => :create, :unless => :admin? validate :valid_identifier? - validate :sender_owns_aspect? + validate :sender_owns_aspect?, :unless => :admin? validates_uniqueness_of :sender_id, :scope => [:identifier, :service], :unless => :admin? after_create :queue_send! #TODO make this after_commit :queue_saved!, :on => :create @@ -117,15 +117,15 @@ class Invitation < ActiveRecord::Base # @note Validation def ensure_not_inviting_self - if !self.admin? && self.identifier == self.sender.email - errors[:base] << 'You can not invite yourself' + if self.identifier == self.sender.email + errors[:base] << 'You can not invite yourself.' end end # @note Validation def sender_owns_aspect? - unless(self.sender && (self.sender_id == self.aspect.user_id)) - errors[:base] << 'You do not own that aspect' + if self.sender_id != self.aspect.user_id + errors[:base] << 'You do not own that aspect.' end end diff --git a/app/models/person.rb b/app/models/person.rb index dbd17c6e1..cbae71017 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -19,6 +19,7 @@ class Person < ActiveRecord::Base has_one :profile, :dependent => :destroy delegate :last_name, :to => :profile + accepts_nested_attributes_for :profile before_validation :downcase_diaspora_handle def downcase_diaspora_handle @@ -51,7 +52,21 @@ class Person < ActiveRecord::Base AppConfig[:featured_users].present? ? Person.where(:diaspora_handle => AppConfig[:featured_users]) : [] end - + # Set a default of an empty profile when a new Person record is instantiated. + # Passing :profile => nil to Person.new will instantiate a person with no profile. + # Calling Person.new with a block: + # Person.new do |p| + # p.profile = nil + # end + # will not work! The nil profile will be overriden with an empty one. + def initialize(params={}) + profile_set = params.has_key?(:profile) || params.has_key?("profile") + params[:profile_attributes] = params.delete(:profile) if params.has_key?(:profile) && params[:profile].is_a?(Hash) + super + self.profile ||= Profile.new unless profile_set + end + + def self.find_from_id_or_username(params) p = if params[:id].present? Person.where(:id => params[:id]).first diff --git a/app/models/user.rb b/app/models/user.rb index b8e8ed6d7..c595ec726 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -328,7 +328,9 @@ class User < ActiveRecord::Base self.invitation_token = nil self.password = opts[:password] self.password_confirmation = opts[:password_confirmation] - self.save! + + self.save + return unless self.errors.empty? # moved old Invitation#share_with! logic into here, # but i don't think we want to destroy the invitation @@ -341,8 +343,6 @@ class User < ActiveRecord::Base log_hash[:status] = "success" Rails.logger.info(log_hash) - - self.reload # Because to_request adds a request and saves elsewhere self end end @@ -362,23 +362,17 @@ class User < ActiveRecord::Base errors = self.errors errors.delete :person return if errors.size > 0 - - opts[:person] ||= {} - unless opts[:person][:profile].is_a?(Profile) - opts[:person][:profile] ||= Profile.new - opts[:person][:profile] = Profile.new(opts[:person][:profile]) - end - - #TODO make this User#person= - self.person = Person.new(opts[:person]) - self.person.diaspora_handle = "#{opts[:username]}@#{AppConfig[:pod_uri].authority}" - self.person.url = AppConfig[:pod_url] - + self.set_person(Person.new(opts[:person] || {} )) self.generate_keys - self end + def set_person(person) + person.url = AppConfig[:pod_url] + person.diaspora_handle = "#{self.username}@#{AppConfig[:pod_uri].authority}" + self.person = person + end + def seed_aspects self.aspects.create(:name => I18n.t('aspects.seed.family')) self.aspects.create(:name => I18n.t('aspects.seed.friends')) diff --git a/spec/factories.rb b/spec/factories.rb index e90ab36d3..d6edc0355 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -21,7 +21,7 @@ Factory.define :person do |p| p.sequence(:url) { |n| AppConfig[:pod_url] } p.serialized_public_key OpenSSL::PKey::RSA.generate(1024).public_key.export p.after_build do |person| - person.profile ||= Factory.build(:profile, :person => person) + person.profile = Factory.build(:profile, :person => person) unless person.profile.first_name.present? end p.after_create do |person| person.profile.save diff --git a/spec/models/invitation_spec.rb b/spec/models/invitation_spec.rb index 54f1800db..a4e76e2e3 100644 --- a/spec/models/invitation_spec.rb +++ b/spec/models/invitation_spec.rb @@ -1,4 +1,4 @@ -# Copyright (c) 2010, Diaspora Inc. This file is +# Copyright (c) 2011, Diaspora Inc. This file is # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 63a8861b3..9706335c9 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -11,6 +11,15 @@ describe Person do @person = Factory.create(:person) end + it 'always has a profile' do + Person.new.profile.should_not be_nil + end + + it 'does not save automatically' do + Person.new.persisted?.should be_false + Person.new.profile.persisted?.should be_false + end + context 'scopes' do describe '.for_json' do it 'does not select public keys' do @@ -144,7 +153,7 @@ describe Person do end end - describe 'xml' do + describe 'XML' do before do @xml = @person.to_xml.to_s end From 4ed684491d8a8f22bd318c6acea8140d2982d8c2 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Wed, 17 Aug 2011 14:19:20 -0700 Subject: [PATCH 089/133] MS RS fix view params from invitations#new --- app/controllers/invitations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 1e7463afd..bd1b03da9 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -17,7 +17,7 @@ class InvitationsController < Devise::InvitationsController end def create - aspect_id = params[:user].delete(:aspect_id) + aspect_id = params[:user].delete(:aspects) message = params[:user].delete(:invite_messages) emails = params[:user][:email].to_s.gsub(/\s/, '').split(/, */) #NOTE should we try and find users by email here? probs From e0fb8a08cba45b4042e5a0a7d19145112ec4aa08 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Wed, 17 Aug 2011 14:56:31 -0700 Subject: [PATCH 090/133] set the user email if inviting by email --- app/models/invitation.rb | 3 ++- app/models/user.rb | 2 +- spec/models/user_spec.rb | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 992e3f6be..4ccbc3322 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -71,7 +71,8 @@ class Invitation < ActiveRecord::Base # @return [Invitation] self def send! self.attach_recipient! - + puts self.recipient.inspect + # Sets an instance variable in User (set by devise invitable) # This determines whether an email should be sent to the recipient. recipient.skip_invitation = self.skip_email? diff --git a/app/models/user.rb b/app/models/user.rb index c595ec726..733de5159 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -92,7 +92,7 @@ class User < ActiveRecord::Base user = User.new user.generate_keys user.send(:generate_invitation_token) - #user.invitations_to_me << invitation + 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 diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 7c472fd6c..283470736 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -367,6 +367,27 @@ describe User do end end + describe '.find_or_create_by_invitation' do + + end + + describe '.create_from_invitation!' do + before do + @identifier = 'max@foobar.com' + @inv = Factory.build(:invitation, :admin => true, :service => 'email', :identifier => @identifier) + @user = User.create_from_invitation!(@inv) + end + + it 'creates a persisted user' do + @user.should be_persisted + end + + it 'sets the email if the service is email' do + @user.email.should == @inv.identifier + end + + end + describe 'update_user_preferences' do before do @pref_count = UserPreference::VALID_EMAIL_TYPES.count From ad1b122e20f2fea7116617dcc38d0794a8df9076 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Wed, 17 Aug 2011 16:27:36 -0700 Subject: [PATCH 091/133] test batch_invite --- app/controllers/invitations_controller.rb | 3 +- app/models/invitation.rb | 31 ++++++++++++------- .../invitations_controller_spec.rb | 2 +- spec/models/invitation_spec.rb | 25 ++++++++++++++- 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index bd1b03da9..e29490341 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -22,7 +22,8 @@ class InvitationsController < Devise::InvitationsController emails = params[:user][:email].to_s.gsub(/\s/, '').split(/, */) #NOTE should we try and find users by email here? probs aspect = current_user.aspects.find(aspect_id) - invites = Invitation.batch_build(:sender => current_user, :aspect => aspect, :emails => emails, :service => 'email') + + invites = Invitation.batch_invite(emails, :sender => current_user, :aspect => aspect, :service => 'email') flash[:notice] = extract_messages(invites) diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 4ccbc3322..344bc7d04 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -8,15 +8,14 @@ class Invitation < ActiveRecord::Base belongs_to :recipient, :class_name => 'User' belongs_to :aspect - validates_presence_of :identifier, :service - - validates_presence_of :sender, :aspect, :unless => :admin? attr_accessible :sender, :recipient, :aspect, :service, :identifier, :admin before_validation :set_email_as_default_service - validate :ensure_not_inviting_self, :on => :create, :unless => :admin? + validates_presence_of :identifier, :service validate :valid_identifier? + validates_presence_of :sender, :aspect, :unless => :admin? + validate :ensure_not_inviting_self, :on => :create, :unless => :admin? validate :sender_owns_aspect?, :unless => :admin? validates_uniqueness_of :sender_id, :scope => [:identifier, :service], :unless => :admin? @@ -26,10 +25,20 @@ class Invitation < ActiveRecord::Base # @note options hash is passed through to [Invitation.new] # @see [Invitation.new] # - # @option opts [Array] :emails - # @return [Array] An array of initialized [Invitation] models. - def self.batch_build(opts) - emails = opts.delete(:emails) + # @param [Array] emails + # @option opts [User] :sender + # @option opts [Aspect] :aspect + # @option opts [String] :service + # @return [Array] An array of [Invitation] models + # the valid ones are saved, and the invalid ones are not. + def self.batch_invite(emails, opts) + + users_on_pod = User.where(:email => emails, :invitation_token => nil) + + #share with anyone whose email you entered who is on the pod + emails = emails - users_on_pod.map{|u| u.email} + users_on_pod.each{|u| opts[:sender].share_with(u.person, opts[:aspect])} + emails.map! do |e| Invitation.create(opts.merge(:identifier => e)) end @@ -71,7 +80,6 @@ class Invitation < ActiveRecord::Base # @return [Invitation] self def send! self.attach_recipient! - puts self.recipient.inspect # Sets an instance variable in User (set by devise invitable) # This determines whether an email should be sent to the recipient. @@ -94,9 +102,10 @@ class Invitation < ActiveRecord::Base # @return [String] def recipient_identifier - if self.service == 'email' + case self.service + when 'email' self.identifier - elsif self.service == 'facebook' + when'facebook' if su = ServiceUser.where(:uid => self.identifier).first su.name else diff --git a/spec/controllers/invitations_controller_spec.rb b/spec/controllers/invitations_controller_spec.rb index a2256366e..dc1b3fdad 100644 --- a/spec/controllers/invitations_controller_spec.rb +++ b/spec/controllers/invitations_controller_spec.rb @@ -11,7 +11,7 @@ describe InvitationsController do AppConfig[:open_invitations] = true @user = alice @aspect = @user.aspects.first - @invite = {:invite_message=>"test", :aspect_id=> @aspect.id.to_s, :email=>"abc@example.com"} + @invite = {:invite_message=>"test", :aspects=> @aspect.id.to_s, :email=>"abc@example.com"} request.env["devise.mapping"] = Devise.mappings[:user] Webfinger.stub_chain(:new, :fetch).and_return(Factory(:person)) diff --git a/spec/models/invitation_spec.rb b/spec/models/invitation_spec.rb index a4e76e2e3..329df2971 100644 --- a/spec/models/invitation_spec.rb +++ b/spec/models/invitation_spec.rb @@ -77,7 +77,30 @@ describe Invitation do end end - describe '.resend' do + describe '.batch_invite' do + before do + @emails = ['max@foo.com', 'bob@mom.com'] + @opts = {:aspect => eve.aspects.first, :sender => eve, :service => 'email'} + end + + it 'returns an array of invites based on the emails passed in' do + invites = Invitation.batch_invite(@emails, @opts) + invites.count.should be 2 + invites.all?{|x| x.persisted?}.should be_true + end + + it 'shares with people who are already on the pod and does not create an invite for them' do + Factory(:user, :email => @emails.first) + invites = nil + expect{ + invites = Invitation.batch_invite(@emails, @opts) + }.to change(eve.contacts, :count).by(1) + invites.count.should be 1 + + end + end + + describe '#resend' do before do @invitation = Factory(:invitation, :sender => alice, :aspect => alice.aspects.first, :service => 'email', :identifier => 'a@a.com') end From a99e69edd64218431296f448505ec69d9cb90235 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 17 Aug 2011 16:51:34 -0700 Subject: [PATCH 092/133] down to 2 failures in postgres --- app/models/services/facebook.rb | 15 +++++++++++++-- spec/controllers/contacts_controller_spec.rb | 4 ++-- spec/integration/receiving_spec.rb | 1 + spec/models/services/facebook_spec.rb | 4 ++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/models/services/facebook.rb b/app/models/services/facebook.rb index 2252dd01f..8cac6b75f 100644 --- a/app/models/services/facebook.rb +++ b/app/models/services/facebook.rb @@ -47,15 +47,26 @@ class Services::Facebook < Service if postgres? # Take the naive approach to inserting our new visibilities for now. data.each do |su| - su.save + if existing = ServiceUser.find_by_uid(su.uid) + update_hash = OVERRIDE_FIELDS_ON_FB_UPDATE.inject({}) do |acc, element| + acc[element] = su.send(element) + acc + end + + existing.update_attributes(update_hash) + else + su.save + end end else - ServiceUser.import(data, :on_duplicate_key_update => [:updated_at, :contact_id, :person_id, :request_id, :invitation_id, :photo_url, :name, :username]) + ServiceUser.import(data, :on_duplicate_key_update => OVERRIDE_FIELDS_ON_FB_UPDATE + [:updated_at]) end end private + OVERRIDE_FIELDS_ON_FB_UPDATE = [:contact_id, :person_id, :request_id, :invitation_id, :photo_url, :name, :username] + def prevent_service_users_from_being_empty if self.service_users.blank? self.save_friends diff --git a/spec/controllers/contacts_controller_spec.rb b/spec/controllers/contacts_controller_spec.rb index a0b00d5ca..92374536a 100644 --- a/spec/controllers/contacts_controller_spec.rb +++ b/spec/controllers/contacts_controller_spec.rb @@ -59,7 +59,7 @@ describe ContactsController do it 'will return the contacts for multiple aspects' do get :index, :aspect_ids => bob.aspect_ids, :format => 'json' - assigns[:people].should == bob.contacts.map(&:person) + assigns[:people].map(&:id).should =~ bob.contacts.map{|c| c.person.id} response.should be_success end @@ -73,7 +73,7 @@ describe ContactsController do aspect.contacts << bob.contact_for(eve.person) get :index, :format => 'json', :aspect_ids => bob.aspect_ids assigns[:people].map{|p| p.id}.uniq.should == assigns[:people].map{|p| p.id} - assigns[:people].should == bob.contacts.map(&:person) + assigns[:people].map(&:id).should =~ bob.contacts.map{|c| c.person.id} end end diff --git a/spec/integration/receiving_spec.rb b/spec/integration/receiving_spec.rb index a4ea66f3e..4e6d9315d 100644 --- a/spec/integration/receiving_spec.rb +++ b/spec/integration/receiving_spec.rb @@ -272,6 +272,7 @@ describe 'a user receives a post' do post_in_db.comments.should == [] receive_with_zord(bob, alice.person, @xml) + post_in_db.comments(true).first.author.should == remote_person end end diff --git a/spec/models/services/facebook_spec.rb b/spec/models/services/facebook_spec.rb index fcb1be916..fc6d59e73 100644 --- a/spec/models/services/facebook_spec.rb +++ b/spec/models/services/facebook_spec.rb @@ -69,12 +69,12 @@ JSON it 'attaches local models' do @service.save_friends - @service.service_users.first.person.should == @user2.person + @service.service_users.where(:uid => @user2_fb_id).first.person.should == @user2.person end it 'overwrites local model information' do @service.save_friends - su = @service.service_users.first + su = @service.service_users.where(:uid => @user2_fb_id).first su.person.should == @user2.person su.contact.should == nil From 8231ce22395245f5e271ed834d32dbf5efcc9ce1 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Wed, 17 Aug 2011 18:59:06 -0700 Subject: [PATCH 093/133] Don't log big xml things --- app/models/job/http_multi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/job/http_multi.rb b/app/models/job/http_multi.rb index 1972eb8b1..5bdeac98a 100644 --- a/app/models/job/http_multi.rb +++ b/app/models/job/http_multi.rb @@ -49,7 +49,7 @@ module Job end unless response.success? pod = Pod.find_or_create_by_url(response.effective_url) - log_line = "event=http_multi_fail sender_id=#{user_id} recipient_id=#{person.id} url=#{response.effective_url} response_code='#{response.code}' xml='#{Base64.decode64(enc_object_xml)}'" + log_line = "event=http_multi_fail sender_id=#{user_id} recipient_id=#{person.id} url=#{response.effective_url} response_code='#{response.code}'" Rails.logger.info(log_line) pod.pod_stats.create(:error_message => log_line, :person_id => person.id, :error_code => response.code.to_i) failed_request_people << person.id From 2d54d9a97e408de3f64be8e180e396dc1a4973a2 Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Wed, 17 Aug 2011 23:52:31 -0300 Subject: [PATCH 094/133] Validate presence of message text on conversations. Closes #1329. --- app/controllers/conversations_controller.rb | 16 +-- app/controllers/messages_controller.rb | 5 +- app/models/message.rb | 2 + config/locales/diaspora/en.yml | 3 + features/conversations.feature | 4 + .../conversations_controller_spec.rb | 108 +++++++++++------- spec/controllers/messages_controller_spec.rb | 33 ++++-- 7 files changed, 114 insertions(+), 57 deletions(-) diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb index 80d963caa..93342958f 100644 --- a/app/controllers/conversations_controller.rb +++ b/app/controllers/conversations_controller.rb @@ -31,15 +31,17 @@ class ConversationsController < ApplicationController message_text = params[:conversation].delete(:text) params[:conversation][:messages_attributes] = [ {:author => current_user.person, :text => message_text }] - if @conversation = Conversation.create(params[:conversation]) + @conversation = Conversation.new(params[:conversation]) + if @conversation.save Postzord::Dispatch.new(current_user, @conversation).post - flash[:notice] = I18n.t('conversations.create.sent') - if params[:profile] - redirect_to person_path(params[:profile]) - else - redirect_to conversations_path(:conversation_id => @conversation.id) - end + else + flash[:error] = I18n.t('conversations.create.fail') + end + if params[:profile] + redirect_to person_path(params[:profile]) + else + redirect_to conversations_path(:conversation_id => @conversation.id) end end diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 97f21556c..c6f656166 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -19,11 +19,10 @@ class MessagesController < ApplicationController if message.save Rails.logger.info("event=create type=comment user=#{current_user.diaspora_handle} status=success message=#{message.id} chars=#{params[:message][:text].length}") Postzord::Dispatch.new(current_user, message).post - - redirect_to conversations_path(:conversation_id => cnv.id) else - render :nothing => true, :status => 422 + flash[:error] = I18n.t('conversations.new_message.fail') end + redirect_to conversations_path(:conversation_id => cnv.id) else render :nothing => true, :status => 422 end diff --git a/app/models/message.rb b/app/models/message.rb index fb46d91e4..4d13d7807 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -14,6 +14,8 @@ class Message < ActiveRecord::Base belongs_to :author, :class_name => 'Person' belongs_to :conversation, :touch => true + validates_presence_of :text + after_create do #sign comment as commenter self.author_signature = self.sign_with_key(self.author.owner.encryption_key) if self.author.owner diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 43eceebb2..93efc0d8b 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -257,6 +257,9 @@ en: other: "%{count} new messages" create: sent: "Message sent" + fail: "Invalid message" + new_message: + fail: "Invalid message" destroy: success: "Conversation successfully removed" diff --git a/features/conversations.feature b/features/conversations.feature index 55626aa03..9bf3b6566 100644 --- a/features/conversations.feature +++ b/features/conversations.feature @@ -16,3 +16,7 @@ Feature: private messages And I should see "Greetings" within "#conversation_show" And "Alice Awesome" should be part of active conversation And I should see "hello, alice!" within ".stream" + + Scenario: send an empty message + Given I send a message with subject "Greetings" and text " " to "Alice Awesome" + Then I should not see "Greetings" within "#conversation_inbox" diff --git a/spec/controllers/conversations_controller_spec.rb b/spec/controllers/conversations_controller_spec.rb index 6ee8b1d59..09c93b403 100644 --- a/spec/controllers/conversations_controller_spec.rb +++ b/spec/controllers/conversations_controller_spec.rb @@ -54,47 +54,75 @@ describe ConversationsController do end describe '#create' do - before do - @hash = { - :conversation => { - :subject => "secret stuff", - :text => 'text'}, - :contact_ids => [alice.contacts.first.id] - } - end - - it 'creates a conversation' do - lambda { - post :create, @hash - }.should change(Conversation, :count).by(1) - end - - it 'creates a message' do - lambda { - post :create, @hash - }.should change(Message, :count).by(1) - end - - it 'sets the author to the current_user' do - @hash[:author] = Factory.create(:user) - post :create, @hash - Message.first.author.should == alice.person - Conversation.first.author.should == alice.person - end - - it 'dispatches the conversation' do - cnv = Conversation.create( - { - :author => alice.person, - :participant_ids => [alice.contacts.first.person.id, alice.person.id], - :subject => 'not spam', - :messages_attributes => [ {:author => alice.person, :text => 'cool stuff'} ] + context 'with a valid conversation' do + before do + @hash = { + :conversation => { + :subject => "secret stuff", + :text => 'text debug' + }, + :contact_ids => [alice.contacts.first.id] } - ) - p = Postzord::Dispatch.new(alice, cnv) - Postzord::Dispatch.stub!(:new).and_return(p) - p.should_receive(:post) - post :create, @hash + end + + it 'creates a conversation' do + lambda { + post :create, @hash + }.should change(Conversation, :count).by(1) + end + + it 'creates a message' do + lambda { + post :create, @hash + }.should change(Message, :count).by(1) + end + + it 'sets the author to the current_user' do + @hash[:author] = Factory.create(:user) + post :create, @hash + Message.first.author.should == alice.person + Conversation.first.author.should == alice.person + end + + it 'dispatches the conversation' do + cnv = Conversation.create( + { + :author => alice.person, + :participant_ids => [alice.contacts.first.person.id, alice.person.id], + :subject => 'not spam', + :messages_attributes => [ {:author => alice.person, :text => 'cool stuff'} ] + } + ) + + p = Postzord::Dispatch.new(alice, cnv) + Postzord::Dispatch.stub!(:new).and_return(p) + p.should_receive(:post) + post :create, @hash + end + end + + context 'with empty text' do + before do + @hash = { + :conversation => { + :subject => 'secret stuff', + :text => ' ' + }, + :contact_ids => [alice.contacts.first.id] + } + end + + it 'does not create a conversation' do + lambda { + post :create, @hash + }.should_not change(Conversation, :count).by(1) + end + + it 'does not create a message' do + lambda { + post :create, @hash + }.should_not change(Message, :count).by(1) + end end end diff --git a/spec/controllers/messages_controller_spec.rb b/spec/controllers/messages_controller_spec.rb index 6a120effd..36a899b99 100644 --- a/spec/controllers/messages_controller_spec.rb +++ b/spec/controllers/messages_controller_spec.rb @@ -28,15 +28,34 @@ describe MessagesController do context "on my own post" do before do @cnv = Conversation.create(@create_hash) - @message_hash = {:conversation_id => @cnv.id, :message => {:text => "here is something else"}} end - it 'redirects to conversation' do - lambda{ - post :create, @message_hash - }.should change(Message, :count).by(1) - response.code.should == '302' - response.should redirect_to(conversations_path(:conversation_id => @cnv)) + context "with a valid message" do + before do + @message_hash = {:conversation_id => @cnv.id, :message => {:text => "here is something else"}} + end + + it 'redirects to conversation' do + lambda{ + post :create, @message_hash + }.should change(Message, :count).by(1) + response.code.should == '302' + response.should redirect_to(conversations_path(:conversation_id => @cnv)) + end + end + + context "with an empty message" do + before do + @message_hash = {:conversation_id => @cnv.id, :message => {:text => " "}} + end + + it 'redirects to conversation' do + lambda{ + post :create, @message_hash + }.should_not change(Message, :count).by(1) + response.code.should == '302' + response.should redirect_to(conversations_path(:conversation_id => @cnv)) + end end end From 419707412adde75e634ef0e18c58d2867221607a Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Wed, 17 Aug 2011 20:57:11 -0700 Subject: [PATCH 095/133] update jasmine to destroy deprication warnings in the tests --- Gemfile | 2 +- Gemfile.lock | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 91c15f150..baed1cd43 100644 --- a/Gemfile +++ b/Gemfile @@ -97,7 +97,7 @@ group :test, :development do gem 'linecache', '0.43', :platforms => :mri_18 end gem 'launchy' - gem 'jasmine', '1.0.2.1' + gem 'jasmine', '1.1.0.rc3' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 0aa586894..1e8a31b37 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -225,11 +225,12 @@ GEM jammit (0.5.4) closure-compiler (>= 0.1.0) yui-compressor (>= 0.9.1) - jasmine (1.0.2.1) - json_pure (>= 1.4.3) + jasmine (1.1.0.rc3) + jasmine-core (>= 1.1.0.rc2) rack (>= 1.1) rspec (>= 1.3.1) selenium-webdriver (>= 0.1.3) + jasmine-core (1.1.0.rc3) json (1.4.6) json_pure (1.5.3) launchy (2.0.3) @@ -484,7 +485,7 @@ DEPENDENCIES http_accept_language! i18n-inflector-rails (~> 1.0) jammit (= 0.5.4) - jasmine (= 1.0.2.1) + jasmine (= 1.1.0.rc3) json (= 1.4.6) jwt! launchy From fca2be5c5d1cac4cfc5ba2c27d357e1a33074736 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 17 Aug 2011 22:43:40 -0700 Subject: [PATCH 096/133] facebox overlay dark again, with a faint spotlight --- public/stylesheets/vendor/facebox.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/stylesheets/vendor/facebox.css b/public/stylesheets/vendor/facebox.css index 285633cd5..bfa2ed16e 100755 --- a/public/stylesheets/vendor/facebox.css +++ b/public/stylesheets/vendor/facebox.css @@ -12,9 +12,9 @@ -webkit-border-radius:2px; -moz-border-radius:2px; border-radius:2px; - -webkit-box-shadow:0 0 12px rgba(0,0,0,0.8); - -moz-box-shadow:0 0 12px rgba(0,0,0,0.8); - box-shadow:0 0 12px rgba(0,0,0,0.8); + -webkit-box-shadow:0 0 10px rgba(0,0,0,0.8), 0 2px 200px rgba(255,255,255,0.2); + -moz-box-shadow:0 0 10px rgba(0,0,0,0.8), 0 2px 200px rgba(255,255,255,0.2);; + box-shadow:0 0 10px rgba(0,0,0,0.8), 0 2px 200px rgba(255,255,255,0.2);; } #facebox .content { @@ -73,6 +73,6 @@ } .facebox_overlayBG { - background-color: #fff; + background-color: #000; z-index: 99; } From f3932132d33109608ee851b66d4f1e953e53e3ae Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 18 Aug 2011 08:34:05 -0700 Subject: [PATCH 097/133] Let the next backup job overwrite the sqldump --- lib/tasks/backup.rake | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake index 4f8a3ce4a..582bc9905 100644 --- a/lib/tasks/backup.rake +++ b/lib/tasks/backup.rake @@ -36,7 +36,6 @@ namespace :backup do if file.write File.open("/tmp/backup/" + tar_name) puts("event=backup status=success type=mysql") `rm /tmp/backup/#{tar_name}` - `rm -rf /tmp/backup/mysql/` files = mysql_container.objects files.sort!.pop(NUMBER_OF_DAYS * 24) From 2c6559357904dbcb2646e8598f55a01e6047f41d Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 18 Aug 2011 10:33:27 -0700 Subject: [PATCH 098/133] Add quick option to mysqldump --- lib/tasks/backup.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/backup.rake b/lib/tasks/backup.rake index 582bc9905..785b625ac 100644 --- a/lib/tasks/backup.rake +++ b/lib/tasks/backup.rake @@ -24,7 +24,7 @@ namespace :backup do puts "Dumping Mysql at #{Time.now.to_s}" `mkdir -p /tmp/backup/mysql` - `nice mysqldump --single-transaction --user=#{user} --password=#{password} #{database} > /tmp/backup/mysql/backup.txt ` + `nice mysqldump --single-transaction --quick --user=#{user} --password=#{password} #{database} > /tmp/backup/mysql/backup.txt ` puts "Gzipping dump at #{Time.now.to_s}" tar_name = "mysql_#{Time.now.to_i}.tar" From a6eb275c7acc93cc42bc1a4e365d111ab516ff83 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 18 Aug 2011 11:03:59 -0700 Subject: [PATCH 099/133] remove uploaded test images after running the specs/cucumber --- app/uploaders/processed_image.rb | 5 ++++- app/uploaders/unprocessed_image.rb | 5 ++++- features/support/env.rb | 7 +++++++ spec/spec_helper.rb | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/uploaders/processed_image.rb b/app/uploaders/processed_image.rb index 226fe0df4..1d79e07ba 100644 --- a/app/uploaders/processed_image.rb +++ b/app/uploaders/processed_image.rb @@ -14,7 +14,10 @@ class ProcessedImage < CarrierWave::Uploader::Base end def filename - model.random_string + File.extname(@filename) if @filename + fn = model.random_string + fn += "-test" if Rails.env = 'test' + fn += File.extname(@filename) if @filename + fn end version :thumb_small do diff --git a/app/uploaders/unprocessed_image.rb b/app/uploaders/unprocessed_image.rb index 579241253..d6a4cb319 100644 --- a/app/uploaders/unprocessed_image.rb +++ b/app/uploaders/unprocessed_image.rb @@ -14,7 +14,10 @@ class UnprocessedImage < CarrierWave::Uploader::Base end def filename - model.random_string + File.extname(@filename) if @filename + fn = model.random_string + fn += "-test" if Rails.env = 'test' + fn += File.extname(@filename) if @filename + fn end version :thumb_small diff --git a/features/support/env.rb b/features/support/env.rb index a00b28268..a304a6cb2 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -52,6 +52,13 @@ Before do Devise.mailer.deliveries = [] end +After do + # Rollback any images created during the features. + `rm -rf #{Rails.root}/tmp/uploads/*` + `rm -rf #{Rails.root}/public/uploads/images/*-test.png` + `rm -rf #{Rails.root}/public/uploads/tmp/` +end + silence_warnings do SERVICES['facebook'] = {'app_id' => :fake, 'app_secret' => 'sdoigjosdfijg'} AppConfig[:configured_services] << 'facebook' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c232f4e47..ef4eef7cb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,7 +41,10 @@ RSpec.configure do |config| end config.after(:all) do + # Rollback any images created during the specs `rm -rf #{Rails.root}/tmp/uploads/*` + `rm -rf #{Rails.root}/public/uploads/images/*-test.png` + `rm -rf #{Rails.root}/public/uploads/tmp/` end end From 7969b52035fd709c6b14d87a9f658b5d940b1206 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 18 Aug 2011 11:11:08 -0700 Subject: [PATCH 100/133] Revert "remove uploaded test images after running the specs/cucumber" This reverts commit a6eb275c7acc93cc42bc1a4e365d111ab516ff83. --- app/uploaders/processed_image.rb | 5 +---- app/uploaders/unprocessed_image.rb | 5 +---- features/support/env.rb | 7 ------- spec/spec_helper.rb | 3 --- 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/app/uploaders/processed_image.rb b/app/uploaders/processed_image.rb index 1d79e07ba..226fe0df4 100644 --- a/app/uploaders/processed_image.rb +++ b/app/uploaders/processed_image.rb @@ -14,10 +14,7 @@ class ProcessedImage < CarrierWave::Uploader::Base end def filename - fn = model.random_string - fn += "-test" if Rails.env = 'test' - fn += File.extname(@filename) if @filename - fn + model.random_string + File.extname(@filename) if @filename end version :thumb_small do diff --git a/app/uploaders/unprocessed_image.rb b/app/uploaders/unprocessed_image.rb index d6a4cb319..579241253 100644 --- a/app/uploaders/unprocessed_image.rb +++ b/app/uploaders/unprocessed_image.rb @@ -14,10 +14,7 @@ class UnprocessedImage < CarrierWave::Uploader::Base end def filename - fn = model.random_string - fn += "-test" if Rails.env = 'test' - fn += File.extname(@filename) if @filename - fn + model.random_string + File.extname(@filename) if @filename end version :thumb_small diff --git a/features/support/env.rb b/features/support/env.rb index a304a6cb2..a00b28268 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -52,13 +52,6 @@ Before do Devise.mailer.deliveries = [] end -After do - # Rollback any images created during the features. - `rm -rf #{Rails.root}/tmp/uploads/*` - `rm -rf #{Rails.root}/public/uploads/images/*-test.png` - `rm -rf #{Rails.root}/public/uploads/tmp/` -end - silence_warnings do SERVICES['facebook'] = {'app_id' => :fake, 'app_secret' => 'sdoigjosdfijg'} AppConfig[:configured_services] << 'facebook' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ef4eef7cb..c232f4e47 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,10 +41,7 @@ RSpec.configure do |config| end config.after(:all) do - # Rollback any images created during the specs `rm -rf #{Rails.root}/tmp/uploads/*` - `rm -rf #{Rails.root}/public/uploads/images/*-test.png` - `rm -rf #{Rails.root}/public/uploads/tmp/` end end From 0473037d1ba8ba8d257121316dfb5fad9c89f7f0 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 18 Aug 2011 11:12:42 -0700 Subject: [PATCH 101/133] fix notification links --- app/controllers/notifications_controller.rb | 2 +- app/helpers/notifications_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 62d2c4d67..b665a6c37 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -33,7 +33,7 @@ class NotificationsController < VannaController end notifications.each do |n| n[:actors] = n.actors - n[:translation] = object_link(n, n.actors.map { |a| person_link(a) }) + n[:translation] = notification_message_for(n) n[:translation_key] = n.popup_translation_key n[:target] = n.translation_key == "notifications.mentioned" ? n.target.post : n.target end diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index bd288fee8..3f69849e2 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -60,7 +60,7 @@ module NotificationsHelper number_of_actors = actors.count sentence_translations = {:two_words_connector => " #{t('notifications.index.and')} ", :last_word_connector => ", #{t('notifications.index.and')} " } actor_links = actors.collect{ |person| - person_link(person, :class => 'hovercardable', :what => 'thefuck' ) + person_link(person, :class => 'hovercardable') } if number_of_actors < 4 From b11bd23da24544193bbb24ded5f03a8c9b4e00c2 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 18 Aug 2011 11:13:00 -0700 Subject: [PATCH 102/133] Revert "Revert "remove uploaded test images after running the specs/cucumber"" -- using == now instead of = This reverts commit 7969b52035fd709c6b14d87a9f658b5d940b1206. --- app/uploaders/processed_image.rb | 5 ++++- app/uploaders/unprocessed_image.rb | 5 ++++- features/support/env.rb | 7 +++++++ spec/spec_helper.rb | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/uploaders/processed_image.rb b/app/uploaders/processed_image.rb index 226fe0df4..5992fa2ee 100644 --- a/app/uploaders/processed_image.rb +++ b/app/uploaders/processed_image.rb @@ -14,7 +14,10 @@ class ProcessedImage < CarrierWave::Uploader::Base end def filename - model.random_string + File.extname(@filename) if @filename + fn = model.random_string + fn += "-test" if Rails.env == 'test' + fn += File.extname(@filename) if @filename + fn end version :thumb_small do diff --git a/app/uploaders/unprocessed_image.rb b/app/uploaders/unprocessed_image.rb index 579241253..c21ca2091 100644 --- a/app/uploaders/unprocessed_image.rb +++ b/app/uploaders/unprocessed_image.rb @@ -14,7 +14,10 @@ class UnprocessedImage < CarrierWave::Uploader::Base end def filename - model.random_string + File.extname(@filename) if @filename + fn = model.random_string + fn += "-test" if Rails.env == 'test' + fn += File.extname(@filename) if @filename + fn end version :thumb_small diff --git a/features/support/env.rb b/features/support/env.rb index a00b28268..a304a6cb2 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -52,6 +52,13 @@ Before do Devise.mailer.deliveries = [] end +After do + # Rollback any images created during the features. + `rm -rf #{Rails.root}/tmp/uploads/*` + `rm -rf #{Rails.root}/public/uploads/images/*-test.png` + `rm -rf #{Rails.root}/public/uploads/tmp/` +end + silence_warnings do SERVICES['facebook'] = {'app_id' => :fake, 'app_secret' => 'sdoigjosdfijg'} AppConfig[:configured_services] << 'facebook' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c232f4e47..ef4eef7cb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,7 +41,10 @@ RSpec.configure do |config| end config.after(:all) do + # Rollback any images created during the specs `rm -rf #{Rails.root}/tmp/uploads/*` + `rm -rf #{Rails.root}/public/uploads/images/*-test.png` + `rm -rf #{Rails.root}/public/uploads/tmp/` end end From c7331230bcff3b0d7cc869ea1618af2ff5e6343d Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 18 Aug 2011 12:06:04 -0700 Subject: [PATCH 103/133] Revert "Revert "Revert "remove uploaded test images after running the specs/cucumber"" -- using == now instead of =" This reverts commit b11bd23da24544193bbb24ded5f03a8c9b4e00c2. --- app/uploaders/processed_image.rb | 5 +---- app/uploaders/unprocessed_image.rb | 5 +---- features/support/env.rb | 7 ------- spec/spec_helper.rb | 3 --- 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/app/uploaders/processed_image.rb b/app/uploaders/processed_image.rb index 5992fa2ee..226fe0df4 100644 --- a/app/uploaders/processed_image.rb +++ b/app/uploaders/processed_image.rb @@ -14,10 +14,7 @@ class ProcessedImage < CarrierWave::Uploader::Base end def filename - fn = model.random_string - fn += "-test" if Rails.env == 'test' - fn += File.extname(@filename) if @filename - fn + model.random_string + File.extname(@filename) if @filename end version :thumb_small do diff --git a/app/uploaders/unprocessed_image.rb b/app/uploaders/unprocessed_image.rb index c21ca2091..579241253 100644 --- a/app/uploaders/unprocessed_image.rb +++ b/app/uploaders/unprocessed_image.rb @@ -14,10 +14,7 @@ class UnprocessedImage < CarrierWave::Uploader::Base end def filename - fn = model.random_string - fn += "-test" if Rails.env == 'test' - fn += File.extname(@filename) if @filename - fn + model.random_string + File.extname(@filename) if @filename end version :thumb_small diff --git a/features/support/env.rb b/features/support/env.rb index a304a6cb2..a00b28268 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -52,13 +52,6 @@ Before do Devise.mailer.deliveries = [] end -After do - # Rollback any images created during the features. - `rm -rf #{Rails.root}/tmp/uploads/*` - `rm -rf #{Rails.root}/public/uploads/images/*-test.png` - `rm -rf #{Rails.root}/public/uploads/tmp/` -end - silence_warnings do SERVICES['facebook'] = {'app_id' => :fake, 'app_secret' => 'sdoigjosdfijg'} AppConfig[:configured_services] << 'facebook' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ef4eef7cb..c232f4e47 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,10 +41,7 @@ RSpec.configure do |config| end config.after(:all) do - # Rollback any images created during the specs `rm -rf #{Rails.root}/tmp/uploads/*` - `rm -rf #{Rails.root}/public/uploads/images/*-test.png` - `rm -rf #{Rails.root}/public/uploads/tmp/` end end From f5e93c3e83cc89fc2a0cae8cd9cbb2453d471a84 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Thu, 18 Aug 2011 22:12:09 +0200 Subject: [PATCH 104/133] Comment delete icon should also have a tipsy tooltip --- public/javascripts/stream.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index f0c810026..8697c08ef 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -10,12 +10,13 @@ var Stream = { Diaspora.widgets.timeago.updateTimeAgo(); Diaspora.widgets.directionDetector.updateBinds(); - $.each([".stream_element_delete", "span.post_scope"], function(idx, el){ + $.each(["a.stream_element_delete", "span.post_scope"], function(idx, el){ $(el).tipsy({ trigger: "hover", gravity: "n" }); }); + //audio links Stream.setUpAudioLinks(); //Stream.setUpImageLinks(); From f59275adb4ebda42131d149049d31fd098b7084c Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Thu, 18 Aug 2011 22:22:47 +0200 Subject: [PATCH 105/133] Actually add the comment delete link to list of tipsified elements --- public/javascripts/stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index 8697c08ef..2b9918ad2 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -10,7 +10,7 @@ var Stream = { Diaspora.widgets.timeago.updateTimeAgo(); Diaspora.widgets.directionDetector.updateBinds(); - $.each(["a.stream_element_delete", "span.post_scope"], function(idx, el){ + $.each(["a.stream_element_delete", "a.comment_delete", "span.post_scope"], function(idx, el){ $(el).tipsy({ trigger: "hover", gravity: "n" From e033eda5d1d176e4c703bbea4dbe3e2e9a4df02d Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Thu, 18 Aug 2011 22:28:36 +0200 Subject: [PATCH 106/133] Use live binding for tipsy tooltips within stream elements, so that elements loaded by the infiniscroll get them too --- public/javascripts/stream.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index 2b9918ad2..7665ffcf8 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -13,7 +13,8 @@ var Stream = { $.each(["a.stream_element_delete", "a.comment_delete", "span.post_scope"], function(idx, el){ $(el).tipsy({ trigger: "hover", - gravity: "n" + gravity: "n", + live: true }); }); From 947dfaacf73e87c007c632df3743aff9b69b7b06 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 18 Aug 2011 14:09:50 -0700 Subject: [PATCH 107/133] make profile photo auto so it does not get smooshed --- public/stylesheets/sass/application.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index f006caffe..9fcb6b13b 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -735,7 +735,7 @@ form.new_comment .profile_photo img - :height 200px + :height auto :width 200px #profile From 7d9b1636c0fb19a5eadb332e1dda65e1ac928ec3 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 18 Aug 2011 14:14:24 -0700 Subject: [PATCH 108/133] dont raise runtime error if invitation token is not found --- app/controllers/invitations_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index e29490341..924254a83 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -34,7 +34,8 @@ class InvitationsController < Devise::InvitationsController invitation_token = params[:user][:invitation_token] if invitation_token.nil? || invitation_token.blank? - raise I18n.t('invitations.check_token.not_found') + redirect_to :back, :error => I18n.t('invitations.check_token.not_found') + return end user = User.find_by_invitation_token!(invitation_token) From 8b278adff657979a1ea6151bb20632b80bc31486 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 18 Aug 2011 14:51:15 -0700 Subject: [PATCH 109/133] migration to fix old invites for resend --- ..._add_identifier_to_existing_invitations.rb | 19 +++++++++++++++++++ db/schema.rb | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20110818212541_add_identifier_to_existing_invitations.rb diff --git a/db/migrate/20110818212541_add_identifier_to_existing_invitations.rb b/db/migrate/20110818212541_add_identifier_to_existing_invitations.rb new file mode 100644 index 000000000..1471552fc --- /dev/null +++ b/db/migrate/20110818212541_add_identifier_to_existing_invitations.rb @@ -0,0 +1,19 @@ +class AddIdentifierToExistingInvitations < ActiveRecord::Migration + def self.up + execute < 20110816061820) do +ActiveRecord::Schema.define(:version => 20110818212541) do create_table "aspect_memberships", :force => true do |t| t.integer "aspect_id", :null => false From 064ae972b30b2ca941ee2b0425461bfd27ff24f7 Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Thu, 18 Aug 2011 15:38:27 -0700 Subject: [PATCH 110/133] the cucumber is now passing & renamed the partial to conform with convention --- app/helpers/aspect_global_helper.rb | 2 +- ...embership_dropdown.haml => _aspect_membership_dropdown.haml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename app/views/people/{aspect_membership_dropdown.haml => _aspect_membership_dropdown.haml} (100%) diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index cf509e6d4..9b38b7a09 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -66,7 +66,7 @@ module AspectGlobalHelper end def aspect_membership_dropdown(contact, person, hang, aspect=nil) - selected_aspects = all_aspects.select{|aspect| contact.in_aspect?(aspect.id) } + selected_aspects = all_aspects.select{|aspect| contact.in_aspect?(aspect) } render "shared/aspect_dropdown", :selected_aspects => selected_aspects, diff --git a/app/views/people/aspect_membership_dropdown.haml b/app/views/people/_aspect_membership_dropdown.haml similarity index 100% rename from app/views/people/aspect_membership_dropdown.haml rename to app/views/people/_aspect_membership_dropdown.haml From 31584eed844d6d2ae77b7e811bd640581e413ad0 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 18 Aug 2011 13:41:27 -0700 Subject: [PATCH 111/133] It turns out find_for_database_authentication calls find_for_authentication, not the other way around. --- spec/models/user_spec.rb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 283470736..a3e898d38 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -39,7 +39,7 @@ describe User do addr = '12345@alice.com' alice.invitation_service = 'email' alice.invitation_identifier = addr - + lambda { alice.infer_email_from_invitation_provider }.should change(alice, :email) @@ -49,7 +49,7 @@ describe User do addr = '1233123' alice.invitation_service = 'facebook' alice.invitation_identifier = addr - + lambda { alice.infer_email_from_invitation_provider }.should_not change(alice, :email) @@ -359,7 +359,7 @@ describe User do context 'not on server (not yet invited)' do it 'returns nil' do @recipient = nil - @identifier = 'foo@bar.com' + @identifier = 'foo@bar.com' @type = 'email' invited_user.should be_nil end @@ -368,14 +368,14 @@ describe User do end describe '.find_or_create_by_invitation' do - + end describe '.create_from_invitation!' do before do @identifier = 'max@foobar.com' @inv = Factory.build(:invitation, :admin => true, :service => 'email', :identifier => @identifier) - @user = User.create_from_invitation!(@inv) + @user = User.create_from_invitation!(@inv) end it 'creates a persisted user' do @@ -409,18 +409,22 @@ describe User do end end - describe ".find_for_authentication" do + describe ".find_for_database_authentication" do it 'finds a user' do - User.find_for_authentication(:username => alice.username).should == alice + User.find_for_database_authentication(:username => alice.username).should == alice + end + + it 'finds a user by email' do + User.find_for_database_authentication(:username => alice.email).should == alice end it "does not preserve case" do - User.find_for_authentication(:username => alice.username.upcase).should == alice + User.find_for_database_authentication(:username => alice.username.upcase).should == alice end it 'errors out when passed a non-hash' do lambda { - User.find_for_authentication(alice.username) + User.find_for_database_authentication(alice.username) }.should raise_error end end @@ -892,7 +896,7 @@ describe User do :password => "secret", :password_confirmation => "secret", :person => {:profile => {:first_name => "Bob", - :last_name => "Smith"}}} + :last_name => "Smith"}}} end From 60e9fd54e2fadb78cec7410ccc208f317b6b35a5 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 18 Aug 2011 16:04:55 -0700 Subject: [PATCH 112/133] Fix a problem with re-saving deleted objects in a spec in postgres, add postgres to test group in gemfile --- Gemfile | 2 ++ Gemfile.lock | 2 ++ spec/integration/receiving_spec.rb | 25 +++++++++++-------------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index baed1cd43..137303975 100644 --- a/Gemfile +++ b/Gemfile @@ -101,6 +101,8 @@ group :test, :development do end group :test do + gem 'mysql2', '0.2.6' + gem 'pg' gem 'factory_girl_rails' gem 'fixture_builder', '0.2.2' gem 'selenium-webdriver', '2.4' diff --git a/Gemfile.lock b/Gemfile.lock index 1e8a31b37..091cdf07d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -319,6 +319,7 @@ GEM oa-openid (= 0.2.6) open4 (1.1.0) orm_adapter (0.0.5) + pg (0.11.0) polyglot (0.3.2) pyu-ruby-sasl (0.0.3.3) rack (1.2.3) @@ -498,6 +499,7 @@ DEPENDENCIES oauth2-provider (= 0.0.16) ohai (= 0.5.8) omniauth (= 0.2.6) + pg rails (= 3.0.9) rails-i18n rcov diff --git a/spec/integration/receiving_spec.rb b/spec/integration/receiving_spec.rb index 4e6d9315d..a4dc06eee 100644 --- a/spec/integration/receiving_spec.rb +++ b/spec/integration/receiving_spec.rb @@ -233,10 +233,10 @@ describe 'a user receives a post' do receive_with_zord(bob, alice.person, xml) receive_with_zord(eve, alice.person, xml) - @comment = eve.comment('tada',:post => @post) - @comment.parent_author_signature = @comment.sign_with_key(alice.encryption_key) - @xml = @comment.to_diaspora_xml - @comment.delete + comment = eve.comment('tada',:post => @post) + comment.parent_author_signature = comment.sign_with_key(alice.encryption_key) + @xml = comment.to_diaspora_xml + comment.delete end it 'should correctly attach the user already on the pod' do @@ -254,17 +254,14 @@ describe 'a user receives a post' do eve.delete Person.where(:id => remote_person.id).delete_all Profile.where(:person_id => remote_person.id).delete_all - remote_person.id = nil + remote_person.attributes.delete(:id) # leaving a nil id causes it to try to save with id set to NULL in postgres - Person.should_receive(:by_account_identifier).twice.and_return{ |handle| - if handle == alice.person.diaspora_handle - alice.person.save - alice.person - else - remote_person.save(:validate => false) - remote_person.profile = Factory(:profile, :person => remote_person) - remote_person - end + m = mock() + Webfinger.should_receive(:new).twice.with(eve.person.diaspora_handle).and_return(m) + m.should_receive(:fetch).twice.and_return{ + remote_person.save(:validate => false) + remote_person.profile = Factory(:profile, :person => remote_person) + remote_person } bob.reload.visible_posts.size.should == 1 From a407f124636e234a5217fc6b5e2a24c3acc91c2e Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Thu, 18 Aug 2011 16:16:14 -0700 Subject: [PATCH 113/133] Revert "Merge branch 'issue1586-aspectdropdown-when-posting'" This reverts commit 2777f16f4ff632ccc3d1d05d9f944d3d054a5bac, reversing changes made to 8b278adff657979a1ea6151bb20632b80bc31486. --- app/controllers/people_controller.rb | 2 +- app/helpers/aspect_global_helper.rb | 17 +------ .../_aspect_dropdown.html.haml | 21 ++++++++ .../_aspect_dropdown_list_item.haml | 6 +++ app/views/aspects/_aspect_stream.haml | 2 +- app/views/aspects/create.js.erb | 2 +- app/views/aspects/index.mobile.haml | 2 +- app/views/contacts/sharing.haml | 2 +- app/views/notifications/index.html.haml | 2 +- .../people/_aspect_membership_dropdown.haml | 1 - app/views/people/_relationship_action.haml | 2 +- app/views/people/_sub_header.html.haml | 2 +- app/views/services/_remote_friend.html.haml | 4 +- app/views/shared/_aspect_dropdown.html.haml | 21 -------- app/views/shared/_publisher.html.haml | 7 ++- .../status_messages/bookmarklet.html.haml | 6 +-- app/views/status_messages/new.haml | 4 +- config/assets.yml | 1 - config/locales/diaspora/en.yml | 16 +++---- features/posts.feature | 3 +- features/step_definitions/custom_web_steps.rb | 9 ---- public/javascripts/aspects-dropdown.js | 33 ------------- public/javascripts/contact-edit.js | 29 +++++++++-- public/javascripts/publisher.js | 48 ++++--------------- public/stylesheets/sass/application.sass | 14 ++---- 25 files changed, 97 insertions(+), 159 deletions(-) create mode 100644 app/views/aspect_memberships/_aspect_dropdown.html.haml create mode 100644 app/views/aspect_memberships/_aspect_dropdown_list_item.haml delete mode 100644 app/views/people/_aspect_membership_dropdown.haml delete mode 100644 app/views/shared/_aspect_dropdown.html.haml delete mode 100644 public/javascripts/aspects-dropdown.js diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 173f133b8..0277fa88f 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -158,7 +158,7 @@ class PeopleController < ApplicationController def aspect_membership_dropdown @person = Person.find(params[:person_id]) @contact = current_user.contact_for(@person) || Contact.new - render :partial => 'aspect_membership_dropdown', :locals => {:contact => @contact, :person => @person, :hang => 'left'} + render :partial => 'aspect_memberships/aspect_dropdown', :locals => {:contact => @contact, :person => @person, :hang => 'left'} end private diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index 9b38b7a09..0545d60f1 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -65,17 +65,8 @@ module AspectGlobalHelper end end - def aspect_membership_dropdown(contact, person, hang, aspect=nil) - selected_aspects = all_aspects.select{|aspect| contact.in_aspect?(aspect) } - - render "shared/aspect_dropdown", - :selected_aspects => selected_aspects, - :person => person, - :hang => hang, - :dropdown_class => "aspect_membership" - end - - def aspect_dropdown_list_item(aspect, checked) + def aspect_dropdown_list_item(aspect, contact, person) + checked = (contact.persisted? && contact.in_aspect?(aspect)) klass = checked ? "selected" : "" str = < "hang_#{hang} #{extra_class if defined?(extra_class)}"} + .button.toggle{:class => ("in_aspects" if contact.aspects.size > 0)} + - if contact.aspects.size == 1 + = contact.aspects.first.name + - else + = t('.toggle', :count => contact.aspects.size) + ▼ + + .wrapper + %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => ((person.id) if person), 'data-service_uid' => (service_uid if defined?(service_uid))} + - for aspect in all_aspects + = aspect_dropdown_list_item(aspect, contact, person) + + - if @aspect && (@aspect == :profile || @aspect == :getting_started || @aspect == :tag || @aspect == :search || @aspect == :notification) + %li.newItem + .add_aspect + = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id), :rel => 'facebox', :class => 'new_aspect' diff --git a/app/views/aspect_memberships/_aspect_dropdown_list_item.haml b/app/views/aspect_memberships/_aspect_dropdown_list_item.haml new file mode 100644 index 000000000..d7508aa0c --- /dev/null +++ b/app/views/aspect_memberships/_aspect_dropdown_list_item.haml @@ -0,0 +1,6 @@ +-# Copyright (c) 2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + += aspect_dropdown_list_item(aspect, contact, person) + diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index b086f3127..c727f32fc 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -16,7 +16,7 @@ - else = @aspects.to_sentence -= render 'shared/publisher', :selected_aspects => @aspects, :aspect_ids => aspect_ids, :aspect => @aspect += render 'shared/publisher', :aspect => aspect, :aspect_ids => aspect_ids - if posts.length == 0 = render 'aspects/no_posts_message' diff --git a/app/views/aspects/create.js.erb b/app/views/aspects/create.js.erb index 1b3b6d428..304732473 100644 --- a/app/views/aspects/create.js.erb +++ b/app/views/aspects/create.js.erb @@ -3,7 +3,7 @@ // the COPYRIGHT file. var dropdown = $("ul.dropdown_list[data-person_id=<%= @person.id %>]") -$('.newItem', dropdown).before("<%= escape_javascript( aspect_dropdown_list_item(@aspect, @contact.aspects.include?(@aspect))) %>"); +$('.newItem', dropdown).before("<%= escape_javascript( render('aspect_memberships/aspect_dropdown_list_item', :aspect => @aspect, :person => @person, :contact => @contact)) %>"); ContactEdit.updateNumber(dropdown, "<%= @person.id %>", <%= @contact.aspects.size %>); $.facebox.close(); diff --git a/app/views/aspects/index.mobile.haml b/app/views/aspects/index.mobile.haml index e7e22f20a..caea84c34 100644 --- a/app/views/aspects/index.mobile.haml +++ b/app/views/aspects/index.mobile.haml @@ -17,4 +17,4 @@ %a.more-link.paginate{:href => next_page_path} %h2= t("more") - content_for :subpages do - = render 'shared/publisher', :aspect_ids => @aspect_ids, :selected_aspects => @aspects, :aspect => @aspect + = render 'shared/publisher', :aspect_ids => @aspect_ids diff --git a/app/views/contacts/sharing.haml b/app/views/contacts/sharing.haml index 3ef702ece..8e687f361 100644 --- a/app/views/contacts/sharing.haml +++ b/app/views/contacts/sharing.haml @@ -23,7 +23,7 @@ = contact.person.diaspora_handle .right - = aspect_membership_dropdown(contact, contact.person, 'right') + = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => contact.person, :hang => 'right' %br %div{:style => "text-align:right;"} diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index 88a098ab2..cc02bb16a 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -24,7 +24,7 @@ .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note[:target]) .right - = aspect_membership_dropdown(contact, note[:target], 'left') + = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => note[:target], :hang => 'left' %span.from = notification_message_for(note) diff --git a/app/views/people/_aspect_membership_dropdown.haml b/app/views/people/_aspect_membership_dropdown.haml deleted file mode 100644 index 778ca85bf..000000000 --- a/app/views/people/_aspect_membership_dropdown.haml +++ /dev/null @@ -1 +0,0 @@ -= aspect_membership_dropdown(@contact, @person, 'left') diff --git a/app/views/people/_relationship_action.haml b/app/views/people/_relationship_action.haml index 98119128c..9f70f9981 100644 --- a/app/views/people/_relationship_action.haml +++ b/app/views/people/_relationship_action.haml @@ -1,6 +1,6 @@ - unless person == current_user.person - contact = current_user.contacts.find_by_person_id(person.id) - contact ||= Contact.new(:person => person) - = aspect_membership_dropdown(contact, person, 'left') + = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => person, :hang => 'left' -else = t('people.person.thats_you') diff --git a/app/views/people/_sub_header.html.haml b/app/views/people/_sub_header.html.haml index fd9b70547..4d376461f 100644 --- a/app/views/people/_sub_header.html.haml +++ b/app/views/people/_sub_header.html.haml @@ -1,7 +1,7 @@ #author_info .right - if user_signed_in? && current_user.person != person - = aspect_membership_dropdown(contact, person, 'left') + = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => person, :hang => 'left' - elsif user_signed_in? && current_user.person == person = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path, :class => 'button creation' diff --git a/app/views/services/_remote_friend.html.haml b/app/views/services/_remote_friend.html.haml index db4a668c0..09d5fce2f 100644 --- a/app/views/services/_remote_friend.html.haml +++ b/app/views/services/_remote_friend.html.haml @@ -4,9 +4,9 @@ - if friend.already_invited? = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id) - elsif friend.on_diaspora? - = render 'shared/aspect_dropdown', :selected_aspects => contact_proxy(friend).aspects, :person => friend.person, :hang => 'left' + = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left' - else - = render 'shared/aspect_dropdown', :selected_aspects => contact_proxy(friend).aspects, :person => friend.person, :hang => 'left', :dropdown_class => 'inviter', :service_uid => friend.uid + = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left', :extra_class => 'inviter', :service_uid => friend.uid - if friend.on_diaspora? = person_image_link(friend.person, :size => :thumb_small) diff --git a/app/views/shared/_aspect_dropdown.html.haml b/app/views/shared/_aspect_dropdown.html.haml deleted file mode 100644 index 33c9ae811..000000000 --- a/app/views/shared/_aspect_dropdown.html.haml +++ /dev/null @@ -1,21 +0,0 @@ --# Copyright (c) 2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -.dropdown{:class => ["hang_#{hang}", defined?(dropdown_class) && dropdown_class]} - .button.toggle{:class => ("in_aspects" if selected_aspects.size > 0)} - - if selected_aspects.size == 1 - = selected_aspects.first.name - - else - = t('.toggle', :count => selected_aspects.size) - ▼ - - .wrapper - %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => (person.id if defined?(person) && person), 'data-service_uid' => (service_uid if defined?(service_uid))} - - for aspect in all_aspects - = aspect_dropdown_list_item(aspect, selected_aspects.include?(aspect) ) - - - if (dropdown_may_create_new_aspect && defined?(person) && person) - %li.newItem - .add_aspect - = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id), :rel => 'facebox' diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index 3b534281a..d899c3d02 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -29,6 +29,12 @@ = hidden_field_tag 'aspect_ids[]', aspect_id.to_s .options_and_submit + - if aspect == :profile + .mention_helper + .badges + %i= t('.publishing_to') + = aspect_badges(aspects_with_person, :link => false) + .public_toggle %span#publisher_service_icons = t("shared.publisher.click_to_share_with") @@ -39,7 +45,6 @@ - for service in current_user.services = image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider.titleize, :class => "service_icon dim", :id =>"#{service.provider}", :maxchar => "#{service.class::MAX_CHARACTERS}" = link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage') - = render "shared/aspect_dropdown", :selected_aspects => selected_aspects, :hang => 'left' = status.submit t('.share'), :disable_with => t('.posting'), :class => 'button creation', :tabindex => 2 .facebox_content diff --git a/app/views/status_messages/bookmarklet.html.haml b/app/views/status_messages/bookmarklet.html.haml index 3854a9255..134d01303 100644 --- a/app/views/status_messages/bookmarklet.html.haml +++ b/app/views/status_messages/bookmarklet.html.haml @@ -10,7 +10,7 @@ :javascript Diaspora.widgets.i18n.loadLocale(#{get_javascript_strings_for(current_user.language).to_json}, "#{current_user.language}"); - $(document).ready(function() + $(document).ready(function() { Publisher.open(); $("#publisher").bind('ajax:success', function(){ @@ -24,7 +24,7 @@ if ("#{params[:notes]}".length > 0){ contents = contents + " - #{params[:notes]}"; } - + $("#publisher #status_message_fake_text").val(contents); $("#publisher #status_message_text").val(contents); $('input.button')[0].removeAttribute('disabled'); @@ -34,5 +34,5 @@ .span-15.last %h4 =t('bookmarklet.post_something') - = render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids } + = render :partial => 'shared/publisher', :locals => { :aspect => :profile, :aspects_with_person => @aspects, :aspect_ids => @aspect_ids} diff --git a/app/views/status_messages/new.haml b/app/views/status_messages/new.haml index 003073df1..acc8b1677 100644 --- a/app/views/status_messages/new.haml +++ b/app/views/status_messages/new.haml @@ -6,7 +6,7 @@ = javascript_include_tag "publisher.js" :javascript - $(document).ready(function() + $(document).ready(function() { var person = {name: '#{@person.name}', handle: '#{@person.diaspora_handle}' }; Publisher.autocompletion.onSelect($("#status_message_fake_text"),person,'#{@person.name}'); @@ -21,5 +21,5 @@ %h3 = t('.mentioning', :person => @person.name) - = render :partial => 'shared/publisher', :locals => { :aspect => @aspect, :aspect_ids => @aspect_ids, :selected_aspects => @aspects_with_person, :person => @person} + = render :partial => 'shared/publisher', :locals => { :aspect => @aspect, :aspect_ids => @aspect_ids, :aspects_with_person => @aspects_with_person, :person => @person} diff --git a/config/assets.yml b/config/assets.yml index 62a75ae4b..f45144dbf 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -42,7 +42,6 @@ javascripts: - public/javascripts/stream.js - public/javascripts/content-updater.js - public/javascripts/search.js - - public/javascripts/aspects-dropdown.js - public/javascripts/contact-edit.js - public/javascripts/contact-list.js - public/javascripts/aspect-sorting.js diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 700fb2585..93efc0d8b 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -180,6 +180,14 @@ en: success: "Successfully removed person from aspect" failure: "Failed to remove person from aspect" no_membership: "Could not find the selected person in that aspect" + aspect_dropdown: + add_to_aspect: "Add to aspect" + toggle: + zero: "Add to aspect" + one: "In %{count} aspect" + few: "In %{count} aspects" + many: "In %{count} aspects" + other: "In %{count} aspects" bookmarklet: heading: "Bookmarklet" @@ -645,14 +653,6 @@ en: not_on_diaspora: "Not yet on Diaspora" shared: - aspect_dropdown: - add_to_aspect: "Add to aspect" - toggle: - zero: "Add to aspect" - one: "In %{count} aspect" - few: "In %{count} aspects" - many: "In %{count} aspects" - other: "In %{count} aspects" publisher: posting: "Posting..." share: "Share" diff --git a/features/posts.feature b/features/posts.feature index b95cea3cb..95a6436eb 100644 --- a/features/posts.feature +++ b/features/posts.feature @@ -154,8 +154,7 @@ Feature: posting And I click "Mention" button And I expand the publisher in the modal window And I append "I am eating a yogurt" to the publisher - And I press the aspect dropdown in the modal window - And I toggle the aspect "DidntPostTo" in the modal window + And I follow "DidntPostTo" within "#publisher" in the modal window And I press "Share" in the modal window And I am on the aspects page And I follow "" within "#aspect_nav" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 594ffc2f6..08b99dd74 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -11,15 +11,6 @@ And /^I expand the publisher$/ do ') end -When /^I press the aspect dropdown$/ do - find('.dropdown .button').click -end - -And /^I toggle the aspect "([^"]*)"$/ do |aspect_name| - aspect = @me.aspects.where(:name => aspect_name).first - find("li[data-aspect_id='#{aspect.id}']").click -end - Then /^the publisher should be collapsed$/ do find("#publisher")["class"].should include("closed") end diff --git a/public/javascripts/aspects-dropdown.js b/public/javascripts/aspects-dropdown.js deleted file mode 100644 index 5aed7eeb9..000000000 --- a/public/javascripts/aspects-dropdown.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2011, Diaspora Inc. This file is -// licensed under the Affero General Public License version 3 or later. See -// the COPYRIGHT file. - -var AspectsDropdown = { - updateNumber: function(dropdown, personId, number, inAspectClass){ - var button = dropdown.parents(".dropdown").children('.button.toggle'), - replacement; - - if (number == 0) { - button.removeClass(inAspectClass); - replacement = Diaspora.widgets.i18n.t("aspect_dropdown.toggle.zero"); - }else if (number == 1) { - button.addClass(inAspectClass); - replacement = dropdown.find(".selected").first().text(); - }else if (number < 3) { - replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.few', { count: number.toString()}) - }else if (number > 3) { - replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.many', { count: number.toString()}) - }else { - //the above one are a tautology, but I want to have them here once for once we figure out a neat way i18n them - replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.other', { count: number.toString()}) - } - - button.html(replacement + ' ▼'); - }, - - toggleCheckbox: - function(check){ - check.parent('li').toggleClass('selected'); - }, -}; - diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index 9480257aa..76795ba3d 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -4,8 +4,7 @@ var ContactEdit = { init: function(){ - $.extend(ContactEdit, AspectsDropdown); - $('.dropdown.aspect_membership .dropdown_list > li').live('click', function(evt){ + $('.dropdown .dropdown_list > li').live('click', function(evt){ ContactEdit.processClick($(this), evt); }); }, @@ -45,11 +44,33 @@ var ContactEdit = { "_method": (selected) ? "DELETE" : "POST" }, function(aspectMembership) { li.removeClass('loading') - ContactEdit.toggleCheckbox(checkbox); - ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length, 'in_aspect'); + li.toggleClass("selected"); + ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length); Diaspora.widgets.publish("aspectDropdown/updated", [li.parent().data("person_id"), li.parents(".dropdown").parent(".right").html()]); }); }, + + updateNumber: function(dropdown, personId, number){ + var button = dropdown.parents(".dropdown").children('.button.toggle'), + replacement; + + if (number == 0) { + button.removeClass("in_aspects"); + replacement = Diaspora.widgets.i18n.t("aspect_dropdown.toggle.zero"); + }else if (number == 1) { + button.addClass("in_aspects"); + replacement = dropdown.find(".selected").first().text(); + }else if (number < 3) { + replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.few', { count: number.toString()}) + }else if (number > 3) { + replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.many', { count: number.toString()}) + }else { + //the above one are a tautology, but I want to have them here once for once we figure out a neat way i18n them + replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.other', { count: number.toString()}) + } + + button.html(replacement + ' ▼'); + }, }; $(document).ready(function(){ diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index d3265c2ec..77950f6e2 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -315,12 +315,6 @@ var Publisher = { ''); } }, - selectedAspectIds: function() { - var aspects = $('#publisher [name="aspect_ids[]"]'); - var aspectIds = []; - aspects.each(function() { aspectIds.push( parseInt($(this).attr('value'))); }); - return aspectIds; - }, toggleAspectIds: function(aspectId) { var hidden_field = $('#publisher [name="aspect_ids[]"][value="'+aspectId+'"]'); if(hidden_field.length > 0){ @@ -344,25 +338,18 @@ var Publisher = { $('#status_message_fake_text').charCount({allowed: min, warning: min/10 }); } }, + bindAspectToggles: function() { - $('#publisher .dropdown .dropdown_list li').bind("click", function(evt){ - var li = $(this), - button = li.find('.button'), - checkbox = li.find('img.check'); - if(button.hasClass('disabled')) { return; } - - AspectsDropdown.toggleCheckbox(checkbox); - AspectsDropdown.updateNumber(li.closest(".dropdown_list"), null, li.parent().find('li.selected').length, ''); - - Publisher.toggleAspectIds(li.attr('data-aspect_id')); + $('#publisher .aspect_badge').bind("click", function(){ + var unremovedAspects = $(this).parent().children('.aspect_badge').length - $(this).parent().children(".aspect_badge.removed").length; + if(!$(this).hasClass('removed') && ( unremovedAspects == 1 )){ + alert(Diaspora.widgets.i18n.t('publisher.at_least_one_aspect')); + }else{ + Publisher.toggleAspectIds($(this).children('a').attr('data-guid')); + $(this).toggleClass("removed"); + } }); }, - beforeSubmit: function(){ - if($("#publisher .content_creation form #aspect_ids_").length == 0){ - alert(Diaspora.widgets.i18n.t('publisher.at_least_one_aspect')); - return false; - } - }, onSubmit: function(data, json, xhr){ $("#photodropzone").find('li').remove(); $("#publisher textarea").removeClass("with_attachments").css('paddingBottom', ''); @@ -376,21 +363,7 @@ var Publisher = { } }, onSuccess: function(data, json, xhr){ - var isPostVisible = false; - var postedTo = Publisher.selectedAspectIds(); - $.each(AspectFilters.selectedGUIDS, function(index, value){ - if(postedTo.indexOf(parseInt(value))>-1) - isPostVisible = true; - }); - - if(isPostVisible) - ContentUpdater.addPostToStream(json.html); - else - Diaspora.widgets.flashes.render({ - success: true, - message: Diaspora.widgets.i18n.t('successfully_posted_message_to_an_aspects_that_is_not_visible') - }); - + ContentUpdater.addPostToStream(json.html); //collapse publisher Publisher.close(); Publisher.clear(); @@ -398,7 +371,6 @@ var Publisher = { Stream.setUpAudioLinks(); }, bindAjax: function(){ - Publisher.form().bind('submit', Publisher.beforeSubmit); Publisher.form().bind('ajax:loading', Publisher.onSubmit); Publisher.form().bind('ajax:failure', Publisher.onFailure); Publisher.form().bind('ajax:success', Publisher.onSuccess); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 78026adb1..9fcb6b13b 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -765,12 +765,8 @@ a.paginate, #infscr-loading &:hover :border 1px solid #1C6D99 -#main_stream - :position relative - :z-index 0 - - .pagination - :display none +#main_stream .pagination + :display none .request_buttons :position absolute @@ -870,7 +866,7 @@ label #publisher - :z-index 1 + :z-index 0 :color #999 :position relative :margin @@ -934,9 +930,6 @@ label .public_toggle :text :align right - .dropdown - :text - :align left #publisher_service_icons :position relative @@ -952,7 +945,6 @@ label :position relative :top -2px - .content_creation :margin :top 1em From c3bcb9c9621fc21cc038d56a88d0d284a5208b92 Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Thu, 18 Aug 2011 16:48:20 -0700 Subject: [PATCH 114/133] Revert "Revert "Merge branch 'issue1586-aspectdropdown-when-posting'"" This reverts commit a407f124636e234a5217fc6b5e2a24c3acc91c2e. --- app/controllers/people_controller.rb | 2 +- app/helpers/aspect_global_helper.rb | 17 ++++++- .../_aspect_dropdown.html.haml | 21 -------- .../_aspect_dropdown_list_item.haml | 6 --- app/views/aspects/_aspect_stream.haml | 2 +- app/views/aspects/create.js.erb | 2 +- app/views/aspects/index.mobile.haml | 2 +- app/views/contacts/sharing.haml | 2 +- app/views/notifications/index.html.haml | 2 +- .../people/_aspect_membership_dropdown.haml | 1 + app/views/people/_relationship_action.haml | 2 +- app/views/people/_sub_header.html.haml | 2 +- app/views/services/_remote_friend.html.haml | 4 +- app/views/shared/_aspect_dropdown.html.haml | 21 ++++++++ app/views/shared/_publisher.html.haml | 7 +-- .../status_messages/bookmarklet.html.haml | 6 +-- app/views/status_messages/new.haml | 4 +- config/assets.yml | 1 + config/locales/diaspora/en.yml | 16 +++---- features/posts.feature | 3 +- features/step_definitions/custom_web_steps.rb | 9 ++++ public/javascripts/aspects-dropdown.js | 33 +++++++++++++ public/javascripts/contact-edit.js | 29 ++--------- public/javascripts/publisher.js | 48 +++++++++++++++---- public/stylesheets/sass/application.sass | 14 ++++-- 25 files changed, 159 insertions(+), 97 deletions(-) delete mode 100644 app/views/aspect_memberships/_aspect_dropdown.html.haml delete mode 100644 app/views/aspect_memberships/_aspect_dropdown_list_item.haml create mode 100644 app/views/people/_aspect_membership_dropdown.haml create mode 100644 app/views/shared/_aspect_dropdown.html.haml create mode 100644 public/javascripts/aspects-dropdown.js diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 0277fa88f..173f133b8 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -158,7 +158,7 @@ class PeopleController < ApplicationController def aspect_membership_dropdown @person = Person.find(params[:person_id]) @contact = current_user.contact_for(@person) || Contact.new - render :partial => 'aspect_memberships/aspect_dropdown', :locals => {:contact => @contact, :person => @person, :hang => 'left'} + render :partial => 'aspect_membership_dropdown', :locals => {:contact => @contact, :person => @person, :hang => 'left'} end private diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index 0545d60f1..9b38b7a09 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -65,8 +65,17 @@ module AspectGlobalHelper end end - def aspect_dropdown_list_item(aspect, contact, person) - checked = (contact.persisted? && contact.in_aspect?(aspect)) + def aspect_membership_dropdown(contact, person, hang, aspect=nil) + selected_aspects = all_aspects.select{|aspect| contact.in_aspect?(aspect) } + + render "shared/aspect_dropdown", + :selected_aspects => selected_aspects, + :person => person, + :hang => hang, + :dropdown_class => "aspect_membership" + end + + def aspect_dropdown_list_item(aspect, checked) klass = checked ? "selected" : "" str = < "hang_#{hang} #{extra_class if defined?(extra_class)}"} - .button.toggle{:class => ("in_aspects" if contact.aspects.size > 0)} - - if contact.aspects.size == 1 - = contact.aspects.first.name - - else - = t('.toggle', :count => contact.aspects.size) - ▼ - - .wrapper - %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => ((person.id) if person), 'data-service_uid' => (service_uid if defined?(service_uid))} - - for aspect in all_aspects - = aspect_dropdown_list_item(aspect, contact, person) - - - if @aspect && (@aspect == :profile || @aspect == :getting_started || @aspect == :tag || @aspect == :search || @aspect == :notification) - %li.newItem - .add_aspect - = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id), :rel => 'facebox', :class => 'new_aspect' diff --git a/app/views/aspect_memberships/_aspect_dropdown_list_item.haml b/app/views/aspect_memberships/_aspect_dropdown_list_item.haml deleted file mode 100644 index d7508aa0c..000000000 --- a/app/views/aspect_memberships/_aspect_dropdown_list_item.haml +++ /dev/null @@ -1,6 +0,0 @@ --# Copyright (c) 2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -= aspect_dropdown_list_item(aspect, contact, person) - diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index c727f32fc..b086f3127 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -16,7 +16,7 @@ - else = @aspects.to_sentence -= render 'shared/publisher', :aspect => aspect, :aspect_ids => aspect_ids += render 'shared/publisher', :selected_aspects => @aspects, :aspect_ids => aspect_ids, :aspect => @aspect - if posts.length == 0 = render 'aspects/no_posts_message' diff --git a/app/views/aspects/create.js.erb b/app/views/aspects/create.js.erb index 304732473..1b3b6d428 100644 --- a/app/views/aspects/create.js.erb +++ b/app/views/aspects/create.js.erb @@ -3,7 +3,7 @@ // the COPYRIGHT file. var dropdown = $("ul.dropdown_list[data-person_id=<%= @person.id %>]") -$('.newItem', dropdown).before("<%= escape_javascript( render('aspect_memberships/aspect_dropdown_list_item', :aspect => @aspect, :person => @person, :contact => @contact)) %>"); +$('.newItem', dropdown).before("<%= escape_javascript( aspect_dropdown_list_item(@aspect, @contact.aspects.include?(@aspect))) %>"); ContactEdit.updateNumber(dropdown, "<%= @person.id %>", <%= @contact.aspects.size %>); $.facebox.close(); diff --git a/app/views/aspects/index.mobile.haml b/app/views/aspects/index.mobile.haml index caea84c34..e7e22f20a 100644 --- a/app/views/aspects/index.mobile.haml +++ b/app/views/aspects/index.mobile.haml @@ -17,4 +17,4 @@ %a.more-link.paginate{:href => next_page_path} %h2= t("more") - content_for :subpages do - = render 'shared/publisher', :aspect_ids => @aspect_ids + = render 'shared/publisher', :aspect_ids => @aspect_ids, :selected_aspects => @aspects, :aspect => @aspect diff --git a/app/views/contacts/sharing.haml b/app/views/contacts/sharing.haml index 8e687f361..3ef702ece 100644 --- a/app/views/contacts/sharing.haml +++ b/app/views/contacts/sharing.haml @@ -23,7 +23,7 @@ = contact.person.diaspora_handle .right - = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => contact.person, :hang => 'right' + = aspect_membership_dropdown(contact, contact.person, 'right') %br %div{:style => "text-align:right;"} diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index cc02bb16a..88a098ab2 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -24,7 +24,7 @@ .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note[:target]) .right - = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => note[:target], :hang => 'left' + = aspect_membership_dropdown(contact, note[:target], 'left') %span.from = notification_message_for(note) diff --git a/app/views/people/_aspect_membership_dropdown.haml b/app/views/people/_aspect_membership_dropdown.haml new file mode 100644 index 000000000..778ca85bf --- /dev/null +++ b/app/views/people/_aspect_membership_dropdown.haml @@ -0,0 +1 @@ += aspect_membership_dropdown(@contact, @person, 'left') diff --git a/app/views/people/_relationship_action.haml b/app/views/people/_relationship_action.haml index 9f70f9981..98119128c 100644 --- a/app/views/people/_relationship_action.haml +++ b/app/views/people/_relationship_action.haml @@ -1,6 +1,6 @@ - unless person == current_user.person - contact = current_user.contacts.find_by_person_id(person.id) - contact ||= Contact.new(:person => person) - = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => person, :hang => 'left' + = aspect_membership_dropdown(contact, person, 'left') -else = t('people.person.thats_you') diff --git a/app/views/people/_sub_header.html.haml b/app/views/people/_sub_header.html.haml index 4d376461f..fd9b70547 100644 --- a/app/views/people/_sub_header.html.haml +++ b/app/views/people/_sub_header.html.haml @@ -1,7 +1,7 @@ #author_info .right - if user_signed_in? && current_user.person != person - = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => person, :hang => 'left' + = aspect_membership_dropdown(contact, person, 'left') - elsif user_signed_in? && current_user.person == person = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path, :class => 'button creation' diff --git a/app/views/services/_remote_friend.html.haml b/app/views/services/_remote_friend.html.haml index 09d5fce2f..db4a668c0 100644 --- a/app/views/services/_remote_friend.html.haml +++ b/app/views/services/_remote_friend.html.haml @@ -4,9 +4,9 @@ - if friend.already_invited? = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id) - elsif friend.on_diaspora? - = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left' + = render 'shared/aspect_dropdown', :selected_aspects => contact_proxy(friend).aspects, :person => friend.person, :hang => 'left' - else - = render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left', :extra_class => 'inviter', :service_uid => friend.uid + = render 'shared/aspect_dropdown', :selected_aspects => contact_proxy(friend).aspects, :person => friend.person, :hang => 'left', :dropdown_class => 'inviter', :service_uid => friend.uid - if friend.on_diaspora? = person_image_link(friend.person, :size => :thumb_small) diff --git a/app/views/shared/_aspect_dropdown.html.haml b/app/views/shared/_aspect_dropdown.html.haml new file mode 100644 index 000000000..33c9ae811 --- /dev/null +++ b/app/views/shared/_aspect_dropdown.html.haml @@ -0,0 +1,21 @@ +-# Copyright (c) 2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +.dropdown{:class => ["hang_#{hang}", defined?(dropdown_class) && dropdown_class]} + .button.toggle{:class => ("in_aspects" if selected_aspects.size > 0)} + - if selected_aspects.size == 1 + = selected_aspects.first.name + - else + = t('.toggle', :count => selected_aspects.size) + ▼ + + .wrapper + %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => (person.id if defined?(person) && person), 'data-service_uid' => (service_uid if defined?(service_uid))} + - for aspect in all_aspects + = aspect_dropdown_list_item(aspect, selected_aspects.include?(aspect) ) + + - if (dropdown_may_create_new_aspect && defined?(person) && person) + %li.newItem + .add_aspect + = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id), :rel => 'facebox' diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index d899c3d02..3b534281a 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -29,12 +29,6 @@ = hidden_field_tag 'aspect_ids[]', aspect_id.to_s .options_and_submit - - if aspect == :profile - .mention_helper - .badges - %i= t('.publishing_to') - = aspect_badges(aspects_with_person, :link => false) - .public_toggle %span#publisher_service_icons = t("shared.publisher.click_to_share_with") @@ -45,6 +39,7 @@ - for service in current_user.services = image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider.titleize, :class => "service_icon dim", :id =>"#{service.provider}", :maxchar => "#{service.class::MAX_CHARACTERS}" = link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage') + = render "shared/aspect_dropdown", :selected_aspects => selected_aspects, :hang => 'left' = status.submit t('.share'), :disable_with => t('.posting'), :class => 'button creation', :tabindex => 2 .facebox_content diff --git a/app/views/status_messages/bookmarklet.html.haml b/app/views/status_messages/bookmarklet.html.haml index 134d01303..3854a9255 100644 --- a/app/views/status_messages/bookmarklet.html.haml +++ b/app/views/status_messages/bookmarklet.html.haml @@ -10,7 +10,7 @@ :javascript Diaspora.widgets.i18n.loadLocale(#{get_javascript_strings_for(current_user.language).to_json}, "#{current_user.language}"); - $(document).ready(function() + $(document).ready(function() { Publisher.open(); $("#publisher").bind('ajax:success', function(){ @@ -24,7 +24,7 @@ if ("#{params[:notes]}".length > 0){ contents = contents + " - #{params[:notes]}"; } - + $("#publisher #status_message_fake_text").val(contents); $("#publisher #status_message_text").val(contents); $('input.button')[0].removeAttribute('disabled'); @@ -34,5 +34,5 @@ .span-15.last %h4 =t('bookmarklet.post_something') - = render :partial => 'shared/publisher', :locals => { :aspect => :profile, :aspects_with_person => @aspects, :aspect_ids => @aspect_ids} + = render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids } diff --git a/app/views/status_messages/new.haml b/app/views/status_messages/new.haml index acc8b1677..003073df1 100644 --- a/app/views/status_messages/new.haml +++ b/app/views/status_messages/new.haml @@ -6,7 +6,7 @@ = javascript_include_tag "publisher.js" :javascript - $(document).ready(function() + $(document).ready(function() { var person = {name: '#{@person.name}', handle: '#{@person.diaspora_handle}' }; Publisher.autocompletion.onSelect($("#status_message_fake_text"),person,'#{@person.name}'); @@ -21,5 +21,5 @@ %h3 = t('.mentioning', :person => @person.name) - = render :partial => 'shared/publisher', :locals => { :aspect => @aspect, :aspect_ids => @aspect_ids, :aspects_with_person => @aspects_with_person, :person => @person} + = render :partial => 'shared/publisher', :locals => { :aspect => @aspect, :aspect_ids => @aspect_ids, :selected_aspects => @aspects_with_person, :person => @person} diff --git a/config/assets.yml b/config/assets.yml index f45144dbf..62a75ae4b 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -42,6 +42,7 @@ javascripts: - public/javascripts/stream.js - public/javascripts/content-updater.js - public/javascripts/search.js + - public/javascripts/aspects-dropdown.js - public/javascripts/contact-edit.js - public/javascripts/contact-list.js - public/javascripts/aspect-sorting.js diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 93efc0d8b..700fb2585 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -180,14 +180,6 @@ en: success: "Successfully removed person from aspect" failure: "Failed to remove person from aspect" no_membership: "Could not find the selected person in that aspect" - aspect_dropdown: - add_to_aspect: "Add to aspect" - toggle: - zero: "Add to aspect" - one: "In %{count} aspect" - few: "In %{count} aspects" - many: "In %{count} aspects" - other: "In %{count} aspects" bookmarklet: heading: "Bookmarklet" @@ -653,6 +645,14 @@ en: not_on_diaspora: "Not yet on Diaspora" shared: + aspect_dropdown: + add_to_aspect: "Add to aspect" + toggle: + zero: "Add to aspect" + one: "In %{count} aspect" + few: "In %{count} aspects" + many: "In %{count} aspects" + other: "In %{count} aspects" publisher: posting: "Posting..." share: "Share" diff --git a/features/posts.feature b/features/posts.feature index 95a6436eb..b95cea3cb 100644 --- a/features/posts.feature +++ b/features/posts.feature @@ -154,7 +154,8 @@ Feature: posting And I click "Mention" button And I expand the publisher in the modal window And I append "I am eating a yogurt" to the publisher - And I follow "DidntPostTo" within "#publisher" in the modal window + And I press the aspect dropdown in the modal window + And I toggle the aspect "DidntPostTo" in the modal window And I press "Share" in the modal window And I am on the aspects page And I follow "" within "#aspect_nav" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 08b99dd74..594ffc2f6 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -11,6 +11,15 @@ And /^I expand the publisher$/ do ') end +When /^I press the aspect dropdown$/ do + find('.dropdown .button').click +end + +And /^I toggle the aspect "([^"]*)"$/ do |aspect_name| + aspect = @me.aspects.where(:name => aspect_name).first + find("li[data-aspect_id='#{aspect.id}']").click +end + Then /^the publisher should be collapsed$/ do find("#publisher")["class"].should include("closed") end diff --git a/public/javascripts/aspects-dropdown.js b/public/javascripts/aspects-dropdown.js new file mode 100644 index 000000000..5aed7eeb9 --- /dev/null +++ b/public/javascripts/aspects-dropdown.js @@ -0,0 +1,33 @@ +// Copyright (c) 2011, Diaspora Inc. This file is +// licensed under the Affero General Public License version 3 or later. See +// the COPYRIGHT file. + +var AspectsDropdown = { + updateNumber: function(dropdown, personId, number, inAspectClass){ + var button = dropdown.parents(".dropdown").children('.button.toggle'), + replacement; + + if (number == 0) { + button.removeClass(inAspectClass); + replacement = Diaspora.widgets.i18n.t("aspect_dropdown.toggle.zero"); + }else if (number == 1) { + button.addClass(inAspectClass); + replacement = dropdown.find(".selected").first().text(); + }else if (number < 3) { + replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.few', { count: number.toString()}) + }else if (number > 3) { + replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.many', { count: number.toString()}) + }else { + //the above one are a tautology, but I want to have them here once for once we figure out a neat way i18n them + replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.other', { count: number.toString()}) + } + + button.html(replacement + ' ▼'); + }, + + toggleCheckbox: + function(check){ + check.parent('li').toggleClass('selected'); + }, +}; + diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index 76795ba3d..9480257aa 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -4,7 +4,8 @@ var ContactEdit = { init: function(){ - $('.dropdown .dropdown_list > li').live('click', function(evt){ + $.extend(ContactEdit, AspectsDropdown); + $('.dropdown.aspect_membership .dropdown_list > li').live('click', function(evt){ ContactEdit.processClick($(this), evt); }); }, @@ -44,33 +45,11 @@ var ContactEdit = { "_method": (selected) ? "DELETE" : "POST" }, function(aspectMembership) { li.removeClass('loading') - li.toggleClass("selected"); - ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length); + ContactEdit.toggleCheckbox(checkbox); + ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length, 'in_aspect'); Diaspora.widgets.publish("aspectDropdown/updated", [li.parent().data("person_id"), li.parents(".dropdown").parent(".right").html()]); }); }, - - updateNumber: function(dropdown, personId, number){ - var button = dropdown.parents(".dropdown").children('.button.toggle'), - replacement; - - if (number == 0) { - button.removeClass("in_aspects"); - replacement = Diaspora.widgets.i18n.t("aspect_dropdown.toggle.zero"); - }else if (number == 1) { - button.addClass("in_aspects"); - replacement = dropdown.find(".selected").first().text(); - }else if (number < 3) { - replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.few', { count: number.toString()}) - }else if (number > 3) { - replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.many', { count: number.toString()}) - }else { - //the above one are a tautology, but I want to have them here once for once we figure out a neat way i18n them - replacement = Diaspora.widgets.i18n.t('aspect_dropdown.toggle.other', { count: number.toString()}) - } - - button.html(replacement + ' ▼'); - }, }; $(document).ready(function(){ diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 77950f6e2..d3265c2ec 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -315,6 +315,12 @@ var Publisher = { ''); } }, + selectedAspectIds: function() { + var aspects = $('#publisher [name="aspect_ids[]"]'); + var aspectIds = []; + aspects.each(function() { aspectIds.push( parseInt($(this).attr('value'))); }); + return aspectIds; + }, toggleAspectIds: function(aspectId) { var hidden_field = $('#publisher [name="aspect_ids[]"][value="'+aspectId+'"]'); if(hidden_field.length > 0){ @@ -338,18 +344,25 @@ var Publisher = { $('#status_message_fake_text').charCount({allowed: min, warning: min/10 }); } }, - bindAspectToggles: function() { - $('#publisher .aspect_badge').bind("click", function(){ - var unremovedAspects = $(this).parent().children('.aspect_badge').length - $(this).parent().children(".aspect_badge.removed").length; - if(!$(this).hasClass('removed') && ( unremovedAspects == 1 )){ - alert(Diaspora.widgets.i18n.t('publisher.at_least_one_aspect')); - }else{ - Publisher.toggleAspectIds($(this).children('a').attr('data-guid')); - $(this).toggleClass("removed"); - } + $('#publisher .dropdown .dropdown_list li').bind("click", function(evt){ + var li = $(this), + button = li.find('.button'), + checkbox = li.find('img.check'); + if(button.hasClass('disabled')) { return; } + + AspectsDropdown.toggleCheckbox(checkbox); + AspectsDropdown.updateNumber(li.closest(".dropdown_list"), null, li.parent().find('li.selected').length, ''); + + Publisher.toggleAspectIds(li.attr('data-aspect_id')); }); }, + beforeSubmit: function(){ + if($("#publisher .content_creation form #aspect_ids_").length == 0){ + alert(Diaspora.widgets.i18n.t('publisher.at_least_one_aspect')); + return false; + } + }, onSubmit: function(data, json, xhr){ $("#photodropzone").find('li').remove(); $("#publisher textarea").removeClass("with_attachments").css('paddingBottom', ''); @@ -363,7 +376,21 @@ var Publisher = { } }, onSuccess: function(data, json, xhr){ - ContentUpdater.addPostToStream(json.html); + var isPostVisible = false; + var postedTo = Publisher.selectedAspectIds(); + $.each(AspectFilters.selectedGUIDS, function(index, value){ + if(postedTo.indexOf(parseInt(value))>-1) + isPostVisible = true; + }); + + if(isPostVisible) + ContentUpdater.addPostToStream(json.html); + else + Diaspora.widgets.flashes.render({ + success: true, + message: Diaspora.widgets.i18n.t('successfully_posted_message_to_an_aspects_that_is_not_visible') + }); + //collapse publisher Publisher.close(); Publisher.clear(); @@ -371,6 +398,7 @@ var Publisher = { Stream.setUpAudioLinks(); }, bindAjax: function(){ + Publisher.form().bind('submit', Publisher.beforeSubmit); Publisher.form().bind('ajax:loading', Publisher.onSubmit); Publisher.form().bind('ajax:failure', Publisher.onFailure); Publisher.form().bind('ajax:success', Publisher.onSuccess); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 9fcb6b13b..78026adb1 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -765,8 +765,12 @@ a.paginate, #infscr-loading &:hover :border 1px solid #1C6D99 -#main_stream .pagination - :display none +#main_stream + :position relative + :z-index 0 + + .pagination + :display none .request_buttons :position absolute @@ -866,7 +870,7 @@ label #publisher - :z-index 0 + :z-index 1 :color #999 :position relative :margin @@ -930,6 +934,9 @@ label .public_toggle :text :align right + .dropdown + :text + :align left #publisher_service_icons :position relative @@ -945,6 +952,7 @@ label :position relative :top -2px + .content_creation :margin :top 1em From 2c47262d5432744848da6ae0e738346ec42b6bc6 Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Thu, 18 Aug 2011 16:44:53 -0700 Subject: [PATCH 115/133] manually pulled in manuels latest commits --- public/javascripts/aspects-dropdown.js | 2 +- public/javascripts/contact-edit.js | 5 ++--- public/javascripts/publisher.js | 8 +++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/public/javascripts/aspects-dropdown.js b/public/javascripts/aspects-dropdown.js index 5aed7eeb9..4bd65eb2f 100644 --- a/public/javascripts/aspects-dropdown.js +++ b/public/javascripts/aspects-dropdown.js @@ -27,7 +27,7 @@ var AspectsDropdown = { toggleCheckbox: function(check){ - check.parent('li').toggleClass('selected'); + check.toggleClass('selected'); }, }; diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index 9480257aa..cb4a1d7ac 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -35,8 +35,7 @@ var ContactEdit = { var button = li.find('.button'); if(button.hasClass('disabled') || li.hasClass('newItem')){ return; } - var checkbox = li.find('img.check'), - selected = li.hasClass("selected"), + var selected = li.hasClass("selected"), routedId = selected ? "/42" : ""; $.post("/aspect_memberships" + routedId + ".json", { @@ -45,7 +44,7 @@ var ContactEdit = { "_method": (selected) ? "DELETE" : "POST" }, function(aspectMembership) { li.removeClass('loading') - ContactEdit.toggleCheckbox(checkbox); + ContactEdit.toggleCheckbox(li); ContactEdit.updateNumber(li.closest(".dropdown_list"), li.parent().data("person_id"), aspectMembership.aspect_ids.length, 'in_aspect'); Diaspora.widgets.publish("aspectDropdown/updated", [li.parent().data("person_id"), li.parents(".dropdown").parent(".right").html()]); }); diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index d3265c2ec..33b51dd6b 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -347,11 +347,9 @@ var Publisher = { bindAspectToggles: function() { $('#publisher .dropdown .dropdown_list li').bind("click", function(evt){ var li = $(this), - button = li.find('.button'), - checkbox = li.find('img.check'); - if(button.hasClass('disabled')) { return; } + button = li.parent('.dropdown').find('.button'); - AspectsDropdown.toggleCheckbox(checkbox); + AspectsDropdown.toggleCheckbox(li); AspectsDropdown.updateNumber(li.closest(".dropdown_list"), null, li.parent().find('li.selected').length, ''); Publisher.toggleAspectIds(li.attr('data-aspect_id')); @@ -376,7 +374,7 @@ var Publisher = { } }, onSuccess: function(data, json, xhr){ - var isPostVisible = false; + var isPostVisible = AspectFilters.selectedGUIDS.length == 0; var postedTo = Publisher.selectedAspectIds(); $.each(AspectFilters.selectedGUIDS, function(index, value){ if(postedTo.indexOf(parseInt(value))>-1) From 6beeecefd8a7e24e0ca66755af9bf077f28433e3 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 18 Aug 2011 18:27:24 -0700 Subject: [PATCH 116/133] add better messages telling a user that they sent share requests if they try and email exsisting users --- app/controllers/invitations_controller.rb | 9 +++++++-- app/models/invitation.rb | 13 +++++++++++-- spec/controllers/services_controller_spec.rb | 4 +++- spec/models/invitation_spec.rb | 8 ++++---- spec/models/user_spec.rb | 2 +- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 924254a83..7b070c1c8 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -87,14 +87,19 @@ class InvitationsController < Devise::InvitationsController def extract_messages(invites) success_message = "Invites Successfully Sent to: " failure_message = "There was a problem with: " + following_message = " already are on Diaspora, so you are now sharing with them." successes, failures = invites.partition{|x| x.persisted? } - success_message += successes.map{|k| k.identifier }.join(', ') - failure_message += failures.map{|k| k.identifier }.join(', ') + followings, real_failures = failures.partition{|x| x.errors[:recipient].present? } + + success_message += successes.map{|k| k.identifier }.to_sentence + failure_message += real_failures.map{|k| k.identifier }.to_sentence + following_message += followings.map{|k| k.identifier}.to_sentence messages = [] messages << success_message if successes.present? messages << failure_message if failures.present? + messages << following_message if followings.present? messages.join('\n') end diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 344bc7d04..c75375dab 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -12,8 +12,10 @@ class Invitation < ActiveRecord::Base before_validation :set_email_as_default_service + # before_create :share_with_exsisting_user, :if => :recipient_id? validates_presence_of :identifier, :service validate :valid_identifier? + validate :recipient_not_on_pod? validates_presence_of :sender, :aspect, :unless => :admin? validate :ensure_not_inviting_self, :on => :create, :unless => :admin? validate :sender_owns_aspect?, :unless => :admin? @@ -36,11 +38,11 @@ class Invitation < ActiveRecord::Base users_on_pod = User.where(:email => emails, :invitation_token => nil) #share with anyone whose email you entered who is on the pod - emails = emails - users_on_pod.map{|u| u.email} users_on_pod.each{|u| opts[:sender].share_with(u.person, opts[:aspect])} emails.map! do |e| - Invitation.create(opts.merge(:identifier => e)) + user = users_on_pod.find{|u| u.email == e} + Invitation.create(opts.merge(:identifier => e, :recipient => user)) end emails end @@ -140,6 +142,13 @@ class Invitation < ActiveRecord::Base end + def recipient_not_on_pod? + return true if self.recipient.nil? + if self.recipient.username? + errors[:recipient] << "The user '#{self.identifier}' (#{self.recipient.diaspora_handle}) is already on this pod, so we sent them a share request" + end + end + # @note Validation def valid_identifier? return false unless self.identifier diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index 1333262f4..8012c880c 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -146,7 +146,9 @@ describe ServicesController do end it 'does not create a duplicate invitation' do - inv = Invitation.create!(:sender => @user, :recipient => eve, :aspect => @user.aspects.first, :identifier => eve.email) + invited_user = Factory.build(:user, :username =>nil) + invited_user.save(:validate => false) + inv = Invitation.create!(:sender => @user, :recipient => invited_user, :aspect => @user.aspects.first, :identifier => eve.email) @invite_params[:invitation_id] = inv.id lambda { diff --git a/spec/models/invitation_spec.rb b/spec/models/invitation_spec.rb index 329df2971..4e5b531df 100644 --- a/spec/models/invitation_spec.rb +++ b/spec/models/invitation_spec.rb @@ -13,12 +13,12 @@ describe Invitation do end describe 'validations' do before do - @invitation = Factory.build(:invitation, :sender => user, :recipient => eve, :aspect => user.aspects.first) + @invitation = Factory.build(:invitation, :sender => user, :recipient => nil, :aspect => user.aspects.first) end it 'is valid' do @invitation.sender.should == user - @invitation.recipient.should == eve + @invitation.recipient.should == nil @invitation.aspect.should == user.aspects.first @invitation.should be_valid end @@ -89,13 +89,13 @@ describe Invitation do invites.all?{|x| x.persisted?}.should be_true end - it 'shares with people who are already on the pod and does not create an invite for them' do + it 'shares with people who are already on the pod' do Factory(:user, :email => @emails.first) invites = nil expect{ invites = Invitation.batch_invite(@emails, @opts) }.to change(eve.contacts, :count).by(1) - invites.count.should be 1 + invites.count.should be 2 end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index a3e898d38..100fd8087 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -565,7 +565,7 @@ describe User do end it 'removes invitations to the user' do - Invitation.create!(:sender => eve, :recipient => alice, :identifier => alice.email, :aspect => eve.aspects.first) + Invitation.new(:sender => eve, :recipient => alice, :identifier => alice.email, :aspect => eve.aspects.first).save(:validate => false) lambda { alice.destroy }.should change {alice.invitations_to_me(true).count }.by(-1) From 3d7297ba5e18a08beda30f7659a0b4462e357c50 Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Fri, 19 Aug 2011 00:47:26 -0300 Subject: [PATCH 117/133] Closes #1753. Render thats_you message instead of dropdown for your hovercard --- app/controllers/people_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 173f133b8..d14468e67 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -157,8 +157,12 @@ class PeopleController < ApplicationController def aspect_membership_dropdown @person = Person.find(params[:person_id]) - @contact = current_user.contact_for(@person) || Contact.new - render :partial => 'aspect_membership_dropdown', :locals => {:contact => @contact, :person => @person, :hang => 'left'} + if @person == current_user.person + render :text => I18n.t('people.person.thats_you') + else + @contact = current_user.contact_for(@person) || Contact.new + render :partial => 'aspect_membership_dropdown', :locals => {:contact => @contact, :person => @person, :hang => 'left'} + end end private From ecf38305b494306b59db3bdf4e7edd9f50287861 Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Fri, 19 Aug 2011 11:05:48 -0700 Subject: [PATCH 118/133] added a visible style for missing translations in development and production modes --- app/views/layouts/application.html.haml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index d1522e709..628dc6c4f 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -51,6 +51,12 @@ = yield(:head) + -unless Rails.env == "production" + :css + .translation_missing { + color: purple; + background-color: red; + } -if AppConfig[:google_a_site] :javascript var _gaq = _gaq || []; From 96d183a041d6a9fe9b0956895c80e83021ecf725 Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Fri, 19 Aug 2011 11:33:55 -0700 Subject: [PATCH 119/133] fixed private message emails not including the message --- app/models/message.rb | 4 ++++ spec/mailers/notifier_spec.rb | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/models/message.rb b/app/models/message.rb index 4d13d7807..a2a05b933 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -74,6 +74,10 @@ class Message < ActiveRecord::Base Notifications::PrivateMessage unless user.person == person end + def formatted_message(opts={}) + opts[:plain_text] ? self.text: ERB::Util.h(self.text) + end + private def participant_of_parent_conversation if self.parent && !self.parent.participants.include?(self.author) diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index 17326f582..c5ece598a 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -88,8 +88,8 @@ describe Notifier do @mail.body.encoded.should include(@sm.text) end - it 'should not include translation missing' do - @mail.body.encoded.should_not include("missing") + it 'should not include translation fallback' do + @mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared') end end @@ -112,8 +112,8 @@ describe Notifier do @mail.body.encoded.should include(@like.author.name) end - it 'should not include translation missing' do - @mail.body.encoded.should_not include("missing") + it 'should not include translation fallback' do + @mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared') end it 'can handle a reshare' do @@ -170,8 +170,8 @@ describe Notifier do @mail.body.encoded.should include(@cnv.messages.first.text) end - it 'should not include translation missing' do - @mail.body.encoded.should_not include("missing") + it 'should not include translation fallback' do + @mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared') end end @@ -204,6 +204,10 @@ describe Notifier do it "contains the original post's link" do comment_mail.body.encoded.include?("#{comment.post.id.to_s}").should be true end + + it 'should not include translation fallback' do + comment_mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared') + end end [:reshare, :activity_streams_photo].each do |post_type| @@ -242,6 +246,10 @@ describe Notifier do it "contains the original post's link" do comment_mail.body.encoded.include?("#{comment.post.id.to_s}").should be true end + + it 'should not include translation fallback' do + comment_mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared') + end end [:reshare, :activity_streams_photo].each do |post_type| context post_type.to_s do From f2e25c5fc56aea2d826e6a1b7b0e0bc5114b8ee9 Mon Sep 17 00:00:00 2001 From: MrZYX Date: Fri, 19 Aug 2011 20:39:26 +0200 Subject: [PATCH 120/133] updated locales --- config/locales/diaspora/es-CL.yml | 88 +++++++++++++++---------------- config/locales/diaspora/ko.yml | 14 ++--- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/config/locales/diaspora/es-CL.yml b/config/locales/diaspora/es-CL.yml index 572643859..1e1884241 100644 --- a/config/locales/diaspora/es-CL.yml +++ b/config/locales/diaspora/es-CL.yml @@ -37,7 +37,7 @@ es-CL: person: invalid: "No es valido." username: - invalid: "is invalid. We only allow letters, numbers, and underscores" + invalid: "es invalido. Solo se permiten letras, números y guiones bajos" taken: "Ya está siendo ocupado." ago: "hace %{time}" all_aspects: "Todos los Aspectos" @@ -111,14 +111,14 @@ es-CL: handle_explanation: "Este es tu ID de Diaspora. Como una dirección de correo, puedes dársela a la gente para que te encuentren." keep_us_running: "Mantén %{pod} rápido, !compra a nuestros servidores su dosis mensual de café!" no_contacts: "No hay contactos" - no_tags: "Sin tags" + no_tags: "+ Busca un tag para seguir" people_sharing_with_you: "Personas compartiendo contigo" post_a_message: "postea un mensaje >>" services: content: "Puedes enlazar los siguientes servicios a Diaspora:" heading: "Servicios que puedes enlazar" tags_following: "Tags" - unfollow_tag: "Stop following #%{tag}" + unfollow_tag: "Dejar de seguir #%{tag}" your_aspects: "Tus Aspectos" many: "%{count} aspectos" move_contact: @@ -129,10 +129,10 @@ es-CL: create: "Crear" name: "Nombre" no_contacts_message: - featured_users: "featured users" - or_featured: "Or you can share with %{link}" - try_adding_some_more_contacts: "You can search (top) or invite (right) more contacts." - you_should_add_some_more_contacts: "You should add some more contacts!" + featured_users: "usuarios destacados" + or_featured: "O puedes compartir con %{link}" + try_adding_some_more_contacts: "Puedes buscar (arriba) o invitar (derecha) más contactos." + you_should_add_some_more_contacts: "Deberías añadir mas contactos!" no_posts_message: start_talking: "Nadie ha dicho nada aún!" one: "1 aspecto" @@ -236,7 +236,7 @@ es-CL: correct_the_following_errors_and_try_again: "Corrige los siguientes errores e inténtalo de nuevo." invalid_fields: "Campos Inválidos" fill_me_out: "Complétame" - find_people: "Buscar personas" + find_people: "Buscar personas o #tags" hide: "Ocultar" home: show: @@ -253,7 +253,7 @@ es-CL: tagline_first_half: "Comparte lo que quieras," tagline_second_half: "con los que quiera." invitations: - a_facebook_user: "A Facebook user" + a_facebook_user: "Un usuario de Facebook" check_token: not_found: "Identificación de invitación no encontrada" create: @@ -264,8 +264,8 @@ es-CL: rejected: "Las siguientes direcciones de correo han tenido problemas:" sent: "Las invitaciones han sido enviadas a:" edit: - accept_your_invitation: "Accept your invitation" - your_account_awaits: "Your account awaits!" + accept_your_invitation: "Acepta tu invitación" + your_account_awaits: "Tu cuenta te espera!" new: already_invited: "Las siguientes personas no aceptaron tu invitación:" aspect: "Aspecto" @@ -392,7 +392,7 @@ es-CL: other: "%{actors} comenzaron a compartir contigo." zero: "%{actors} comenzó a compartir contigo." notifier: - a_post_you_shared: "a post." + a_post_you_shared: "un post." click_here: "haz click aquí" comment_on_post: reply: "Responde o mira el post de %{name}>" @@ -457,7 +457,7 @@ es-CL: add_some: "agrega algunas" does_not_exist: "¡La persona no existe!" edit: "editar" - has_not_shared_with_you_yet: "%{name} has not shared any posts with you yet!" + has_not_shared_with_you_yet: "%{name} todavía no ha compartido ningún post contigo!" incoming_request: "Tienes una solicitud pendiente de %{name}" mention: "Mencionar" message: "Mensaje" @@ -473,7 +473,7 @@ es-CL: fail: "Lo siento, no pudimos encontrar %{handle}." zero: "ninguna persona" photos: - comment_email_subject: "%{name}'s photo" + comment_email_subject: "foto de %{name}" create: integrity_error: "Error al subir la foto. ¿Estás seguro que eso era una imagen?" runtime_error: "Error al subir la foto. ¿Estás seguro que tienes puesto el cinturon de seguridad?" @@ -501,7 +501,7 @@ es-CL: edit: "editar" edit_delete_photo: "Editar descripción de foto / borrar foto" make_profile_photo: "convertir en foto de perfil" - show_original_post: "Show original post" + show_original_post: "Mostrar post original" update_photo: "Actualizar Foto" update: error: "Error al editar foto." @@ -549,13 +549,13 @@ es-CL: unhappy: "¿Triste?" update: "Actualizar" new: - create_my_account: "Create my account" + create_my_account: "Crear mi cuenta" enter_email: "Ingresa un email" enter_password: "Ingresar contraseña" enter_password_again: "Ingresa la misma contraseña anterior" enter_username: "Escoge un nick (solo letras, números, y guión bajo)" - join_the_movement: "Join the movement!" - sign_up_today: "Sign up today" + join_the_movement: "Unete al movimiento!" + sign_up_today: "Registrate hoy día" requests: create: sending: "Enviando" @@ -577,7 +577,7 @@ es-CL: new_request_to_person: sent: "¡enviado!" reshares: - comment_email_subject: "%{resharer}'s reshare of %{author}'s post" + comment_email_subject: "%{resharer} compartió el post de %{author}" create: failure: "Hubo un error al compartir este post." reshare: @@ -600,8 +600,8 @@ es-CL: failure: error: "ocurrió un error al conectarse con ese servicio" finder: - no_friends: "No Facebook friends found." - service_friends: "%{service} Friends" + no_friends: "Ningún amigo de Facebook encontrado." + service_friends: "Los %{service} de tus amigos" index: connect_to_facebook: "Conectar a facebook" connect_to_tumblr: "Conectar a Tumblr" @@ -616,7 +616,7 @@ es-CL: join_me_on_diaspora: "Únete a mi en DIASPORA*" remote_friend: invite: "invitar" - not_on_diaspora: "Not yet on Diaspora" + not_on_diaspora: "Aun no en Diaspora" resend: "reenviar" settings: "Configuración" shared: @@ -746,32 +746,32 @@ es-CL: your_email: "Tu correo electrónico" your_handle: "Tu id de diaspora" getting_started: - aspects: "aspects" - connect_to: "Connect to" - connect_to_your_other_social_networks: "Connect to your other social networks" - connect_with_people: "Connect with cool people" - connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" - connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." - featured_tags: "Featured tags" - featured_users: "Featured users" - fill_out_your_profile: "Fill out your profile" - find_friends: "Find friends" - find_friends_from_facebook: "find friends from Facebook" + aspects: "aspectos" + connect_to: "Conectar a" + connect_to_your_other_social_networks: "Conectate con tus otras redes sociales" + connect_with_people: "Conectate con gente cool" + connect_with_people_explanation_pt1: "Conectate con las personas ubicándolas en uno o mas de tus" + connect_with_people_explanation_pt2: "Los Aspectos son la forma intuitiva de agrupar caras nuevas y familiares, de manera privada, te permiten filtrar o compartir con un subconjunto de tus contactos de manera sencilla." + featured_tags: "Etiquetas destacadas" + featured_users: "Usuarios destacados" + fill_out_your_profile: "Rellena tu perfil" + find_friends: "Encuentra tus amigos" + find_friends_from_facebook: "encuentra amigos de Facebook" finished: "¡Terminaste!" - follow_your_interests: "Follow your interests" - hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." - profile_description: "Make it easier for people to find you by filling out your profile information." + follow_your_interests: "Sigue tus intereses" + hashtag_explanation: "Los Hashtags te permiten hablar y seguir sobre tus intereses. También son una manera genial de encontrar nuevas personas en Diaspora." + profile_description: "Hazle mas fácil a las personas encontrarte llenando tu información de perfil." profile_fields: bio: "Bio" - birthday: "Birthday" - gender: "Gender" - location: "Location" - name: "Name" - photo: "Photo" + birthday: "Fecha de nacimiento" + gender: "Genero" + location: "Ubicación" + name: "Nombre" + photo: "Foto" tags: "Tags" - see_all_featured_users: "See all featured users" - welcome: "¡Bienvenido a Diaspora!" - welcome_with_name: "Welcome, %{name}!" + see_all_featured_users: "Ver todos los usuarios destacados" + welcome: "¡Bienvenido!" + welcome_with_name: "Bienvenido, %{name}!" public: does_not_exist: "¡El usuario %{username} no existe!" update: diff --git a/config/locales/diaspora/ko.yml b/config/locales/diaspora/ko.yml index a834e0e40..fc17be3f7 100644 --- a/config/locales/diaspora/ko.yml +++ b/config/locales/diaspora/ko.yml @@ -746,21 +746,21 @@ ko: your_email: "이메일 주소" your_handle: "디아스포라 핸들" getting_started: - aspects: "애스펙" + aspects: "그 사람은 내 컨택이 됩니다" connect_to: "연결하기:" - connect_to_your_other_social_networks: "내 다른 소셜네트워크와 연결하기" + connect_to_your_other_social_networks: "다른 소셜 네트워크와 연결하기" connect_with_people: "멋진 사람들과 연결하기" - connect_with_people_explanation_pt1: "Connect with people by placing them into one or more of your" - connect_with_people_explanation_pt2: "Aspects are an intuitive way to group new and familar faces, private to you, allowing you to filter down or share with subsets of your contacts easily." + connect_with_people_explanation_pt1: "누군가를 한 개 이상의 애스펙으로 분류하면" + connect_with_people_explanation_pt2: "애스펙은 새로운 컨택, 낯익은 컨택, 사적인 컨택을 분류하여 일부와만 공유하거나 일부를 거를 수 있게하는 쉽고 직관적인 방법입니다." featured_tags: "추천 태그" featured_users: "추천 사용자" - fill_out_your_profile: "내 프로필 채우기" + fill_out_your_profile: "프로필 채우기" find_friends: "친구 찾기" find_friends_from_facebook: "페이스북에서 친구 찾기" finished: "완료!" follow_your_interests: "내 관심사 팔로우하기" hashtag_explanation: "해시태그로 내 관심사에 대해 말하거나 팔로우할 수 있습니다. 디아스포라에서 새로운 사람들을 찾을 수 있는 또 하나의 훌륭한 방법입니다." - profile_description: "내 프로필 정보를 채우면 사람들이 나를 찾기가 더욱 쉬워집니다." + profile_description: "프로필을 채우면 누군가가 나를 더 쉽게 찾을 수 있습니다." profile_fields: bio: "자기소개" birthday: "생일" @@ -770,7 +770,7 @@ ko: photo: "사진" tags: "태그" see_all_featured_users: "모든 추천 사용자 보기" - welcome: "디아스포라에 오신걸 환영합니다!" + welcome: "환영합니다!" welcome_with_name: "%{name}님 환영합니다!" public: does_not_exist: "%{username}님을 찾을 수 없습니다!" From 6f20e11a676e96bc64a2c21025892d2cd4116760 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 18 Aug 2011 19:09:20 -0700 Subject: [PATCH 121/133] better invite emails wip --- app/controllers/invitations_controller.rb | 2 +- app/models/invitation.rb | 2 +- app/views/devise/mailer/_inviters.haml | 12 ++++---- ...nvites.erb => invitation_instructions.erb} | 28 +++++++++++++++++++ .../mailer/invitation_instructions.haml | 22 --------------- 5 files changed, 35 insertions(+), 31 deletions(-) rename app/views/devise/mailer/{_batch_invites.erb => invitation_instructions.erb} (94%) delete mode 100644 app/views/devise/mailer/invitation_instructions.haml diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 7b070c1c8..1046e247b 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -23,7 +23,7 @@ class InvitationsController < Devise::InvitationsController #NOTE should we try and find users by email here? probs aspect = current_user.aspects.find(aspect_id) - invites = Invitation.batch_invite(emails, :sender => current_user, :aspect => aspect, :service => 'email') + invites = Invitation.batch_invite(emails, :message => message, :sender => current_user, :aspect => aspect, :service => 'email') flash[:notice] = extract_messages(invites) diff --git a/app/models/invitation.rb b/app/models/invitation.rb index c75375dab..d088458e0 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -8,7 +8,7 @@ class Invitation < ActiveRecord::Base belongs_to :recipient, :class_name => 'User' belongs_to :aspect - attr_accessible :sender, :recipient, :aspect, :service, :identifier, :admin + attr_accessible :sender, :recipient, :aspect, :service, :identifier, :admin, :message before_validation :set_email_as_default_service diff --git a/app/views/devise/mailer/_inviters.haml b/app/views/devise/mailer/_inviters.haml index 88046fe46..b4c1f12d9 100644 --- a/app/views/devise/mailer/_inviters.haml +++ b/app/views/devise/mailer/_inviters.haml @@ -1,11 +1,9 @@ -%p - - if @invs.count == 1 - = t('.has_invited_you', :name => @invs.first.sender.name + " (#{@invs.first.sender.diaspora_handle})") - - else - = t('.have_invited_you', :names => (@invs.map{|inv| inv.sender.name + " (#{inv.sender.diaspora_handle})"}.join(","))) - = t('.accept_at', :url => root_url) +- if @invs.count == 1 + = person_image_link(@invs.first.sender.person, :size => :thumb_small) + = t('.has_invited_you', :name => @invs.first.sender.name + " (#{@invs.first.sender.diaspora_handle})") +- else + = t('.have_invited_you', :names => (@invs.map{|inv| inv.sender.name + " (#{inv.sender.diaspora_handle})"}.to_sentence)) - @invs.each do |inv| - unless inv.message.blank? = "#{inv.sender.name}:" = "\"#{inv.message}\"" - %p diff --git a/app/views/devise/mailer/_batch_invites.erb b/app/views/devise/mailer/invitation_instructions.erb similarity index 94% rename from app/views/devise/mailer/_batch_invites.erb rename to app/views/devise/mailer/invitation_instructions.erb index 600fa306b..598ad585a 100644 --- a/app/views/devise/mailer/_batch_invites.erb +++ b/app/views/devise/mailer/invitation_instructions.erb @@ -1,3 +1,6 @@ + + Accept Your Diaspora* Invite! +

Email not displaying correctly? View it in your browser

+ + + + + + + + + + + + + <% if @resource.invitations_to_me.any?{|x| !x.admin?} %> + <% @invs = @resource.invitations_to_me %> + + + + <% end %> + + + +
@@ -10,14 +13,38 @@
Finally - it's here.
+ <%= render :partial => 'devise/mailer/inviters' %> +
The social network you have been waiting for has arrived. Revamped, more secure, and more fun, DIASPORA* is ready to help you share and explore the web in a whole new way.
@@ -124,3 +151,4 @@
+ diff --git a/app/views/devise/mailer/invitation_instructions.haml b/app/views/devise/mailer/invitation_instructions.haml deleted file mode 100644 index b945d898f..000000000 --- a/app/views/devise/mailer/invitation_instructions.haml +++ /dev/null @@ -1,22 +0,0 @@ -- @invs = @resource.invitations_to_me --unless @invs.first.admin? - !!! - %html - %head - %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - = render :partial => 'notifier/notifier_css' - %body - %header - = image_tag AppConfig[:pod_url] + 'images/logo_caps.png' - #container - %p - = t('devise.mailer.welcome', :email => @resource.email) - = render :partial => 'inviters' - - %p= link_to t('.accept'), accept_invitation_url(@resource, :invitation_token => @resource.invitation_token), :class => "large_text" - %p.small - = t('.ignore') - %br/ - = t('.no_account_till') --else - = render :partial => 'devise/mailer/batch_invites' From fe78a69161897efdb555142f18ae8751cf694e0d Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Fri, 19 Aug 2011 12:15:04 -0700 Subject: [PATCH 122/133] combine invitation emails --- app/helpers/notifier_helper.rb | 9 +++ app/views/devise/mailer/_inviter.erb | 18 ++++++ app/views/devise/mailer/_inviters.haml | 9 --- .../devise/mailer/invitation_instructions.erb | 56 ++++++++++++++----- config/locales/devise/devise.en.yml | 4 +- 5 files changed, 72 insertions(+), 24 deletions(-) create mode 100644 app/views/devise/mailer/_inviter.erb delete mode 100644 app/views/devise/mailer/_inviters.haml diff --git a/app/helpers/notifier_helper.rb b/app/helpers/notifier_helper.rb index 3f841fdb5..71784a324 100644 --- a/app/helpers/notifier_helper.rb +++ b/app/helpers/notifier_helper.rb @@ -23,4 +23,13 @@ module NotifierHelper text = process_newlines(text) if opts[:process_newlines] text end + + def invite_email_title + names = @invites.collect{|x| x.sender.person.name}.uniq + if @invites.empty? && names.empty? + "Accept Your Diaspora* invite!" + else + "#{names.to_sentence} invited you to Diaspora*" + end + end end diff --git a/app/views/devise/mailer/_inviter.erb b/app/views/devise/mailer/_inviter.erb new file mode 100644 index 000000000..cc058942b --- /dev/null +++ b/app/views/devise/mailer/_inviter.erb @@ -0,0 +1,18 @@ + + + + + + + +
+ + + <%= t('.has_invited_you', :name => invite.sender.name + " (#{invite.sender.diaspora_handle})") %>
+ + <% unless invite.message.blank? %> + "<%= invite.message %>" + <% end %> + +
+ diff --git a/app/views/devise/mailer/_inviters.haml b/app/views/devise/mailer/_inviters.haml deleted file mode 100644 index b4c1f12d9..000000000 --- a/app/views/devise/mailer/_inviters.haml +++ /dev/null @@ -1,9 +0,0 @@ -- if @invs.count == 1 - = person_image_link(@invs.first.sender.person, :size => :thumb_small) - = t('.has_invited_you', :name => @invs.first.sender.name + " (#{@invs.first.sender.diaspora_handle})") -- else - = t('.have_invited_you', :names => (@invs.map{|inv| inv.sender.name + " (#{inv.sender.diaspora_handle})"}.to_sentence)) -- @invs.each do |inv| - - unless inv.message.blank? - = "#{inv.sender.name}:" - = "\"#{inv.message}\"" diff --git a/app/views/devise/mailer/invitation_instructions.erb b/app/views/devise/mailer/invitation_instructions.erb index 598ad585a..502cced49 100644 --- a/app/views/devise/mailer/invitation_instructions.erb +++ b/app/views/devise/mailer/invitation_instructions.erb @@ -1,5 +1,7 @@ + +<% @invites = Invitation.includes(:sender =>{:person => :profile}).where(:admin => false)%> - Accept Your Diaspora* Invite! + <%=invite_email_title %>

Email not displaying correctly? View it in your browser

@@ -19,7 +21,6 @@ - Finally - it's here.
@@ -33,15 +34,6 @@ - <% if @resource.invitations_to_me.any?{|x| !x.admin?} %> - <% @invs = @resource.invitations_to_me %> - - - <%= render :partial => 'devise/mailer/inviters' %> - - - <% end %> - @@ -52,6 +44,46 @@ Sign up now → + + <% unless @invites.blank? %> + <% @invites_with_message, @invites_without_message = @invites.partition{|x| !x.message.blank?} %> + <% unless @invites_with_message.empty? %> + + +
+ What your friends are saying...
+ + + + <% @invites_with_message.each do |i| %> + + <%= render(:partial => 'devise/mailer/inviter', :locals => {:invite => i}) %> + + <% end %> + <% end %> + + <% unless @invites_without_message.empty? %> + + + +
+ Even more people are excited to see you!
+ + + + <% @invites_without_message.each do |i| %> + + <%= render(:partial => 'devise/mailer/inviter', :locals => {:invite => i}) %> + + <% end %> + + <% end %> + <% end %> + + + + + 1. Get Connected @@ -150,5 +182,3 @@ - - diff --git a/config/locales/devise/devise.en.yml b/config/locales/devise/devise.en.yml index c920bf1de..fcca12c35 100644 --- a/config/locales/devise/devise.en.yml +++ b/config/locales/devise/devise.en.yml @@ -77,8 +77,8 @@ en: accept: "Accept invitation" ignore: "If you don't want to accept the invitation, please ignore this email." no_account_till: "Your account won't be created until you access the link above and sign up." - inviters: - has_invited_you: "%{name} has invited you to join Diaspora" + inviter: + has_invited_you: "%{name}" have_invited_you: "%{names} have invited you to join Diaspora" accept_at: "at %{url}, you can accept it through the link below." shared: From 3cee58939717e1bcc5c2e39118877f0e04669412 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Fri, 19 Aug 2011 13:58:22 -0700 Subject: [PATCH 123/133] show only invites from a user --- app/views/devise/mailer/invitation_instructions.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/devise/mailer/invitation_instructions.erb b/app/views/devise/mailer/invitation_instructions.erb index 502cced49..34f2f3723 100644 --- a/app/views/devise/mailer/invitation_instructions.erb +++ b/app/views/devise/mailer/invitation_instructions.erb @@ -1,5 +1,4 @@ - -<% @invites = Invitation.includes(:sender =>{:person => :profile}).where(:admin => false)%> +<% @invites = @resource.invitations_to_me.includes(:sender =>{:person => :profile}).where(:admin => false)%> <%=invite_email_title %> From e100032244fec9de9cd143bead7a3e36bc8b30f3 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Fri, 19 Aug 2011 13:59:41 -0700 Subject: [PATCH 124/133] add all in the query, to be more pedantic --- app/views/devise/mailer/invitation_instructions.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/devise/mailer/invitation_instructions.erb b/app/views/devise/mailer/invitation_instructions.erb index 34f2f3723..fb443a746 100644 --- a/app/views/devise/mailer/invitation_instructions.erb +++ b/app/views/devise/mailer/invitation_instructions.erb @@ -1,4 +1,4 @@ -<% @invites = @resource.invitations_to_me.includes(:sender =>{:person => :profile}).where(:admin => false)%> +<% @invites = @resource.invitations_to_me.includes(:sender =>{:person => :profile}).where(:admin => false).all%> <%=invite_email_title %> From 834c75894c1e36016469991e719535193d2cc8aa Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Fri, 19 Aug 2011 14:42:03 -0700 Subject: [PATCH 125/133] jasmine is green again --- spec/javascripts/publisher-spec.js | 31 ++++++++++------------------ spec/javascripts/support/jasmine.yml | 1 + 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/spec/javascripts/publisher-spec.js b/spec/javascripts/publisher-spec.js index 56894f794..a386819d9 100644 --- a/spec/javascripts/publisher-spec.js +++ b/spec/javascripts/publisher-spec.js @@ -35,6 +35,7 @@ describe("Publisher", function() { describe("bindAspectToggles", function() { beforeEach( function(){ spec.loadFixture('status_message_new'); + Publisher.open(); }); it('gets called on initialize', function(){ @@ -44,40 +45,30 @@ describe("Publisher", function() { }); it('toggles removed only on the clicked icon', function(){ - expect($("#publisher .aspect_badge").first().hasClass("removed")).toBeFalsy(); - expect($("#publihser .aspect_badge").last().hasClass("removed")).toBeFalsy(); + Publisher.initialize(); + + expect($("#publisher .dropdown .dropdown_list li").first().hasClass("selected")).toBeTruthy(); + expect($("#publihser .dropdown .dropdown_list li").last().hasClass("selected")).toBeFalsy(); Publisher.bindAspectToggles(); - $("#publisher .aspect_badge").last().click(); + $("#publisher .dropdown .dropdown_list li").last().click(); - expect($("#publisher .aspect_badge").first().hasClass("removed")).toBeFalsy(); - expect($("#publisher .aspect_badge").last().hasClass("removed")).toBeTruthy(); + expect($("#publisher .dropdown .dropdown_list li").first().hasClass("selected")).toBeTruthy(); + expect($("#publisher .dropdown .dropdown_list li").last().hasClass("selected")).toBeTruthy(); }); it('binds to the services icons and toggles the hidden field', function(){ spyOn(Publisher, 'toggleAspectIds'); Publisher.bindAspectToggles(); - var aspBadge = $("#publisher .aspect_badge a").last(); - var aspNum = aspBadge.attr('data-guid'); + var aspBadge = $("#publisher .dropdown .dropdown_list li").last(); + var aspNum = aspBadge.attr('data-aspect_id'); aspBadge.click(); expect(Publisher.toggleAspectIds).toHaveBeenCalledWith(aspNum); }); - it('does not execute if it is the last non-removed aspect', function(){ - var aspects = $("#publisher .aspect_badge").length; - spyOn(Publisher, 'toggleAspectIds'); - - Publisher.bindAspectToggles(); - spyOn(window, 'alert');// click through the dialog if it happens - $("#publisher .aspect_badge a").each(function(){$(this).click()}); - - var lastAspectNum = $("#publisher .aspect_badge a").last().attr('data-guid'); - - expect($("#publisher .aspect_badge.removed").length).toBe(aspects-1); - expect(Publisher.toggleAspectIds.callCount).toBe(1); - }); }); + describe('toggleAspectIds', function(){ beforeEach( function(){ spec.loadFixture('status_message_new'); diff --git a/spec/javascripts/support/jasmine.yml b/spec/javascripts/support/jasmine.yml index a17b09bcd..80ad20767 100644 --- a/spec/javascripts/support/jasmine.yml +++ b/spec/javascripts/support/jasmine.yml @@ -42,6 +42,7 @@ src_files: - public/javascripts/validation.js - public/javascripts/rails.js - public/javascripts/aspect-filters.js + - public/javascripts/aspects-dropdown.js - public/javascripts/content-updater.js - public/javascripts/tag-followings.js # stylesheets From 32368a16dd9258859589699369d4a107d11b1fde Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 19 Aug 2011 15:55:27 -0700 Subject: [PATCH 126/133] Make latest migration postgres compatible --- .../20110818212541_add_identifier_to_existing_invitations.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/migrate/20110818212541_add_identifier_to_existing_invitations.rb b/db/migrate/20110818212541_add_identifier_to_existing_invitations.rb index 1471552fc..02c2524f0 100644 --- a/db/migrate/20110818212541_add_identifier_to_existing_invitations.rb +++ b/db/migrate/20110818212541_add_identifier_to_existing_invitations.rb @@ -1,6 +1,7 @@ class AddIdentifierToExistingInvitations < ActiveRecord::Migration + class Invitation < ActiveRecord::Base; end def self.up - execute < Date: Wed, 17 Aug 2011 19:20:42 -0700 Subject: [PATCH 127/133] wip --- app/controllers/services_controller.rb | 35 ++++++++++++++------- app/models/invitation.rb | 18 ++++++++++- app/models/service_user.rb | 8 +++++ app/views/services/_remote_friend.html.haml | 3 +- public/javascripts/contact-edit.js | 23 ++++++++++++-- 5 files changed, 71 insertions(+), 16 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 9c3386944..43ac6fc22 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -57,29 +57,40 @@ class ServicesController < ApplicationController @uid = params[:uid] if i_id = params[:invitation_id] - invited_user = Invitation.find(i_id).recipient + invite = Invitation.find(i_id) + invited_user = invite.recipient else invite = Invitation.create(:service => params[:provider], :identifier => @uid, :sender => current_user, :aspect => current_user.aspects.find(params[:aspect_id])) invited_user = invite.attach_recipient! end - @subject = t('services.inviter.join_me_on_diaspora') - @message = < invited_user.invitation_token)} -MSG - + #to make sure a friend you just invited from facebook shows up as invited service = current_user.services.where(:type => "Services::Facebook").first su = ServiceUser.where(:service_id => service.id, :uid => @uid).first su.attach_local_models su.save - url = "https://www.facebook.com/?compose=1&id=#{@uid}&subject=#{@subject}&message=#{@message}&sk=messages" respond_to do |format| - format.html{ redirect_to url } - format.json{ render :json => {:url => url} } + format.json{ render :json => invite_redirect_url(invite, invited_user, su) } + end + end + + def facebook_message_url(user, facebook_uid) + subject = t('services.inviter.join_me_on_diaspora') + message = < user.invitation_token)} +MSG + "https://www.facebook.com/?compose=1&id=#{facebook_uid}&subject=#{subject}&message=#{message}&sk=messages" + end + + def invite_redirect_url(invite, user, service_user) + if invite.email_like_identifer + {:message => t("invitations.create.sent") + service_user.name } + else + {:url => facebook_message_url(user, service_user.uid)} end end end diff --git a/app/models/invitation.rb b/app/models/invitation.rb index d088458e0..4875c521e 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -61,7 +61,7 @@ class Invitation < ActiveRecord::Base # @return [Boolean] # @return [void] def skip_email? - self.service != 'email' + !email_like_identifer end # Attach a recipient [User] to the [Invitation] unless @@ -115,6 +115,22 @@ class Invitation < ActiveRecord::Base end end end + + # @return [String] + def email_like_identifer + case self.service + when 'email' + self.identifier + when 'facebook' + if username = ServiceUser.username_of_service_user_by_uid(self.identifier) + unless username.include?('profile.php?') + "#{username}@facebook.com" + else + nil + end + end + end + end def queue_send! unless self.recipient.present? diff --git a/app/models/service_user.rb b/app/models/service_user.rb index 7157d26c1..a13c74d9c 100644 --- a/app/models/service_user.rb +++ b/app/models/service_user.rb @@ -18,6 +18,14 @@ class ServiceUser < ActiveRecord::Base self.person_id.present? end + def self.username_of_service_user_by_uid(uid) + if su = ServiceUser.find_by_uid(uid) + su.username + else + nil + end + end + def attach_local_models service_for_uid = Services::Facebook.where(:type => service.type.to_s, :uid => self.uid).first if !service_for_uid.blank? && (service_for_uid.user.person.profile.searchable) diff --git a/app/views/services/_remote_friend.html.haml b/app/views/services/_remote_friend.html.haml index db4a668c0..ad9ad73b7 100644 --- a/app/views/services/_remote_friend.html.haml +++ b/app/views/services/_remote_friend.html.haml @@ -2,7 +2,8 @@ .right - if friend.already_invited? - = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id) + .button.resend + = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id, :format => :json) - elsif friend.on_diaspora? = render 'shared/aspect_dropdown', :selected_aspects => contact_proxy(friend).aspects, :person => friend.person, :hang => 'left' - else diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index cb4a1d7ac..9cbf94eb6 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -8,6 +8,14 @@ var ContactEdit = { $('.dropdown.aspect_membership .dropdown_list > li').live('click', function(evt){ ContactEdit.processClick($(this), evt); }); + $('.button.resend').live('click', function(evt){ + evt.preventDefault(); + $.post($(this).href, {}, + function(data){ + console.log(data); + ContactEdit.processSuccess($(this), evt, data) + }); + }); }, processClick: function(li, evt){ @@ -26,11 +34,22 @@ var ContactEdit = { "aspect_id" : li.data("aspect_id"), "uid" : li.parent().data("service_uid") }, function(data){ - li.removeClass('loading') - window.location = data.url; + processSuccess(li, evt, data); }); }, + processSuccess: function(element, evt, data) { + element.removeClass('loading') + + if (data.url != undefined) { + window.location = data.url; + } else { + element.toggleClass("selected"); + + Diaspora.widgets.flashes.render({'success':true, 'notice':data.message}); + } + }, + toggleAspectMembership: function(li, evt) { var button = li.find('.button'); if(button.hasClass('disabled') || li.hasClass('newItem')){ return; } From e4062bf5fd03481f1e4a21da034120f1d9c23701 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 18 Aug 2011 12:29:51 -0700 Subject: [PATCH 128/133] now functionally correct --- app/controllers/services_controller.rb | 13 +++++++++++-- app/views/services/_remote_friend.html.haml | 3 +-- public/javascripts/contact-edit.js | 18 +++++++++--------- public/stylesheets/sass/application.sass | 7 +++++++ 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 43ac6fc22..3e96a1a74 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -71,7 +71,8 @@ class ServicesController < ApplicationController su.save respond_to do |format| - format.json{ render :json => invite_redirect_url(invite, invited_user, su) } + format.html{ invite_redirect_url(invite, invited_user, su)} + format.json{ render :json => invite_redirect_json(invite, invited_user, su) } end end @@ -86,11 +87,19 @@ MSG "https://www.facebook.com/?compose=1&id=#{facebook_uid}&subject=#{subject}&message=#{message}&sk=messages" end - def invite_redirect_url(invite, user, service_user) + def invite_redirect_json(invite, user, service_user) if invite.email_like_identifer {:message => t("invitations.create.sent") + service_user.name } else {:url => facebook_message_url(user, service_user.uid)} end end + + def invite_redirect_url(invite, user, service_user) + if invite.email_like_identifer + redirect_to(friend_finder_path(:provider => 'facebook'), :notice => "you re-invited #{service_user.name}") + else + redirect_to(facebook_message_url(user, service_user.uid)) + end + end end diff --git a/app/views/services/_remote_friend.html.haml b/app/views/services/_remote_friend.html.haml index ad9ad73b7..86abd04ed 100644 --- a/app/views/services/_remote_friend.html.haml +++ b/app/views/services/_remote_friend.html.haml @@ -2,8 +2,7 @@ .right - if friend.already_invited? - .button.resend - = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id, :format => :json) + = link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id), :class => 'button resend' - elsif friend.on_diaspora? = render 'shared/aspect_dropdown', :selected_aspects => contact_proxy(friend).aspects, :person => friend.person, :hang => 'left' - else diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index 9cbf94eb6..2e09fac6a 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -8,14 +8,14 @@ var ContactEdit = { $('.dropdown.aspect_membership .dropdown_list > li').live('click', function(evt){ ContactEdit.processClick($(this), evt); }); - $('.button.resend').live('click', function(evt){ - evt.preventDefault(); - $.post($(this).href, {}, - function(data){ - console.log(data); - ContactEdit.processSuccess($(this), evt, data) - }); - }); + // $('.button.resend').live('click', function(evt){ + // evt.preventDefault(); + // $.post($(this).href, {}, + // function(data){ + // console.log(data); + // ContactEdit.processSuccess($(this), evt, data) + // }); + // }); }, processClick: function(li, evt){ @@ -34,7 +34,7 @@ var ContactEdit = { "aspect_id" : li.data("aspect_id"), "uid" : li.parent().data("service_uid") }, function(data){ - processSuccess(li, evt, data); + ContactEdit.processSuccess(li, evt, data); }); }, diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 78026adb1..cbbcf9df8 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3397,3 +3397,10 @@ ul#getting_started .green :color green +// .resend +// :color black +// &:hover +// :text-decoration none +// :color black +// &:hover +// :text-decoration none From bb5ada6533abec59a93f0415ce14e71422994444 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Fri, 19 Aug 2011 15:27:51 -0700 Subject: [PATCH 129/133] create a wrapper class for devise mailer, both so we can resquify it and so we can inject helpers --- app/mailers/diaspora_devise_mailer.rb | 5 +++++ config/initializers/devise.rb | 13 +++---------- public/javascripts/contact-edit.js | 3 ++- 3 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 app/mailers/diaspora_devise_mailer.rb diff --git a/app/mailers/diaspora_devise_mailer.rb b/app/mailers/diaspora_devise_mailer.rb new file mode 100644 index 000000000..39a34b2bf --- /dev/null +++ b/app/mailers/diaspora_devise_mailer.rb @@ -0,0 +1,5 @@ +class DiasporaDeviseMailer < DeviseMailer + include NotifierHelper + default :from => AppConfig[:smtp_sender_address] + +end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 65beed6da..718bfd33f 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -15,21 +15,14 @@ end Devise.setup do |config| # Configure the e-mail address which will be shown in DeviseMailer. - if AppConfig[:smtp_sender_address] - config.mailer_sender = AppConfig[:smtp_sender_address] - else - unless Rails.env == 'test' - Rails.logger.warn("No smtp sender address set, mail may fail.") - puts "WARNING: No smtp sender address set, mail may fail." - end - config.mailer_sender = "please-change-me@config-initializers-devise.com" - end - # ==> ORM configuration # Load and configure the ORM. Supports :active_record (default), :mongoid # (bson_ext recommended) and :data_mapper (experimental). require 'devise/orm/active_record' + # Configure the class responsible to send e-mails. + config.mailer = "DiasporaDeviseMailer" + # ==> Configuration for any authentication mechanism # Configure which keys are used when authenticating an user. By default is # just :email. You can configure it to use [:username, :subdomain], so for diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index 2e09fac6a..2d8d49ece 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -5,7 +5,7 @@ var ContactEdit = { init: function(){ $.extend(ContactEdit, AspectsDropdown); - $('.dropdown.aspect_membership .dropdown_list > li').live('click', function(evt){ + $('.dropdown.aspect_membership .dropdown_list > li, .dropdown.inviter .dropdown_list >li').live('click', function(evt){ ContactEdit.processClick($(this), evt); }); // $('.button.resend').live('click', function(evt){ @@ -23,6 +23,7 @@ var ContactEdit = { li.addClass('loading'); if (dropdown.hasClass('inviter')) { ContactEdit.inviteFriend(li, evt); + dropdown.html('sending, please wait...'); } else { ContactEdit.toggleAspectMembership(li, evt); From 735a37ffe02b91bad7a5897401ee05936f852216 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Fri, 19 Aug 2011 15:55:21 -0700 Subject: [PATCH 130/133] really basic preventivie mesures for facebook friending. we need to GO ALL THE WAY and proxy facebook users to be in many aspects --- app/mailers/diaspora_devise_mailer.rb | 2 +- app/views/devise/mailer/invitation_instructions.erb | 8 -------- public/javascripts/contact-edit.js | 3 +-- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/app/mailers/diaspora_devise_mailer.rb b/app/mailers/diaspora_devise_mailer.rb index 39a34b2bf..3ec4cbb63 100644 --- a/app/mailers/diaspora_devise_mailer.rb +++ b/app/mailers/diaspora_devise_mailer.rb @@ -1,4 +1,4 @@ -class DiasporaDeviseMailer < DeviseMailer +class DiasporaDeviseMailer < Devise::Mailer include NotifierHelper default :from => AppConfig[:smtp_sender_address] diff --git a/app/views/devise/mailer/invitation_instructions.erb b/app/views/devise/mailer/invitation_instructions.erb index fb443a746..9e27bba76 100644 --- a/app/views/devise/mailer/invitation_instructions.erb +++ b/app/views/devise/mailer/invitation_instructions.erb @@ -17,9 +17,6 @@ - - - Finally - it's here.
@@ -31,11 +28,6 @@ - - - - - The social network you have been waiting for has arrived. Revamped, more secure, and more fun, DIASPORA* is ready to help you share and explore the web in a whole new way.
diff --git a/public/javascripts/contact-edit.js b/public/javascripts/contact-edit.js index 2d8d49ece..3017cda28 100644 --- a/public/javascripts/contact-edit.js +++ b/public/javascripts/contact-edit.js @@ -41,12 +41,11 @@ var ContactEdit = { processSuccess: function(element, evt, data) { element.removeClass('loading') - + element.parent().parent().html('sent!'); if (data.url != undefined) { window.location = data.url; } else { element.toggleClass("selected"); - Diaspora.widgets.flashes.render({'success':true, 'notice':data.message}); } }, From a74080e27d676b7a08052d312c334a7d23460ac1 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Fri, 19 Aug 2011 16:52:26 -0700 Subject: [PATCH 131/133] Fix ServicesController spec --- app/views/services/finder.html.haml | 1 - spec/controllers/services_controller_spec.rb | 14 ++------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/app/views/services/finder.html.haml b/app/views/services/finder.html.haml index 53d86ab95..e76190e31 100644 --- a/app/views/services/finder.html.haml +++ b/app/views/services/finder.html.haml @@ -27,4 +27,3 @@ %br %h4 = link_to t('services.index.connect_to_facebook'), '/auth/facebook' - diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index 8012c880c..289e63f32 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -99,7 +99,7 @@ describe ServicesController do it 'has no translations missing' do get :finder, :provider => @service1.provider - response.body.match(/translation/).should be_nil + Nokogiri(response.body).css('.translation_missing').should be_empty end end @@ -119,16 +119,6 @@ describe ServicesController do put :inviter, @invite_params end - it 'sets the subject' do - put :inviter, @invite_params - assigns[:subject].should_not be_nil - end - - it 'sets a message containing the invitation link' do - put :inviter, @invite_params - assigns[:message].should include(User.last.invitation_token) - end - it 'redirects to a prefilled facebook message url' do put :inviter, @invite_params response.location.should match(/https:\/\/www\.facebook\.com\/\?compose=1&id=.*&subject=.*&message=.*&sk=messages/) @@ -156,7 +146,7 @@ describe ServicesController do }.should_not change(Invitation, :count) end - it 'disregares the amount of invites if open_invitations are enabled' do + it 'disregards the amount of invites if open_invitations are enabled' do open_bit = AppConfig[:open_invitations] AppConfig[:open_invitations] = true From 234af2a15b88427fe08ad475e737c0692a953243 Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Fri, 19 Aug 2011 23:57:33 -0300 Subject: [PATCH 132/133] Fixing some tests that weren't testing correctly These assertions were always returning true even if you dont populate the flash, because nil.should_not be_empty returns true --- spec/controllers/aspect_memberships_controller_spec.rb | 2 +- spec/controllers/invitations_controller_spec.rb | 2 +- spec/controllers/profiles_controller_spec.rb | 2 +- spec/controllers/registrations_controller_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/controllers/aspect_memberships_controller_spec.rb b/spec/controllers/aspect_memberships_controller_spec.rb index e94bad8dc..a4f895bbc 100644 --- a/spec/controllers/aspect_memberships_controller_spec.rb +++ b/spec/controllers/aspect_memberships_controller_spec.rb @@ -59,7 +59,7 @@ describe AspectMembershipsController do :format => 'js', :person_id => @person.id, :aspect_id => @aspect0.id - flash[:error].should_not be_empty + flash[:error].should_not be_blank end it 'does not 500 on a duplicate key error' do diff --git a/spec/controllers/invitations_controller_spec.rb b/spec/controllers/invitations_controller_spec.rb index dc1b3fdad..21ad1da4a 100644 --- a/spec/controllers/invitations_controller_spec.rb +++ b/spec/controllers/invitations_controller_spec.rb @@ -162,7 +162,7 @@ describe InvitationsController do it 'displays a message that tells the user how many invites were sent, and which REJECTED' do post :create, :user => @invite.merge( :email => "mbs@gmail.com, foo@bar.com, foo.com, lala@foo, cool@bar.com") - flash[:notice].should_not be_empty + flash[:notice].should_not be_blank flash[:notice].should =~ /foo\.com/ flash[:notice].should =~ /lala@foo/ end diff --git a/spec/controllers/profiles_controller_spec.rb b/spec/controllers/profiles_controller_spec.rb index 4f40af60c..28da2f5ca 100644 --- a/spec/controllers/profiles_controller_spec.rb +++ b/spec/controllers/profiles_controller_spec.rb @@ -39,7 +39,7 @@ describe ProfilesController do :first_name => "Will", :last_name => "Smith" } - flash[:notice].should_not be_empty + flash[:notice].should_not be_blank end it 'sets tags' do diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 6954f23c4..e8c51962c 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -61,7 +61,7 @@ describe RegistrationsController do it "sets the flash" do get :create, @valid_params - flash[:notice].should_not be_empty + flash[:notice].should_not be_blank end it "redirects to the home path" do From f1cf81772b54efdc371a80daf0ea6d19e183527e Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Sat, 20 Aug 2011 15:51:39 -0300 Subject: [PATCH 133/133] Closes #1386. On conversations, disable Reply button once pressed --- app/views/conversations/_show.haml | 2 +- config/locales/diaspora/en.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/conversations/_show.haml b/app/views/conversations/_show.haml index 43623aae6..29e37e36a 100644 --- a/app/views/conversations/_show.haml +++ b/app/views/conversations/_show.haml @@ -29,4 +29,4 @@ = form_for [conversation, Message.new] do |message| = message.text_area :text, :rows => 5, :tabindex => 1 .right - = message.submit t('.reply').capitalize, :class => 'button creation', :tabindex => 2 + = message.submit t('.reply').capitalize, :disable_with => t('.replying'), :class => 'button creation', :tabindex => 2 diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 700fb2585..9b3397fab 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -233,6 +233,7 @@ en: inbox: "Inbox" show: reply: "reply" + replying: "Replying..." delete: "delete and block conversation" new: to: "to"