Merge branch 'dev_tieba' of https://git.trustie.net/jacknudt/trustieforge into dev_tieba
This commit is contained in:
commit
94822a5c95
|
@ -583,7 +583,7 @@ class ApplicationController < ActionController::Base
|
||||||
uri = URI.parse(back_url)
|
uri = URI.parse(back_url)
|
||||||
# do not redirect user to another host or to the login or register page
|
# do not redirect user to another host or to the login or register page
|
||||||
if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
|
if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
|
||||||
back_url = back_url.gsub(%r{\/users\/(\d+)},"/users/"+default.id.to_s) if default.is_a?(User)
|
back_url = back_url.gsub(%r{\/users\/(\D+)},"/users/"+default.to_s) if default.is_a?(User)
|
||||||
redirect_to(back_url)
|
redirect_to(back_url)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -278,6 +278,15 @@ class CoursesController < ApplicationController
|
||||||
@members = paginateHelper @members, @limit
|
@members = paginateHelper @members, @limit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 显示/隐藏课程"开源检索"的入口
|
||||||
|
def open_or_close_os_interface
|
||||||
|
os_status = @course.os_allow == 0 ? 1 : 0
|
||||||
|
@course.update_attribute(:os_allow, os_status)
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def valid_ajax
|
def valid_ajax
|
||||||
req = Hash.new(false)
|
req = Hash.new(false)
|
||||||
req[:message] = ''
|
req[:message] = ''
|
||||||
|
|
|
@ -225,13 +225,8 @@ class MyController < ApplicationController
|
||||||
File.delete(diskfile1) if File.exist?(diskfile1)
|
File.delete(diskfile1) if File.exist?(diskfile1)
|
||||||
end
|
end
|
||||||
|
|
||||||
# 基本资料不完善,无法使用其他功能,完善着可继续使用
|
|
||||||
if @force
|
|
||||||
render :layout => 'new_base_user_show'
|
|
||||||
else
|
|
||||||
render :layout => 'new_base_user'
|
render :layout => 'new_base_user'
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Destroys user's account
|
# Destroys user's account
|
||||||
def destroy
|
def destroy
|
||||||
|
|
|
@ -36,7 +36,7 @@ class UsersController < ApplicationController
|
||||||
#
|
#
|
||||||
before_filter :can_show_course, :only => [:user_courses,:user_homeworks]
|
before_filter :can_show_course, :only => [:user_courses,:user_homeworks]
|
||||||
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :unsolved_issues_list, :unfinished_homework_list, :user_manage_homeworks,
|
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :unsolved_issues_list, :unfinished_homework_list, :user_manage_homeworks,
|
||||||
:unfinished_poll_list, :user_homeworks,:student_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
|
:unfinished_poll_list, :user_homeworks,:student_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :update_message_viewed,
|
||||||
:anonymous_evaluation_list,:unfinished_test_list, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :user_receive_homeworks,
|
:anonymous_evaluation_list,:unfinished_test_list, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :user_receive_homeworks,
|
||||||
:unapproval_applied_list, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
|
:unapproval_applied_list, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
|
||||||
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,:user_contestlist, :user_manage_issues, :user_receive_issues,
|
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,:user_contestlist, :user_manage_issues, :user_receive_issues,
|
||||||
|
@ -489,9 +489,9 @@ class UsersController < ApplicationController
|
||||||
# 初始化/更新 点击按钮时间, 24小时内显示系统消息
|
# 初始化/更新 点击按钮时间, 24小时内显示系统消息
|
||||||
update_onclick_time
|
update_onclick_time
|
||||||
# 全部设为已读
|
# 全部设为已读
|
||||||
if params[:viewed] == "all"
|
# if params[:viewed] == "all"
|
||||||
update_message_viewed(@user)
|
# update_message_viewed(@user)
|
||||||
end
|
# end
|
||||||
# @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count
|
# @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count
|
||||||
courses = @user.courses.where("is_delete = 1")
|
courses = @user.courses.where("is_delete = 1")
|
||||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||||
|
@ -571,17 +571,17 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
# 消息设置为已读
|
# 消息设置为已读
|
||||||
def update_message_viewed(user)
|
def update_message_viewed
|
||||||
if User.current.id == @user.id
|
if User.current.id == @user.id
|
||||||
course_querys = CourseMessage.where("user_id =? and viewed =?", user, 0)
|
course_querys = CourseMessage.where("user_id =? and viewed =?", @user.id, 0)
|
||||||
forge_querys = ForgeMessage.where("user_id =? and viewed =?", user, 0)
|
forge_querys = ForgeMessage.where("user_id =? and viewed =?", @user.id, 0)
|
||||||
user_querys = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0)
|
user_querys = UserFeedbackMessage.where("user_id =? and viewed =?", @user.id, 0)
|
||||||
forum_querys = MemoMessage.where("user_id =? and viewed =?", user, 0)
|
forum_querys = MemoMessage.where("user_id =? and viewed =?", @user.id, 0)
|
||||||
org_querys = OrgMessage.where("user_id=? and viewed=0", user)
|
org_querys = OrgMessage.where("user_id=? and viewed=0", @user.id)
|
||||||
at_querys = AtMessage.where("user_id=? and viewed=0", user)
|
at_querys = AtMessage.where("user_id=? and viewed=0", @user.id)
|
||||||
contest_querys = ContestMessage.where(:user_id => user, :viewed => 0)
|
contest_querys = ContestMessage.where(:user_id => @user.id, :viewed => 0)
|
||||||
blog_querys = BlogMessage.where(:user_id => user, :viewed => 0)
|
blog_querys = BlogMessage.where(:user_id => @user.id, :viewed => 0)
|
||||||
applied_querys = AppliedMessage.where("user_id=? and viewed =?", user, 0)
|
applied_querys = AppliedMessage.where("user_id=? and viewed =?", @user.id, 0)
|
||||||
course_querys.update_all(:viewed => true) unless course_querys.nil?
|
course_querys.update_all(:viewed => true) unless course_querys.nil?
|
||||||
forge_querys.update_all(:viewed => true) unless forge_querys.nil?
|
forge_querys.update_all(:viewed => true) unless forge_querys.nil?
|
||||||
user_querys.update_all(:viewed => true) unless user_querys.nil?
|
user_querys.update_all(:viewed => true) unless user_querys.nil?
|
||||||
|
@ -592,6 +592,7 @@ class UsersController < ApplicationController
|
||||||
blog_querys.update_all(:viewed => true) unless blog_querys.nil?
|
blog_querys.update_all(:viewed => true) unless blog_querys.nil?
|
||||||
applied_querys.update_all(:viewed => true) unless applied_querys.nil?
|
applied_querys.update_all(:viewed => true) unless applied_querys.nil?
|
||||||
end
|
end
|
||||||
|
redirect_to user_path(@user)
|
||||||
end
|
end
|
||||||
|
|
||||||
# 系统消息
|
# 系统消息
|
||||||
|
@ -2011,9 +2012,6 @@ class UsersController < ApplicationController
|
||||||
def show
|
def show
|
||||||
if User.current == @user
|
if User.current == @user
|
||||||
# 全部设为已读
|
# 全部设为已读
|
||||||
if params[:viewed] == "set_viewed"
|
|
||||||
update_message_viewed(@user)
|
|
||||||
end
|
|
||||||
# 自己的主页显示消息
|
# 自己的主页显示消息
|
||||||
messages_all = MessageAll.where(:user_id => @user.id)
|
messages_all = MessageAll.where(:user_id => @user.id)
|
||||||
@message_count = messages_all.count
|
@message_count = messages_all.count
|
||||||
|
@ -2333,7 +2331,7 @@ class UsersController < ApplicationController
|
||||||
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
|
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
|
||||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||||
user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
||||||
project_types = "('Message','Issue','Project')"
|
project_types = "('Message','Issue','Project', 'Attachment')"
|
||||||
principal_types = "JournalsForMessage"
|
principal_types = "JournalsForMessage"
|
||||||
container_type = ''
|
container_type = ''
|
||||||
act_type = ''
|
act_type = ''
|
||||||
|
@ -2348,6 +2346,9 @@ class UsersController < ApplicationController
|
||||||
when "current_user"
|
when "current_user"
|
||||||
container_type = 'Principal'
|
container_type = 'Principal'
|
||||||
act_type = 'Principal'
|
act_type = 'Principal'
|
||||||
|
when "project_resource"
|
||||||
|
container_type = 'Project'
|
||||||
|
act_type = "Attachment"
|
||||||
when "all"
|
when "all"
|
||||||
container_type = 'all'
|
container_type = 'all'
|
||||||
act_type = 'all'
|
act_type = 'all'
|
||||||
|
@ -4051,6 +4052,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_courselist
|
def user_courselist
|
||||||
|
@user_courselist = "课程"
|
||||||
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
|
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
|
||||||
|
|
||||||
@my_syllabuses = @user.syllabuses
|
@my_syllabuses = @user.syllabuses
|
||||||
|
@ -4234,6 +4236,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_projectlist
|
def user_projectlist
|
||||||
|
@user_projectlist = "项目"
|
||||||
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
|
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
|
||||||
#limit = 5
|
#limit = 5
|
||||||
|
|
||||||
|
|
|
@ -1348,10 +1348,10 @@ module ApplicationHelper
|
||||||
elsif @forum || params[:controller] == "forums"
|
elsif @forum || params[:controller] == "forums"
|
||||||
title << "问吧"
|
title << "问吧"
|
||||||
elsif @user
|
elsif @user
|
||||||
if !@project_community.blank?
|
if !@project_community.blank? || !@user_projectlist.blank?
|
||||||
title << @project_community
|
title << "项目"
|
||||||
elsif !@course_community.blank?
|
elsif !@course_community.blank? || !@user_courselist.blank?
|
||||||
title << @course_community
|
title << "课程"
|
||||||
elsif !@contest_community.blank?
|
elsif !@contest_community.blank?
|
||||||
title << @contest_community
|
title << @contest_community
|
||||||
elsif !@manage_issues.blank?
|
elsif !@manage_issues.blank?
|
||||||
|
|
|
@ -203,7 +203,7 @@ class Memo < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroyable_by? user
|
def destroyable_by? user
|
||||||
(user && self.author == user) || user.admin? || self.forum.creator == user
|
(user && self.author == user) || user.admin? || self.forum.creator == user || Memo.find(self.root_id).author == user
|
||||||
#self.author == user || user.admin?
|
#self.author == user || user.admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,18 +5,18 @@
|
||||||
<div class="email_verify" style="width: 580px;">
|
<div class="email_verify" style="width: 580px;">
|
||||||
<p class="fb f18" style="color:green;"><i class="icon-ok mr5 f18"></i>注册成功!
|
<p class="fb f18" style="color:green;"><i class="icon-ok mr5 f18"></i>注册成功!
|
||||||
<span style=" color:#3b94d6; font-size:12px; font-weight:normal;">请在24小时内点击邮件中的链接来激活您的账号。</span></p>
|
<span style=" color:#3b94d6; font-size:12px; font-weight:normal;">请在24小时内点击邮件中的链接来激活您的账号。</span></p>
|
||||||
<p class="f14 mt30 mb5">请登录邮箱(<span class="c_red"><%= @mail_type %></span>)收取账号激活邮件。<br/>点击邮件中的激活链接,方可使用该账号
|
<p class="f14 mt30 mb5">请登录邮箱(<span class="c_red"><%= @user.mail %></span>)收取账号激活邮件。<br/>点击邮件中的激活链接,方可使用该账号
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://mail.<%= email %>" class="btn btn-blue" target="_blank"><%= l(:label_check_email)%></a>
|
<a href="http://mail.<%= email %>" class="btn btn-blue" target="_blank"><%= l(:label_check_email)%></a>
|
||||||
<%= link_to "<input class='btn btn-blue' type='button' id='btn' value='重新获取验证码' onclick='settime(this)' />".html_safe, { :controller => 'account', :action => 'resendmail', :user => @user}, :remote => true, :method => 'get' %>
|
<%= link_to "<input class='btn btn-blue' type='button' id='btn' value='重新发送激活邮件' onclick='settime(this)' />".html_safe, { :controller => 'account', :action => 'resendmail', :user => @user}, :remote => true, :method => 'get' %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul class="email_prompt_txt mt30" style="width: 580px;">
|
<ul class="email_prompt_txt mt30" style="width: 580px;">
|
||||||
<p class="email_prompt_p">如果您一直收不到激活邮件,请按照以下步骤操作:</p>
|
<p class="email_prompt_p">如果您一直收不到激活邮件,请按照以下步骤操作:</p>
|
||||||
<li>1.请确认是否填写了正确的邮箱地址 </li>
|
<li>1.请确认是否填写了正确的邮箱地址 </li>
|
||||||
<li>2.请注意查看邮箱中的“订阅邮件”、“垃圾邮件”,可能Trustie的邮件被误杀了</li>
|
<li>2.请注意查看邮箱中的“订阅邮件”、“垃圾邮件”,可能Trustie的邮件被误杀了</li>
|
||||||
<li>3.点击这里重新发送激活邮件</li>
|
<li>3.请点击重新发送激活邮件按钮</li>
|
||||||
<li>4.如果您无法收到激活邮件,请直接给我们留言:</li>
|
<li>4.如果您无法收到激活邮件,请直接给我们留言:</li>
|
||||||
<div class="mt10 clearfix">
|
<div class="mt10 clearfix">
|
||||||
<% get_memo %>
|
<% get_memo %>
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
<td class="center">
|
<td class="center">
|
||||||
<%= format_date(course.created_at) %>
|
<%= format_date(course.created_at) %>
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: center;"><a><%= course.try(:os_allow) == 0 ? 不允许 : 允许 %></a></td>
|
<td style="text-align: center;"><a href="<%= open_or_close_os_interface_course_path(course.id) %>" id="os_allow_<%= course.id %>" data-remote="true"><%= course.try(:os_allow) == 0 ? "允许" : "不允许" %></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
$("#os_allow_<%= @course.id %>").html("<%= @course.try(:os_allow) == 0 ? "允许" : "不允许" %>");
|
|
@ -1,7 +1,7 @@
|
||||||
<div id="Footer" class="f12">
|
<div id="Footer" class="f12">
|
||||||
<div class="footerAboutContainer">
|
<div class="footerAboutContainer">
|
||||||
<ul class="footerAbout">
|
<ul class="footerAbout">
|
||||||
<li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
|
<!--<li class="fl"><a href="<%#= about_us_path %>" class="f_grey mw20" target="_blank"><%#= l(:label_about_us)%></a>|</li>-->
|
||||||
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
|
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
|
||||||
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
|
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
|
||||||
<% memo = Memo.where(:id => 1168).first %>
|
<% memo = Memo.where(:id => 1168).first %>
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
</li>
|
</li>
|
||||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%>
|
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post", :id => "logout_trustie" %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<%= f.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => l(:label_feedback_tips) %>
|
<%= f.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => l(:label_feedback_tips) %>
|
||||||
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
|
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
|
||||||
<span class="c_grey fl ml10">还能输入<span id="textCount" class="c_orange">50</span>个字符</span>
|
<span class="c_grey fl ml10">还能输入<span id="textCount" class="c_orange">50</span>个字符</span>
|
||||||
<a href="javascript:void(0);" class="linkBlue f12 fr mr10" style="height:21px;" id="" onclick="f_submit();">
|
<a href="javascript:void(0);" class="linkBlue f12 fr mr10" style="height:21px;" id="inquiry_question" onclick="f_submit();">
|
||||||
<%= l(:label_submit) %>
|
<%= l(:label_submit) %>
|
||||||
</a>
|
</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -242,7 +242,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<!--<a onclick = "show_more();" id = "show_more_messages" style="display: none; cursor: pointer;" class = "shadowbox_news_all">展开更多</a>-->
|
<!--<a onclick = "show_more();" id = "show_more_messages" style="display: none; cursor: pointer;" class = "shadowbox_news_all">展开更多</a>-->
|
||||||
<%= link_to '查看全部', user_message_path(User.current),:id =>'show_all_messages', :class => "shadowbox_news_all", :target =>"_Blank" %>
|
<%= link_to '查看全部', user_path(User.current), :id =>'show_all_messages', :class => "shadowbox_news_all", :target =>"_Blank" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -147,9 +147,11 @@
|
||||||
<%# 课程英雄榜 %>
|
<%# 课程英雄榜 %>
|
||||||
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
|
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
|
||||||
<div class="sy_class_leftbox" >
|
<div class="sy_class_leftbox" >
|
||||||
|
<% if @course.try(:os_allow) == 1 %>
|
||||||
<h3 class="fontGrey7"><span>推荐</span>
|
<h3 class="fontGrey7"><span>推荐</span>
|
||||||
<a class="c_white db creatPostIcon2 bGreen fr" href="http://ossean.trustie.net?user_id=<%= User.current.id %>" target="_blank">开源检索</a>
|
<a class="c_white db creatPostIcon2 bGreen fr" href="http://ossean.trustie.net?user_id=<%= User.current.id %>" target="_blank">开源检索</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
<% end %>
|
||||||
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
|
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
|
||||||
</div>
|
</div>
|
||||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||||
|
|
|
@ -64,7 +64,6 @@
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="prettyPrint();">
|
<body onload="prettyPrint();">
|
||||||
<div class="navContainer">
|
<div class="navContainer">
|
||||||
<% is_current_user = User.current.logged? && User.current == @user %>
|
<% is_current_user = User.current.logged? && User.current == @user %>
|
||||||
|
@ -291,6 +290,20 @@
|
||||||
$("#projectMenu").mouseleave(function(){
|
$("#projectMenu").mouseleave(function(){
|
||||||
$("#topnav_project_menu").hide();
|
$("#topnav_project_menu").hide();
|
||||||
});
|
});
|
||||||
|
// 如果是强制修改资料页面,则除退出按钮外,其他按钮的连接都失效
|
||||||
|
<% if @force %>
|
||||||
|
// 禁用所有a标签
|
||||||
|
var t = document.getElementsByTagName("a");
|
||||||
|
len = t.length;
|
||||||
|
for(var i=0;i<len;i++){
|
||||||
|
t[i].href = 'javascript:void(0)';
|
||||||
|
}
|
||||||
|
// 退出按钮可用
|
||||||
|
var d = document.getElementById("logout_trustie");
|
||||||
|
d.href='<%= logout_url_without_domain %>';
|
||||||
|
// 提问按钮不可用
|
||||||
|
document.getElementById('inquiry_question').onclick = function (){return false;};
|
||||||
|
<% end %>
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -39,9 +39,9 @@
|
||||||
|
|
|
|
||||||
<%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%>
|
<%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%>
|
||||||
<% elsif ma.status == 1%> <!-- 同意 -->
|
<% elsif ma.status == 1%> <!-- 同意 -->
|
||||||
您已同意申请
|
<%= Course.find(ma.course_id).teacher.show_name %>已同意
|
||||||
<% elsif ma.status == 2%> <!-- 拒绝 -->
|
<% elsif ma.status == 2%> <!-- 拒绝 -->
|
||||||
您已拒绝申请
|
<%= Course.find(ma.course_id).teacher.show_name %>已拒绝
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -12,13 +12,14 @@
|
||||||
</h3>
|
</h3>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p class="sy_cgrey clear">
|
<p class="sy_cgrey clear">
|
||||||
<span class="mr15 fl"><%= (cur_homework_end_time homework).html_safe %></span>
|
<span class="fl mr30"><%= (cur_homework_end_time homework).html_safe %></span>
|
||||||
<span class="fl">未交:</span>
|
<span class="fl">未交:</span>
|
||||||
<span class="sy_cgrey hw_w30 fl mr15"><%= homework.course.student.count - homework.student_works.has_committed.count %></span>
|
<span class="sy_cgrey hw_w30 fl mr30"><%= homework.course.student.count - homework.student_works.has_committed.count %></span>
|
||||||
<span class="fl c_green">已评:</span>
|
<span class="fl">已评:</span>
|
||||||
<span class="sy_cgrey hw_w30 fl mr15"><%= homework.student_works.where("work_status != 0 and (teacher_score is not null or teaching_asistant_score is not null)").count %></span>
|
<span class="sy_cgrey hw_w30 fl mr30"><%= homework.student_works.where("work_status != 0 and (teacher_score is not null or teaching_asistant_score is not null)").count %></span>
|
||||||
<span class="fl c_red">未评:</span>
|
<% not_evaluate_count = homework.student_works.where("work_status != 0 and teacher_score is null and teaching_asistant_score is null").count %>
|
||||||
<span class="sy_cgrey hw_w30 fl mr15"><%= homework.student_works.where("work_status != 0 and teacher_score is null and teaching_asistant_score is null").count %></span>
|
<span class="fl">未评:</span>
|
||||||
|
<span class="<%= not_evaluate_count > 0 ? "c_red" : "sy_cgrey" %> hw_w30 fl mr30"><%= not_evaluate_count %></span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<% if homework.student_works.has_committed.count == 0 %>
|
<% if homework.student_works.has_committed.count == 0 %>
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
<div class="container-big mt10">
|
<!-- 项目社区赛选的资源库动态为短版,具体项目赛选的资源库为宽版 -->
|
||||||
<div class="pr">
|
<div class="<%= @project_community.nil? ? 'container-big' : 'resources' %> mt10">
|
||||||
|
<div class="<%= @project_community.nil? ? 'pr' : 'homepagePostBrief' %>">
|
||||||
<div class="homepagePostPortrait">
|
<div class="homepagePostPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-big">
|
<div class="<%= @project_community.nil? ? 'content-big' : 'homepagePostDes' %>">
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
|
@ -12,10 +13,10 @@
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
TO
|
TO
|
||||||
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.course), :class => "newsBlue ml15" %>
|
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.project), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word" >
|
<div class="homepagePostTitle break_word" >
|
||||||
<%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %>
|
<%= link_to activity.filename, project_files_path(activity.project), :class => "postGrey" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostSubmitContainer">
|
<div class="homepagePostSubmitContainer">
|
||||||
<div class="homepagePostDeadline mr15">
|
<div class="homepagePostDeadline mr15">
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
</h3>
|
</h3>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p class="sy_cgrey clear">
|
<p class="sy_cgrey clear">
|
||||||
<span class="mr15 fl"><%= cur_homework_end_time homework %></span>
|
<span class="mr30 fl"><%= cur_homework_end_time homework %></span>
|
||||||
<% my_work = homework.student_works.where("user_id = ? && work_status != 0",User.current).first %>
|
<% my_work = homework.student_works.where("user_id = ? && work_status != 0",User.current).first %>
|
||||||
<span class="fl">状态:</span><span class="<%= my_work ? '' : 'hw_cir_nomal hw_cir_lorange' %> fl mr15"><%= my_work ? '已提交' : '未提交' %></span>
|
<span class="fl">状态:</span><span class="<%= my_work ? '' : 'hw_cir_nomal hw_cir_lorange' %> fl mr30"><%= my_work ? '已提交' : '未提交' %></span>
|
||||||
<span class="fl">成绩:</span>
|
<span class="fl">成绩:</span>
|
||||||
<% if my_work && !my_work.work_score.nil? %>
|
<% if my_work && !my_work.work_score.nil? %>
|
||||||
<span class="sy_corange hw_w40 fl mr15"><%= format("%.1f",my_work.work_score.to_f) %></span>
|
<span class="sy_corange hw_w40 fl mr15"><%= format("%.1f",my_work.work_score.to_f) %></span>
|
||||||
|
|
|
@ -78,6 +78,8 @@
|
||||||
<%# end %>
|
<%# end %>
|
||||||
<% when 'Message' %>
|
<% when 'Message' %>
|
||||||
<%= render :partial => 'project_message', :locals => {:activity => act, :user_activity_id => user_activity.id, :is_course => 0, :is_board => 0} %>
|
<%= render :partial => 'project_message', :locals => {:activity => act, :user_activity_id => user_activity.id, :is_course => 0, :is_board => 0} %>
|
||||||
|
<% when 'Attachment'%>
|
||||||
|
<%= render :partial => 'users/project_attachment', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||||
<% when 'Project' %>
|
<% when 'Project' %>
|
||||||
<%# cache (act) do %>
|
<%# cache (act) do %>
|
||||||
<%= render :partial => 'project_create', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
<%= render :partial => 'project_create', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
|
<div class="resources" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
|
||||||
<div class="homepagePostBrief">
|
<div class="homepagePostBrief">
|
||||||
<div class="homepagePostPortrait">
|
<div class="homepagePostPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<%#= javascript_include_tag "init_KindEditor","user" %>
|
<%#= javascript_include_tag "init_KindEditor","user" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%if jours %>
|
<% if jours.count > 0 %>
|
||||||
<% jours.each do |jour| %>
|
<% jours.each do |jour| %>
|
||||||
<% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id && !User.current.admin?)) %>
|
<% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id && !User.current.admin?)) %>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -15,6 +15,8 @@
|
||||||
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
|
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= render :partial => "projects/no_data" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if (jours.count + page * 10) < count %>
|
<% if (jours.count + page * 10) < count %>
|
||||||
<%= link_to "点击展开更多", feedback_path(@user.id, :type => type, :page => page), :id => "show_more_jours", :remote => "true", :class => "loadMore mt10 f_grey" %>
|
<%= link_to "点击展开更多", feedback_path(@user.id, :type => type, :page => page), :id => "show_more_jours", :remote => "true", :class => "loadMore mt10 f_grey" %>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<% user_id = User.find(BlogComment.find(ma.blog_message_id).blog.author_id) %>
|
<% user_id = User.find(BlogComment.find(ma.blog_message_id).blog.author_id) %>
|
||||||
<% blog_id = BlogComment.find(ma.blog_message_id).root_id %>
|
<% blog_id = BlogComment.find(ma.blog_message_id).root_id %>
|
||||||
<%= link_to message_content(ma.content), user_blog_blog_comment_path(:user_id => user_id, :blog_id => ma.blog_id, :id => blog_id),
|
<%= link_to message_content(ma.content), user_blog_blog_comment_path(:user_id => user_id, :blog_id => ma.blog_id, :id => blog_id),
|
||||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
:class => "#{ma.viewed == false ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
|
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
|
|
|
@ -726,9 +726,9 @@
|
||||||
</div>
|
</div>
|
||||||
<li class="messageOperateContents fl">
|
<li class="messageOperateContents fl">
|
||||||
<% if ma.status == 1 %>
|
<% if ma.status == 1 %>
|
||||||
<span class="user_hiddent fl" title="<%=User.find(ma.course_message_id).show_name %>"><%= User.find(ma.course_message_id).show_name %></span><span>已通过</span>
|
<span class="fl" title="<%= User.find(ma.course_message_id).show_name %>已同意"><%= User.find(ma.course_message_id).show_name %>已同意</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="user_hiddent fl" title="<%=User.find(ma.course_message_id).show_name %>"><%= User.find(ma.course_message_id).show_name %></span><span>已拒绝</span>
|
<span class="fl" title="<%= User.find(ma.course_message_id).show_name %>已拒绝"><%= User.find(ma.course_message_id).show_name %>已拒绝</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
|
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<% count = unviewed_message(@user) %>
|
<% count = unviewed_message(@user) %>
|
||||||
<span class="fr" style="margin-top:5px;">
|
<span class="fr" style="margin-top:5px;">
|
||||||
<% unless (count == 0 || User.current != @user) %>
|
<% unless (count == 0 || User.current != @user) %>
|
||||||
<%= link_to "全部设为已读", user_path(User.current, :viewed => 'set_viewed'), :class => "fl mr10" %>
|
<%= link_to "全部设为已读", update_message_viewed_user_path(@user), :class => "fl mr10" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<span class="fl">共 <span style="color: red;"><%= @message_count %></span> 个消息</span>
|
<span class="fl">共 <span style="color: red;"><%= @message_count %></span> 个消息</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
:class => "homepagePostTypeMine postTypeGrey" %></li>
|
:class => "homepagePostTypeMine postTypeGrey" %></li>
|
||||||
<li><%= link_to "问题动态", {:controller => "users", :action => "project_community", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%></li>
|
<li><%= link_to "问题动态", {:controller => "users", :action => "project_community", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%></li>
|
||||||
<li><%= link_to "论坛动态", {:controller => "users", :action => "project_community", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%></li>
|
<li><%= link_to "论坛动态", {:controller => "users", :action => "project_community", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%></li>
|
||||||
|
<li><%= link_to "资源库动态", {:controller => "users", :action => "project_community", :type => "project_resource"}, :class => "homepagePostTypeNotice postTypeGrey" %></li>
|
||||||
<!-- <li><%#= link_to "个人留言", {:controller => "users", :action => "project_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>-->
|
<!-- <li><%#= link_to "个人留言", {:controller => "users", :action => "project_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>-->
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</script>
|
</script>
|
||||||
<div class="mt10 mb10">
|
<div class="mt10 mb10">
|
||||||
<div class="banner-big f16 fontGrey3" style="margin: 0 auto; position: relative;">
|
<div class="banner-big f16 fontGrey3" style="margin: 0 auto; position: relative;">
|
||||||
我发布的的作业
|
<%= @user.id == User.current.id ? "我发布的的作业" : "TA发布的的作业" %>
|
||||||
<div class="hw_more_box" >
|
<div class="hw_more_box" >
|
||||||
<ul>
|
<ul>
|
||||||
<li class="hw_more_icons fr">
|
<li class="hw_more_icons fr">
|
||||||
|
|
|
@ -218,7 +218,9 @@
|
||||||
<!--缺陷列表开始-->
|
<!--缺陷列表开始-->
|
||||||
<div id="myissues_con" class="myissues_con mb10">
|
<div id="myissues_con" class="myissues_con mb10">
|
||||||
<div class="myissues_head mb5">
|
<div class="myissues_head mb5">
|
||||||
<h2 class="ml15">我发布的Issue</h2>
|
<h2 class="ml15">
|
||||||
|
<%= @user.id == User.current.id ? "我发布的Issue" : "TA发布的Issue" %>
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear mb5">
|
<div class="clear mb5">
|
||||||
<div class="issues_statistics fl">
|
<div class="issues_statistics fl">
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<div id="messageContent">
|
<div id="messageContent">
|
||||||
<% unless is_current_user %>
|
<% unless is_current_user %>
|
||||||
<div class="resources"><%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
|
<div class="resources mb10"><%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
|
||||||
<div class="fl" style="width:658px;">
|
<div class="fl" style="width:658px;">
|
||||||
<%= form_for('new_form',:url => leave_user_message_path(@user.id), :html =>{:id => "user_feedback_new"}, :method => "post") do |f|%>
|
<%= form_for('new_form',:url => leave_user_message_path(@user.id), :html =>{:id => "user_feedback_new"}, :method => "post") do |f|%>
|
||||||
<%= render :partial => "jour_form", :locals => {:f => f, :object => @user} %>
|
<%= render :partial => "jour_form", :locals => {:f => f, :object => @user} %>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</script>
|
</script>
|
||||||
<div class="mt10 mb10">
|
<div class="mt10 mb10">
|
||||||
<div class="banner-big f16 fontGrey3" style="margin: 0 auto; position: relative;">
|
<div class="banner-big f16 fontGrey3" style="margin: 0 auto; position: relative;">
|
||||||
我收到的的作业
|
<%= @user.id == User.current.id ? "我收到的的作业" : "TA收到的的作业" %>
|
||||||
<div class="hw_more_box" >
|
<div class="hw_more_box" >
|
||||||
<ul>
|
<ul>
|
||||||
<li class="hw_more_icons fr">
|
<li class="hw_more_icons fr">
|
||||||
|
|
|
@ -218,7 +218,9 @@
|
||||||
<!--缺陷列表开始-->
|
<!--缺陷列表开始-->
|
||||||
<div id="myissues_con" class="myissues_con mb10">
|
<div id="myissues_con" class="myissues_con mb10">
|
||||||
<div class="myissues_head mb5">
|
<div class="myissues_head mb5">
|
||||||
<h2 class="ml15">我收到的Issue</h2>
|
<h2 class="ml15">
|
||||||
|
<%= @user.id == User.current.id ? "我收到的Issue" : "TA收到的Issue" %>
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear mb5">
|
<div class="clear mb5">
|
||||||
<div class="issues_statistics fl">
|
<div class="issues_statistics fl">
|
||||||
|
|
|
@ -700,6 +700,7 @@ RedmineApp::Application.routes.draw do
|
||||||
get 'choose_user_course'
|
get 'choose_user_course'
|
||||||
get 'user_import_resource'
|
get 'user_import_resource'
|
||||||
match 'watch_projects', :to => 'users#watch_projects', :via => :get
|
match 'watch_projects', :to => 'users#watch_projects', :via => :get
|
||||||
|
get 'update_message_viewed'
|
||||||
#
|
#
|
||||||
# added by bai
|
# added by bai
|
||||||
match 'show_score', :to => 'users#show_score', :via => :get
|
match 'show_score', :to => 'users#show_score', :via => :get
|
||||||
|
@ -1359,6 +1360,7 @@ RedmineApp::Application.routes.draw do
|
||||||
get 'delete_member'
|
get 'delete_member'
|
||||||
get 'archive_course'
|
get 'archive_course'
|
||||||
get 'set_invite_code_halt'
|
get 'set_invite_code_halt'
|
||||||
|
get 'open_or_close_os_interface'
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
match 'join_private_courses', :via => [:get, :post]
|
match 'join_private_courses', :via => [:get, :post]
|
||||||
|
|
|
@ -415,7 +415,7 @@ a.sortArrowActiveD {background:url(../images/post_image_list.png) -0px -20px no-
|
||||||
a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:5px;}
|
a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:5px;}
|
||||||
.creatPost {width:80px; height:25px; border-radius:3px; color:#ffffff; text-align:center; float:right; line-height:25px; vertical-align:middle; margin-top:2px;}
|
.creatPost {width:80px; height:25px; border-radius:3px; color:#ffffff; text-align:center; float:right; line-height:25px; vertical-align:middle; margin-top:2px;}
|
||||||
.creatPostIcon {background:url(../images/post_image_list.png) -40px -54px no-repeat; width:70px; height:25px; padding-left:10px; border-radius:3px;}
|
.creatPostIcon {background:url(../images/post_image_list.png) -40px -54px no-repeat; width:70px; height:25px; padding-left:10px; border-radius:3px;}
|
||||||
.creatPostIcon2 {width:60px; height:20px; padding-left:10px; border-radius:3px;}
|
.creatPostIcon2 {width:60px; height:30px; padding-left:3px; border-radius:3px;}
|
||||||
.postRow {width:970px; border-bottom:1px solid #efefef; padding:15px 0;}
|
.postRow {width:970px; border-bottom:1px solid #efefef; padding:15px 0;}
|
||||||
.postPortrait {width:75px; height:75px; float:left; margin-right:15px;}
|
.postPortrait {width:75px; height:75px; float:left; margin-right:15px;}
|
||||||
.postWrap {width:690px; float:left; margin-right:95px;}
|
.postWrap {width:690px; float:left; margin-right:95px;}
|
||||||
|
|
Loading…
Reference in New Issue