From f9e5dd47f6f2e29f7036712729ee02fec5c808f7 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Fri, 11 Apr 2014 21:56:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/contests_helper.rb | 8 ++++---- app/views/layouts/base_newcontest.html.erb | 2 +- app/views/layouts/base_projects.html.erb | 2 +- app/views/softapplications/show.html.erb | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/helpers/contests_helper.rb b/app/helpers/contests_helper.rb index 00fb5b77..93af48b4 100644 --- a/app/helpers/contests_helper.rb +++ b/app/helpers/contests_helper.rb @@ -62,12 +62,12 @@ module ContestsHelper content = ''.html_safe case state when 0 - content << content_tag('li', link_to(l(:label_sort_by_active), contest_path(:contest_sort_type => '1'))) - content << content_tag('li', link_to(l(:label_sort_by_time), contest_path(:contest_sort_type => '0'), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'contests', action: 'index' ,:contest_sort_type => '1'})) + content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'contests', action: 'index' ,:contest_sort_type => '0'}, :class=>"selected"), :class=>"selected") when 1 - content << content_tag('li', link_to(l(:label_sort_by_active), contest_path(:contest_sort_type => '1'), :class=>"selected"), :class=>"selected") - content << content_tag('li', link_to(l(:label_sort_by_time), contest_path(:contest_sort_type => '0'))) + content << content_tag('li', link_to(l(:label_sort_by_active), {controller: 'contests', action: 'index' ,:contest_sort_type => '1'}, :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), {controller: 'contests', action: 'index' ,:contest_sort_type => '0'})) end content = content_tag('ul', content) content_tag('div', content, :class => "tabs") diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index f41969ea..14598db3 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -92,7 +92,7 @@ <%=link_to "#{@contest.projects.where('is_public=1').count}", :controller => 'contests', :action => 'show_project' %> - <%=link_to "#{@contest.projects.where('is_public=1').count}", :controller => 'contests', :action => 'show_softapplication' %> + <%=link_to "#{@contest.contesting_softapplications.count}", :controller => 'contests', :action => 'show_softapplication' %> <%= l(:label_participate) %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 1a4ed1b4..af9ad87e 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -53,7 +53,7 @@ <% @project = Project.find_by_id(@project.id)%> - + - +
<%= image_tag(url_to_avatar(@project), :class => 'avatar2') %>
<%= @project.name %> diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index d82a130e..a01006cb 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -9,9 +9,11 @@

<%= notice %>

+ <%= image_tag(url_to_avatar(@user), :class => "avatar2") %>
<%= image_tag(url_to_avatar(@softapplication), :class => "avatar2") %> +