* add share to buffer button * wip * wip * adds listings to buffer via form * create migration for buffered timestamp and update seed file * display when listing was last buffered * remove annoying spacing * refactor article script for listings * social preview wip * add custom social card for indivdual listings * add styling * fix css * tweak styling * final css tweaks * fix branch * add buffer listings id * update envfile * add social previews spec
29 lines
993 B
Ruby
29 lines
993 B
Ruby
class Internal::BufferUpdatesController < Internal::ApplicationController
|
|
def create
|
|
article_id = params[:article_id]
|
|
article = Article.find(article_id) if article_id.present?
|
|
fb_post = params[:fb_post]
|
|
tweet = params[:tweet]
|
|
listing_id = params[:listing_id]
|
|
listing = ClassifiedListing.find(params[:listing_id]) if listing_id.present?
|
|
case params[:social_channel]
|
|
when "main_twitter"
|
|
Bufferizer.new("article", article, tweet).main_tweet!
|
|
render body: nil
|
|
when "satellite_twitter"
|
|
Bufferizer.new("article", article, tweet).satellite_tweet!
|
|
render body: nil
|
|
when "facebook"
|
|
Bufferizer.new("article", article, fb_post).facebook_post!
|
|
render body: nil
|
|
when "listings_twitter"
|
|
Bufferizer.new("listing", listing, tweet).listings_tweet!
|
|
render body: nil
|
|
end
|
|
end
|
|
|
|
def update
|
|
BufferUpdate.upbuff!(params[:id], current_user.id, params[:body_text], params[:status])
|
|
render body: nil
|
|
end
|
|
end
|