socialforge/app/helpers/open_source_projects_helper.rb

38 lines
1.6 KiB
Ruby
Raw Normal View History

2014-03-29 10:57:36 +08:00
module OpenSourceProjectsHelper
def show_condition(app_dir, language, created_at, name)
2014-04-21 08:54:11 +08:00
s=''.html_safe
unless app_dir.nil?
s_temp = content_tag('a', app_dir)
temp = link_to 'x', {:controller => "open_source_projects", :action => "remove_condition", :language => language, :created_at => created_at, :name => name}
2014-04-21 08:54:11 +08:00
temp = content_tag('span', temp, :class => 'del')
s_temp << temp
s_temp = content_tag('span', s_temp, :class => 'tag_show')
s << content_tag('div', s_temp, :id => 'tag')
2014-04-21 08:54:11 +08:00
end
unless language.nil?
s_temp = content_tag('a', language)
temp = link_to 'x', {:controller => "open_source_projects", :action => "remove_condition", :app_dir => app_dir, :created_at => created_at, :name => name}
2014-04-21 08:54:11 +08:00
temp = content_tag('span', temp, :class => 'del')
s_temp << temp
s_temp = content_tag('span', s_temp, :class => 'tag_show')
s << content_tag('div', s_temp, :id => 'tag')
end
unless created_at.nil?
s_temp = content_tag('a', created_at)
temp = link_to 'x', {:controller => "open_source_projects", :action => "remove_condition", :app_dir => app_dir, :language => language, :name => name}
2014-04-21 08:54:11 +08:00
temp = content_tag('span', temp, :class => 'del')
s_temp << temp
s_temp = content_tag('span', s_temp, :class => 'tag_show')
s << content_tag('div', s_temp, :id => 'tag')
end
s = content_tag('div', s, :id => 'tags_show')
2014-04-21 08:54:11 +08:00
s = content_tag('div', s, :id => 'tags')
s = content_tag('div', s, :class => 'user_tags')
2014-04-21 08:54:11 +08:00
end
def get_open_source_projects_by_tag(tag_name)
OpenSourceProject.tagged_with(tag_name).order('created_at desc')
end
2014-03-29 10:57:36 +08:00
end