Improved opengraph data display

Style fixup
This commit is contained in:
Fábián Tamás László 2013-06-09 21:55:00 +02:00 committed by Jonne Haß
parent c3a76fa886
commit 6e4c1fe3c6
3 changed files with 15 additions and 17 deletions

View file

@ -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

View file

@ -1,10 +1,9 @@
{{#if open_graph_cache}}
<a href="{{open_graph_cache.url}}" target="_blank">
<div>
<h3>{{open_graph_cache.title}}</h3>
<img src="{{open_graph_cache.image}}" />
<strong>{{open_graph_cache.title}}</strong>
<p>{{open_graph_cache.description}}</p>
<br />
</div>
</a>
{{/if}}

View file

@ -45,15 +45,13 @@ module OpenGraphHelper
end
def og_html(cache)
title = cache.title
html =
"<div class=\"og-concent\">" +
"<a class=\"og-link\" href=\"#{cache.url}\">" +
"<img class=\"og-image\" src=\"#{cache.image}\"/>"
"<h1 class=\"og-title\">#{cache.title}</h1>" +
"<p class=\"og-description\">#{cache.description}</p>"
"</a></div>"
return html
"<a href=\"#{cache.url}\" target=\"_blank\">" +
" <div>" +
" <img src=\"#{cache.image}\" />" +
" <strong>#{cache.title}</strong>" +
" <p>#{cache.description}</p>" +
" </div>" +
"</a>"
end
def link_to_oembed_image(cache, prefix = 'thumbnail_')