From 5f9a6aa0c1eba2c12aad06be691ccefa3372d3e3 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Tue, 25 Aug 2015 16:34:51 -0700 Subject: [PATCH] fixes #2465: Switch Twitter cards to use summary card+image --- Gemfile.lock | 3 +++ app/models/post.rb | 2 +- app/views/posts/show.html.erb | 9 +++++---- config/danbooru_default_config.rb | 4 ++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9f360122b..f61479045 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -384,3 +384,6 @@ DEPENDENCIES vcr webmock whenever + +BUNDLED WITH + 1.10.0 diff --git a/app/models/post.rb b/app/models/post.rb index 657a5e179..b1201b32f 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -184,7 +184,7 @@ class Post < ActiveRecord::Base end def twitter_card_supported? - image_width.to_i >= 280 && image_height.to_i >= 150 + image_width.to_i >= 280 && image_height.to_i >= 150 && file_size <= 1.megabyte end def has_large? diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index dfb486e18..9d224943c 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -163,10 +163,11 @@ <% if @post.twitter_card_supported? %> - - - - + + + + + <% end %> <% end %> diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index 5ade06b0c..4b02dd46f 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -392,5 +392,9 @@ module Danbooru false end end + + def twitter_site + "@teruyo" + end end end