Code style fixes

This commit is contained in:
Jyri-Petteri Paloposki 2020-10-10 02:27:42 +03:00
parent c6bbc67dab
commit d8acf60049
72 changed files with 458 additions and 594 deletions

View file

@ -1,7 +1,6 @@
module FeedlistHelper
def linkoptions(format, options)
merge_hashes( {:format => format}, options, user_token_hash)
merge_hashes( { :format => format }, options, user_token_hash)
end
def rss_formatted_link(options = {})
@ -10,25 +9,25 @@ module FeedlistHelper
end
def text_formatted_link(options = {})
link_to(content_tag(:span, 'TXT', {:class => 'feed', :title => "Plain text feed"}), linkoptions('txt', options))
link_to(content_tag(:span, 'TXT', { :class => 'feed', :title => "Plain text feed" }), linkoptions('txt', options))
end
def ical_formatted_link(options = {})
link_to(content_tag(:span, 'iCal', {:class=>"feed", :title => "iCal feed"}), linkoptions('ics', options))
link_to(content_tag(:span, 'iCal', { :class=>"feed", :title => "iCal feed" }), linkoptions('ics', options))
end
def feed_links(feeds, link_options, title)
space = " "
html = ""
html << rss_formatted_link(link_options) +space if feeds.include?(:rss)
html << text_formatted_link(link_options)+space if feeds.include?(:txt)
html << ical_formatted_link(link_options)+space if feeds.include?(:ical)
html << rss_formatted_link(link_options) + space if feeds.include?(:rss)
html << text_formatted_link(link_options) + space if feeds.include?(:txt)
html << ical_formatted_link(link_options) + space if feeds.include?(:ical)
html << title
return html.html_safe
end
def all_feed_links(object, symbol)
feed_links([:rss, :txt, :ical], { :controller=> 'todos', :action => 'index', symbol => object.to_param }, content_tag(:strong, object.name))
feed_links([:rss, :txt, :ical], { :controller => 'todos', :action => 'index', symbol => object.to_param }, content_tag(:strong, object.name))
end
def all_feed_links_for_project(project)
@ -48,6 +47,4 @@ module FeedlistHelper
def user_token_hash
{ :token => current_user.token }
end
end