From 8600265f00bccd46a318637e208067796c6dc794 Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Mon, 21 Apr 2014 08:54:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/open_source_projects_helper.rb | 33 ++++++++++++++++++- app/views/layouts/base_opensource_p.html.erb | 9 +++-- app/views/open_source_projects/index.html.erb | 5 ++- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/app/helpers/open_source_projects_helper.rb b/app/helpers/open_source_projects_helper.rb index 793e1458e..1ae851569 100644 --- a/app/helpers/open_source_projects_helper.rb +++ b/app/helpers/open_source_projects_helper.rb @@ -1,6 +1,6 @@ module OpenSourceProjectsHelper def render_opensource_project(os_projects) - s='' + s=''.html_safe s << "" end + def show_condition(app_dir, language, created_at) + s=''.html_safe + unless app_dir.nil? + s_temp = content_tag('a', app_dir) + temp = link_to 'x', {:controller => "tags", :action => "remove_tag"}, :remote => true + 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 language.nil? + s_temp = content_tag('a', language) + temp = link_to 'x', {:controller => "tags", :action => "remove_tag"}, :remote => true + 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 => "tags", :action => "remove_tag"}, :remote => true + 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') + # s = content_tag('div', s, :class => 'tags') + end + end diff --git a/app/views/layouts/base_opensource_p.html.erb b/app/views/layouts/base_opensource_p.html.erb index a25451544..ce6b7cb22 100644 --- a/app/views/layouts/base_opensource_p.html.erb +++ b/app/views/layouts/base_opensource_p.html.erb @@ -37,7 +37,10 @@ <% end %> - + + <%= link_to request.host()+"/open_source_projects", :controller => 'open_source_projects', :action => 'index' %> + <%= link_to l(:field_homepage), home_path %> > <%= link_to "开源项目社区", :controller => 'open_source_projects', :action => 'index' %> > <%=link_to @open_source_project.name, open_source_project_path(@open_source_project) %> + @@ -119,10 +122,10 @@
-
<% end %> diff --git a/app/views/open_source_projects/index.html.erb b/app/views/open_source_projects/index.html.erb index e83417dbb..6aca9d2d4 100644 --- a/app/views/open_source_projects/index.html.erb +++ b/app/views/open_source_projects/index.html.erb @@ -144,10 +144,9 @@ li {
  • 查找条件>
  • + - <%= @app_dir%> - <%= @language%> - <%= @created_at%> + <%= show_condition(@app_dir, @language, @created_at) %>
  • <%= @os_project_count %> 个开源项目