From 74bcc6f06e990e77ca41fc81509e6d0b3dc8a510 Mon Sep 17 00:00:00 2001 From: David Kettler <21echoes@gmail.com> Date: Mon, 7 Nov 2011 21:16:19 -0800 Subject: [PATCH 1/6] now that we have the 'read more' link in the stream, let posts be as long as the mysql character limit --- app/models/status_message.rb | 2 +- spec/models/status_message_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/status_message.rb b/app/models/status_message.rb index 1834c56e5..50fd79ea7 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -14,7 +14,7 @@ class StatusMessage < Post acts_as_taggable_on :tags extract_tags_from :raw_message - validates_length_of :text, :maximum => 10000, :message => I18n.t('status_messages.too_long', :count => 10000) + validates_length_of :text, :maximum => 65535, :message => I18n.t('status_messages.too_long', :count => 65535) xml_name :status_message xml_attr :raw_message diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 698257816..71a908e20 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -114,9 +114,9 @@ describe StatusMessage do db_status.text.should == message end - it 'should require status messages to be less than 10000 characters' do + it 'should require status messages to be less than 65535 characters' do message = '' - 10001.times{message = message +'1'} + 65535.times{message = message +'1'} status = Factory.build(:status_message, :text => message) status.should_not be_valid From e0a9b50c84e1be5180a5721309947ed23b57f6fa Mon Sep 17 00:00:00 2001 From: Pistos Date: Wed, 9 Nov 2011 12:50:10 -0500 Subject: [PATCH 2/6] Remove a comment from the publisher Haml code, so publisher isn't mangled in Firefox 3. "//" is not really proper Haml comment syntax anyway. --- app/views/shared/_publisher.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index dd9403586..35f1e63f4 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -17,7 +17,7 @@ -if publisher_explain :javascript - $(document).ready(function() + $(document).ready(function() { Publisher.triggerGettingStarted(); }); @@ -54,7 +54,6 @@ = 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') - // NOTE(dropdown special casing to DRY up -- taken from the aspect_dropdown partial) .dropdown{:class => "hang_right", :title => popover_with_close_html("2. #{t('shared.public_explain.control_your_audience')}"), 'data-content'=> t('shared.public_explain.visibility_dropdown')} .button.toggle.publisher - if publisher_public From f2997f514667ca090378ca3dd86dc7226b5a7f19 Mon Sep 17 00:00:00 2001 From: Lennart Prelle Date: Wed, 9 Nov 2011 20:38:06 +0100 Subject: [PATCH 3/6] change #newhere to translation --- app/views/shared/_right_sections.html.haml | 2 +- config/locales/diaspora/de.yml | 3 ++- config/locales/diaspora/en.yml | 1 + lib/stream/multi.rb | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/shared/_right_sections.html.haml b/app/views/shared/_right_sections.html.haml index 9aebcb4ea..8a13aaa16 100644 --- a/app/views/shared/_right_sections.html.haml +++ b/app/views/shared/_right_sections.html.haml @@ -27,7 +27,7 @@ %h5 = t('aspects.index.new_here.title') .content - != t('aspects.index.new_here.follow', :link => link_to('#NewHere', tag_path(:name => "NewHere"))) + != t('aspects.index.new_here.follow', :link => link_to("#"+t('shared.publisher.new_user_prefill.newhere'), tag_path(:name => "NewHere"))) %br = link_to(t('aspects.index.new_here.learn_more'), "https://github.com/diaspora/diaspora/wiki/Welcoming-Committee") diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index b1e6256cc..62350935a 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -745,7 +745,8 @@ de: all_contacts: "Alle Kontakte" discard_post: "Beitrag verwerfen" make_public: "veröffentlichen" - new_user_prefill: + new_user_prefill: + newhere: "NeuHier" hello: "Hallo zusammen, ich bin #%{new_user_tag}. " i_like: "Ich interessiere mich für %{tags}." invited_by: "Danke für die Einladung," diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index f47463bf8..347ba269e 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -759,6 +759,7 @@ en: publishing_to: "publishing to: " discard_post: "Discard post" new_user_prefill: + newhere: "NewHere" hello: "Hey everyone, I'm #%{new_user_tag}. " i_like: "I'm interested in %{tags}. " invited_by: "Thanks for the invite, " diff --git a/lib/stream/multi.rb b/lib/stream/multi.rb index 675d0389a..b4963306a 100644 --- a/lib/stream/multi.rb +++ b/lib/stream/multi.rb @@ -49,7 +49,7 @@ class Stream::Multi < Stream::Base # # @return [String] def publisher_prefill - prefill = I18n.t("shared.publisher.new_user_prefill.hello", :new_user_tag => "NewHere") + prefill = I18n.t("shared.publisher.new_user_prefill.hello", :new_user_tag => I18n.t('shared.publisher.new_user_prefill.newhere')) if self.user.followed_tags.size > 0 tag_string = self.user.followed_tags.map{|t| "##{t.name}"}.to_sentence prefill << I18n.t("shared.publisher.new_user_prefill.i_like", :tags => tag_string) From b9c57111f8cc7820b5012ebc120009d21e846fe7 Mon Sep 17 00:00:00 2001 From: Lennart Prelle Date: Wed, 9 Nov 2011 20:40:10 +0100 Subject: [PATCH 4/6] deleted german #newhere translation --- config/locales/diaspora/de.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 62350935a..b1e6256cc 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -745,8 +745,7 @@ de: all_contacts: "Alle Kontakte" discard_post: "Beitrag verwerfen" make_public: "veröffentlichen" - new_user_prefill: - newhere: "NeuHier" + new_user_prefill: hello: "Hallo zusammen, ich bin #%{new_user_tag}. " i_like: "Ich interessiere mich für %{tags}." invited_by: "Danke für die Einladung," From af5c469f1062242779923387f5fe4de141d59be3 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Mon, 7 Nov 2011 23:21:00 +0200 Subject: [PATCH 5/6] Created missing view for mobile bookmarklet. Adjusted status_messages_controller.rb to render it. --- app/controllers/status_messages_controller.rb | 6 +++++- .../status_messages/bookmarklet.mobile.haml | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 app/views/status_messages/bookmarklet.mobile.haml diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index b15a447c2..b66965f5c 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -34,7 +34,11 @@ class StatusMessagesController < ApplicationController @aspects = current_user.aspects @selected_contacts = @aspects.map { |aspect| aspect.contacts }.flatten.uniq @aspect_ids = @aspects.map{|x| x.id} - render :layout => nil + if is_mobile_device? + #render :layout + else + render :layout => nil + end end def create diff --git a/app/views/status_messages/bookmarklet.mobile.haml b/app/views/status_messages/bookmarklet.mobile.haml new file mode 100644 index 000000000..7a3bae975 --- /dev/null +++ b/app/views/status_messages/bookmarklet.mobile.haml @@ -0,0 +1,20 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + += include_javascripts :mobile + +:javascript + $(document).ready(function() + { + var contents = "#{params[:title]} - #{params[:url]}"; + if ("#{params[:notes]}".length > 0){ + contents = contents + " - #{params[:notes]}"; + } + if (contents.length > 0) { + $("#status_message_text").val(contents); + } + }); + += render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids } + From c04bcebfcab1ec14faae224366c608392456f381 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Wed, 9 Nov 2011 22:38:28 +0200 Subject: [PATCH 6/6] Bookmarklet render if statement negated for code simplicity --- app/controllers/status_messages_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index b66965f5c..d10318101 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -34,9 +34,7 @@ class StatusMessagesController < ApplicationController @aspects = current_user.aspects @selected_contacts = @aspects.map { |aspect| aspect.contacts }.flatten.uniq @aspect_ids = @aspects.map{|x| x.id} - if is_mobile_device? - #render :layout - else + if ! is_mobile_device? render :layout => nil end end