diff --git a/app/controllers/open_source_projects_controller.rb b/app/controllers/open_source_projects_controller.rb index 7b933364..43a5e3d9 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 f1c1cd35..dfc7cc8d 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 1c488fe8..f0b69bd4 100644 --- a/app/views/open_source_projects/index.html.erb +++ b/app/views/open_source_projects/index.html.erb @@ -148,16 +148,18 @@ li {
diff --git a/app/views/open_source_projects/showbug.html.erb b/app/views/open_source_projects/showbug.html.erb index 86e8a226..7fac230c 100644 --- a/app/views/open_source_projects/showbug.html.erb +++ b/app/views/open_source_projects/showbug.html.erb @@ -32,7 +32,7 @@ <% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %> - <%= link_to l(:label_memo_new_from_forum), new_open_source_project_relative_memo_path(@open_source_project), :class => 'icon icon-add', + <%#= link_to l(:label_memo_new_from_forum), new_open_source_project_relative_memo_path(@open_source_project), :class => 'icon icon-add', :onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>