取消已完成课程在软件创客列表的显示

This commit is contained in:
sw 2014-07-18 10:01:54 +08:00
parent 6379dd704a
commit bcaaa02bed
3 changed files with 44 additions and 11 deletions

View File

@ -258,4 +258,24 @@ module UsersHelper
end
return result
end
#获取用户参与的公开的课程列表
def user_public_course_list user
membership = user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
membership.sort! {|older, newer| newer.created_on <=> older.created_on }
memberships = []
membership.collect { |e|
memberships.push(e)
}
## 判断课程是否过期 [需封装]
memberships_doing = []
memberships_done = []
memberships.map { |e|
if course_endTime_timeout?(e.course)
memberships_done.push e
else
memberships_doing.push e
end
}
end
end

View File

@ -66,7 +66,7 @@
<%# unless user.memberships.empty? %>
<%# cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
<%# memberships = user.memberships.all(:conditions => cond) %>
<% user_courses = user.coursememberships.map(&:course) %>
<% user_courses = user_courses_list(user) %>
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
<% for course in user_courses %>
<%# if course.name != nil %>

View File

@ -809,18 +809,18 @@ ActiveRecord::Schema.define(:version => 20140716021558) do
create_table "relative_memos", :force => true do |t|
t.integer "osp_id"
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :null => false
t.string "subject", :null => false
t.text "content", :limit => 16777215, :null => false
t.integer "author_id"
t.integer "replies_count", :default => 0
t.integer "replies_count", :default => 0
t.integer "last_reply_id"
t.boolean "lock", :default => false
t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0
t.boolean "lock", :default => false
t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0
t.string "url"
t.string "username"
t.string "userhomeurl"
@ -844,6 +844,19 @@ ActiveRecord::Schema.define(:version => 20140716021558) do
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
create_table "rich_rich_files", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "rich_file_file_name"
t.string "rich_file_content_type"
t.integer "rich_file_file_size"
t.datetime "rich_file_updated_at"
t.string "owner_type"
t.integer "owner_id"
t.text "uri_cache"
t.string "simplified_type", :default => "file"
end
create_table "roles", :force => true do |t|
t.string "name", :limit => 30, :default => "", :null => false
t.integer "position", :default => 1