From 6e4c1fe3c66fef821c6eae1fb8859a5102181259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bi=C3=A1n=20Tam=C3=A1s=20L=C3=A1szl=C3=B3?= Date: Sun, 9 Jun 2013 21:55:00 +0200 Subject: [PATCH] Improved opengraph data display Style fixup --- app/assets/stylesheets/application.css.sass | 13 +++++++------ app/assets/templates/opengraph_tpl.jst.hbs | 3 +-- app/helpers/open_graph_helper.rb | 16 +++++++--------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/application.css.sass b/app/assets/stylesheets/application.css.sass index bcf92ee20..8063466f4 100644 --- a/app/assets/stylesheets/application.css.sass +++ b/app/assets/stylesheets/application.css.sass @@ -1954,22 +1954,23 @@ ul#press_logos :width 100% .opengraph - :float left :width 100% a :display block :text-decoration none :color #000 - :margin-top 10px + :margin 10px 0px 10px 0px :border-top solid 1px #DDD :border-bottom solid 1px #DDD - :padding 10px 0px 10px 0px + :padding 10px 0px 5px 0px + :overflow hidden img - :margin 10px 0px 10px 0px + :margin 0px 5px 5px 0px :float left - br - :clear both + :max-width 155px + .og-title + :margin-bottom 5px .conversation_participants :background diff --git a/app/assets/templates/opengraph_tpl.jst.hbs b/app/assets/templates/opengraph_tpl.jst.hbs index dc4f1fca5..634c6b8d4 100644 --- a/app/assets/templates/opengraph_tpl.jst.hbs +++ b/app/assets/templates/opengraph_tpl.jst.hbs @@ -1,10 +1,9 @@ {{#if open_graph_cache}}
-

{{open_graph_cache.title}}

+ {{open_graph_cache.title}}

{{open_graph_cache.description}}

-
{{/if}} diff --git a/app/helpers/open_graph_helper.rb b/app/helpers/open_graph_helper.rb index 009ee0ed5..3226a5862 100644 --- a/app/helpers/open_graph_helper.rb +++ b/app/helpers/open_graph_helper.rb @@ -45,15 +45,13 @@ module OpenGraphHelper end def og_html(cache) - title = cache.title - html = - "
" + - "" + - "" - "

#{cache.title}

" + - "

#{cache.description}

" - "
" - return html + "" + + "
" + + " " + + " #{cache.title}" + + "

#{cache.description}

" + + "
" + + "
" end def link_to_oembed_image(cache, prefix = 'thumbnail_')