Merge branch 'cxt_course' into develop
Conflicts: app/helpers/application_helper.rb app/views/at/show.json.erb app/views/layouts/new_base_user.html.erb
This commit is contained in:
commit
6eb518c465
|
@ -77,15 +77,15 @@ module Mobile
|
|||
if ac.container_type == "Course"
|
||||
case ac.act_type
|
||||
when "HomeworkCommon"
|
||||
"课程作业"
|
||||
"班级作业"
|
||||
when "News"
|
||||
"课程通知"
|
||||
"班级通知"
|
||||
when "Message"
|
||||
"课程问答区"
|
||||
"班级讨论区"
|
||||
when "Poll"
|
||||
"课程问卷"
|
||||
"班级问卷"
|
||||
when "Course"
|
||||
"课程"
|
||||
"班级"
|
||||
end
|
||||
elsif ac.container_type == "Project"
|
||||
case ac.act_type
|
||||
|
|
|
@ -12,11 +12,13 @@ class AvatarController < ApplicationController
|
|||
@source_id = params[:source_id]
|
||||
@temp_file = params[:avatar][:image]
|
||||
@image_file = @temp_file.original_filename
|
||||
@is_direct = params[:is_direct]
|
||||
else
|
||||
unless request.raw_post.nil?
|
||||
@source_type = params[:source_type]
|
||||
@source_id = params[:source_id]
|
||||
@temp_file = request.raw_post
|
||||
@is_direct = params[:is_direct]
|
||||
if @temp_file.size > 0
|
||||
if @temp_file.respond_to?(:original_filename)
|
||||
@image_file = @temp_file.original_filename
|
||||
|
@ -38,7 +40,7 @@ class AvatarController < ApplicationController
|
|||
@urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file))
|
||||
|
||||
# 用户头像上传时进行特别处理
|
||||
if @source_type == 'User'
|
||||
if @is_direct == '1' && (@source_type == 'User' || @source_type == 'Course' || @source_type == 'Project')
|
||||
diskfile += "temp"
|
||||
@urlfile += "temp"
|
||||
end
|
||||
|
@ -105,7 +107,7 @@ class AvatarController < ApplicationController
|
|||
path = File.dirname(diskfile)
|
||||
if File.directory?(path) && File.exist?(diskfile)
|
||||
# 用户头像进行特别处理
|
||||
if @source_type == 'User'
|
||||
if @source_type == 'User' || @source_type == 'Course' || @source_type == 'Project'
|
||||
diskfile1 = diskfile + 'temp'
|
||||
File.open(diskfile1, "wb") do |f|
|
||||
buffer = "DELETE"
|
||||
|
|
|
@ -94,8 +94,10 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
status = false
|
||||
if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0
|
||||
homework_detail_manual.comment_status = 1
|
||||
status = true
|
||||
end
|
||||
eval_start = homework_detail_manual.evaluation_start
|
||||
if eval_start.nil? || (eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1)
|
||||
|
@ -145,6 +147,10 @@ class HomeworkCommonController < ApplicationController
|
|||
@homework_detail_programing.save if @homework_detail_programing
|
||||
@homework_detail_group.save if @homework_detail_group
|
||||
|
||||
if @homework.homework_type != 3 && homework_detail_manual.comment_status == 1 && status
|
||||
create_works_list @homework
|
||||
end
|
||||
|
||||
if params[:is_manage] == "1"
|
||||
redirect_to manage_or_receive_homeworks_user_path(User.current.id)
|
||||
elsif params[:is_manage] == "2"
|
||||
|
|
|
@ -90,14 +90,34 @@ class MyController < ApplicationController
|
|||
end
|
||||
|
||||
def clear_user_avatar_temp
|
||||
@user = User.current
|
||||
diskfile = disk_filename('User', @user.id)
|
||||
if params[:course]
|
||||
@course = Course.find params[:course]
|
||||
diskfile = disk_filename('Course', @course.id)
|
||||
elsif params[:project]
|
||||
@project = Project.find params[:project]
|
||||
diskfile = disk_filename('Project', @project.id)
|
||||
else
|
||||
@user = User.current
|
||||
diskfile = disk_filename('User', @user.id)
|
||||
end
|
||||
diskfile1 = diskfile + 'temp'
|
||||
File.delete(diskfile1) if File.exist?(diskfile1)
|
||||
end
|
||||
|
||||
def save_user_avatar
|
||||
@user = User.current
|
||||
diskfile = disk_filename('User', @user.id)
|
||||
if params[:source_id] && params[:source_type]
|
||||
case params[:source_type]
|
||||
when 'User'
|
||||
@user = User.current
|
||||
diskfile = disk_filename('User', @user.id)
|
||||
when 'Course'
|
||||
@course = Course.find params[:source_id]
|
||||
diskfile = disk_filename('Course', @course.id)
|
||||
when 'Project'
|
||||
@project = Project.find params[:source_id]
|
||||
diskfile = disk_filename('Project', @project.id)
|
||||
end
|
||||
end
|
||||
diskfile1 = diskfile + 'temp'
|
||||
begin
|
||||
FileUtils.mv diskfile1, diskfile, force: true if File.exist? diskfile1
|
||||
|
|
|
@ -734,24 +734,33 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
def destroy
|
||||
if @work.destroy
|
||||
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||
pros = @work.student_work_projects.where("is_leader = 0")
|
||||
pros.each do |pro|
|
||||
pro.destroy
|
||||
end
|
||||
project = @work.student_work_projects.where("is_leader = 1").first
|
||||
project.update_attributes(:student_work_id => nil)
|
||||
elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0
|
||||
@work.student_work_projects.each do |pro2|
|
||||
pro2.destroy
|
||||
if @homework.homework_type == 3
|
||||
if @work.destroy
|
||||
if @homework.homework_detail_group.base_on_project == 1
|
||||
pros = @work.student_work_projects.where("is_leader = 0")
|
||||
pros.each do |pro|
|
||||
pro.destroy
|
||||
end
|
||||
project = @work.student_work_projects.where("is_leader = 1").first
|
||||
project.update_attributes(:student_work_id => nil)
|
||||
elsif @homework.homework_detail_group.base_on_project == 0
|
||||
@work.student_work_projects.each do |pro2|
|
||||
pro2.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to student_work_index_url(:homework => @homework.id)
|
||||
}
|
||||
end
|
||||
else
|
||||
@work.attachments.destroy_all
|
||||
@work.student_works_scores.destroy_all
|
||||
@work.course_messages.destroy_all
|
||||
@work.student_work_tests.destroy_all
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil)
|
||||
@work.update_column("work_score",nil)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to student_work_index_url(:homework => @homework.id)
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -793,6 +802,8 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
elsif @homework.homework_type == 1
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil)
|
||||
@work.attachments.destroy_all
|
||||
@work.course_messages.destroy_all
|
||||
end
|
||||
@student_work = StudentWork.new
|
||||
respond_to do |format|
|
||||
|
|
|
@ -42,7 +42,7 @@ class UsersController < ApplicationController
|
|||
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
|
||||
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
|
||||
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks]
|
||||
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses]
|
||||
before_filter :auth_user_extension, only: :show
|
||||
#before_filter :rest_user_score, only: :show
|
||||
#before_filter :select_entry, only: :user_projects
|
||||
|
@ -1115,23 +1115,8 @@ class UsersController < ApplicationController
|
|||
homework_detail_programing.save if homework_detail_programing
|
||||
homework_detail_group.save if homework_detail_group
|
||||
|
||||
if homework.homework_type != 3
|
||||
students = homework.course.student
|
||||
if !homework.course.nil? && !students.empty?
|
||||
name = homework.name
|
||||
name_str = name + "的作品提交"
|
||||
str = ""
|
||||
students.each do |student|
|
||||
if str != ""
|
||||
str += ","
|
||||
end
|
||||
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
|
||||
end
|
||||
#('#{name}的作品提交',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')
|
||||
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
|
||||
#StudentWork.create(:name => "#{name}的作品提交", :homework_common_id => homework.id, :user_id => student.student_id)
|
||||
ActiveRecord::Base.connection.execute sql
|
||||
end
|
||||
if homework.homework_type != 3 && homework_detail_manual.comment_status == 1
|
||||
create_works_list homework
|
||||
end
|
||||
|
||||
if params[:quotes] && !params[:quotes].blank?
|
||||
|
@ -1474,15 +1459,15 @@ class UsersController < ApplicationController
|
|||
#显示更多用户课程
|
||||
def user_courses4show
|
||||
@page = params[:page].to_i + 1
|
||||
@courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10).offset(@page * 10)
|
||||
@all_count = @user.courses.visible.where("is_delete =?", 0).count
|
||||
@courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10).offset(@page * 10)
|
||||
@all_count = @user.favorite_courses.visible.where("is_delete =?", 0).count
|
||||
end
|
||||
|
||||
#显示更多用户项目
|
||||
def user_projects4show
|
||||
@page = params[:page].to_i + 1
|
||||
@projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10).offset(@page * 10)
|
||||
@all_count = @user.projects.visible.count
|
||||
@projects = @user.favorite_projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10).offset(@page * 10)
|
||||
@all_count = @user.favorite_projects.visible.count
|
||||
end
|
||||
|
||||
def user_course_activities
|
||||
|
@ -3439,6 +3424,28 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#收藏班级/项目
|
||||
def cancel_or_collect
|
||||
if params[:project]
|
||||
@project = Project.find params[:project]
|
||||
member = Member.where("user_id = #{@user.id} and project_id = #{@project.id}")
|
||||
elsif params[:course]
|
||||
@course = Course.find params[:course]
|
||||
member = Member.where("user_id = #{@user.id} and course_id = #{@course.id}")
|
||||
end
|
||||
unless member.empty?
|
||||
member.first.update_attribute(:is_collect, member.first.is_collect == 0 ? 1 : 0)
|
||||
end
|
||||
if @project
|
||||
@projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)
|
||||
elsif @course
|
||||
@courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def user_projectlist
|
||||
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
|
||||
#limit = 5
|
||||
|
|
|
@ -3437,8 +3437,26 @@ def course_syllabus_option user = User.current
|
|||
type
|
||||
end
|
||||
|
||||
def create_works_list homework
|
||||
students = homework.course.student
|
||||
if !homework.course.nil? && !students.empty?
|
||||
name = homework.name
|
||||
name_str = name + "的作品提交"
|
||||
str = ""
|
||||
students.each do |student|
|
||||
if str != ""
|
||||
str += ","
|
||||
end
|
||||
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
|
||||
end
|
||||
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
|
||||
ActiveRecord::Base.connection.execute sql
|
||||
end
|
||||
end
|
||||
|
||||
# 获取项目动态更新时间
|
||||
def get_forge_act_message(act, type)
|
||||
forge_act = ForgeActivity.where(:forge_act_id => act.id, :forge_act_type => type).first
|
||||
format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
|
||||
end
|
||||
|
||||
|
|
|
@ -131,6 +131,22 @@ class Principal < ActiveRecord::Base
|
|||
columns.uniq.map {|field| "#{table}.#{field}"}
|
||||
end
|
||||
|
||||
#收藏的课程
|
||||
def favorite_courses
|
||||
members = Member.where("user_id = #{self.id} and course_id != -1 and is_collect = 1")
|
||||
course_ids = members.empty? ? "(-1)" : "(" + members.map{|member| member.course_id}.join(",") + ")"
|
||||
courses = Course.where("id in #{course_ids}")
|
||||
return courses
|
||||
end
|
||||
|
||||
#收藏的项目
|
||||
def favorite_projects
|
||||
members = Member.where("user_id = #{self.id} and project_id != -1 and project_id != 0 and is_collect = 1")
|
||||
project_ids = members.empty? ? "(-1)" : "(" + members.map{|member| member.project_id}.join(",") + ")"
|
||||
projects = Project.where("id in #{project_ids}")
|
||||
return projects
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# Make sure we don't try to insert NULL values (see #4632)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#学生提交作品表
|
||||
class StudentWork < ActiveRecord::Base
|
||||
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time
|
||||
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time
|
||||
|
||||
belongs_to :homework_common
|
||||
belongs_to :user
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
:upload_path => upload_avatar_path(:format => 'js'),
|
||||
:description_placeholder => nil ,# l(:label_optional_description)
|
||||
:source_type => source.class.to_s,
|
||||
:source_id => source.id.to_s
|
||||
:source_id => source.id.to_s,
|
||||
:is_direct => 0
|
||||
} %>
|
||||
<!--</span>-->
|
||||
<% content_for :header_tags do %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% if @source_type=='User' %>
|
||||
<% if @is_direct == '1' && (@source_type=='User'|| @source_type == 'Course' || @source_type == 'Project') %>
|
||||
var imgSpan = $("img[nhname='avatar_image']");
|
||||
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
|
||||
<% else %>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<div class="homepageRight mt0 ml10">
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">
|
||||
班级问答区
|
||||
班级讨论区
|
||||
</div>
|
||||
</div>
|
||||
<div nhname="topic_form">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
|
||||
<li>
|
||||
<a href="<%=course_boards_path(@course) %>">问答区</a>
|
||||
<a href="<%=course_boards_path(@course) %>">讨论区</a>
|
||||
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如:计算机系A班" onkeyup="regex_course_name('new');">
|
||||
<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如:软件工程计算机系A班" onkeyup="regex_course_name('new');">
|
||||
<span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
$("#course_is_public").attr("checked",true);
|
||||
<% end %>
|
||||
}
|
||||
if(document.getElementById("course_list")) {
|
||||
window.location.href = "<%=course_files_path(@course) %>";
|
||||
}
|
||||
<% else %>
|
||||
<% if @course.is_public? %>
|
||||
$("#show_course_<%= @course.id %>").attr("title","公开班级:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||
|
|
|
@ -27,9 +27,8 @@
|
|||
<div class="hwork_dis" id="tbc_01" style="padding-top: 10px;">
|
||||
<ul>
|
||||
<%= labelled_form_for @course do |f| %>
|
||||
<li class="ml45 mb10">
|
||||
<li class="ml45 mb10" id="course_avatar_form">
|
||||
<%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||
|
|
|
@ -30,7 +30,16 @@
|
|||
|
||||
<div class="cl"></div>
|
||||
<div class="sy_class_logo fl">
|
||||
<%= image_tag(url_to_avatar(@course), :width => "110", :height => "110", :alt => "班级logo") %>
|
||||
<div class="pr" style="width: 96px; height:96px;">
|
||||
<% if User.current.logged? && (User.current == @course.teacher || User.current.admin?)%>
|
||||
<%=link_to image_tag(url_to_avatar(@course),width:"96", height: "96", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @course.id), :remote => true%>
|
||||
<div class="homepageEditProfile undis">
|
||||
<%=link_to '', my_clear_user_avatar_temp_path(:course => @course.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(@course), :width => "96", :height => "96", :alt => "班级logo") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sy_class_id fl">
|
||||
<p>邀 请 码<br />
|
||||
|
@ -54,7 +63,7 @@
|
|||
</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<p class="sy_cgrey mb10">
|
||||
<p class="sy_cgrey mb5">
|
||||
<span class=" mr15">主讲老师:<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cblue') %></span>
|
||||
<span class=" mr15">学时:<span class="sy_cblack"><%= @course.class_period %>学时</span></span>
|
||||
<span class=" mr15">学期:<span class="sy_cblack"><%= current_time_and_term @course %></span></span>
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<% all_count = @user.favorite_courses.visible.where("is_delete =?", 0).count%>
|
||||
<div id="homepageLeftMenuCourses">
|
||||
<ul class="user_sub_menu" id="user_courses_li">
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user,:all_count => all_count,:page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !courses.empty? %>
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_course" onclick="leftCourseslistChange();">
|
||||
<span id="hide_show_courseicon" class="user_icons_closeclass"></span>
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('#user_hide_course').hide();
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,17 @@
|
|||
<% all_count = @user.favorite_projects.visible.count%>
|
||||
<div id="homepageLeftMenuForge">
|
||||
<ul class="user_sub_menu" id="user_projects_li">
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :all_count => all_count, :page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !projects.empty? %>
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_project" onclick="leftProjectslistChange();">
|
||||
<span id="hide_show_projecticon" class="user_icons_closeclass"></span>
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('#user_hide_project').hide();
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,44 @@
|
|||
<div>
|
||||
<div><a href="javascript:hideModal();" class="box_close"></a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="pro_new">
|
||||
<h3 class="box_h3 mb10">头像设置</h3>
|
||||
<div class="uppicBox">
|
||||
<input type="button" class="uppic_btn" onclick="$('#upload_avatar').click();" value="浏览.."/>
|
||||
<%= file_field_tag 'avatar[image]',
|
||||
:id => "upload_avatar",
|
||||
:style => 'display:none;',#added by young
|
||||
:size => "1",
|
||||
:multiple => false,
|
||||
:onchange => 'addInputAvatar(this);',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:file_type => Redmine::Configuration['pic_types'].to_s,
|
||||
:type_support_message => l(:error_pic_type),
|
||||
:upload_path => upload_avatar_path(:format => 'js'),
|
||||
:description_placeholder => nil ,# l(:label_optional_description)
|
||||
:source_type => source.class.to_s,
|
||||
:source_id => source.id.to_s,
|
||||
:is_direct => 1
|
||||
} %>
|
||||
<!--<br/>-->
|
||||
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
|
||||
</div>
|
||||
<div class="showpicBox">
|
||||
<p>预览</p>
|
||||
<%= image_tag(url_to_avatar(source), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
|
||||
<br/>
|
||||
<span >96px*96px</span> <br />
|
||||
<div class="mb20"></div>
|
||||
<%= image_tag(url_to_avatar(source), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
|
||||
<br />
|
||||
<span>48px*48px</span> <br />
|
||||
</div>
|
||||
<div class="cl mb10"></div>
|
||||
<a href="javascript:hideModal();" class=" fr grey_btn mr15 f14"> 取 消</a>
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar', :source_id => source.id, :source_type => source.class.to_s) %>" data-remote="true" class="blue_btn fr mr10 f14">确 定</a>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
||||
</div><!--floatbox end-->
|
|
@ -52,6 +52,10 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<% if User.current == user %>
|
||||
<li>
|
||||
<%= link_to "取消收藏", cancel_or_collect_user_path(user, :course => course.id), :class => 'user_navmore_li',:target => '_blank', :remote => true %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
<% if count == 0 %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post', :class => 'user_navmore_li',:remote => true %>
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<% if User.current == @user %>
|
||||
<li>
|
||||
<%= link_to "取消收藏", cancel_or_collect_user_path(user, :project => project.id), :class => 'user_navmore_li',:target => '_blank', :remote => true %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
|
||||
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true,:class => "user_navmore_li" %>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus'%>
|
||||
<%= javascript_include_tag "course","header","attachments",'prettify' %>
|
||||
<%= javascript_include_tag "course","avatars","header","attachments",'prettify' %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
|
@ -65,7 +65,7 @@
|
|||
<% unless show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
|
||||
<li id="sy_02" class="sy_icons_boards">
|
||||
<% count = @course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0 %>
|
||||
<a href="<%=course_boards_path(@course) %>">问答区<span><%=count %></span></a>
|
||||
<a href="<%=course_boards_path(@course) %>">讨论区<span><%=count %></span></a>
|
||||
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
@ -151,6 +151,9 @@
|
|||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
|
||||
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @course} %>
|
||||
</div>
|
||||
<%= call_hook :view_layouts_base_body_bottom %>
|
||||
</body>
|
||||
<script>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository' %>
|
||||
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %>
|
||||
<%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %>
|
||||
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
|
@ -50,7 +50,16 @@
|
|||
<div id="LSide" class="fl">
|
||||
<div class="project_info">
|
||||
<div class="pr_info_logo fl mr10 mb5">
|
||||
<%= image_tag(url_to_avatar(@project), :width => "60", :height => "60") %>
|
||||
<div class="pr" style="width: 64px; height:64px;">
|
||||
<% if User.current.logged? && (User.current.id == @project.user_id || User.current.admin?)%>
|
||||
<%=link_to image_tag(url_to_avatar(@project),width:"60", height: "60", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:project => @project.id), :remote => true%>
|
||||
<div class="homepageEditProfile undis">
|
||||
<%=link_to '', my_clear_user_avatar_temp_path(:project => @project.id), :remote => true, :class => 'homepageEditProfileIcon', :title => '点击编辑Logo' %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(@project), :width => "60", :height => "60", :alt => "项目logo") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pr_info_id fl mb5 f14">
|
||||
<%= l(:label_project_ivite_code)%>
|
||||
|
@ -249,6 +258,9 @@
|
|||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
|
||||
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @project} %>
|
||||
</div>
|
||||
<%= call_hook :view_layouts_base_body_bottom %>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -103,9 +103,12 @@
|
|||
<div class="homepageLeft mt10" id="LSide">
|
||||
<div class="user_leftinfo mb10">
|
||||
<% if User.current.logged? && User.current == @user%>
|
||||
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id => 'nh_user_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
|
||||
<% elsif User.current.logged? %>
|
||||
<a href="javascript:void(0)" style="cursor: default;" class="user_leftinfo_img"><%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx') %></a>
|
||||
<div class="pr" style="width: 80px; margin:0 auto;">
|
||||
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
|
||||
<div class="homepageEditProfile undis">
|
||||
<%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<img src="images/user/male.jpg" width="74" height="74" />
|
||||
<% end %>
|
||||
|
@ -159,20 +162,10 @@
|
|||
<% if !unvisiable %>
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_01" class="user_icons_course">
|
||||
<%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
|
||||
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
|
||||
<% all_count = @user.courses.visible.where("is_delete =?", 0).count%>
|
||||
<div class="<%= courses.empty? ? 'none' : ''%>" >
|
||||
<div id="homepageLeftMenuCourses">
|
||||
<ul class="user_sub_menu" id="user_courses_li">
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user,:all_count => all_count,:page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !courses.empty? %>
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_course" onclick="leftCourseslistChange();">
|
||||
<span id="hide_show_courseicon" class="user_icons_closeclass"></span>
|
||||
</a>
|
||||
<% end %>
|
||||
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
|
||||
<% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
|
||||
<div class="<%= courses.empty? ? 'none' : ''%>" id="homepage_left_course_list">
|
||||
<%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %>
|
||||
</div>
|
||||
</li>
|
||||
<% if is_current_user %>
|
||||
|
@ -197,19 +190,9 @@
|
|||
<ul class="users_accordion mb10">
|
||||
<li id="user_06" class="user_icons_project">
|
||||
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%>
|
||||
<% all_count = @user.projects.visible.count%>
|
||||
<% projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
|
||||
<div class="<%= projects.empty? ? 'none' : ''%>" >
|
||||
<div id="homepageLeftMenuForge">
|
||||
<ul class="user_sub_menu" id="user_projects_li">
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :all_count => all_count, :page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% if !projects.empty? %>
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_hide_project" onclick="leftProjectslistChange();">
|
||||
<span id="hide_show_projecticon" class="user_icons_closeclass"></span>
|
||||
</a>
|
||||
<% end %>
|
||||
<% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
|
||||
<div class="<%= projects.empty? ? 'none' : ''%>" id="homepage_left_project_list">
|
||||
<%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %>
|
||||
</div>
|
||||
</li>
|
||||
<% if is_current_user %>
|
||||
|
@ -248,53 +231,10 @@
|
|||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
|
||||
<div>
|
||||
<div><a href="javascript:hideModal();" class="box_close"></a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="pro_new">
|
||||
<h3 class="box_h3 mb10">头像设置</h3>
|
||||
<div class="uppicBox">
|
||||
<input type="button" class="uppic_btn" onclick="$('#upload_user_image').click();" value="浏览.."/>
|
||||
<%= file_field_tag 'avatar[image]',
|
||||
:id => "upload_user_image",
|
||||
:style => 'display:none;',#added by young
|
||||
:size => "1",
|
||||
:multiple => false,
|
||||
:onchange => 'addInputAvatar(this);',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:file_type => Redmine::Configuration['pic_types'].to_s,
|
||||
:type_support_message => l(:error_pic_type),
|
||||
:upload_path => upload_avatar_path(:format => 'js'),
|
||||
:description_placeholder => nil ,# l(:label_optional_description)
|
||||
:source_type => @user.class.to_s,
|
||||
:source_id => @user.id.to_s
|
||||
} %>
|
||||
<!--<br/>-->
|
||||
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
|
||||
</div>
|
||||
<div class="showpicBox">
|
||||
<p>预览</p>
|
||||
<%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
|
||||
<br/>
|
||||
<span >96px*96px</span> <br />
|
||||
<div class="mb20"></div>
|
||||
<%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
|
||||
<br />
|
||||
<span>48px*48px</span> <br />
|
||||
</div>
|
||||
<div class="cl mb10"></div>
|
||||
<a href="javascript:hideModal();" class=" fr grey_btn mr15 f14"> 取 消</a>
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10 f14">确 定</a>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
||||
</div><!--floatbox end-->
|
||||
<%=render :partial => 'layouts/upload_avatar', :locals => {:source => @user} %>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#user_hide_course').hide();
|
||||
$('#user_hide_project').hide();
|
||||
autoUrl("user_brief_introduction_show");
|
||||
if(<%= @is_course == 1 %>) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$("img[nhname='avatar_image']").attr('src',$("#nh_user_tx").attr('src'));
|
||||
$("img[nhname='avatar_image']").attr('src',$("#nh_source_tx").attr('src'));
|
||||
$('#ajax-modal').html($("#nh_tx_dialog_html").html());
|
||||
showModal('ajax-modal','460px');
|
||||
$('#ajax-modal').siblings().hide();
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:78px;height:78px;overflow:hidden",:alt=>"头像") %>');
|
||||
<% if @user %>
|
||||
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_source_tx',:style=>"width:78px;height:78px;overflow:hidden",:alt=>"头像") %>');
|
||||
$("#nh_user_logo").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_logo',:width =>"40",:height => "40",:alt=>"头像") %>');
|
||||
<% elsif @course %>
|
||||
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@course), :id=>'nh_source_tx',:style=>"width:96px;height:96px;overflow:hidden",:alt=>"班级logo") %>');
|
||||
if($("#course_avatar_form").length > 0) {
|
||||
window.location.href = "<%=settings_course_path(@course) %>";
|
||||
}
|
||||
<% elsif @project %>
|
||||
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"项目logo") %>');
|
||||
if($("#project_avatar_form").length > 0) {
|
||||
window.location.href = "<%=settings_project_path(@project) %>";
|
||||
}<% end %>
|
||||
hideModal();
|
|
@ -12,7 +12,7 @@
|
|||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.course.name.to_s+" | 班级问答区", course_boards_url_in_org(activity.course.id), :class => "newsBlue ml15 mr5"%>
|
||||
<%= link_to activity.course.name.to_s+" | 班级讨论区", course_boards_url_in_org(activity.course.id), :class => "newsBlue ml15 mr5"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle hidden m_w530 fl">
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<%= error_messages_for 'project' %>
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<ul class="newpro_box ">
|
||||
<li class="ml45 mb10">
|
||||
<li class="ml45 mb10" id="project_avatar_form">
|
||||
<%= render :partial=>"avatar/new_avatar_form",:locals=> {source:@project} %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<label class="label02"><span class="c_red">*</span> 项目名称 :</label>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<span title ="该项目是私有的"><%=work.project.name %></span>
|
||||
<% end %>
|
||||
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=work.project.project_score.score.to_i %></font>)</span>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=static_project_score(work.project.project_score).to_i %></font>)</span>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<% member = Member.where("user_id = #{@user.id} and course_id = #{course.id}").first %>
|
||||
<% if User.current == @user %>
|
||||
<% if member %>
|
||||
<%= link_to "", cancel_or_collect_user_path(@user, :course => course.id), :class => "#{member.is_collect == 1 ? 'icons_sy_favorite' : 'icons_sy_star'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从个人主页的班级列表中移除' : '点击将其添加至个人主页的班级列表中'}" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if member %>
|
||||
<span class="<%= member.is_collect == 1 ? 'icons_sy_favorite' : 'icons_sy_star'%>"></span>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,10 @@
|
|||
<% member = Member.where("user_id = #{@user.id} and project_id = #{project.id}").first %>
|
||||
<% if User.current == @user %>
|
||||
<% if member %>
|
||||
<%= link_to "", cancel_or_collect_user_path(@user, :project => project.id), :class => "#{member.is_collect == 1 ? 'icons_project_favorite mt3' : 'icons_project_star mt3'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从个人主页的班级列表中移除' : '点击将其添加至个人主页的班级列表中'}" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if member %>
|
||||
<span class="<%= member.is_collect == 1 ? 'icons_project_favorite mt3' : 'icons_project_star mt3'%>"></span>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1,7 +1,7 @@
|
|||
<div class = "cl"> </div>
|
||||
<div id="course-boardlist">
|
||||
<div class="listbox mt10" >
|
||||
<h2 class="list-h2">问答区列表</h2>
|
||||
<h2 class="list-h2">讨论区列表</h2>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<div class="homepagePostTo break_word">
|
||||
<%= link_to activity.author.show_name, user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
TO
|
||||
<%= link_to activity.course.name.to_s+" | 班级问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||
<%= link_to activity.course.name.to_s+" | 班级讨论区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle hidden m_w530 fl">
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
|
|
|
@ -1,30 +1,44 @@
|
|||
<% unless courses.nil? %>
|
||||
<% courses.each_with_index do |course, i| %>
|
||||
<li class="syllabus_class_list <%=i > 2 ? 'none' : '' %>">
|
||||
<li class="syllabus_class_list <%= i > 2 ? 'none' : '' %>">
|
||||
<% allow_visit = User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1 %>
|
||||
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问"%>">
|
||||
<span class="icons_sy_cir "></span>
|
||||
<div class="fl">
|
||||
<div class="syllabus_class_w ">
|
||||
<p class="syllabus_class_title fl"><%=course.name %></p>
|
||||
<span class="<%= course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl"></span>
|
||||
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%=course.teacher.show_name %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="">
|
||||
<p class="fl grayTxt ">更新:<%=format_date Time.at(course.updatetime) %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p>
|
||||
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(course).count %></span><span>资源</span></p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<span id="collect_course_icon_<%=course.id %>">
|
||||
<%=render :partial => 'collect_course', :locals => {:course => course} %>
|
||||
</span>
|
||||
|
||||
<div class="fl">
|
||||
<div class="syllabus_class_w ">
|
||||
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" class="syllabus_class_title fl" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= course.name %></a>
|
||||
<span class="<%= course.is_public == 0 ? 'syllabus_class_private' : 'syllabus_class_open' %> fl ml10 mt3 syllabus_class_property"><%= course.is_public == 0 ? '私有' : '公开' %></span>
|
||||
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %></span>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<span class="icons_sy_arrow fl mt19 ml10" ></span>
|
||||
<div class="cl"></div>
|
||||
</a>
|
||||
<div class="">
|
||||
<p class="fl grayTxt ">更新:<%= format_date Time.at(course.updatetime) %><span class="mr10"></span>
|
||||
学期:<%= current_time_and_term(course) %></p>
|
||||
|
||||
<p class="list-info fr grayTxt">
|
||||
<% student_link = (User.current.logged? && course.open_student == 1 && course.is_public == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
|
||||
<span><a href="<%= student_link ? course_member_path(course, :role => 2) : "javascript:void(0)" %>" target="_blank" title="<%= student_link ? "" : "学生列表不对外公开" %>"><%= studentCount course %></a></span><span>学生</span>
|
||||
<span>|</span>
|
||||
<span><a href="<%= allow_visit ? homework_common_index_path(:course => course.id) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= visable_course_homework course %></a></span><span>作业</span>
|
||||
<span>|</span>
|
||||
<span><a href="<%= allow_visit ? course_files_path(course) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= visable_attachemnts_incourse(course).count %></a></span><span>资源</span>
|
||||
</p>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="icons_sy_arrow fl mt19 ml10"></span>
|
||||
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if courses.count > 3 %>
|
||||
<li class="syllabus_class_list_more" id="syllabus_class_list_more_<%=syllabus.id %>">
|
||||
<a href="javascript:void(0);" id="expand_list_<%=syllabus.id %>" data-init="0" onclick="expand_course_list(<%=syllabus.id %>,'#syllabus_course_ul_<%=syllabus.id %> li','#expand_list_<%=syllabus.id %>',<%=courses.count %>)">共<%=courses.count %>个班级,点击全部展开</a>
|
||||
<li class="syllabus_class_list_more" id="syllabus_class_list_more_<%= syllabus.id %>">
|
||||
<a href="javascript:void(0);" id="expand_list_<%= syllabus.id %>" data-init="0" onclick="expand_course_list(<%=syllabus.id %>,'#syllabus_course_ul_<%=syllabus.id %> li','#expand_list_<%=syllabus.id %>',<%=courses.count %>)">共<%= courses.count %>
|
||||
个班级,点击全部展开</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -32,10 +32,12 @@
|
|||
<% projects.each_with_index do |project, i| %>
|
||||
<div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;">
|
||||
<div class="sy_courses_open">
|
||||
<span class="icons_project_list fl mt5 mr10"></span>
|
||||
<span id="collect_project_icon_<%=project.id %>">
|
||||
<%=render :partial => 'collect_project', :locals => {:project => project} %>
|
||||
</span>
|
||||
<h3><%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%></h3>
|
||||
<% unless project.is_public? %>
|
||||
<span class="hw_icon_private fl"></span>
|
||||
<span class="syllabus_class_private fl ml10 mt3 syllabus_class_property">私有</span>
|
||||
<% end %>
|
||||
<% projectUser = User.where("id=?",project.user_id).first %>
|
||||
<%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<% if @course %>
|
||||
$("#homepage_left_course_list").html("<%= escape_javascript(render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => @courses}) %>");
|
||||
if($("#collect_course_icon_<%=@course.id %>").length > 0){
|
||||
$("#collect_course_icon_<%=@course.id %>").html("<%= escape_javascript(render :partial => 'users/collect_course', :locals => {:course => @course}) %>");
|
||||
}
|
||||
<% elsif @project %>
|
||||
$("#homepage_left_project_list").html("<%= escape_javascript(render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => @projects}) %>");
|
||||
if($("#collect_project_icon_<%=@project.id %>").length > 0){
|
||||
$("#collect_project_icon_<%=@project.id %>").html("<%= escape_javascript(render :partial => 'users/collect_project', :locals => {:project => @project}) %>");
|
||||
}
|
||||
<% end %>
|
|
@ -27,8 +27,9 @@
|
|||
} else if(count > 0) {
|
||||
var str = div.next().children().eq(0).attr('id');
|
||||
var id = str.substring(19);
|
||||
var user_id = <%= @user.id%>;
|
||||
$.get(
|
||||
'/users/expand_courses?syllabus_id=' + id
|
||||
'/users/'+user_id+'/expand_courses?syllabus_id=' + id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -621,7 +621,7 @@ zh:
|
|||
label_homework_info: 提交情况 #huang
|
||||
|
||||
label_course_news_description: '课程必须是高校正式开设的课程,或是围绕特定主题定期发布课程资料的公共开放课程;<br/>如果您想创建一个协作研究空间,请您前往“我的项目”页面创建项目,谢谢!'
|
||||
label_course_board: 问答区
|
||||
label_course_board: 讨论区
|
||||
label_version: 版本
|
||||
label_version_new: 新建版本
|
||||
|
||||
|
@ -1743,7 +1743,7 @@ zh:
|
|||
label_newbie_faq: '新手指引 & 问答'
|
||||
label_hot_project: '热门项目'
|
||||
label_borad_project: 项目讨论区
|
||||
label_borad_course: 班级问答区
|
||||
label_borad_course: 班级讨论区
|
||||
label_borad_org_subfield: 资源栏目讨论区
|
||||
view_borad_course: 课程讨论
|
||||
label_memo_create_succ: 发布成功
|
||||
|
@ -2143,7 +2143,7 @@ zh:
|
|||
#微信模板消息
|
||||
label_new_homework_template: 您有新作业了。
|
||||
label_update_homework_template: 您的作业已被修改。
|
||||
label_course_topic_template: 课程问答区有新帖子发布了。
|
||||
label_course_topic_template: 班级讨论区有新帖子发布了。
|
||||
label_topic_comment_template: 您的帖子有新回复了。
|
||||
label_project_topic_template: 项目讨论区有新帖子发布了。
|
||||
label_issue_comment_template: 您的缺陷有新回复了。
|
||||
|
|
|
@ -567,7 +567,6 @@ RedmineApp::Application.routes.draw do
|
|||
post 'user_select_homework'
|
||||
post 'check_homework'
|
||||
get 'all_journals'
|
||||
get 'expand_courses'
|
||||
end
|
||||
|
||||
member do
|
||||
|
@ -667,6 +666,8 @@ RedmineApp::Application.routes.draw do
|
|||
post 'apply_for_resource'
|
||||
match 'manage_or_receive_homeworks', :to => 'users#manage_or_receive_homeworks', :via => :get
|
||||
get 'search_m_r_homeworks'
|
||||
get 'expand_courses'
|
||||
get 'cancel_or_collect'
|
||||
# end
|
||||
end
|
||||
#resources :blogs
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddIsCollectToMembers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :members, :is_collect, :integer, :default => 1
|
||||
end
|
||||
end
|
5053
db/schema.rb
5053
db/schema.rb
File diff suppressed because it is too large
Load Diff
|
@ -8,6 +8,22 @@ namespace :homework_publishtime do
|
|||
homework_detail_manual = homework.homework_detail_manual
|
||||
if homework_detail_manual.comment_status == 0
|
||||
homework_detail_manual.update_column('comment_status', 1)
|
||||
if homework.homework_type != 3
|
||||
students = homework.course.student
|
||||
if !homework.course.nil? && !students.empty?
|
||||
name = homework.name
|
||||
name_str = name + "的作品提交"
|
||||
str = ""
|
||||
students.each do |student|
|
||||
if str != ""
|
||||
str += ","
|
||||
end
|
||||
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
|
||||
end
|
||||
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
|
||||
ActiveRecord::Base.connection.execute sql
|
||||
end
|
||||
end
|
||||
course = homework.course
|
||||
course.members.each do |m|
|
||||
homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => nil)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<div class="cl"></div>
|
||||
<div class="ml40">
|
||||
<div class="post-dynamic-title c-black fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div>
|
||||
<div class="c-grey4 f13 mt5"><span class="mr10">{{discussion.course_project_name}} - 课程问答区</span><span>{{discussion.created_on}}</span></div>
|
||||
<div class="c-grey4 f13 mt5"><span class="mr10">{{discussion.course_project_name}} - 班级讨论区</span><span>{{discussion.created_on}}</span></div>
|
||||
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
|
||||
<div class="cl"></div>
|
||||
<div class="fr f13">
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
|
@ -2099,3 +2099,15 @@ function throttle_me(method, context, e, condition, url){
|
|||
},500);
|
||||
}
|
||||
|
||||
//头像、logo编辑图标显隐
|
||||
function edit_img(){
|
||||
$(".homepageEditProfile").parent().mouseover(function(){
|
||||
$(".homepageEditProfile").show();
|
||||
});
|
||||
$(".homepageEditProfile").parent().mouseout(function(){
|
||||
$(".homepageEditProfile").hide();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(edit_img);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
ajaxUpload.uploading++;
|
||||
|
||||
uploadBlob(file, $(inputEl).data('upload-path'),$(inputEl).data('source-type'), $(inputEl).data('source-id'),{
|
||||
uploadBlob(file, $(inputEl).data('upload-path'),$(inputEl).data('source-type'), $(inputEl).data('source-id'),$(inputEl).data('is-direct'),{
|
||||
loadstartEventHandler: onLoadstart.bind(progressSpan),
|
||||
progressEventHandler: onProgress.bind(progressSpan)
|
||||
})
|
||||
|
@ -82,14 +82,14 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
function uploadBlob(blob, uploadUrl, source_type,source_id, options) {
|
||||
function uploadBlob(blob, uploadUrl, source_type,source_id,is_direct, options) {
|
||||
|
||||
var actualOptions = $.extend({
|
||||
loadstartEventHandler: $.noop,
|
||||
progressEventHandler: $.noop
|
||||
}, options);
|
||||
|
||||
uploadUrl = uploadUrl + '?source_type=' + source_type + '&source_id=' + source_id;
|
||||
uploadUrl = uploadUrl + '?source_type=' + source_type + '&source_id=' + source_id + '&is_direct=' + is_direct;
|
||||
if (blob instanceof window.File) {
|
||||
uploadUrl += '&filename=' + encodeURIComponent(blob.name);
|
||||
}
|
||||
|
|
|
@ -551,32 +551,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
|
|||
/*新版项目列表新增*/
|
||||
.new_project_title{ font-size:16px; color:#333; max-width:560px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
.icons_project_list{ width:8px; height:8px; border:2px solid #fff; background:#3b94d6;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;-webkit-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5); }
|
||||
.icons_project_favorite {background: url(/images/syllabus/sy_icons_star.png) 0px 0px no-repeat; width:20px; height:20px; display:block; float:left;}
|
||||
.icons_project_star{background: url(/images/syllabus/sy_icons_star.png) 0px -27px no-repeat; width:20px; height:20px; display:block; float:left;}
|
||||
.new_projectlist_more{ text-align:center;}
|
||||
.new_projectlist_more a:hover{ color:#3b94d6;}
|
||||
/*新版项目引用的新版课程大纲中的公共样式*/
|
||||
.icons_tishi{
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
margin: 135px auto 20px;
|
||||
}
|
||||
.sy_tab_con_p{
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin-bottom:100px;
|
||||
color:#888;
|
||||
}
|
||||
a.sy_btn_green{
|
||||
display:inline-block;
|
||||
color: #fff;
|
||||
background: #60b25e;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
padding:0 15px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
-webkit-border-radius:3px;
|
||||
-moz-border-radius:3px;
|
||||
-o-border-radius:3px;
|
||||
border-radius:3px;
|
||||
}
|
||||
a:hover.sy_btn_green{ background: #51a74f;}
|
||||
.new_projectlist_more a:hover{ color:#3b94d6;}
|
||||
|
|
|
@ -1418,4 +1418,31 @@ a:hover.comment_ding_link{ color:#269ac9;}
|
|||
}
|
||||
a.syllabusbox_a_blue{
|
||||
color:#3b94d6 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.icons_tishi{
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
margin: 135px auto 20px;
|
||||
}
|
||||
.sy_tab_con_p{
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin-bottom:100px;
|
||||
color:#888;
|
||||
}
|
||||
a.sy_btn_green{
|
||||
display:inline-block;
|
||||
color: #fff;
|
||||
background: #60b25e;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
padding:0 15px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
-webkit-border-radius:3px;
|
||||
-moz-border-radius:3px;
|
||||
-o-border-radius:3px;
|
||||
border-radius:3px;
|
||||
}
|
||||
a:hover.sy_btn_green{ background: #51a74f;}
|
|
@ -109,21 +109,6 @@ a:hover.btn_green_big{
|
|||
background: #60b25e;
|
||||
color: #fff;
|
||||
}
|
||||
a.sy_btn_green{
|
||||
display:inline-block;
|
||||
color: #fff;
|
||||
background: #60b25e;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
padding:0 15px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
-webkit-border-radius:3px;
|
||||
-moz-border-radius:3px;
|
||||
-o-border-radius:3px;
|
||||
border-radius:3px;
|
||||
}
|
||||
a:hover.sy_btn_green{ background: #51a74f;}
|
||||
|
||||
/*a.sy_btn_grey{*/
|
||||
/*color: #333;*/
|
||||
|
|
|
@ -80,6 +80,8 @@ input.syllabus_input_min{
|
|||
.icons_sy_setting{background: url(../images/syllabus/icons_syllabus.png) -51px -33px no-repeat; width:20px; height:20px; display:block; position:absolute; right:10px; top:10px; }
|
||||
.icons_sy_setting:hover{background: url(../images/syllabus/icons_syllabus.png) -25px -33px no-repeat; }
|
||||
.icons_sy_cir{background: url(../images/syllabus/icons_syllabus.png) 0px -82px no-repeat; width:15px; height:15px; display:block; position:absolute; left:-8px; top:25px;}
|
||||
.icons_sy_favorite{background: url(../images/syllabus/sy_icons_star.png) 0px 0px no-repeat; width:20px; height:20px; display:block; position:absolute; left:-10px; top:25px;}
|
||||
.icons_sy_star{background: url(../images/syllabus/sy_icons_star.png) 0px -27px no-repeat; width:20px; height:20px; display:block; position:absolute; left:-10px; top:25px;}
|
||||
.icons_sy_arrow{background: url(../images/syllabus/icons_syllabus.png) -31px -81px no-repeat; width:20px; height:20px; display:block; }
|
||||
.syllabus_h2_top{ font-size:18px; color:#333; font-weight:normal; padding:10px 15px;border-bottom:1px solid #e7e7e7; }
|
||||
.syllabus_category{ padding:10px 15px; background-color:#f6f6f6; border-bottom:1px solid #e7e7e7;}
|
||||
|
@ -94,8 +96,11 @@ input.syllabus_input_min{
|
|||
.syllabus_class_list_more{padding:8px; text-align:center;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7;}
|
||||
.syllabus_class_list_more:hover{ background:#ececec;}
|
||||
.syllabus_class_list_more a{ color:#ff7e00;}
|
||||
.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
a.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
.syllabus_class_w{ width:650px;}
|
||||
.syllabus_class_property {font-size:12px; padding:0 5px; border-radius:3px; line-height:14px;}
|
||||
.syllabus_class_private {color:#ff4a1b; border:1px solid #ff4a1b;}
|
||||
.syllabus_class_open {color:#7dd26c; border:1px solid #7dd26c;}
|
||||
|
||||
|
||||
/*新建页面*/
|
||||
|
@ -164,17 +169,6 @@ input.syllabus_input_min{
|
|||
border-bottom:none;
|
||||
}
|
||||
/* 课程大纲 */
|
||||
.icons_tishi{
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
margin: 135px auto 20px;
|
||||
}
|
||||
.sy_tab_con_p{
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin-bottom:100px;
|
||||
color:#888;
|
||||
}
|
||||
.sy_classlist{
|
||||
padding: 15px 15px;
|
||||
border-bottom: 1px dashed #e6e6e6;
|
||||
|
@ -320,16 +314,16 @@ a.sy_class_option:hover {
|
|||
}
|
||||
|
||||
.sy_class_logo{
|
||||
width:110px;
|
||||
height:110px;
|
||||
width:96px;
|
||||
height:96px;
|
||||
}
|
||||
.sy_class_id{
|
||||
width:108px;
|
||||
height:78px;
|
||||
width:94px;
|
||||
height:70px;
|
||||
border:1px solid #f1f1f1;
|
||||
background:#fff;
|
||||
text-align:center;
|
||||
padding-top:30px;
|
||||
padding-top:24px;
|
||||
}
|
||||
.sy_class_id p{
|
||||
font-size:16px;
|
||||
|
@ -375,7 +369,7 @@ a.sy_class_option:hover {
|
|||
line-height: 22px;
|
||||
}
|
||||
|
||||
.sy_class_titbox{margin-bottom:5px; padding-top:10px; }
|
||||
.sy_class_titbox{ padding-top:5px; }
|
||||
a.sy_btn_orange{
|
||||
display:block;
|
||||
border:1px solid #ee4a1f;
|
||||
|
@ -425,9 +419,9 @@ a:hover.sy_btn_orange{
|
|||
|
||||
.accordion li > a span {
|
||||
margin-top:15px;
|
||||
font-size:12px;
|
||||
font-size:11px;
|
||||
padding: 0 10px;
|
||||
background: #ccc;
|
||||
background: #eee;
|
||||
-webkit-border-radius: 15px;
|
||||
-moz-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
|
@ -439,7 +433,7 @@ a:hover.sy_btn_orange{
|
|||
.accordion > li > a.active span {
|
||||
margin-left:10px;
|
||||
color: #888;
|
||||
background: #ccc;
|
||||
background: #ddd;
|
||||
}
|
||||
/* Images */
|
||||
.accordion > li > a:before {
|
||||
|
|
Loading…
Reference in New Issue