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..8bd91b089 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] 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 a132ec295..9b81ac775 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -185,7 +185,7 @@ class IssuesController < ApplicationController respond_to do |format| format.html { render_attachment_warning_if_needed(@issue) - flash[:notice] = l(:label_successful_create) + #flash[:notice] = l(:label_successful_create) #flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("#{@issue.subject}", issue_path(@issue), :title => @issue.subject)) #flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject)) if params[:continue] 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/repositories_controller.rb b/app/controllers/repositories_controller.rb index 8eb6a6860..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 @@ -351,7 +357,7 @@ update @changesets = g.commits(@project.gpid, :ref_name => @rev) # @changesets = @repository.latest_changesets(@path, @rev) # @changesets_count = @repository.latest_changesets(@path, @rev).count - @changesets_all_count = 0 + @changesets_all_count = @project.gpid.nil? ? 0 : g.commits_total_count(@project.gpid).count @changesets_latest_coimmit = @changesets[0] @properties = @repository.properties(@path, @rev) @repositories = @project.repositories @@ -383,10 +389,10 @@ update @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s) #add by hx - rep_count = commit_count(@project) + #rep_count = commit_count(@project) #页面传递必须要str类型,但是Paginator的初始化必须要num类型,需要类型转化 - @commits_count = rep_count + @commits_count = params[:commit_count].to_i @commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page] @commit = g.commit(@project.gpid,@rev) 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/news.rb b/app/models/news.rb index 53581a536..a7407c91f 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -41,7 +41,7 @@ class News < ActiveRecord::Base validates_presence_of :title, :description validates_length_of :title, :maximum => 60 validates_length_of :summary, :maximum => 255 - validates_length_of :description, :maximum => 10000 + # validates_length_of :description, :maximum => 10000 acts_as_attachable :delete_permission => :manage_news acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :project diff --git a/app/models/repository.rb b/app/models/repository.rb index f50f37f31..571bba1b9 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -107,7 +107,7 @@ class Repository < ActiveRecord::Base def scm unless @scm @scm = self.scm_adapter.new(url, root_url, - login, password, path_encoding) + login, password, path_encoding, project_id) if root_url.blank? && @scm.root_url.present? update_attribute(:root_url, @scm.root_url) end 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/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/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 1b6bebb01..f0967843a 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -46,7 +46,7 @@ :method => 'get', :title => l(:label_version_new), :tabindex => 200) if User.current.allowed_to?(:manage_versions, @issue.project) %> - <%= link_to "", new_project_version_path(@issue.project), :class => "pic_add mt5 ml5 " %> + <%= link_to "", new_project_version_path(@issue.project), :class => "pic_add mt5 ml5 ", :target => "_blank" %> <% end %> diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 62d3ff8a5..8b313a2ef 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -7,7 +7,7 @@ <%= f.select :tracker_id, @issue.project.trackers.collect { |t| [t.name, t.id] }, {:required => true, :no_label => true}, - :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')", + #:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')", :class => "w90" %> <% end %> @@ -49,7 +49,7 @@ <%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %> <%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> <%#= content_tag 'span', :id => "issue_description_and_toolbar" do %> - <%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'87%', :resizeType => 0, :no_label => true,at_id: @project.id, at_type: @project.class.to_s %> + <%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'85%', :height =>170, :resizeType => 0, :no_label => true,at_id: @project.id, at_type: @project.class.to_s %> <%# end %> <%#= wikitoolbar_for 'issue_description' %> <% end %> diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index fd6171f18..52f6570da 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -40,14 +40,14 @@ <%= 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 "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> + + <%= link_to "点击展开更多",project_issues_path({:project_id => project.id,:page => issue_pages.page}.merge(params)),:id => "show_more_issues",:remote => "true",:class => "loadMore mt10 f_grey"%> <% end%> - --> \ No newline at end of file diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb index be018c3f5..ede4a0534 100644 --- a/app/views/issues/update.js.erb +++ b/app/views/issues/update.js.erb @@ -12,12 +12,25 @@ issue_desc_editor = KindEditor.create('#issue_description', {"width":"85%", "resizeType":0, "no_label":true, + "at_id":<%= @issue.project_id%>, + "at_type":"Project", "autoHeightMode":true, - "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\")})", - "emotionsBasePath":"http://localhost:3000","height":300, + "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, \"<%=@issue.project_id %>\", 'Project');}; this.loadPlugin('autoheight')})", + "emotionsBasePath":'<%= Setting.host_name%>', + "height":300, "allowFileManager":true, "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager"}); +//issue_desc_editor = KindEditor.create('#issue_description', +// {"width":"85%", +// "resizeType":0, +// "no_label":true, +// "autoHeightMode":true, +// "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\")})", +// "emotionsBasePath":"http://localhost:3000","height":300, +// "allowFileManager":true, +// "uploadJson":"/kindeditor/upload", +// "fileManagerJson":"/kindeditor/filemanager"}); <%else%> alert('<%= @issue.errors.full_messages[0].to_s%>') <%end %> diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index e0a6ece50..1cb8efe01 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -130,7 +130,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 +154,7 @@ <% 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 e3b691253..4ece1ba8c 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,121 +75,136 @@
    -
    -
    -
    -
    - - - - diff --git a/app/views/mailer/issue_edit.text.erb b/app/views/mailer/issue_edit.text.erb index d1d625cec..8730d8a16 100644 --- a/app/views/mailer/issue_edit.text.erb +++ b/app/views/mailer/issue_edit.text.erb @@ -9,6 +9,6 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb index ae5604099..7fdd737e3 100644 --- a/app/views/mailer/send_for_user_activities.html.erb +++ b/app/views/mailer/send_for_user_activities.html.erb @@ -16,16 +16,16 @@
  • [ - <%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value), + <%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value), :class => "wmail_name", + <%= link_to course_new.author, user_activities_url(course_new.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_notice) %> - <%= link_to truncate(course_new.title.html_safe,length: 30,omission: '...'), news_url(course_new,:token => @token.value), + <%= link_to truncate(course_new.title.html_safe,length: 30,omission: '...'), news_url(course_new), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -39,17 +39,17 @@ [ <% unless course_news_comment.commented.nil? %> - <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course, :token => @token.value), + <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> ] - <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author,:token => @token.value), :class => "wmail_name", + <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_notice_reply) %> - <%= link_to truncate(l(:label_course_notice_point),length: 30,omission: '...'), news_url(course_news_comment.commented,:token => @token.value), + <%= link_to truncate(l(:label_course_notice_point),length: 30,omission: '...'), news_url(course_news_comment.commented), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -72,16 +72,16 @@ [ - <%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course, :token => @token.value), + <%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value), :class => "wmail_name", + <%= link_to bid.user, user_activities_url(bid.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_course_homework) %> - <%= link_to truncate(bid.name.html_safe,length: 30,omission: '...'), student_work_index_url(:homework => bid.id,:token => @token.value), + <%= link_to truncate(bid.name.html_safe,length: 30,omission: '...'), student_work_index_url(:homework => bid.id), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -105,16 +105,16 @@ [ - <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value), + <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value), :class => "wmail_name", + <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_send_course_journals_for_messages) %> - <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value), + <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -135,14 +135,14 @@
  • [ - <%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id, :token => @token.value), + <%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value), :class => "wmail_name", + <%= link_to course_message.author, user_activities_url(course_message.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_send_course_messages) %> - <%= link_to truncate(course_message.subject.html_safe,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value), + <%= link_to truncate(course_message.subject.html_safe,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= format_time(course_message.created_on) %> @@ -163,16 +163,16 @@ [ - <%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value), + <%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value), :class => "wmail_name", + <%= link_to attachment.author, user_activities_url(attachment.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_course_file_upload) %> - <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value), + <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -199,14 +199,14 @@
  • [ - <%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value), + <%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to issue.author, user_activities_url(issue.author,:token => @token.value), :class => "wmail_name", + <%= link_to issue.author, user_activities_url(issue.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_issue) %> - <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value), + <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue), :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= format_time(issue.created_on) %> @@ -217,14 +217,14 @@
  • [ - <%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project, :token => @token.value), + <%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value), :class => "wmail_name", + <%= link_to issues_journal.user, user_activities_url(issues_journal.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_issue_update) %> - <%= link_to truncate(issues_journal.issue.subject, length:30,omission:'...'),issue_url(issues_journal.issue, :token => @token.value), + <%= link_to truncate(issues_journal.issue.subject, length:30,omission:'...'),issue_url(issues_journal.issue), :style => "color:#2E8DD7;float:left;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" @@ -251,16 +251,16 @@ [ - <%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value), + <%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_message.author, user_activities_url(project_message.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_send_course_messages) %> - <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value), + <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -283,16 +283,16 @@ [ <% unless wikicontent.page.nil? %> - <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value), + <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> ] - <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value), :class => "wmail_name", + <%= link_to wikicontent.author, user_activities_url(wikicontent.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_wiki_mail_notification) %> <% unless wikicontent.page.nil? %> - <%= link_to wikicontent.text.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_wiki_url(wikicontent.page.wiki,:token => @token.value), + <%= link_to wikicontent.text.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_wiki_url(wikicontent.page.wiki), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; max-width:400px;height:23px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> @@ -314,15 +314,15 @@ [ - <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value), + <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_new.author, user_activities_url(project_new.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_mail_notice) %> - <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value), + <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= format_time(project_new.created_on) %> @@ -336,16 +336,16 @@ [ <% unless project_news_comment.commented.nil? %> - <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project, :token => @token.value), + <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> ] - <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:lable_project_mail_notice_reply) %> - <%= link_to truncate(l(:lable_project_notice_point),length: 30,omission: '...'), news_url(project_news_comment.commented,:token => @token.value), + <%= link_to truncate(l(:lable_project_notice_point),length: 30,omission: '...'), news_url(project_news_comment.commented), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= format_time(project_news_comment.created_on) %> @@ -366,16 +366,16 @@ [ - <%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project, :token => @token.value), + <%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_attachment.author, user_activities_url(project_attachment.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_attachment.author, user_activities_url(project_attachment.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_mail_upload) %> - <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'), project_files_url(project_attachment.project,:token => @token.value), + <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'), project_files_url(project_attachment.project), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -398,16 +398,16 @@ [ - <%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value), + <%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value), :class => "wmail_name", + <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_send_course_journals_for_messages) %> - <%= link_to project_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_feedback_url(project_journal_message.project,:token => @token.value), + <%= link_to project_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_feedback_url(project_journal_message.project), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; max-width:400px; max-height:30px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -434,12 +434,12 @@
  • - <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value), + <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= l(:label_show_your_message) %> - <%= link_to user_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe,feedback_url(@user,:token => @token.value), + <%= link_to user_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe,feedback_url(@user), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; max-width:400px; max-height:30px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -466,12 +466,12 @@
  • - <%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value), + <%= link_to forum.creator, user_activities_url(forum.creator), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= l(:label_forum_new) %> - <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value), + <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -492,7 +492,7 @@
  • - <%= link_to memo.author, user_activities_url(memo.author,:token => @token.value), + <%= link_to memo.author, user_activities_url(memo.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %> @@ -516,7 +516,7 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %>
  • diff --git a/app/views/mailer/send_for_user_activities.text.erb b/app/views/mailer/send_for_user_activities.text.erb index f86dec62d..f4c354790 100644 --- a/app/views/mailer/send_for_user_activities.text.erb +++ b/app/views/mailer/send_for_user_activities.text.erb @@ -6,11 +6,11 @@ <%= l(:label_course_news) %> <% @course_news.each do |course_new|%> - ▪[<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%> ] + ▪[<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course)%> ] - <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value) %> + <%= link_to course_new.author, user_activities_url(course_new.author) %> <%= l(:label_project_notice) %> - <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value) %> + <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new) %> <%= format_time(course_new.created_on) %> <% end %> <% end %> @@ -19,12 +19,12 @@ <%= l(:label_course_news) %> <% @course_news_comments.each do |course_news_comment|%> ▪[ <% unless course_news_comment.commented.nil? %> - <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course, :token => @token.value) %> + <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course) %> <% end %> ] - <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author,:token => @token.value) %> + <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author) %> <%= l(:label_project_notice_reply) %> - <%= link_to truncate(course_news_comment.comments,length: 30,omission: '...'), news_url(course_news_comment.commented,:token => @token.value) %> + <%= link_to truncate(course_news_comment.comments,length: 30,omission: '...'), news_url(course_news_comment.commented) %> <%= format_time(course_news_comment.created_on) %> <% end %> <% end %> @@ -33,10 +33,10 @@ <%= l(:label_homework_overview) %> <% unless @bids.first.nil?%> <% @bids.each do |bid| %> - ▪[<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value) %>] - <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value) %> + ▪[<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course) %>] + <%= link_to bid.user, user_activities_url(bid.user) %> <%= l(:label_course_homework) %> - <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value) %> + <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id) %> <%= format_time(bid.created_at) %> <% end %> <% end %> @@ -46,10 +46,10 @@ <% unless @course_journal_messages.first.nil? %> <%= l(:view_course_journals_for_messages) %> <% @course_journal_messages.each do |course_journal_message|%> - [ <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value) %>] - <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value) %> + [ <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course) %>] + <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user) %> <%= l(:label_send_course_journals_for_messages) %> - <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value) %> + <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course) %> <%= format_time(course_journal_message.created_on) %> <% end %> <% end %> @@ -57,10 +57,10 @@ <% unless @course_messages.first.nil? %> <%= l(:view_borad_course) %> <% @course_messages.each do |course_message|%> - ▪[<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)%>] - <%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value) %> + ▪[<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course)%>] + <%= link_to course_message.author, user_activities_url(course_message.author) %> <%= l(:label_send_course_messages) %> - <%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value) %> + <%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id) %> <%= format_time(course_message.created_on) %> <% end %> <% end %> @@ -68,10 +68,10 @@ <% unless @attachments.first.nil? %> <%= l(:label_course_mail_files) %> <% @attachments.each do |attachment|%> - ▪[<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value) %>] - <%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value) %> + ▪[<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course) %>] + <%= link_to attachment.author, user_activities_url(attachment.author) %> <%= l(:label_course_file_upload) %> - <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value) %> + <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course) %> <%= format_time(attachment.created_on) %> <% end %> @@ -86,10 +86,10 @@ <% unless @issues.first.nil? %> <%= l(:label_issue_tracking) %> <% @issues.each do |issue|%> - ▪[<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value) %>] - <%= link_to issue.author, user_activities_url(issue.author,:token => @token.value) %> + ▪[<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project) %>] + <%= link_to issue.author, user_activities_url(issue.author) %> <%= l(:label_project_issue) %> - <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %> + <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue) %> <%= format_time(issue.created_on) %> <% end %> @@ -99,13 +99,13 @@ <% unless @issues_journals.first.nil? %> <%= l(:label_issue_tracking) %> <% @issues_journals.each do |issues_journal| %> - ▪[<%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project, :token => @token.value) %>] - <%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value) %> + ▪[<%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project) %>] + <%= link_to issues_journal.user, user_activities_url(issues_journal.user) %> <%= l(:label_project_issue_update) %> <% if issues_journal.notes.nil? %> - <%= link_to truncate(issues_journal.issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %> + <%= link_to truncate(issues_journal.issue.subject,length: 30,omission: '...'),issue_url(issue) %> <% else %> - <%= link_to truncate(issues_journal.notes.html_safe,length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value) %> + <%= link_to truncate(issues_journal.notes.html_safe,length: 30,omission: '...'),issue_url(issues_journal.issue) %> <% end %> <%= format_time(issues_journal.created_on) %> <% end %> @@ -115,10 +115,10 @@ <% unless @project_messages.first.nil? %> <%= l(:project_moule_boards_show) %> <% @project_messages.each do |project_message|%> - ▪[<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value) %>] - <%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value) %> + ▪[<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project) %>] + <%= link_to project_message.author, user_activities_url(project_message.author) %> <%= l(:label_send_course_messages) %> - <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value) %> + <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id) %> <%= format_time(project_message.created_on) %> <% end %> @@ -129,13 +129,13 @@ <%= l(:label_wiki) %> <% @wiki_contents.each do |wikicontent|%> ▪[<% unless wikicontent.page.nil? %> - <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value) %> + <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project) %> <% end %> ] - <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value) %> + <%= link_to wikicontent.author, user_activities_url(wikicontent.author) %> <%= l(:label_wiki_mail_notification) %> <% unless wikicontent.page.nil? %> - <%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value) %> + <%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki) %> <% end %> <%= format_time(wikicontent.updated_on) %> <% end %> @@ -145,10 +145,10 @@ <% unless @project_news.first.nil? %> <%= l(:label_project_news) %> <% @project_news.each do |project_new|%> - ▪[<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value) %> ] - <%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value) %> + ▪[<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project) %> ] + <%= link_to project_new.author, user_activities_url(project_new.author) %> <%= l(:label_project_mail_notice) %> - <%= link_to truncate(project_new.title.html_safe,length: 30,omission: '...'), news_url(project_new,:token => @token.value) %> + <%= link_to truncate(project_new.title.html_safe,length: 30,omission: '...'), news_url(project_new) %> <%= format_time(project_new.created_on) %> <% end %> <% end %> @@ -158,11 +158,11 @@ <%= l(:label_project_news) %> <% @project_news_comments.each do |project_news_comment|%> ▪[ <% unless project_news_comment.commented.nil? %> - <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project, :token => @token.value) %> + <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project) %> <% end %>] - <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author,:token => @token.value) %> + <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author) %> <%= l(:lable_project_mail_notice_reply) %> - <%= link_to truncate(project_news_comment.comments.html_safe,length: 30,omission: '...'), news_url(project_news_comment.commented,:token => @token.value) %> + <%= link_to truncate(project_news_comment.comments.html_safe,length: 30,omission: '...'), news_url(project_news_comment.commented) %> <%= format_time(project_news_comment.created_on) %> <% end %> @@ -172,10 +172,10 @@ <% unless @project_attachments.first.nil? %> <%= l(:label_project_mail_attachments) %> <% @project_attachments.each do |project_attachment|%> - ▪[<%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project, :token => @token.value) %>] - <%= link_to project_attachment.author, user_activities_url(project_attachment.author,:token => @token.value) %> + ▪[<%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project) %>] + <%= link_to project_attachment.author, user_activities_url(project_attachment.author) %> <%= l(:label_project_mail_upload) %> - <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'),project_files_url(project_attachment.project,:token => @token.value) %> + <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'),project_files_url(project_attachment.project) %> <%= format_time(project_attachment.created_on) %> <% end %> <% end %> @@ -184,10 +184,10 @@ <% unless @project_journal_messages.first.nil? %> <%= l(:label_project_mail_feedback) %> <% @project_journal_messages.each do |project_journal_message|%> - ▪[<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value) %> ] - <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value) %> + ▪[<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project) %> ] + <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user) %> <%= l(:label_send_course_journals_for_messages) %> - <%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value) %> + <%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project) %> <%= format_time(project_journal_message.created_on) %> <% end %> @@ -202,9 +202,9 @@ <%= l(:label_user_message) %> (<%= @user_journal_messages.count %>) <% @user_journal_messages.each do |user_journal_message|%> - ▪ <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)%> + ▪ <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user)%> <%= l(:label_show_your_message) %> - <%= link_to truncate(user_journal_message.notes.html_safe,length: 30,omission: '...'), feedback_url(@user,:token => @token.value) %> + <%= link_to truncate(user_journal_message.notes.html_safe,length: 30,omission: '...'), feedback_url(@user) %> <%= format_time(user_journal_message.created_on) %> <% end %> <% end %> @@ -214,9 +214,9 @@ <% unless @forums.first.nil? %> <%= l(:label_user_forum) %> <% @forums.each do |forum|%> - ▪<%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value) %> + ▪<%= link_to forum.creator, user_activities_url(forum.creator) %> <%= l(:label_forum_new) %> - <%= link_to truncate(forum.name.html_safe,length: 30,omission: '...'),forum_url(forum,:token => @token.value) %> + <%= link_to truncate(forum.name.html_safe,length: 30,omission: '...'),forum_url(forum) %> <%= format_time(forum.created_at) %> <% end %> @@ -224,7 +224,7 @@ <% unless @memos.first.nil? %> <%= l(:label_user_message_forum) %> <% @memos.each do |memo|%> - ▪<%= link_to memo.author, user_activities_url(memo.author,:token => @token.value)%> + ▪<%= link_to memo.author, user_activities_url(memo.author)%> <%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %> <%= link_to truncate(memo.subject.html_safe,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id))%> <%= format_time(memo.created_at) %> @@ -238,6 +238,6 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <%= l(mail_option) %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index c8510c8cf..6806e0996 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -21,10 +21,7 @@ $.ajax({ url:' /forums/'+'<%= @memo.forum_id.to_s %>'+'/memos/<%= @memo.id.to_s%>', type:'put', - data:{ - 'memo[subject]':$("#memo_subject").val(), - 'memo[content]':$("#memo_content").val() - }, + data:$("#edit_memo").serialize(), success:function(data){ }, diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 30072777e..56cf4b915 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -18,8 +18,8 @@
  • 登录名 : *
  • 邮箱 : *
  • 身份 : *
  • -
  • 姓(First Name) : *
  • -
  • 名(Last Name) : *
  • +
  • 姓(Last Name) : *
  • +
  • 名(First Name) : *
  • 组织名 : *
  • 性别 : 
  • 工作单位 : 
  • diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index e2c50fe24..245ee4104 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -1,42 +1,34 @@ -<% - btn_tips = l(:label_news_notice) - label_tips = l(:label_course_news) -%> - -
    -

    <%= label_tips %>

    -
    -
    -
    -

    - <%= l(:label_total_news) %> - <%= @news_count %> - <%= l(:label_course_news_count) %> -

    - <% if @course && User.current.allowed_to?(:manage_news, @course) %> - <%= link_to(btn_tips,new_course_news_path(@course),:class => 'problem_new_btn fl c_dorange')%> -
    - - <% end %> +
    +
    +
    + 课程通知 +
    - -
    -
    - -
    - <%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %> -
    -<% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> - <%= stylesheet_link_tag 'scm' %> -<% end %> -<% html_title(l(:label_course_news)) -%> + <% if @course && User.current.allowed_to?(:manage_news, @course) %> + <%= labelled_form_for @news, :url =>{:controller=>'news',:action => 'new', :course_id => @course.id}, + :html => {:nhname=>'form',:multipart => true, :id => 'news-form'} do |f| %> + <%= render :partial => 'course_news_new', :locals => {:f => f, :news => @news, :edit_mode => false, :course => @course} %> + <% end %> + <% end %> + <%= render :partial=> 'course_news_detail',:locals =>{:newss => @newss, :page => 0} %> +
    \ No newline at end of file diff --git a/app/views/news/_course_news_detail.html.erb b/app/views/news/_course_news_detail.html.erb new file mode 100644 index 000000000..954f7dbf1 --- /dev/null +++ b/app/views/news/_course_news_detail.html.erb @@ -0,0 +1,56 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false) %> + <%= javascript_include_tag "init_activity_KindEditor" %> +<% end %> + + +<% if newss%> + <% newss.each do |news| %> + + <% if news %> + <%= render :partial => 'users/course_news', :locals => {:activity => news, :user_activity_id => news.id} %> + <% end %> + <% end %> + + <% if newss.count == 10 %> + <%= link_to "点击展开更多",news_index_path(:course_id => @course.id ,:page => page),:id => "show_more_course_news",:remote => "true",:class => "loadMore mt10 f_grey"%> + <% end %> +<% end%> + diff --git a/app/views/news/_course_news_new.html.erb b/app/views/news/_course_news_new.html.erb new file mode 100644 index 000000000..158f57459 --- /dev/null +++ b/app/views/news/_course_news_new.html.erb @@ -0,0 +1,60 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true, prettify: false) %> +<% end %> + +
    +
    +
    +
    + +

    +
    + +
    +
    +
    \ No newline at end of file diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index a976dbe1e..914b1a6a1 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -2,85 +2,172 @@ <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <% end %> -
    -

    <%= l(:label_course_news) %>

    -
    -
    - <%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %> -
    -

    - <%=h @news.title %> -

    - <% if @news.sticky == 1%> - 置顶 - <% end%> - <%= link_to(l(:button_edit), - edit_news_path(@news), - :class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %> - <%= delete_link(news_path(@news),:class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %> -
    -
    - <%= @news.description.html_safe %> -
    - <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %> + + + +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@news.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@news.author) %>
    - <%= link_to_attachments_course @news %> - +
    + <% if User.current.allowed_to?(:manage_news, @course)%> + + <%end%> + +
    + +
    + <% if @news.try(:author).try(:realname) == ' ' %> + <%= link_to @news.try(:author), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% else %> + <%= link_to @news.try(:author).try(:realname), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> + <% end %> +
    +
    <%= format_time( @news.created_on)%>
    +
    +
    + <%= @news.description.html_safe%> +
    +
    +
    + <%= link_to_attachments_course @news, :author => false %> +
    +
    +
    -
    +
    + <% unless @comments.empty? %> +
    +
    回复(<%=@comments.count %>)
    +
    +
    +
    + <% @comments.each_with_index do |reply,i| %> + +
    +
    + <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
    +
    +
    + <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> + <% end %> +
    +
    + <%= reply.comments.html_safe%> +
    +
    + <%= format_time(reply.created_on) %> + +
    +

    +
    +
    +
    + <% end %> +
    - <% if @news.commentable? %> -
    -

    <%= l(:label_comment_add) %>

    - <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %> -
    - <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%> -
    -

    -

    - - <%= l(:label_cancel_with_space) %> - - - <%= l(:label_comment_with_space) %> - -

    - <% end %> -
    - <% end %> -
    - <% comments = @comments.reverse %> - <% comments.each do |comment| %> - <% next if comment.new_record? %> -
    -
    <%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author), :class => "problem_pic fl"%>
    -
    -
    - <%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %> - - <%= format_time(comment.created_on) %> - + <% end %> +
    + <% if @news.commentable? %> +
    + +
    +
    + <%= form_for @comment, :url=>{:controller => 'comments', :action => 'create', :id => @news}, :html => {:multipart => true, :id => 'add_comment_form'} do |f| %> +
    + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + <%= f.kindeditor :comments, :editor_id => 'comment_editor', + :owner_id => @comment.nil? ? 0: @comment.id, + :owner_type => OwnerTypeHelper::COMMENT, + :width => '99%', + :height => 100, + :minHeight=>100, + :input_html => { :id => 'comment_content', + :class => 'talk_text fl', + :maxlength => 5000 }%> +
    +

    +

    + + <%= l(:label_cancel_with_space) %> + + + <%= l(:label_comment_with_space) %> + +

    + <% end %>
    -

    <%= comment.comments.html_safe %>

    -
    -
    - <%= link_to_if_authorized_course image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, - :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
    -
    -
    -
    - <% end if @comments.any? %> - - - - - <% content_for :header_tags do %> - <%= stylesheet_link_tag 'scm' %> - <% end %> - - -<% html_title @news.title -%> \ No newline at end of file + <% end %> +
    +
    diff --git a/app/views/news/edit.html.erb b/app/views/news/edit.html.erb index c2ba15588..b043b06f8 100644 --- a/app/views/news/edit.html.erb +++ b/app/views/news/edit.html.erb @@ -1,14 +1,23 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <% end %> - -
    -

    <%= l(:label_course_news) %>

    -
    -
    + +
    +
    +
    + 编辑通知 +
    +
    <%= labelled_form_for :news, @news, :url => news_path(@news), :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> - <%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %> + <%#= labelled_form_for :news, :url =>{:controller=>'news',:action => 'new', :course_id => @course.id}, + :html => {:nhname=>'form',:multipart => true, :id => 'news-form'} do |f| %> + <%= render :partial => 'course_news_new', :locals => {:f => f, :news => @news, :edit_mode => true, :course => @course} %> <% end %> -
    diff --git a/app/views/news/index.js.erb b/app/views/news/index.js.erb index 04671917b..302c0cf9d 100644 --- a/app/views/news/index.js.erb +++ b/app/views/news/index.js.erb @@ -1 +1,5 @@ -$("#news_list").html("<%= escape_javascript(render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count})%>"); \ No newline at end of file +<% if @project %> + $("#news_list").html("<%= escape_javascript(render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count})%>"); +<% else %> + $("#show_more_course_news").replaceWith("<%= escape_javascript( render :partial => 'course_news_detail', :locals =>{:newss => @newss, :page => @page} )%>"); +<% end %> \ No newline at end of file diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index 2a4355af3..4e4ee3d4c 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -66,10 +66,11 @@ <% end %> <% if org_act_count == 10 %> -
    展开更多<%=link_to "", organization_path(org,:page => page.to_i + 1, :show_homepage =>params[:show_homepage],:type => params[:type]),:id => "more_org_activities_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"%> + + <%= link_to "点击展开更多",organization_path(org,:page => page.to_i + 1, :show_homepage =>params[:show_homepage],:type => params[:type]),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> <% end%> + + <%= link_to "点击展开更多",project_path(@project.id, :type => type, :page => page),:id => "show_more_forge_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> <% end %> + diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index da7f79dd8..afe4740eb 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -41,7 +41,7 @@
    <%= @changesets_latest_coimmit.message %>
    <% else %> -
    <%=@changesets_latest_coimmit.author_email %>
    +
    <%=@changesets_latest_coimmit.author_email %>
    提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
    <%= @changesets_latest_coimmit.message %>
    @@ -51,9 +51,8 @@ <%= @repository.branches.count %> 个分支
    - - - <%=link_to"提交明细", {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %> + + <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %> 提交
    diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb index 0258b3b83..052443155 100644 --- a/app/views/student_work/_add_score.html.erb +++ b/app/views/student_work/_add_score.html.erb @@ -1,9 +1,10 @@ -<%= form_for('new_form', :remote => true, :method => :post,:url => add_score_student_work_path(work.id)) do |f|%> +<%= form_for('new_form', :remote => true, :method => :post,:url => add_score_student_work_path(work.id),:id=>'add_score_'+work.id.to_s) do |f|%>
  • 评价: - <%= f.text_area 'user_message', :class => 'hwork_ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %> + <%= f.text_area 'user_message', :class => 'hwork_ping_text', :id => 'score_comment_'+work.id.to_s, :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %>
  • +

  • 评分: @@ -16,7 +17,19 @@ <%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
  • <%end%> - 提交 + 提交
    -<% end%> \ No newline at end of file +<% end%> + \ No newline at end of file diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 880be0ffa..f7ecb0ccf 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -115,8 +115,20 @@ $('#ajax-modal').parent().addClass("resourceUploadPopup"); $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); } - function submit_files(){ - $("#upload_form").submit(); + function regex_des() { + if ($.trim($("#attachment_des").val()) == "") { + $("#hint_message").text("附件描述不能为空"); + $("#hint_message").css('color','#ff0000'); + return false; + } else { + $("#hint_message").text(""); + return true; + } + } + function submit_revise_files(){ + if (regex_des()) { + $("#upload_form").submit(); + } } function closeModal(){ hideModal($(".uploadBoxContainer")); diff --git a/app/views/student_work/_revise_attachment.html.erb b/app/views/student_work/_revise_attachment.html.erb index 4d85b1813..2279856da 100644 --- a/app/views/student_work/_revise_attachment.html.erb +++ b/app/views/student_work/_revise_attachment.html.erb @@ -7,8 +7,12 @@
    追加附件: <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %> - 追加时间:<%=format_time revise_attachment.created_on.to_s %>  (<%=revise_attachment_status @homework,revise_attachment %>) + 追加时间:<%=format_time revise_attachment.created_on.to_s %>  (<%=revise_attachment_status @homework,revise_attachment %>)
    + <% unless revise_attachment.description == "" %> + 附件描述:

    <%=revise_attachment.description %>

    + <% end %>
    +
    <% end %> <% if work.user == User.current %>
    @@ -18,10 +22,14 @@
    追加附件: <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %> - 追加时间:<%=format_time revise_attachment.created_on.to_s %> + 追加时间:<%=format_time revise_attachment.created_on.to_s %>
    + <% unless revise_attachment.description == "" %> + 附件描述:

    <%=revise_attachment.description %>

    + <% end %>
    <% end %> -
    +
    + <% end %> diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index f92614e10..662ddece4 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -113,8 +113,20 @@ $('#ajax-modal').parent().addClass("resourceUploadPopup"); $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); } - function submit_files(){ - $("#upload_form").submit(); + function regex_des() { + if ($.trim($("#attachment_des").val()) == "") { + $("#hint_message").text("附件描述不能为空"); + $("#hint_message").css('color','#ff0000'); + return false; + } else { + $("#hint_message").text(""); + return true; + } + } + function submit_revise_files(){ + if (regex_des()) { + $("#upload_form").submit(); + } } function closeModal(){ hideModal($(".uploadBoxContainer")); diff --git a/app/views/student_work/_upload_attachment.html.erb b/app/views/student_work/_upload_attachment.html.erb index d9c69fc17..02f05c4df 100644 --- a/app/views/student_work/_upload_attachment.html.erb +++ b/app/views/student_work/_upload_attachment.html.erb @@ -9,7 +9,7 @@
    - + 选择文件 <%= file_field_tag 'attachments[dummy][file]', :id => '_file', @@ -37,9 +37,16 @@
    最多只能上传一个小于50MB的附件
    +
    + +
    +
    +

    +
    - <%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %> + 确定 + <%#= submit_tag '确定',:onclick=>'submit_revise_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
    取消 diff --git a/app/views/student_work/_work_information.html.erb b/app/views/student_work/_work_information.html.erb index 90d749af1..bc728ca71 100644 --- a/app/views/student_work/_work_information.html.erb +++ b/app/views/student_work/_work_information.html.erb @@ -20,9 +20,9 @@
    - 确  定 + 确 定 - <%= link_to("重试", retry_work_student_work_path(@student_work.id),:class => "tijiao",:style =>"margin-bottom: 15px;margin-top:15px;",:remote => true)%> + <%= link_to("重 试", retry_work_student_work_path(@student_work.id),:class => "tijiao",:style =>"margin-bottom: 15px;margin-top:15px;",:remote => true)%>
    diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 02a2b1707..c6d2bd313 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -135,7 +135,11 @@ <% else %> 匿评已禁用 <% end %> - 作品提交中 + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%> + 作品提交中 + <% elsif Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %> + 作品补交中 + <% end %> <% elsif @homework.homework_detail_manual.comment_status == 2%> <% if @homework.anonymous_comment == 0%> 匿评中 diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 33286c8fc..da05ac946 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -1,271 +1,278 @@ -<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %> -
    -
    -
    - <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %> -
    -
    -
    - <% if activity.try(:user).try(:realname) == ' ' %> - <%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> - <% end %> TO - <%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%> -
    - - <% if activity.homework_detail_manual%> - <% if activity.homework_detail_manual.comment_status == 1%> - <% if activity.anonymous_comment == 0%> - 未开启匿评 - <% else %> - 匿评已禁用 - <% end %> - <% if Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%> - 作品提交中 - <% elsif Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %> - 作品补交中 - <% end %> - <% elsif activity.homework_detail_manual.comment_status == 2%> - <% if activity.anonymous_comment == 0%> - 匿评中 - <% else %> - 匿评已禁用 - <% end %> - 教师评阅中 - <% elsif activity.homework_detail_manual.comment_status == 3%> - <% if activity.anonymous_comment == 0%> - 匿评已结束 - <% else %> - 匿评已禁用 - <% end %> - 教师评阅中 - <% end%> - <% end%> -
    - <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%> - 系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合! - <% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%> - 系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合! - <% end %> -
    - <% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%> - <% projects = cur_user_projects_for_homework activity %> - <% works = cur_user_works_for_homework activity %> - <% if works.nil? && projects.nil? %> -
    - <%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %> - <%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %> -
    - <% elsif works.nil? %> -
    - <%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %> -
    - <% end %> - <% end %> -
    - <% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %> - <%= user_for_homework_common activity,is_teacher %> -
    - - <% if activity.homework_type == 2 && is_teacher%> -
    - <%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %> -
    - <% end %> - <% if activity.homework_type == 2%> -
    - 语言: - <%= activity.language_name%> -
    - <% end %> - <% if activity.homework_type == 3 && activity.homework_detail_group%> -
    - 分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人 -
    - <% end %> -
    截止时间:<%= activity.end_time.to_s %> 23:59
    -
    -
    -
    - <%= activity.description.html_safe %> -
    -
    -
    - - -
    - -
    -
    - 迟交扣分:<%= activity.late_penalty%>分 -
    -
    - 匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00 -
    -
    -
    -
    -
    - 缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品 -
    -
    - 匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59 -
    -
    -
    -
    - <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %> -
    -
    - <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %> -
    - <% projects = activity.student_work_projects.where("is_leader = 1") %> -
    - 已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %> -
    - <% projects.each do |pro| %> - <% project = Project.find pro.project_id %> - -
    - <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> - <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s,:alt =>"项目头像" %> - <% else %> - <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s,:alt =>"项目头像") %> - <% end %> -
    - 项目名称:<%=project.name %>
    - 创建者:<%=(User.find project.user_id).show_name %>(组长)
    - <% time=project.updated_on %> - <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> - 更新时间:<%=time_from_now time %> -
    -
    - <% end %> -
    - <% end %> -
    - <% if is_teacher%> - <% comment_status = activity.homework_detail_manual.comment_status %> -
    -
      -
    • -
        -
      • - <%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%> -
      • -
      • - <%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %> -
      • -
      • - <%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true) %> -
      • - <% if activity.anonymous_comment == 0 %> -
      • - <%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%> -
      • -
      • - <%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %> -
      • - <% end %> - <% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%> -
      • - <%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%> -
      • - <% end %> -
      -
    • -
    -
    - <% end%> -
    -
    -
    - - <% count=activity.journals_for_messages.count %> -
    -
    -
    -
    - 回复(<%= count %>) -
    -
    - <%if count>3 %> - - <% end %> -
    - - <% replies_all_i = 0 %> - <% if count > 0 %> -
    -
      - <% activity.journals_for_messages.reorder("created_on desc").each do |comment| %> - - <% replies_all_i = replies_all_i + 1 %> -
    • -
      - <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> -
      -
      -
      - <% if comment.try(:user).try(:realname) == ' ' %> - <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%= format_time(comment.created_on) %> - -
      -
      - <%= comment.notes.html_safe %>
      -
      -
      -
    • - <% end %> -
    -
    - <% end %> - -
    -
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
    -
    -
    - <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%> - <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> - <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> - -
    - -
    -

    - <% end%> -
    -
    -
    -
    -
    -
    +<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %> +
    +
    +
    + <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %> +
    +
    +
    + <% if activity.try(:user).try(:realname) == ' ' %> + <%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> + <% end %> TO + <%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%> +
    + + <% if activity.homework_detail_manual%> + <% if activity.homework_detail_manual.comment_status == 1%> + <% if activity.anonymous_comment == 0%> + 未开启匿评 + <% else %> + 匿评已禁用 + <% end %> + <% if Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%> + 作品提交中 + <% elsif Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %> + 作品补交中 + <% end %> + <% elsif activity.homework_detail_manual.comment_status == 2%> + <% if activity.anonymous_comment == 0%> + 匿评中 + <% else %> + 匿评已禁用 + <% end %> + 教师评阅中 + <% elsif activity.homework_detail_manual.comment_status == 3%> + <% if activity.anonymous_comment == 0%> + 匿评已结束 + <% else %> + 匿评已禁用 + <% end %> + 教师评阅中 + <% end%> + <% end%> +
    + <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%> + 系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合! + <% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%> + 系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合! + <% end %> +
    + <% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%> + <% projects = cur_user_projects_for_homework activity %> + <% works = cur_user_works_for_homework activity %> + <% if works.nil? && projects.nil? %> +
    + <%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %> + <%#= relate_project(activity,is_teacher,-1,user_activity_id,course_activity) %> +
    + <% elsif works.nil? %> +
    + <%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:is_in_course=>-1,:user_activity_id=>user_activity_id,:course_activity=>course_activity), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %> +
    + <% end %> + <% end %> +
    + <% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %> + <%= user_for_homework_common activity,is_teacher %> +
    + + <% if activity.homework_type == 2 && is_teacher%> +
    + <%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %> +
    + <% end %> + <% if activity.homework_type == 2%> +
    + 语言: + <%= activity.language_name%> +
    + <% end %> + <% if activity.homework_type == 3 && activity.homework_detail_group%> +
    + 分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人 +
    + <% end %> +
    截止时间:<%= activity.end_time.to_s %> 23:59
    +
    +
    +
    + <%= activity.description.html_safe %> +
    +
    +
    + + +
    + +
    +
    + 迟交扣分:<%= activity.late_penalty%>分 +
    + <% if activity.anonymous_comment == 0%> +
    + 匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00 +
    + <% end %> +
    +
    +
    +
    + 缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品 +
    + <% if activity.anonymous_comment == 0%> +
    + 匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59 +
    + <% end %> +
    +
    +
    + <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %> +
    +
    + <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %> +
    + <% projects = activity.student_work_projects.where("is_leader = 1") %> +
    + 已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %> +
    + <% projects.each do |pro| %> + <% project = Project.find pro.project_id %> + + +
    + <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %> + <% else %> + <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %> + <% end %> + <% time=project.updated_on %> + <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> +

    <%=(User.find project.user_id).show_name %>(组长)

    +

    <%=time_from_now time %>

    +
    + 项目名称:<%=project.name %>
    + 创建者:<%=(User.find project.user_id).show_name %>(组长)
    + 更新时间:<%=time_from_now time %> +
    +
    + <% end %> +
    + <% end %> +
    + <% if is_teacher%> + <% comment_status = activity.homework_detail_manual.comment_status %> +
    +
      +
    • +
        +
      • + <%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%> +
      • +
      • + <%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %> +
      • +
      • + <%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true) %> +
      • + <% if activity.anonymous_comment == 0 %> +
      • + <%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%> +
      • +
      • + <%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %> +
      • + <% end %> + <% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%> +
      • + <%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%> +
      • + <% end %> +
      +
    • +
    +
    + <% end%> +
    +
    +
    + + <% count=activity.journals_for_messages.count %> +
    +
    +
    +
    + 回复(<%= count %>) +
    +
    + <%if count>3 %> + + <% end %> +
    + + <% replies_all_i = 0 %> + <% if count > 0 %> +
    +
      + <% activity.journals_for_messages.reorder("created_on desc").each do |comment| %> + + <% replies_all_i = replies_all_i + 1 %> +
    • +
      + <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> +
      +
      +
      + <% if comment.try(:user).try(:realname) == ' ' %> + <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= format_time(comment.created_on) %> + +
      +
      + <%= comment.notes.html_safe %>
      +
      +
      +
    • + <% end %> +
    +
    + <% end %> + +
    +
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
    +
    +
    + <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%> + <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> + <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> + +
    + +
    +

    + <% end%> +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 7767fedc7..cd9704186 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -81,6 +81,7 @@ <%= format_time(attachment.created_on) %>
    +
    <% end %> <% end %>
    diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 557b9e9ee..5cadcddd6 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -109,12 +109,15 @@ <% end %> <% if user_activities.count == 10%> -
    展开更多<%=link_to "", user_activities_path(@user.id,:type => type,:page => page),:id => "more_activities_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"%> + + <%= 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/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index e49a7ed17..fb6ae0455 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -107,18 +107,22 @@
    迟交扣分:<%= homework_common.late_penalty%>分
    -
    - 匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%> 00:00 -
    + <% if homework_common.anonymous_comment == 0%> +
    + 匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%> 00:00 +
    + <% end %>
    缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
    -
    - 匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%> 23:59 -
    + <% if homework_common.anonymous_comment == 0%> +
    + 匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%> 23:59 +
    + <% end %>
    @@ -135,24 +139,26 @@ <% project = Project.find pro.project_id %> -
    +
    <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> - <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s,:alt =>"项目头像" %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像" %> <% else %> - <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s,:alt =>"项目头像") %> + <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %> <% end %> -
    + <% time=project.updated_on %> + <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> +

    <%=(User.find project.user_id).show_name %>(组长)

    +

    <%=time_from_now time %>

    +
    项目名称:<%=project.name %>
    创建者:<%=(User.find project.user_id).show_name %>(组长)
    - <% time=project.updated_on %> - <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> 更新时间:<%=time_from_now time %>
    diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index a060cf386..29be69a23 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -4,11 +4,23 @@ <%= javascript_include_tag 'homework','baiduTemplate' %> <% end %> @@ -39,6 +51,12 @@ <%= calendar_for('homework_publish_time')%> <% end %>
    + <% if !edit_mode || edit_mode && homework.homework_detail_manual.comment_status < 2 %> +
    + + 启用匿评 +
    + <% end %>

    @@ -68,12 +86,12 @@
    <% if edit_mode %> - 确定 + 确定 <%#= link_to "取消",user_homeworks_user_path(User.current.id),:class => "fr mr10 mt3"%> 取消 <% else %> - 发送 + 发送 取消 <% end %> diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb index 5bd2a9f3c..99c119a0c 100644 --- a/app/views/words/_new_respond_course.html.erb +++ b/app/views/words/_new_respond_course.html.erb @@ -1,9 +1,9 @@ -<%= form_tag(words_create_reply_path, :remote => true,:id=>"form_#{journal.id}") do %> +<%= form_tag(words_create_reply_path, :remote => true) do %> <%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5', :style => "resize: none;overflow: hidden;",:rows => 4, :placeholder => l(:label_feedback_respond_content)#, - #:maxlength => 250 + #:maxlength => 250 %>

    <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> @@ -13,20 +13,6 @@
    <%= submit_tag l(:button_feedback_respond), :name => nil , - :class => "reply_btn" ,:onclick=>"form_sub_#{ journal.id}($(this),event)"%> + :class => "reply_btn"%> -<% end %> - +<% end %> \ No newline at end of file diff --git a/config/configuration.yml.example b/config/configuration.yml.example index 27eb86f68..880c613e9 100644 --- a/config/configuration.yml.example +++ b/config/configuration.yml.example @@ -23,7 +23,7 @@ # email_delivery: # delivery_method: :smtp # smtp_settings: -# address: "localhost" +# address: smtp.163.com # port: 25 # # ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com @@ -32,12 +32,12 @@ # email_delivery: # delivery_method: :smtp # smtp_settings: -# address: "example.com" -# port: 25 +# address: smtp.gmail.com +# port: 587 # authentication: :login # domain: 'foo.com' -# user_name: 'myaccount' -# password: 'password' +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja # # ==== SMTP server at example.com using PLAIN authentication # @@ -45,12 +45,12 @@ # email_delivery: # delivery_method: :smtp # smtp_settings: -# address: "example.com" -# port: 25 +# address: smtp.gmail.com +# port: 587 # authentication: :plain # domain: 'example.com' -# user_name: 'myaccount' -# password: 'password' +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja # # ==== SMTP server at using TLS (GMail) # @@ -62,12 +62,12 @@ # delivery_method: :smtp # smtp_settings: # enable_starttls_auto: true -# address: "smtp.gmail.com" +# address: smtp.gmail.com # port: 587 # domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps # authentication: :plain -# user_name: "your_email@gmail.com" -# password: "your_password" +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja # # # === More configuration options @@ -78,18 +78,17 @@ # http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer -# default configuration options for all environments + default: - # Outgoing emails configuration (see examples above) email_delivery: delivery_method: :smtp smtp_settings: - address: smtp.example.net - port: 25 - domain: example.net - authentication: :login - user_name: "redmine@example.net" - password: "redmine" + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" # Absolute path to the directory where attachments are stored. # The default is the 'files' directory in your Redmine instance. @@ -104,7 +103,7 @@ default: # autologin_cookie_name: the name of the cookie (default: autologin) # autologin_cookie_path: the cookie path (default: /) # autologin_cookie_secure: true sets the cookie secure flag (default: false) - autologin_cookie_name: + autologin_cookie_name: "autologin_trustie" autologin_cookie_path: autologin_cookie_secure: @@ -170,7 +169,7 @@ default: # Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to # the ImageMagick's `convert` binary. Used to generate attachment thumbnails. - #imagemagick_convert_command: + imagemagick_convert_command: '/home/pdl/redmine-2.3.2-0/common/bin/convert' # Configuration of RMagcik font. # @@ -196,11 +195,41 @@ default: # Maximum number of simultaneous AJAX uploads #max_concurrent_ajax_uploads: 2 + #pic_types: "bmp,jpeg,jpg,png,gif" + + repository_root_path: '/tmp/htdocs' + judge_server: 'http://judge.trustie.net/' + + # Git's url + gitlab_address: 'http://gitfast.trustie.net' # specific configuration options for production environment # that overrides the default ones production: + # CJK support + rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf + judge_server: 'http://192.168.80.21:8080/' + repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs' + cookie_domain: ".trustie.net" + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" # specific configuration options for development environment # that overrides the default ones development: + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 03424bd5a..10241b4b3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -703,6 +703,7 @@ zh: label_search_by_login: 登录名 label_search_by_name: 名字 label_search_by_email: 邮箱 + label_search_by_occupation: 单位 label_result_plural: 结果 label_all_words: 所有单词 label_wiki: Wiki diff --git a/config/routes.rb b/config/routes.rb index c5e890d15..3afca2451 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -442,6 +442,8 @@ RedmineApp::Application.routes.draw do post '/courses/:id/course_activity', :to => 'courses#show', :as => 'course_activity' get '/boards/:id/boards_topic', :to =>'boards#show', :as => 'boards_topic' + match 'courses/:course_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_course_news' + match 'courses/:course_id/news/new', :to => 'news#new', :via => [:get, :post] #added by young resources :users do diff --git a/db/migrate/20151224090313_delete_journals_message.rb b/db/migrate/20151224090313_delete_journals_message.rb new file mode 100644 index 000000000..4753cc8e8 --- /dev/null +++ b/db/migrate/20151224090313_delete_journals_message.rb @@ -0,0 +1,17 @@ +class DeleteJournalsMessage < ActiveRecord::Migration + def up + count = JournalsForMessage.all.count / 30 + 2 + transaction do + for i in 1 ... count do + JournalsForMessage.page(i).per(30).each do |message| + if !message.m_parent_id.nil? and message.parent.nil? + message.destroy + end + end + end + end + end + + def down + end +end diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb index 3e51f2d4d..2dd520b92 100644 --- a/lib/redmine/scm/adapters/abstract_adapter.rb +++ b/lib/redmine/scm/adapters/abstract_adapter.rb @@ -80,7 +80,7 @@ module Redmine end def initialize(url, root_url=nil, login=nil, password=nil, - path_encoding=nil) + path_encoding=nil, project_id) @url = url @login = login if login && !login.empty? @password = (password || "") if @login diff --git a/lib/redmine/scm/adapters/gitlab_adapter.rb b/lib/redmine/scm/adapters/gitlab_adapter.rb index 32429fe35..7b2d18310 100644 --- a/lib/redmine/scm/adapters/gitlab_adapter.rb +++ b/lib/redmine/scm/adapters/gitlab_adapter.rb @@ -13,10 +13,12 @@ module Redmine attr_accessor :is_default end - def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil) + def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil, project_id) super @g = Gitlab.client - @project = Repository.find_by_url(url).project.gpid + r = Repository.where("url =? and project_id =?", url, project_id).first + @project = r.project.gpid + # @project = Repository.find_by_url(url).project.gpid @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding end diff --git a/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb b/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb index 23bd5108b..3b93de0b3 100644 --- a/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb +++ b/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb @@ -13,11 +13,12 @@ issue_desc_editor = KindEditor.create('#issue_description', {"width":"85%", "resizeType":0, "no_label":true, + "at_id":<%= @issue.project_id%>, + "at_type":"Project", "autoHeightMode":true, - "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\"),$(this.toolbar.div).hide();})", - "afterFocus":"eval(function(){$(this.toolbar.div).show();})", - "afterBlur":"eval(function(){$(this.toolbar.div).hide();})", - "emotionsBasePath":"http://localhost:3000", - "height":300,"allowFileManager":true, + "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, "<%=@issue.project_id %>", 'Project');}; this.loadPlugin('autoheight')})", + "emotionsBasePath":'<%= Setting.host_name%>', + "height":300, + "allowFileManager":true, "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager"}); \ No newline at end of file diff --git a/public/assets/kindeditor/at/jquery.atwho.css b/public/assets/kindeditor/at/jquery.atwho.css index 9a4c21d9b..df3ff9d94 100644 --- a/public/assets/kindeditor/at/jquery.atwho.css +++ b/public/assets/kindeditor/at/jquery.atwho.css @@ -9,7 +9,7 @@ border: 1px solid #DDD; border-radius: 3px; box-shadow: 0 0 5px rgba(0,0,0,0.1); - min-width: 120px; + min-width: 200px; max-height: 200px; overflow: auto; z-index: 11110 !important; diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 901e302d3..3d9fba942 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -870,7 +870,10 @@ function redo() { window.location.reload() } -function encodeHomeworkUrl(url){ +function encodeHomeworkUrl(url, is_base64){ + if(typeof is_base64 === 'boolean' && is_base64){ + return '/zipdown/download?base64file='+url; + } var file = encodeURI(url).replace(/\+/g, '%2B'); return '/zipdown/download?file='+file; } @@ -891,7 +894,10 @@ $(function(){ } if(res.length==1){ - location.href = encodeHomeworkUrl(res[0].file);return; + if(res[0].base64file){ + location.href = encodeHomeworkUrl(res[0].base64file, true);return; + } + location.href = encodeHomeworkUrl(res[0].file);return; } document.getElementById('light').style.display='block'; @@ -904,8 +910,12 @@ $(function(){ } else { des = '第'+res[i].index+'个学生的作品下载'; } - $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + if(res[i].base64file){ + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } else { + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } } } }); @@ -921,7 +931,10 @@ $(function(){ else { if(res.length==1){ - location.href = encodeHomeworkUrl(res[0].file);return; + if(res[0].base64file){ + location.href = encodeHomeworkUrl(res[0].base64file, true);return; + } + location.href = encodeHomeworkUrl(res[0].file);return; } document.getElementById('light').style.display='block'; $container = $('#light .upload_box_ul'); @@ -933,7 +946,12 @@ $(function(){ } else { des = '第'+res[i].index+'个学生的作品下载'; } + + if(res[i].base64file){ + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } else { $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } } } @@ -973,3 +991,14 @@ function showNormalImage(id) { } } + +$(function(){ + //at 加链接 + $("span.at").hover(function(){ + $(this).css('cursor', 'pointer'); + }); + $("span.at").live('click', function(){ + var userId = $(this).attr('data-user-id'); + $(window.location).attr('href', '/users/'+userId); + }); +}); \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index c147850ef..5bfaccf30 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -299,12 +299,12 @@ function regexDescription() $("#description_notice_span").focus(); return false; } - else if(name.length >=6000){ + /*else if(name.length >=6000){ $("#description_notice_span").text("描述最多3000个汉字(或6000个英文字符)"); $("#description_notice_span").css('color','#ff0000'); $("#description_notice_span").focus(); return false; - } + }*/ else { $("#description_notice_span").text("填写正确"); diff --git a/public/javascripts/project.js b/public/javascripts/project.js index a7bf954a0..cc679847a 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -248,13 +248,13 @@ function regexDescription() { $("#description_notice_span").focus(); return false; } - else if (name.length > 10000) + /*else if (name.length > 10000) { $("#description_notice_span").text("描述超过10000个字符"); $("#description_notice_span").css('color', '#ff0000'); $("#description_notice_span").focus(); return false; - } + }*/ else { $("#description_notice_span").text("填写正确"); $("#description_notice_span").css('color', '#008000'); diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 463fc710a..86586243d 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1209,7 +1209,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;} .proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;} .hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;} .mr150 {margin-right:150px;} -.relatePInfo {position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} +.relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} /*上传资源弹窗*/ .resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} @@ -1227,6 +1227,7 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; .mb10 {margin-bottom: 10px} .mb15 {margin-bottom: 15px} div.disable_link {background-color: #c1c1c1 !important;} +.reUploadDetail{border:1px solid #dddddd; float:left; resize:none; width:400px; height:80px; overflow-y:auto;outline: none;} /*新课程资源库*/ .reCon{ margin:5px; width:710px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 43127d1eb..775ade128 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -119,6 +119,7 @@ a.linkGrey6:hover {color:#ffffff !important;} .w50 {width:50px;} .w60{ width:60px;} .w70{ width:70px;} +.w80{ width:80px;} .w90{ width:90px;} .w210{ width:210px;} .w150{ width:150px;} @@ -1382,10 +1383,12 @@ a:hover.blueCir{ background:#3598db; color:#fff;} .proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;} .hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;} .mr150 {margin-right:150px;} +.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} + /* @功能 定义 */ span.at {color:#269ac9;} -.relatePInfo {position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} +.relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} /*问题状态图片*/ .issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:18px; height:21px;} .duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;} diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index fe8aced9f..bcb50cfed 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -67,7 +67,8 @@ a.linkGrey8:hover {color:#585858;} .orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px; color:#555555;} .orgMenuArrow {background:url(../images/nav_icon.png) -10px -165px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} .orgMenuArrow2 {background:url(../images/nav_icon.png) -10px -132px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} -.org_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-53px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 30px;} +.org_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-53px; + position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 30px;} #orgUserName {max-width:50px; overflow:hidden; white-space: nowrap; text-overflow: ellipsis; display:inline-block;} .org_login_list a {color:#269ac9;} @@ -86,17 +87,19 @@ a.linkGrey8:hover {color:#585858;} .re_con_top span{ color:#999999; font-weight:bold;} ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } -.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} - -/*转发样式*/ -.shareDP {width:415px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; z-index:1000;} -.shareArrow {background:url(../images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;} -.sectionWrap {float:left; max-height:150px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:220px; background-color:#f1f1f1; min-height:150px; padding-top:5px;} -.columnWrap {float:left; max-height:148px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:178px; background-color:#fffff; min-height:148px; padding-top:5px; border:1px solid #f1f1f1;} -.columnWrap li {padding-left:10px; color:#585858;} -.columnWrap span {width:150px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:inline-block;} -.sectionRow:hover {background-color:#cccccc; cursor:pointer;} -.sectionContent {display:none;} -.sectionContent li {padding-left:30px;} -.sectionContent li:hover {background-color:#cccccc; cursor:pointer;} -.sectionContent span {width:175px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:18px; vertical-align:middle;} \ No newline at end of file +.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} + +/*转发样式*/ +.shareDP {width:415px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; z-index:1000;} +.shareArrow {background:url(../images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;} +.sectionWrap {float:left; max-height:150px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:220px; background-color:#f1f1f1; min-height:150px; padding-top:5px;} +.columnWrap {float:left; max-height:148px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:178px; background-color:#fffff; min-height:148px; padding-top:5px; border:1px solid #f1f1f1;} +.columnWrap li {padding-left:10px; color:#585858;} +.columnWrap span {width:150px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:inline-block;} +.sectionRow:hover {background-color:#cccccc; cursor:pointer;} +.sectionContent {display:none;} +.sectionContent li {padding-left:30px;} +.sectionContent li:hover {background-color:#cccccc; cursor:pointer;} +.sectionContent span {width:175px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:18px; vertical-align:middle;}.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; + background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} +.org_login_list a {color:#269ac9;} \ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index f9c9c6c86..c9d303f1d 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1091,4 +1091,7 @@ a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; c .duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;} .support{ background:url(../images/public_icon.png) -66px -45px no-repeat; width:18px; height:21px;} .function{ background:url(../images/public_icon.png) -66px -70px no-repeat; width:18px; height:21px;} -.weekly{ background:url(../images/public_icon.png) -66px -95px no-repeat; width:18px; height:21px;} \ No newline at end of file +.weekly{ background:url(../images/public_icon.png) -66px -95px no-repeat; width:18px; height:21px;} + +.upload_img img{max-width: 100%;} +.table_maxWidth table {max-width: 642px;} \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 8f54df445..99c5168d9 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -917,7 +917,7 @@ a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-r /* @功能 定义 */ span.at {color:#269ac9;} - +.del_line{text-decoration:line-through !important;} /*转发样式*/ .shareDP {width:415px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; z-index:1000;} .shareArrow {background:url(../images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;} diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css index 2e084d61c..baf57c4b1 100644 --- a/public/stylesheets/repository.css +++ b/public/stylesheets/repository.css @@ -286,4 +286,5 @@ li.commit .commit-row-info .committed_ago { } .rep_history_grey{ color: #7F7F7F; -} \ No newline at end of file +} +.rep_mail_name{max-width: 150px; overflow: hidden; text-overflow: ellipsis;} \ No newline at end of file