diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index a0da2d025..026a12e9a 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -54,13 +54,13 @@ class AttachmentsController < ApplicationController # modify by nwb # 下载添加权限设置 candown = false - if @attachment.container.has_attribute?(:project) && @attachment.container.project + if (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project project = @attachment.container.project candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) elsif @attachment.container.is_a?(Project) project = @attachment.container candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1) - elsif @attachment.container.has_attribute?(:course) && @attachment.container.course + elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course course = @attachment.container.course candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1) elsif @attachment.container.is_a?(Course) @@ -173,7 +173,7 @@ class AttachmentsController < ApplicationController respond_to do |format| # modify by nwb - if @attachment.container.is_a?(Course) || @attachment.container.course + if !@attachment.container.nil? && (@attachment.container.is_a?(Course) || @attachment.container.course) if @course.nil? format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } else @@ -286,7 +286,7 @@ private raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename if @attachment.container_type == 'Course' @course = @attachment.course - elsif @attachment.container.has_attribute?(:course) && @attachment.container.course + elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course)) && @attachment.container.course @course = @attachment.container.course else unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index aa0e66ed8..e116a800f 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -143,7 +143,7 @@
<% end %> <% unless @user.user_extensions.nil? %> -+
<%= @user.user_extensions.brief_introduction %>
<% end %> diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 1bdef9df9..c057202f8 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -18,37 +18,37 @@-
+ | <%= link_to @project.watcher_users.count, project_watcherlist_path(project)%> | -+ | <%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %> |
+ | <%= link_to "#{@project.members.count}", project_member_path(@project)%> | -+ | <%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %> |
+ | <%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %> | -+ | <%= content_tag('span', l(:label_since_last_commits)) %> |
+ | <% find_project_repository @project %> <%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %> | -+ | <%= content_tag('span', l(:label_commit_on)) %> |