2014-03-29 10:57:36 +08:00
|
|
|
module OpenSourceProjectsHelper
|
2014-04-22 08:21:35 +08:00
|
|
|
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)
|
2014-04-26 10:42:19 +08:00
|
|
|
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-26 10:42:19 +08:00
|
|
|
|
2014-04-21 08:54:11 +08:00
|
|
|
end
|
|
|
|
unless language.nil?
|
|
|
|
s_temp = content_tag('a', language)
|
2014-04-26 10:42:19 +08:00
|
|
|
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)
|
2014-04-26 10:42:19 +08:00
|
|
|
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
|
2014-04-22 10:16:50 +08:00
|
|
|
s = content_tag('div', s, :id => 'tags_show')
|
2014-04-21 08:54:11 +08:00
|
|
|
s = content_tag('div', s, :id => 'tags')
|
2014-04-22 10:16:50 +08:00
|
|
|
s = content_tag('div', s, :class => 'user_tags')
|
2014-04-21 08:54:11 +08:00
|
|
|
end
|
2014-04-26 10:42:19 +08:00
|
|
|
|
2014-10-30 09:32:33 +08:00
|
|
|
def get_open_source_projects_by_tag(tag_name)
|
|
|
|
OpenSourceProject.tagged_with(tag_name).order('created_at desc')
|
2014-04-26 10:42:19 +08:00
|
|
|
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
|
2014-05-29 20:48:51 +08:00
|
|
|
|
|
|
|
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
|