Merge branch 'dev_shcool' of https://git.trustie.net/jacknudt/trustieforge into dev_shcool
This commit is contained in:
commit
2ee9c22186
|
@ -3518,7 +3518,7 @@ class UsersController < ApplicationController
|
|||
|
||||
# 用户的所有项目
|
||||
# @my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
|
||||
@my_projects = @user.projects.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
|
||||
@my_projects = @user.projects.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
|
||||
@my_projects_count = @my_projects.count
|
||||
|
||||
#@my_joined_projects = @user.projects.visible.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
|
||||
|
|
|
@ -37,13 +37,13 @@
|
|||
<% else %>
|
||||
<% projects.each_with_index do |project, i| %>
|
||||
<div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;">
|
||||
<% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public %>
|
||||
<% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public == 1 %>
|
||||
<div class="sy_courses_open">
|
||||
<span id="collect_project_icon_<%= project.id %>">
|
||||
<%=render :partial => 'collect_project', :locals => {:project => project} %>
|
||||
</span>
|
||||
<h3><%= link_to project.name, allow_visit ? project_path(project.id,:host=>Setting.host_name) : 'javascript:void(0)', :target => '_blank',
|
||||
:class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有班级不可访问") %></h3>
|
||||
:class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有项目不可访问") %></h3>
|
||||
<% unless project.is_public? %>
|
||||
<span class="syllabus_class_private fl ml10 mt3 syllabus_class_property">私有</span>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue