diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 514f68d49..23fe19333 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -600,7 +600,7 @@ private
def has_login
unless @attachment && @attachment.container_type == "PhoneAppVersion"
- render_403 if !User.current.logged? && @attachment.container_type != 'OrgSubfield' && @attachment.container_type != 'OrgDocumentComment'
+ render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download)
end
end
end
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index c8dcf0b8e..5966b310f 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -25,7 +25,9 @@ class CommentsController < ApplicationController
def create
raise Unauthorized unless @news.commentable?
-
+ if !@news.org_subfield_id.nil?
+ @org_subfield = OrgSubfield.find(@news.org_subfield_id)
+ end
@comment = Comment.new
#@project ? @comment.comments = params[:comment][:comments] : @comment.comments = params[:comment]
if params[:user_activity_id]
diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb
index d3ac71b99..0962deb10 100644
--- a/app/controllers/news_controller.rb
+++ b/app/controllers/news_controller.rb
@@ -46,15 +46,16 @@ class NewsController < ApplicationController
@course = Course.find(params[:course_id])
end
if @project
+ @page = params[:page] ? params[:page].to_i + 1 : 0
scope = @project ? @project.news.visible : News.visible
@news_count = scope.count
- @news_pages = Paginator.new @news_count, @limit, params['page']
- @offset ||= @news_pages.offset
+ #@news_pages = Paginator.new @news_count, @limit, params['page']
+ #@offset ||= @news_pages.offset
@newss = scope.all(:include => [:author, :project],
:order => "#{News.table_name}.created_on DESC",
- :offset => @offset,
- :limit => @limit)
+ :offset => @page * 10,
+ :limit => 10)
respond_to do |format|
format.html {
@@ -63,6 +64,7 @@ class NewsController < ApplicationController
render :layout => false if request.xhr?
}
+ format.js
format.api
format.atom { render_feed(@newss, :title => (@project ? @project.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
end
@@ -144,6 +146,10 @@ class NewsController < ApplicationController
if @course
render :layout => 'base_courses'
end
+ elsif @news.org_subfield_id
+ @org_subfield = OrgSubfield.find(@news.org_subfield_id)
+ @organization = @org_subfield.organization
+ render :layout => 'base_org'
end
end
@@ -151,6 +157,21 @@ class NewsController < ApplicationController
#modify by nwb
if @project
@news = News.new(:project => @project, :author => User.current)
+ @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 project_news_index_url(@project)
+ else
+ redirect_to project_news_index_url(@project)
+ #layout_file = 'base_courses'
+ #render :action => 'new', :layout => layout_file
+ end
elsif @course
@news = News.new(:course => @course, :author => User.current)
#render :layout => 'base_courses'
@@ -221,8 +242,14 @@ class NewsController < ApplicationController
end
def edit
+ if @news.org_subfield_id
+ @org_subfield = OrgSubfield.find(@news.org_subfield_id)
+ @organization = @org_subfield.organization
+ end
if @course
render :layout => "base_courses"
+ elsif @org_subfield
+ render :layout => 'base_org'
end
end
@@ -240,12 +267,17 @@ class NewsController < ApplicationController
end
def destroy
+ if @news.org_subfield_id
+ @org_subfield = OrgSubfield.find(@news.org_subfield_id)
+ end
@news.destroy
# modify by nwb
if @project
redirect_to project_news_index_url(@project)
elsif @course
redirect_to course_news_index_url(@course)
+ elsif @org_subfield
+ redirect_to organization_path(@org_subfield.organization, :org_subfield_id => @org_subfield.id)
end
end
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 39ece6fbe..361303833 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -116,6 +116,7 @@ class OrganizationsController < ApplicationController
@organization.description = params[:organization][:description]
# @organization.domain = params[:organization][:domain]
@organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0
+ @organization.allow_guest_download = params[:organization][:allow_guest_download] == 'on' ? 1 : 0
#@organization.name = params[:organization][:name]
@organization.save
respond_to do |format|
@@ -300,7 +301,11 @@ class OrganizationsController < ApplicationController
def org_resources_subfield
@org = Organization.find(params[:id])
- @subfield = @org.org_subfields.where('field_type = "Resource" ')
+ if params[:send_type].present? and params[:send_type] == 'news'
+ @subfield = @org.org_subfields.where("field_type = 'Post'")
+ else
+ @subfield = @org.org_subfields.where('field_type = "Resource" ')
+ end
respond_to do | format|
format.js
end
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index ec54ae8a4..78babc43c 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -2,6 +2,7 @@
class PollController < ApplicationController
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll]
before_filter :find_container, :only => [:new,:create, :index]
+ before_filter :is_logged, :only => [:index, :show, :poll_result,:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll,:commit_answer,:commit_poll,:statistics_result]
before_filter :is_member_of_course, :only => [:index,:show,:poll_result]
before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll]
include PollHelper
@@ -503,6 +504,10 @@ class PollController < ApplicationController
end
end
+ def is_logged
+ redirect_to signin_path unless User.current.logged?
+ end
+
def is_member_of_course
render_403 unless(@course && (User.current.member_of_course?(@course) || User.current.admin?))
end
diff --git a/app/controllers/praise_tread_controller.rb b/app/controllers/praise_tread_controller.rb
index b99963e2f..96eeab884 100644
--- a/app/controllers/praise_tread_controller.rb
+++ b/app/controllers/praise_tread_controller.rb
@@ -24,7 +24,7 @@ class PraiseTreadController < ApplicationController
end
return
end
- #@horizontal = params[:horizontal].downcase == "false" ? false:true
+ @horizontal = params[:horizontal].downcase == "false" ? false:true if params[:horizontal]
if @obj.respond_to?("author_id")
author_id = @obj.author_id
elsif @obj.respond_to?("user_id")
@@ -103,30 +103,36 @@ class PraiseTreadController < ApplicationController
def find_object_by_type_and_id(type,id)
@obj = nil
case type
- when 'User'
- @obj = User.find_by_id(id)
- when 'Issue'
- @obj = Issue.find_by_id(id)
- when 'Project'
- @obj = Project.find_by_id(id)
- when 'Bid'
- @obj = Bid.find_by_id(id)
- when 'Contest'
- @obj = Contest.find_by_id(id)
- when 'Memo'
- @obj = Memo.find_by_id(id)
- when 'Message'
- @obj = Message.find_by_id(id)
- when 'HomeworkCommon'
- @obj = HomeworkCommon.find_by_id(id)
- when 'JournalsForMessage'
- @obj = JournalsForMessage.find_by_id(id)
- when 'News'
- @obj = News.find_by_id(id)
- when 'Comment'
- @obj = Comment.find_by_id(id)
- when 'Journal'
- @obj = Journal.find_by_id(id)
+ when 'Memo'
+ @obj = Memo.find_by_id(id)
+ when 'Message'
+ @obj = Message.find_by_id(id)
+ when 'HomeworkCommon'
+ @obj = HomeworkCommon.find_by_id(id)
+ when 'JournalsForMessage'
+ @obj = JournalsForMessage.find_by_id(id)
+ when 'News'
+ @obj = News.find_by_id(id)
+ when 'Comment'
+ @obj = Comment.find_by_id(id)
+ when 'Journal'
+ @obj = Journal.find_by_id(id)
+ when 'BlogComment'
+ @obj = BlogComment.find_by_id(id)
+ when 'OrgDocumentComment'
+ @obj = OrgDocumentComment.find_by_id(id)
+ when 'User'
+ @obj = User.find_by_id(id)
+ when 'Issue'
+ @obj = Issue.find_by_id(id)
+ when 'Project'
+ @obj = Project.find_by_id(id)
+ when 'Bid'
+ @obj = Bid.find_by_id(id)
+ when 'Contest'
+ @obj = Contest.find_by_id(id)
+ else
+ @obj = nil
end
return @obj
end
@@ -143,7 +149,8 @@ class PraiseTreadController < ApplicationController
# end
#再创建或更新praise_tread_cache表
- @ptc = PraiseTreadCache.find_by_object_id_and_object_type(id,type)
+ #@ptc = PraiseTreadCache.find_by_object_id_and_object_type(id,type)
+ @ptc = PraiseTreadCache.where("object_id = ? and object_type = ?",id.to_i,type).first
@ptc = @ptc.nil? ? PraiseTreadCache.new : @ptc
@ptc.object_id = id.to_i
@ptc.object_type = type
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 449d8b9de..b1c384ae4 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -746,14 +746,34 @@ class UsersController < ApplicationController
end
end
# end
- jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
+ @page = params[:page] ? params[:page].to_i + 1 : 0
+ if params[:type].present?
+ case params[:type]
+ when "public"
+ jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 0').order('created_on DESC')
+ @jour_count = jours.count
+ @jour = jours.limit(10).offset(@page * 10)
+ when "private"
+ jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 1').order('created_on DESC')
+ @jour_count = jours.count
+ @jour = jours.limit(10).offset(@page * 10)
+ else
+ jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
+ @jour_count = jours.count
+ @jour = jours.limit(10).offset(@page * 10)
+ end
+ else
+ jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
+ @jour_count = jours.count
+ @jour = jours.limit(10).offset(@page * 10)
+ end
+ @type = params[:type]
if User.current == @user
jours.update_all(:is_readed => true, :status => false)
jours.each do |journal|
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
end
end
- @jour = paginateHelper jours,10
@state = false
render :layout=>'new_base_user'
end
@@ -1753,6 +1773,48 @@ class UsersController < ApplicationController
end
end
+ def share_news_to_course
+ news = News.find(params[:send_id])
+ course_ids = params[:course_ids]
+ course_ids.each do |course_id|
+ if Course.find(course_id).news.map(&:id).exclude?(news.id)
+ course_news = News.create(:course_id => course_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now,:project_id => -1)
+ news.attachments.each do |attach|
+ course_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
+ end
+ end
+ end
+ end
+
+ def share_news_to_project
+ news = News.find(params[:send_id])
+ project_ids = params[:project_ids]
+ project_ids.each do |project_id|
+ if Project.find(project_id).news.map(&:id).exclude?(news.id)
+ project_news = News.create(:project_id => project_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now)
+ news.attachments.each do |attach|
+ project_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
+ end
+ end
+ end
+ end
+
+ def share_news_to_org
+ news = News.find(params[:send_id])
+ field_id = params[:subfield]
+ org_news = News.create(:org_subfield_id => field_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now,:project_id => -1)
+ news.attachments.each do |attach|
+ org_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
+ end
+ OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'News', :org_act_id => org_news.id, :user_id => User.current.id)
+ end
+
def change_org_subfield
end
@@ -2102,9 +2164,17 @@ class UsersController < ApplicationController
@user = User.current
if !params[:search].nil? #发送到有栏目类型为资源的组织中
search = "%#{params[:search].to_s.strip.downcase}%"
- @orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
+ if params[:send_type].present? and params[:send_type] == 'news'
+ @orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Post'").count > 0}
+ else
+ @orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
+ end
else
- @orgs = @user.organizations.select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
+ if params[:send_type].present? and params[:send_type] == 'news'
+ @orgs = @user.organizations.select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Post'").count > 0}
+ else
+ @orgs = @user.organizations.select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
+ end
end
@search = params[:search]
#这里仅仅是传递需要发送的资源id
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index ebd46caa7..8115f3f91 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -225,11 +225,11 @@ class WordsController < ApplicationController
def leave_user_message
if User.current.logged?
@user = User.find(params[:id])
- if params[:new_form][:user_message].size>0 && User.current.logged? && @user
+ if params[:new_form][:content].size>0 && User.current.logged? && @user
if params[:private] && params[:private] == '1'
- @user.journals_for_messages << JournalsForMessage.new(:user_id => User.current.id, :notes => params[:new_form][:user_message], :reply_id => 0, :status => true, :is_readed => false, :private => 1)
+ @user.journals_for_messages << JournalsForMessage.new(:user_id => User.current.id, :notes => params[:new_form][:content], :reply_id => 0, :status => true, :is_readed => false, :private => 1)
else
- @user.add_jour(User.current, params[:new_form][:user_message])
+ @user.add_jour(User.current, params[:new_form][:content])
end
end
redirect_to feedback_path(@user)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 9f08a63ed..8aa11c3ac 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2789,13 +2789,6 @@ int main(int argc, char** argv){
ss.html_safe
end
- #代码提交数量
- def changesets_num project
- g = Gitlab.client
- project.gpid.nil? ? 0 : g.project(project.gpid).commit_count
- # project.changesets.count
-end
-
#课程动态的更新
def update_course_activity type, id
course_activity = CourseActivity.where("course_act_type=? and course_act_id =?", type.to_s, id).first
@@ -2836,4 +2829,13 @@ end
principal_activity.save
end
end
+
+ #项目按更新时间排序
+ def project_sort_update projects
+ unless projects.empty?
+ project_ids = '('+projects.map{|pro|pro.project_id}.join(',')+')'
+ sort_projects = ForgeActivity.find_by_sql("SELECT MAX(updated_at) AS updated_at,user_id, project_id FROM forge_activities WHERE project_id IN #{project_ids} GROUP BY project_id ORDER BY MAX(updated_at) DESC")
+ return sort_projects
+ end
+ end
end
diff --git a/app/models/course.rb b/app/models/course.rb
index 24e955d15..0194a2a9d 100644
--- a/app/models/course.rb
+++ b/app/models/course.rb
@@ -1,7 +1,6 @@
require 'elasticsearch/model'
class Course < ActiveRecord::Base
include Redmine::SafeAttributes
- include ApplicationHelper
STATUS_ACTIVE = 1
STATUS_CLOSED = 5
@@ -71,7 +70,7 @@ class Course < ActiveRecord::Base
validates_length_of :description, :maximum => 10000
before_save :self_validate
# 公开课程变成私有课程,所有资源都变成私有
- after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity
+ after_update :update_files_public,:update_course_ealasticsearch_index
after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index
before_destroy :delete_all_members,:delete_course_ealasticsearch_index
@@ -429,12 +428,6 @@ class Course < ActiveRecord::Base
end
end
end
-#动态的更新
-def update_activity
- update_course_activity(self.class, self.id)
- update_user_activity(self.class, self.id)
- update_org_activity(self.class, self.id)
-end
# Delete the previous articles index in Elasticsearch
# Course.__elasticsearch__.client.indices.delete index: Course.index_name rescue nil
diff --git a/app/models/news.rb b/app/models/news.rb
index 7c44f7e8a..fee5d2801 100644
--- a/app/models/news.rb
+++ b/app/models/news.rb
@@ -22,6 +22,7 @@ class News < ActiveRecord::Base
has_many_kindeditor_assets :assets, :dependent => :destroy
#added by nwb
belongs_to :course,:touch => true
+ belongs_to :org_subfield, :touch => true
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
has_many :comments, :as => :commented, :dependent => :destroy, :order => "created_on"
# fq
@@ -57,7 +58,7 @@ class News < ActiveRecord::Base
after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity,:act_as_system_message, :add_author_as_watcher, :send_mail, :add_news_count
after_update :update_activity
- after_destroy :delete_kindeditor_assets, :decrease_news_count
+ after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities
scope :visible, lambda {|*args|
includes(:project).where(Project.allowed_to_condition(args.shift || User.current, :view_news, *args))
@@ -187,4 +188,8 @@ class News < ActiveRecord::Base
Mailer.run.news_added(self) if Setting.notified_events.include?('news_added')
end
+ def delete_org_activities
+ OrgActivity.where("container_type='OrgSubfield' and org_act_type='News' and org_act_id=?", self.id).destroy_all
+ end
+
end
\ No newline at end of file
diff --git a/app/models/org_subfield.rb b/app/models/org_subfield.rb
index b109ba042..c62cbf4f8 100644
--- a/app/models/org_subfield.rb
+++ b/app/models/org_subfield.rb
@@ -6,6 +6,7 @@ class OrgSubfield < ActiveRecord::Base
has_many :org_subfield_messages, :dependent => :destroy
has_many :messages, :through => :org_subfield_messages
has_many :boards, :dependent => :destroy
+ has_many :news, :dependent => :destroy
acts_as_attachable
after_create :create_board_sync
# 创建资源栏目讨论区
diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb
index 9bd7d9d2f..32e796382 100644
--- a/app/views/attachments/_activity_attach.html.erb
+++ b/app/views/attachments/_activity_attach.html.erb
@@ -3,7 +3,7 @@
- <%= link_to_short_attachment attachment,:length=> 58, :class => 'mw400 hidden link_file_a fl newsBlue', :download => true -%>
+ <%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw400', :download => true -%>
(
diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb
index c3a6cc9d0..936bdd9b6 100644
--- a/app/views/bids/_homework.html.erb
+++ b/app/views/bids/_homework.html.erb
@@ -28,7 +28,7 @@
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
"");
- $('#ajax-modal').parent().css("top","").css("left","").css("width","511");
+ $('#ajax-modal').parent().css("top","").css("left","").css("width","511").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("alert_praise");
<% end %>
diff --git a/app/views/bids/alert_anonymous_comment.js.erb b/app/views/bids/alert_anonymous_comment.js.erb
index 66c36e223..04f99980c 100644
--- a/app/views/bids/alert_anonymous_comment.js.erb
+++ b/app/views/bids/alert_anonymous_comment.js.erb
@@ -1,8 +1,8 @@
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms', locals: { bid: @bid, totle_size:@totle_size, cur_size:@cur_size, percent:@percent}) %>');
-showModal('ajax-modal', '500px');
-//$('#ajax-modal').css('height','180px');
-$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("" +
- "");
-$('#ajax-modal').parent().css("top","").css("left","");
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms', locals: { bid: @bid, totle_size:@totle_size, cur_size:@cur_size, percent:@percent}) %>');
+showModal('ajax-modal', '500px');
+//$('#ajax-modal').css('height','180px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ "");
+$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
\ No newline at end of file
diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb
index 02f1ad1ad..6f4397569 100644
--- a/app/views/blog_comments/show.html.erb
+++ b/app/views/blog_comments/show.html.erb
@@ -116,9 +116,18 @@
<% count=@article.children.count%>
<% end %>
- <% unless count == 0 %>
+ <%# unless count == 0 %>
-
回复(<%=count %>)
+
回复
+ <%= count>0 ? "(#{count})" : "" %>▪
+
+ <% if @article.author == User.current %>
+ 赞<%= get_praise_num(@article) > 0 ? "(#{get_praise_num(@article)})" : "" %>
+ <% else %>
+ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%>
+ <% end %>
+
+
-
-
-<% end %>
-
-
\ No newline at end of file
diff --git a/app/views/exercise/commit_exercise.js.erb b/app/views/exercise/commit_exercise.js.erb
index ac8c242d1..8b6e9f00c 100644
--- a/app/views/exercise/commit_exercise.js.erb
+++ b/app/views/exercise/commit_exercise.js.erb
@@ -1,8 +1,8 @@
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status,:exercise =>@exercise}) %>');
-showModal('ajax-modal', '270px');
-$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("" +
- "");
-$('#ajax-modal').parent().removeClass("alert_praise");
-$('#ajax-modal').parent().css("top","").css("left","");
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status,:exercise =>@exercise}) %>');
+showModal('ajax-modal', '270px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ "");
+$('#ajax-modal').parent().removeClass("alert_praise");
+$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("alert_box");
\ No newline at end of file
diff --git a/app/views/exercise/index.html.erb b/app/views/exercise/index.html.erb
index 9b6961e6c..8637273f1 100644
--- a/app/views/exercise/index.html.erb
+++ b/app/views/exercise/index.html.erb
@@ -25,7 +25,7 @@
$('#ajax-modal').before("" +
"");
$('#ajax-modal').parent().removeClass("alert_praise");
- $('#ajax-modal').parent().css("top","").css("left","");
+ $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
@@ -57,7 +57,7 @@
$('#ajax-modal').before("" +
"");
$('#ajax-modal').parent().removeClass("alert_praise");
- $('#ajax-modal').parent().css("top","").css("left","");
+ $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
}
diff --git a/app/views/exercise/publish_exercise.js.erb b/app/views/exercise/publish_exercise.js.erb
index c1c4a4fd5..004ca9625 100644
--- a/app/views/exercise/publish_exercise.js.erb
+++ b/app/views/exercise/publish_exercise.js.erb
@@ -1,10 +1,10 @@
-$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index =>@index}) %>");
-$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>");
-showModal('ajax-modal', '250px');
-//$('#ajax-modal').css('height','111px');
-$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("" +
- "");
-$('#ajax-modal').parent().removeClass("alert_praise");
-$('#ajax-modal').parent().css("top","").css("left","");
+$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index =>@index}) %>");
+$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>");
+showModal('ajax-modal', '250px');
+//$('#ajax-modal').css('height','111px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ "");
+$('#ajax-modal').parent().removeClass("alert_praise");
+$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("poll_alert_form");
\ No newline at end of file
diff --git a/app/views/exercise/republish_exercise.js.erb b/app/views/exercise/republish_exercise.js.erb
index 2b4e67606..a55cefbde 100644
--- a/app/views/exercise/republish_exercise.js.erb
+++ b/app/views/exercise/republish_exercise.js.erb
@@ -1,10 +1,10 @@
-$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index => @index}) %>");
-$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>");
-showModal('ajax-modal', '250px');
-//$('#ajax-modal').css('height','80px');
-$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("" +
- "");
-$('#ajax-modal').parent().removeClass("alert_praise");
-$('#ajax-modal').parent().css("top","").css("left","");
+$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index => @index}) %>");
+$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>");
+showModal('ajax-modal', '250px');
+//$('#ajax-modal').css('height','80px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ "");
+$('#ajax-modal').parent().removeClass("alert_praise");
+$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("poll_alert_form");
\ No newline at end of file
diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb
index 9513baab0..85b230be3 100644
--- a/app/views/files/_course_file.html.erb
+++ b/app/views/files/_course_file.html.erb
@@ -40,7 +40,7 @@
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("");
- $('#ajax-modal').parent().css("top","").css("left","");
+ $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb
index f1d96d22c..47c08d2fb 100644
--- a/app/views/files/_course_list.html.erb
+++ b/app/views/files/_course_list.html.erb
@@ -43,7 +43,7 @@
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
- - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %>
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
- <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
<% if @course.is_public? %>
-
@@ -61,7 +61,7 @@
<% end %>
<%else%>
- - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %>
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
<% end %>
<% end %>
diff --git a/app/views/files/_file_tools.html.erb b/app/views/files/_file_tools.html.erb
index df4d9d738..91b475600 100644
--- a/app/views/files/_file_tools.html.erb
+++ b/app/views/files/_file_tools.html.erb
@@ -2,7 +2,7 @@
<% if (is_project_manager?(User.current, @project) || file.author_id == User.current.id) && project_contains_attachment?(@project,file) %>
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @project.id && file.container_type == "Project" %>
- - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %>
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
- <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
<% if @project.is_public? %>
-
@@ -25,7 +25,7 @@
<% end %>
<%else%>
- - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %>
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
<% end %>
<% end %>
diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb
index 424319889..7a5d95125 100644
--- a/app/views/files/_org_subfield_list.html.erb
+++ b/app/views/files/_org_subfield_list.html.erb
@@ -38,7 +38,7 @@
<% if User.current.logged? %>
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
- - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %>
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
- <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
-
@@ -52,7 +52,7 @@
<%else%>
- - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %>
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
<% end %>
<% end %>
diff --git a/app/views/files/_project_file_new.html.erb b/app/views/files/_project_file_new.html.erb
index 4ee1ccede..b66c470e3 100644
--- a/app/views/files/_project_file_new.html.erb
+++ b/app/views/files/_project_file_new.html.erb
@@ -6,7 +6,7 @@
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("");
- $('#ajax-modal').parent().css("top","40%").css("left","36%");
+ $('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
diff --git a/app/views/files/_tool_settings.html.erb b/app/views/files/_tool_settings.html.erb
index 72ec6d89f..41d74b7df 100644
--- a/app/views/files/_tool_settings.html.erb
+++ b/app/views/files/_tool_settings.html.erb
@@ -4,7 +4,7 @@
<% if (is_project_manager?(User.current, project) || file.author_id == User.current.id) && project_contains_attachment?(project, file) %>
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project" %>
- - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %>
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
- <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
<% if project.is_public? %>
-
@@ -20,7 +20,7 @@
<% end %>
<% else %>
- - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %>
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
<% end %>
<% end %>
diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb
index b702d5872..8cb547b13 100644
--- a/app/views/files/index.html.erb
+++ b/app/views/files/index.html.erb
@@ -245,105 +245,7 @@
});
}
- function observeSearchfieldOnInput(fieldId, url,send_id,send_ids) {
- $('#'+fieldId).each(function() {
- var $this = $(this);
- $this.addClass('autocomplete');
- $this.attr('data-value-was', $this.val());
- var check = function() {
- var val = $this.val();
- if ($this.attr('data-value-was') != val){
- $this.attr('data-value-was', val);
- $.ajax({
- url: url,
- type: 'get',
- data: {search: $this.val(),send_id:send_id,send_ids:send_ids},
- success: function(data){ },
- beforeSend: function(){ $this.addClass('ajax-loading'); },
- complete: function(){ $this.removeClass('ajax-loading'); }
- });
- }
- };
- var reset = function() {
- if (timer) {
- clearInterval(timer);
- timer = setInterval(check, 300);
- }
- };
- var timer = setInterval(check, 300);
- $this.bind('keyup click mousemove', reset);
- });
- }
- function check_des(event){
- if($(".sectionContent").find('input[type="radio"]:checked').length <= 0){
- event.preventDefault();
- $(".orgDirection").text('目标地址组织不能为空')
- return false;
- }else if($(".columnContent").find('input[type="radio"]:checked').length <= 0){
- event.preventDefault();
- $(".orgDirection").text('目标地址栏目不能为空')
- return false;
- }else{
- return true;
- }
- }
- <% if User.current.logged? %>
- var sendType = '1';
- var lastSendType ;//初始为发送到我的课程
- function show_send(id){
- if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
- $.ajax({
- type: 'get',
- url: '<%= search_user_project_user_path(User.current)%>' + '?send_id=' + id
- });
- }else if(lastSendType == '1'){
- $.ajax({
- type: 'get',
- url: '<%= search_user_course_user_path(User.current)%>' + '?send_id=' + id
- });
- }else if( lastSendType == '3'){//组织
- $.ajax({
- type: 'get',
- url: '<%= search_user_org_user_path(User.current)%>' + '?send_id=' + id
- });
- }else{
- $.ajax({
- type: 'get',
- url: '<%= search_user_course_user_path(User.current)%>' + '?send_id=' + id
- });
- }
- }
-
- //id 发送的id
- //发送的id数组
- function chooseSendType(res_id,res_ids){
-
- sendType = $(".resourcesSendType").val();
- if (sendType === lastSendType) {
- return;
- } else if(lastSendType != null) { //不是第一次点击的时候
- if (sendType == '1') {
- $.ajax({
- type: 'get',
- url: '<%= search_user_course_user_path(User.current)%>' + '?send_id=' + res_id
- });
- } else if(sendType == '2') {
- $.ajax({
- type: 'get',
- url: '<%= search_user_project_user_path(User.current)%>' + '?send_id=' + res_id
- });
- }else if(sendType == '3'){
- $.ajax({
- type: 'get',
- url: '<%= search_user_org_user_path(User.current)%>' + '?send_id=' + res_id
- });
- }
- }
-
- lastSendType = sendType;
- }
- <% end %>
<% if @course %>
var tagNameHtml; //当前双击的链接的父节点的html
var tagName; //标签的值
diff --git a/app/views/files/quote_resource_show.js.erb b/app/views/files/quote_resource_show.js.erb
index 76025fbd2..12b6ea241 100644
--- a/app/views/files/quote_resource_show.js.erb
+++ b/app/views/files/quote_resource_show.js.erb
@@ -7,5 +7,5 @@
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("");
-$('#ajax-modal').parent().css("top","").css("left","");
+$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
\ No newline at end of file
diff --git a/app/views/files/quote_resource_show_org_subfield.js.erb b/app/views/files/quote_resource_show_org_subfield.js.erb
index fe34e9624..a9207f7f4 100644
--- a/app/views/files/quote_resource_show_org_subfield.js.erb
+++ b/app/views/files/quote_resource_show_org_subfield.js.erb
@@ -1,11 +1,11 @@
-<% if @can_quote %>
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => ''}) %>');
-<% else %>
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => '403'}) %>');
-<% end %>
-
-showModal('ajax-modal', '513px');
-$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("");
-$('#ajax-modal').parent().css("top","").css("left","");
+<% if @can_quote %>
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => ''}) %>');
+<% else %>
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => '403'}) %>');
+<% end %>
+
+showModal('ajax-modal', '513px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("");
+$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
\ No newline at end of file
diff --git a/app/views/files/quote_resource_show_project.js.erb b/app/views/files/quote_resource_show_project.js.erb
index 41dc19fc5..22a47fda9 100644
--- a/app/views/files/quote_resource_show_project.js.erb
+++ b/app/views/files/quote_resource_show_project.js.erb
@@ -7,5 +7,5 @@
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("");
-$('#ajax-modal').parent().css("top","30%").css("left","35%");
+$('#ajax-modal').parent().css("top","30%").css("left","35%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
\ No newline at end of file
diff --git a/app/views/files/subfield_upload_file.js.erb b/app/views/files/subfield_upload_file.js.erb
index fc3afc0ff..340a2890f 100644
--- a/app/views/files/subfield_upload_file.js.erb
+++ b/app/views/files/subfield_upload_file.js.erb
@@ -1,6 +1,6 @@
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>');
-showModal('ajax-modal', '513px');
-$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("");
-$('#ajax-modal').parent().css("top","").css("left","");
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>');
+showModal('ajax-modal', '513px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("");
+$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
\ No newline at end of file
diff --git a/app/views/files/upload_files_menu.js.erb b/app/views/files/upload_files_menu.js.erb
index e083fac85..deec53ea3 100644
--- a/app/views/files/upload_files_menu.js.erb
+++ b/app/views/files/upload_files_menu.js.erb
@@ -3,13 +3,13 @@
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("");
- $('#ajax-modal').parent().css("top","40%").css("left","36%");
+ $('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
<% elsif @course %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_course_files',:locals => {:course => @course,:course_attachment_type => 1}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("");
- $('#ajax-modal').parent().css("top","40%").css("left","36%");
+ $('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
<% end %>
\ No newline at end of file
diff --git a/app/views/homework_attach/show.js.erb b/app/views/homework_attach/show.js.erb
index 953d8bab2..98742e03e 100644
--- a/app/views/homework_attach/show.js.erb
+++ b/app/views/homework_attach/show.js.erb
@@ -1,10 +1,10 @@
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show') %>');
-showModal('ajax-modal', '513px');
-$('#ajax-modal').css('height','569px');
-$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("" +
- "");
-$('#ajax-modal').parent().removeClass("alert_praise");
-$('#ajax-modal').parent().css("top","").css("left","");
-$('#ajax-modal').parent().addClass("alert_box");
-
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show') %>');
+showModal('ajax-modal', '513px');
+$('#ajax-modal').css('height','569px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ "");
+$('#ajax-modal').parent().removeClass("alert_praise");
+$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
+$('#ajax-modal').parent().addClass("alert_box");
+
diff --git a/app/views/homework_common/alert_anonymous_comment.js.erb b/app/views/homework_common/alert_anonymous_comment.js.erb
index 1c354aa45..96e958648 100644
--- a/app/views/homework_common/alert_anonymous_comment.js.erb
+++ b/app/views/homework_common/alert_anonymous_comment.js.erb
@@ -1,6 +1,6 @@
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms') %>');
-showModal('ajax-modal', '500px');
-$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("" +
-"");
-$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed");
\ No newline at end of file
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms') %>');
+showModal('ajax-modal', '500px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+"");
+$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
\ No newline at end of file
diff --git a/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb b/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb
index 5177f4d92..1e81df9e7 100644
--- a/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb
+++ b/app/views/homework_common/alert_forbidden_anonymous_comment.js.erb
@@ -1,6 +1,6 @@
-$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity => @course_activity}) %>');
-showModal('ajax-modal', '500px');
-$('#ajax-modal').siblings().remove();
-$('#ajax-modal').before("" +
- "");
-$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed");
\ No newline at end of file
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity => @course_activity}) %>');
+showModal('ajax-modal', '500px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ "");
+$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
\ No newline at end of file
diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb
index da685b758..f83b51b55 100644
--- a/app/views/homework_common/score_rule_set.js.erb
+++ b/app/views/homework_common/score_rule_set.js.erb
@@ -3,4 +3,4 @@ showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
"");
-$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
\ No newline at end of file
+$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
\ No newline at end of file
diff --git a/app/views/homework_common/start_evaluation_set.js.erb b/app/views/homework_common/start_evaluation_set.js.erb
index 659441ce8..6ed74d0f0 100644
--- a/app/views/homework_common/start_evaluation_set.js.erb
+++ b/app/views/homework_common/start_evaluation_set.js.erb
@@ -4,7 +4,7 @@ showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
"");
-$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
+$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
$(function() { $('#evaluation_start_time').datepicker(datepickerOptions);
$('#evaluation_end_time').datepicker(datepickerOptions);
});
\ No newline at end of file
diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb
index af498b83a..4c5c922f0 100644
--- a/app/views/issues/_issue_replies.html.erb
+++ b/app/views/issues/_issue_replies.html.erb
@@ -70,12 +70,11 @@
-
+
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %>
-
-
发送
+
发送
<% end %>
@@ -83,4 +82,5 @@
+
\ No newline at end of file
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 254b24f01..969e2643b 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -126,7 +126,8 @@
<%# 工具栏展开 %>
<% if @course.homework_commons.count == 0 || @course.news.count == 0 || course_file_num == 0 || course_poll_count == 0 || @course.exercises.count == 0 ||
course_feedback_count == 0 || @course.exercises.count == 0 || (@course.boards.first ? @course.boards.first.topics.count : 0) == 0 %>
- <%= l(:label_project_more) %>
+
+ <%= l(:label_project_more) %>
<%= render 'courses/tool_expand', :locals => {:is_teacher => is_teacher, :course_file_num => course_file_num} %>
@@ -278,7 +279,7 @@
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("");
- $('#ajax-modal').parent().css("top","").css("left","");
+ $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");
}
// 鼠标经过的时候显示内容
@@ -292,6 +293,9 @@
obj.parent().parent().next("div").hide();
}
+ $("#expand_tools_expand").click(function(){
+ $("#navContentCourse").toggle();
+ });