From 150bb1ba1eae7c6222003471fb24731d7a484c92 Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Thu, 29 May 2014 20:48:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E6=BA=90=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E4=B8=BB=E9=A1=B5=E4=B8=AD=E7=9A=84=E6=BC=8F=E6=B4=9E?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/open_source_projects_controller.rb | 3 +++ app/helpers/open_source_projects_helper.rb | 8 ++++++++ app/views/open_source_projects/index.html.erb | 13 ++++++++----- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/controllers/open_source_projects_controller.rb b/app/controllers/open_source_projects_controller.rb index 7b9333647..43a5e3d9a 100644 --- a/app/controllers/open_source_projects_controller.rb +++ b/app/controllers/open_source_projects_controller.rb @@ -12,6 +12,7 @@ class OpenSourceProjectsController < ApplicationController # GET /open_source_projects # GET /open_source_projects.json def index + @app_dir = params[:app_dir] @language = params[:language] @created_at = params[:created_at] @@ -24,6 +25,8 @@ class OpenSourceProjectsController < ApplicationController @os_project_pages = Paginator.new @os_project_count, per_page_option, params['page'] @open_source_projects = @open_source_projects.offset(@os_project_pages.offset).limit(@os_project_pages.per_page) + + @bugs = BugToOsp.order('created_at desc').limit(8) # @open_source_projects = OpenSourceProject.all diff --git a/app/helpers/open_source_projects_helper.rb b/app/helpers/open_source_projects_helper.rb index f1c1cd35e..dfc7cc8d0 100644 --- a/app/helpers/open_source_projects_helper.rb +++ b/app/helpers/open_source_projects_helper.rb @@ -46,4 +46,12 @@ module OpenSourceProjectsHelper 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 end diff --git a/app/views/open_source_projects/index.html.erb b/app/views/open_source_projects/index.html.erb index 1c488fe82..f0b69bd47 100644 --- a/app/views/open_source_projects/index.html.erb +++ b/app/views/open_source_projects/index.html.erb @@ -148,16 +148,18 @@ li {