diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index 8a64918ae..11a788590 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -27,7 +27,12 @@ class CommentsController < ApplicationController
raise Unauthorized unless @news.commentable?
@comment = Comment.new
- @project ? @comment.comments = params[:comment][:comments] : @comment.comments = params[:comment]
+ #@project ? @comment.comments = params[:comment][:comments] : @comment.comments = params[:comment]
+ if params[:user_activity_id]
+ @comment.comments = params[:comment]
+ else
+ @comment.comments = params[:comment][:comments]
+ end
@comment.author = User.current
if @news.comments << @comment
if params[:asset_id]
@@ -48,7 +53,7 @@ class CommentsController < ApplicationController
# end
# end
# # ������ض�̬�ļ�¼add end
- flash[:notice] = l(:label_comment_added)
+ #flash[:notice] = l(:label_comment_added)
course_activity = CourseActivity.where("course_act_type='News' and course_act_id =#{@news.id}").first
if course_activity
course_activity.updated_at = Time.now
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index aa0e1596f..57e365aff 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -293,10 +293,15 @@ class CoursesController < ApplicationController
@all_members = searchTeacherAndAssistant(@course)
@members = @all_members
when '2'
- @subPage_title = l :label_student_list
- page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
- @all_members = student_homework_score(0,page, 10,"desc")
- @members = @all_members
+ if @course.open_student == 1 || User.current.member_of_course?(@course)
+ @subPage_title = l :label_student_list
+ page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
+ @all_members = student_homework_score(0,page, 10,"desc")
+ @members = @all_members
+ else
+ render_403
+ return
+ end
end
respond_to do |format|
if params[:page]
@@ -394,6 +399,25 @@ class CoursesController < ApplicationController
end
+ def private_or_public
+ if @course.is_public == 0
+ @course.update_attributes(:is_public => 1)
+ else
+ @course.update_attributes(:is_public => 0)
+ end
+ if @course.is_public == 0
+ course_status = CourseStatus.find_by_course_id(@course.id)
+ course_status.destroy if course_status
+ elsif @course.is_public == 1
+ course_status = CourseStatus.find_by_course_id(@course.id)
+ course_status.destroy if course_status
+ course_status = CourseStatus.create(:course_id => @course.id, :grade => 0)
+ end
+ respond_to do |format|
+ format.js
+ end
+ end
+
def search_member
if User.current.allowed_to?(:as_teacher,@course) || User.current.admin
q = "#{params[:name].strip}"
diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb
index 25b5dacec..9c073afa8 100644
--- a/app/controllers/exercise_controller.rb
+++ b/app/controllers/exercise_controller.rb
@@ -485,7 +485,7 @@ class ExerciseController < ApplicationController
ea.answer_text = params[:answer_text]
if ea.save
@percent = get_percent(@exercise,User.current)
- render :json => {:text => pv.vote_text,:percent => format("%.2f", @percent)}
+ render :json => {:text => ea.answer_text,:percent => format("%.2f", @percent)}
else
render :json => {:text => "failure"}
end
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 048f62296..46362c2d3 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -63,6 +63,7 @@ class HomeworkCommonController < ApplicationController
end
@homework.end_time = params[:homework_common][:end_time] || Time.now
@homework.course_id = params[:course_id]
+ @homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 1
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
if @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 9b81ac775..77dc1a9aa 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -81,7 +81,8 @@ class IssuesController < ApplicationController
@status_id = params[:status_id]
@subject = params[:subject]
@issue_count = @query.issue_count
- @issue_pages = Paginator.new @issue_count, @limit, params['page'].to_i + 1
+ @issue_pages = Paginator.new @issue_count, @limit, params['page']
+ params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
@offset ||= @issue_pages.offset
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
:order => sort_clause,
diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb
index be2b44c06..d3ac71b99 100644
--- a/app/controllers/news_controller.rb
+++ b/app/controllers/news_controller.rb
@@ -69,20 +69,25 @@ class NewsController < ApplicationController
elsif @course
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
scope = @course ? @course.news.course_visible : News.course_visible
+ news_arr = scope.map{|news| news.id}
+
+ @page = params[:page] ? params[:page].to_i + 1 : 0
+ news_page = @page *10
@news_count = scope.count
+ @is_new = params[:is_new]
@q = params[:subject]
if params[:subject].nil? || params[:subject].blank?
- scope_order = scope.all(:include => [:author, :course],
- :order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC")
+ scope_order = scope.reorder("#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC").limit(10).offset(news_page).includes(:author,:course).all()
+ #all(:include => [:author, :course],
+ #:order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC").limit(10).offset(news_page)
else
- scope_order = scope.where("#{News.table_name}.title like '#{'%' << params[:subject].to_s << '%'}'").all(:include => [:author, :course],
- :order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC")
+ scope_order = scope.where("#{News.table_name}.title like '#{'%' << params[:subject].to_s << '%'}'").reorder("#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC").limit(10).offset(news_page).includes(:author,:course).all()
+ #.all(:include => [:author, :course],:order => "#{News.table_name}.sticky DESC, #{News.table_name}.created_on DESC")
end
- # :offset => @offset,
- # :limit => @limit)
- @newss = paginateHelper scope_order,10
+ @newss = scope_order
+ #@newss = paginateHelper scope_order,10
respond_to do |format|
format.html {
@news = News.new
@@ -130,6 +135,7 @@ class NewsController < ApplicationController
result = cs.show_course_news params,User.current
@news = result[:news]
@comments = result[:comments]
+ @comment = Comment.new
#@comments = @news.comments
#@comments.reverse! if User.current.wants_comments_in_reverse_order?
#modify by nwb
@@ -147,7 +153,22 @@ class NewsController < ApplicationController
@news = News.new(:project => @project, :author => User.current)
elsif @course
@news = News.new(:course => @course, :author => User.current)
- render :layout => 'base_courses'
+ #render :layout => 'base_courses'
+ @news.safe_attributes = params[:news]
+ @news.save_attachments(params[:attachments])
+ if @news.save
+ if params[:asset_id]
+ ids = params[:asset_id].split(',')
+ update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS
+ end
+ render_attachment_warning_if_needed(@news)
+ #flash[:notice] = l(:notice_successful_create)
+ redirect_to course_news_index_url(@course)
+ else
+ redirect_to course_news_index_url(@course)
+ #layout_file = 'base_courses'
+ #render :action => 'new', :layout => layout_file
+ end
end
end
@@ -210,7 +231,7 @@ class NewsController < ApplicationController
@news.save_attachments(params[:attachments])
if @news.save
render_attachment_warning_if_needed(@news)
- flash[:notice] = l(:notice_successful_update)
+ #flash[:notice] = l(:notice_successful_update)
redirect_to news_url(@news)
else
#flash[:error] = l(:notice_successful_update)
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 38402f68e..bba1587b6 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -98,7 +98,7 @@ class OrganizationsController < ApplicationController
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Poll' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
end
end
- @page = params[:page]
+ @page = params[:page] || 1
respond_to do |format|
format.html
format.js
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index e939511b6..1674055ac 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -31,8 +31,8 @@ class RepositoriesController < ApplicationController
default_search_scope :changesets
before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo]
- before_filter :find_repository, :only => [:edit, :update, :destroy, :committers, :forked]
- before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo,:to_gitlab]
+ before_filter :find_repository, :only => [:edit, :update, :destroy, :committers]
+ before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked]
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked]
accept_rss_auth :revisions
@@ -64,6 +64,8 @@ class RepositoriesController < ApplicationController
end
def forked
+ @project = Project.find(params[:id])
+ @repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab")
# 如果当前用户已经fork过该项目,不会新fork项目,则跳至已fork的项
unless has_forked?(@project, User.current)
project = project_from_current_project(@project.id, User.current.id)
@@ -76,7 +78,11 @@ class RepositoriesController < ApplicationController
else
g = Gitlab.client
if User.current.gid.nil?
- g.sync_user(User.current)
+ begin
+ g.sync_user(User.current)
+ ensure
+ logger.error "Synv user failed ==>#{User.current.id}"
+ end
end
gproject = g.fork(@project.gpid, User.current.gid)
if gproject
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 5cb646c8e..9319c4db2 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -649,7 +649,8 @@ class StudentWorkController < ApplicationController
if revise_attachments.count == 2
revise_attachments.last.destroy
end
- #@attachment = @work.attachments.where("attachtype = 7").order("created_on desc").first
+ attachment = @work.attachments.where("attachtype = 7").first
+ attachment.update_attributes(:description => params[:description])
respond_to do |format|
format.js
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 281b8b7e0..f26f6c118 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -522,6 +522,7 @@ class UsersController < ApplicationController
else
homework.publish_time = params[:homework_common][:publish_time]
end
+ homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 1
homework.homework_type = params[:homework_type].to_i || 1
homework.late_penalty = 10
homework.teacher_priority = 1
diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb
index 1a01ac97b..d66c6a30d 100644
--- a/app/controllers/zipdown_controller.rb
+++ b/app/controllers/zipdown_controller.rb
@@ -1,4 +1,8 @@
-require 'zip'
+#coding=utf-8
+
+require "base64"
+require 'zip'
+
class ZipdownController < ApplicationController
#查找项目(课程)
before_filter :find_project_by_bid_id, :only => [:assort]
@@ -11,7 +15,13 @@ class ZipdownController < ApplicationController
def download
if User.current.logged?
begin
- send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file])
+ if params[:base64file]
+ file = Base64.decode64(params[:base64file])
+ file = file.sub('*', '+')
+ send_file "#{OUTPUT_FOLDER}/#{file}", :filename => filename_for_content_disposition(file), :type => detect_content_type(file)
+ else
+ send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file])
+ end
rescue => e
render file: 'public/no_file_found.html'
end
@@ -107,11 +117,17 @@ class ZipdownController < ApplicationController
bid_homework_path, OUTPUT_FOLDER)
}
[{files:[out_file.file_path], count: 1, index: 1,
- real_file: out_file.file_path, file: File.basename(out_file.file_path),
+ real_file: out_file.file_path,
+ file: File.basename(out_file.file_path),
+ base64file: encode64(File.basename(out_file.file_path)),
size:(out_file.pack_size / 1024.0 / 1024.0).round(2)
}]
end
+ def encode64(str)
+ Base64.encode64(str).sub('+', '*')
+ end
+
def zip_homework_common homework_common
bid_homework_path = []
digests = []
@@ -129,7 +145,9 @@ class ZipdownController < ApplicationController
bid_homework_path, OUTPUT_FOLDER)
}
[{files:[out_file.file_path], count: 1, index: 1,
- real_file: out_file.file_path, file: File.basename(out_file.file_path),
+ real_file: out_file.file_path,
+ file: File.basename(out_file.file_path),
+ base64file: encode64(File.basename(out_file.file_path)),
size:(out_file.pack_size / 1024.0 / 1024.0).round(2)
}]
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index c4bbc4ebb..4bdffb9dc 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -253,8 +253,10 @@ module ApplicationHelper
subject = truncate(subject, :length => 60)
end
end
- if issue.status_id == 5
+ if issue.status_id == 3
s = link_to text, issue_path(issue), :class => "text_line_s", :title => title
+ elsif issue.status_id == 5
+ s = link_to text, issue_path(issue), :class => "text_line_s del_line", :title => title
else
s = link_to text, issue_path(issue), :class => "c_blue", :title => title
end
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 551ddd616..1cbe7421c 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -394,7 +394,7 @@ class Mailer < ActionMailer::Base
@issue = issue
user = User.find_by_mail(recipients)
@user = user
- @token = Token.get_token_from_user(user, 'autologin')
+ # @token = Token.get_token_from_user(user, 'autologin')
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id)
# edit
@@ -436,15 +436,15 @@ class Mailer < ActionMailer::Base
user = User.find_by_mail(recipients)
@user = user
- @token = Token.get_token_from_user(user, 'autologin')
+ # @token = Token.get_token_from_user(user, 'autologin')
# edit
- @issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id, :token => @token.value)
- @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value)
- @user_url = url_for(my_account_url(user,:token => @token.value))
+ @issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id)
+ @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id)
+ @user_url = url_for(my_account_url(user))
- @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}", :token => @token.value)
+ @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}")
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject
diff --git a/app/models/user.rb b/app/models/user.rb
index 2714117e9..aa048888c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -344,7 +344,8 @@ class User < Principal
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count
- messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count
+ at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
+ messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count
end
# 查询指派给我的缺陷记录
diff --git a/app/views/blog_comments/_blog_attachments.erb b/app/views/blog_comments/_blog_attachments.erb
index dd8be659b..86298a330 100644
--- a/app/views/blog_comments/_blog_attachments.erb
+++ b/app/views/blog_comments/_blog_attachments.erb
@@ -57,7 +57,7 @@
: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,
- :upload_path => uploads_path(:format => 'js', :project => container),
+ :upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
diff --git a/app/views/boards/_course_show_detail.html.erb b/app/views/boards/_course_show_detail.html.erb
index c324f1d69..7b96c4f9a 100644
--- a/app/views/boards/_course_show_detail.html.erb
+++ b/app/views/boards/_course_show_detail.html.erb
@@ -59,12 +59,14 @@
<% end %>
<% if topics.count == 10 %>
-
展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %>
+
+ <%= link_to "点击展开更多",boards_topic_path(@board, :course_id => @board.course.id ,:page => page),:id => "show_more_course_topic",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end %>
<% end%>
+
diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb
index d31b28bc0..2f2622f3c 100644
--- a/app/views/courses/_course_activity.html.erb
+++ b/app/views/courses/_course_activity.html.erb
@@ -114,11 +114,13 @@
<% end %>
<% if course_activities.count == 10 %>
- 展开更多<%= link_to "", course_activity_path(@course.id, :type => type, :page => page), :id => "more_course_activities_link", :remote => "true", :class => "none" %>
+
+ <%= link_to "点击展开更多",course_activity_path(@course.id, :type => type, :page => page),:id => "show_more_course_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end %>
+
diff --git a/app/views/courses/private_or_public.js.erb b/app/views/courses/private_or_public.js.erb
new file mode 100644
index 000000000..71315e910
--- /dev/null
+++ b/app/views/courses/private_or_public.js.erb
@@ -0,0 +1,8 @@
+$("#project_info_<%=@course.id %>").html('<%=escape_javascript(render :partial=>'layouts/project_info') %>');
+if(document.getElementById("course_is_public")) {
+ <% if @course.is_public == 0%>
+ $("#course_is_public").attr("checked",false);
+ <% elsif @course.is_public == 1 %>
+ $("#course_is_public").attr("checked",true);
+ <% end %>
+}
\ No newline at end of file
diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb
index 634f26495..ae6416c9d 100644
--- a/app/views/courses/settings.html.erb
+++ b/app/views/courses/settings.html.erb
@@ -66,19 +66,19 @@
id="course_is_public" name="course[is_public]" type="checkbox">
- (打钩为公开,不打钩则不公开,若不公开,仅课程成员可见该课程。)
+ (选中后课外用户可见该课程,否则仅对课内成员可见)
id="course_open_student" name="course[open_student]" type="checkbox" style="margin-left: 1px;"/>
- (打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表)
+ (选中后课外用户可见学生列表,否则仅对课内成员可见)
id="course_publish_resource" name="course[publish_resource]" type="checkbox" style="margin-left: 1px;"/>
- (打钩为"允许学生上传资源",不打钩为"不允许学生上传资源")
+ (选中后允许学生上传课程资源,否则不允许)
diff --git a/app/views/exercise/_exercise_student.html.erb b/app/views/exercise/_exercise_student.html.erb
index 8a1f3dbd6..4f4892b79 100644
--- a/app/views/exercise/_exercise_student.html.erb
+++ b/app/views/exercise/_exercise_student.html.erb
@@ -100,6 +100,9 @@
{
obj.checked = false;
}
+ },
+ error: function () {
+ alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
@@ -154,6 +157,9 @@
{
obj.checked = false;
}
+ },
+ error: function () {
+ alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
@@ -196,6 +202,9 @@
success: function (data) {
var dataObj = eval(data);
obj.value = dataObj.text;
+ },
+ error: function () {
+ alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
diff --git a/app/views/exercise/_exercise_student_result.html.erb b/app/views/exercise/_exercise_student_result.html.erb
index 58ebcaf20..3e989d93c 100644
--- a/app/views/exercise/_exercise_student_result.html.erb
+++ b/app/views/exercise/_exercise_student_result.html.erb
@@ -116,8 +116,7 @@
√
<% else %>
×
- <% end %>
- 标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first %>
+ <% end %>
diff --git a/app/views/exercise/_exercise_teacher.html.erb b/app/views/exercise/_exercise_teacher.html.erb
index 586c033a1..ce3928817 100644
--- a/app/views/exercise/_exercise_teacher.html.erb
+++ b/app/views/exercise/_exercise_teacher.html.erb
@@ -95,8 +95,6 @@
第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
-
- 标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first%>
diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb
index 2510952f1..9bbbc9188 100644
--- a/app/views/forums/_file_form.html.erb
+++ b/app/views/forums/_file_form.html.erb
@@ -58,7 +58,7 @@
: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,
- :upload_path => uploads_path(:format => 'js', :project => project),
+ :upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb
index 010bc8ec9..bc960154e 100644
--- a/app/views/homework_common/index.html.erb
+++ b/app/views/homework_common/index.html.erb
@@ -3,6 +3,7 @@
$("#homework_name").val("");
$("#homework_publish_time").val("");
$("#homework_end_time").val("");
+ document.getElementById("anonymous_comment").checked = true;
$("#course_id").val($("#option_select").val());
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true,:has_group => true})%>");
homework_description_editor.html("");
diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb
index fd6171f18..58fbda6d6 100644
--- a/app/views/issues/_list.html.erb
+++ b/app/views/issues/_list.html.erb
@@ -40,7 +40,7 @@
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
<% end %>
<% if issues.count == 10%>
-
展开更多<%=link_to "", project_issues_path({:project_id => project.id,:page => issue_pages.page}.merge(params)),:id => "more_issues_link",:remote => "true",:class => "none" %>
+
展开更多<%=link_to "", project_issues_path({:project_id => project.id}.merge(params)),:id => "more_issues_link",:remote => "true",:class => "none" %>
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end%>
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index 13730fd96..fca343af4 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -12,24 +12,28 @@
diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb
new file mode 100644
index 000000000..b4a2996d0
--- /dev/null
+++ b/app/views/layouts/_project_info.html.erb
@@ -0,0 +1,92 @@
+<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
+<% teacher_num = searchTeacherAndAssistant(@course).count %>
+<% student_num = studentCount(@course) %>
+<% course_file_num = visable_attachemnts_incourse(@course).count%>
+
+
+<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
+
+<%= @course.is_public == 0 ? "私有课程" : "公开课程" %>
+
+ID:<%= @course.id%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%= @course.name %>
+
+ <%# if @course.is_public == 0%>
+
+
+ <%# end %>
+
+ <%if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %>
+
+ <% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0%>
+
+ <% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course) && @course.outline != 0%>
+
+ <% elsif User.current && @course.tea_id != User.current.id && @course.is_public? && @course.outline != 0%>
+
+ <%else%>
+ <%end %>
+
+
+
+
+
+
+<% if is_teacher %>
+
+
+ -
+
+ - <%= link_to "课程配置", {:controller => 'courses', :action => 'settings', :id => @course}, :class => "postOptionLink" %>
+ - <%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "postOptionLink" %>
+
+
+
+
+
+<% end %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index e0a6ece50..a7af387b2 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -1,6 +1,4 @@
<%# course_model %>
-<% teacher_num = searchTeacherAndAssistant(@course).count %>
-<% student_num = studentCount(@course) %>
<% course_file_num = visable_attachemnts_incourse(@course).count%>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
@@ -51,78 +49,8 @@
-
-
-
- <%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
-
-
- ID:<%= @course.id%>
-
-
- <% if is_teacher%>
- <%= link_to "#{l(:button_configure)}".html_safe, {:controller => 'courses', :action => 'settings', :id => @course}, :class => "pr_join_a" %>
- <%= set_course_time @course%>
- <%#= link_to "#{l(:button_copy)}".html_safe, copy_course_course_path(@course.id), :class => "pr_join_a" %>
- <% else%>
-
- <% end%>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <%= @course.name %>
-
- <% if @course.is_public == 0%>
-
-
- <%= l(:field_is_private)%>
-
- <% end %>
-
- <%if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %>
-
- <% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0%>
-
- <% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course) && @course.outline != 0%>
-
- <% elsif User.current && @course.tea_id != User.current.id && @course.is_public? && @course.outline != 0%>
-
- <%else%>
- <%end %>
-
-
-
-
-
-
+
+ <%=render :partial=>'layouts/project_info' %>
@@ -130,7 +58,7 @@
- <%= l(:label_class_period)%> : <%= @course.class_period %> <%= l(:label_class_hour) %>
- <%= l(:label_main_term)%> : <%= @course.time %> <%= @course.term %>
<% if @course.school%>
- - <%= l(:label_course_organizers)%> : <%= @course.school%>
+ - <%= l(:label_course_organizers)%> : <%= @course.school%>
<% end%>
@@ -154,7 +82,7 @@
<%= link_to l(:label_course_news), course_news_index_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{@course.news.count})", course_news_index_path(@course), :class => "subnav_num c_orange"%>
- <%= link_to( "", new_course_news_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
+ <%= link_to( "", new_course_news_path(@course,:is_new=>1), :class => 'courseMenuSetting', :title =>"#{l(:label_course_news_new)}") if is_teacher %>
<% end %>
<% unless show_nav?(course_file_num) %>
diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb
index 93af3fd29..808e80239 100644
--- a/app/views/layouts/base_org.html.erb
+++ b/app/views/layouts/base_org.html.erb
@@ -43,16 +43,16 @@
<%#= link_to '首页', organization_path(@organization, :show_homepage => 1),:class=>"linkGrey8 f14" %>
<% if User.current.logged? %>
-
-
+
+
<% else %>
@@ -75,141 +75,136 @@
-
-
-
-
-
-
-
-
- <%= image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_user_tx') %>
- <% if User.current.logged?%>
- <% if User.current.id == @organization.creator_id%>
-
-
+
+
+
+
+
+
+
+
+ <%= image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_user_tx') %>
+ <% if User.current.logged?%>
+ <% if User.current.id == @organization.creator_id%>
+
+
- <% end %>
- <% end%>
-
-
-
- <%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
- <% if User.current.logged? %>
- <% if @organization.is_public? %>
- <%= l(:label_public)%>
- <% else %>
- <%= l(:label_private)%>
- <% end %>
- <% end %>
-
+
+ <% end %>
+ <% end%>
+
+
+
+ <%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
+ <% if User.current.logged? %>
+ <% if @organization.is_public? %>
+ <%= l(:label_public)%>
+ <% else %>
+ <%= l(:label_private)%>
+ <% end %>
+ <% end %>
+
- <% if User.current.admin_of_org?(@organization) %>
+ <% if User.current.admin_of_org?(@organization) %>
配置
- <% end %>
+ <% end %>
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
- <%= link_to '文章', organization_org_document_comments_path(@organization) %>
- <% if User.current.logged? %>
- (
- <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %>
- )
- <% end %>
- |
- <%= link_to '成员', members_organization_path(@organization.id) %>
- <% if User.current.logged? %>
+
+
+ <%= link_to '文章', organization_org_document_comments_path(@organization) %>
+ <% if User.current.logged? %>
+ (
+ <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %>
+ )
+ <% end %>
+ |
+ <%= link_to '成员', members_organization_path(@organization.id) %>
+ <% if User.current.logged? %>
(<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>)
- <% end %>
-
-
-
-
+
+
-
-
-
+
+
-
- <%= l(:label_loading) %>
-
+
+ <%= l(:label_loading) %>
+
-