bigdir/app/helpers/open_source_projects_helper.rb

58 lines
2.2 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-05-15 10:05:05 +08:00
def show_origin(url)
end
2014-05-22 17:04:45 +08:00
def show_description(bug, open_source_project)
description = BugToOsp.where("osp_id = ? and relative_memo_id = ?", open_source_project.id, bug.id).first.description
if description.nil? || description == ''
description = open_source_project.name + l(:label_bug)
end
description
end
def show_description_of_bug(bug)
description = bug.description
if description.nil? || description == ''
description = bug.open_source_project.name + l(:label_bug)
end
description
end
2014-03-29 10:57:36 +08:00
end