if a user has a linked twitter account, give them attribution

This commit is contained in:
Carl Chenet 2017-05-23 10:44:20 +02:00
rodzic 04c94e6f19
commit 3f6646d87b
2 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -163,6 +163,10 @@ class StoriesController < ApplicationController
"apple-touch-icon-144.png",
}
if @story.user.twitter_username.present?
@meta_tags["twitter:creator"] = "@" + @story.user.twitter_username
end
load_user_votes
render :action => "show"

Wyświetl plik

@ -25,12 +25,18 @@ Time.now - 1.days).order(:id).each_with_index do |s,x|
tags += ' #' + tagging.tag.tag
end
tco_status = "\n" +
via = ""
if s.user.twitter_username.present?
via = "\n" + (s.user_is_author? ? "by" : "via") +
" @#{s.user.twitter_username}"
end
tco_status = via + "\n" +
(s.url.present?? ("X" * Twitter::TCO_LEN) + "\n" : "") +
("X" * Twitter::TCO_LEN) +
tags
status = "\n" +
status = via + "\n" +
(s.url.present?? s.url + "\n" : "") +
s.short_id_url +
tags