diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb
index 9c073afa8..444446ef4 100644
--- a/app/controllers/exercise_controller.rb
+++ b/app/controllers/exercise_controller.rb
@@ -450,7 +450,7 @@ class ExerciseController < ApplicationController
if params[:answer_text].nil? || params[:answer_text].blank?
#用户提交空答案,视作不作答
@percent = get_percent(@exercise,User.current)
- render :json => {:text => ea.answer_text,:percent => format("%.2f", @percent)}
+ render :json => {:text => "",:percent => format("%.2f", @percent)}
else
#添加答案
ea = ExerciseAnswer.new
@@ -476,7 +476,7 @@ class ExerciseController < ApplicationController
# 用户提交空答案,视为删除答案
if ea.delete
@percent = get_percent(@exercise,User.current)
- render :json => {:text => ea.answer_text,:percent => format("%.2f", @percent)}
+ render :json => {:text => "",:percent => format("%.2f", @percent)}
else
render :json => {:text => "failure"}
end
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index 7b70dffe5..ae13b7e78 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -75,7 +75,7 @@ class MessagesController < ApplicationController
@replies = paginateHelper messages_replies,10
@reply = Message.new(:subject => "RE: #{@message.subject}")
render :action => "show", :layout => "base_courses"#by young
- else
+ elsif @project
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
@replies = @topic.children.
includes(:author, :attachments, {:board => :project}).
@@ -86,6 +86,18 @@ class MessagesController < ApplicationController
@reply = Message.new(:subject => "RE: #{@message.subject}")
render :action => "show", :layout => "base_projects"#by young
+ else
+ @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
+ @replies = @topic.children.
+ includes(:author, :attachments, {:board => :project}).
+ reorder("#{Message.table_name}.created_on DESC").
+ limit(@reply_pages.per_page).
+ offset(@reply_pages.offset).
+ all
+
+ @reply = Message.new(:subject => "RE: #{@message.subject}")
+ @organization = @org_subfield.organization
+ render :action => "show", :layout => "base_org"#by young
end
end
@@ -248,7 +260,14 @@ class MessagesController < ApplicationController
else
respond_to do |format|
format.html {
- layout_file = @project ? 'base_projects' : 'base_courses'
+ if @project
+ layout_file = 'base_projects'
+ elsif @course
+ layout_file = 'base_courses'
+ elsif @org_subfield
+ @organization = @org_subfield.organization
+ layout_file = 'base_org'
+ end
render :layout => layout_file
}
end
@@ -287,6 +306,16 @@ class MessagesController < ApplicationController
redirect_to course_board_url(@course, @board)
end
end
+ elsif @org_subfield
+ if params[:is_board]
+ redirect_to organization_path(:id => @org_subfield.organization_id, :org_subfield_id => @org_subfield.id)
+ else
+ if @message.parent
+ redirect_to board_message_url(@board, @message.parent, :r => r)
+ else
+ redirect_to organization_path(:id => @org_subfield.organization_id, :org_subfield_id => @org_subfield.id)
+ end
+ end
end
end
@@ -319,15 +348,25 @@ class MessagesController < ApplicationController
org_subfield_ids = params[:org_subfields]
@message = Message.find(params[:id])
# @message.update_attribute(:updated_on, Time.now)
- type = @message.board.course_id.nil? ? "Project":"Course"
+ # type = @message.board.course_id.nil? ? "Project":"Course"
org_subfield_ids.each do |field_id|
- OrgSubfieldMessage.create(:org_subfield_id => field_id.to_i, :message_id => @message.id, :message_type => type)
- org_acts = OrgActivity.where("container_type='OrgSubfield' and container_id=? and org_act_type='Message' and org_act_id=?", field_id.to_i, @message.id)
- if org_acts.all.size() > 0
- org_acts.first.update_attribute(:updated_at, Time.now)
- else
- OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'Message', :org_act_id => @message.id, :user_id => User.current.id)
+ @message.quotes = @message.quotes.nil? ? 1 : (@message.quotes + 1)
+ @message.save
+ board = OrgSubfield.find(field_id).boards.first
+ mes = Message.create(:board_id => board.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id,
+ :created_on => Time.now, :updated_on => Time.now, :locked => @message.locked, :sticky => @message.sticky)
+ @message.attachments.each do |attach|
+ mes.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
+ # OrgSubfieldMessage.create(:org_subfield_id => field_id.to_i, :message_id => mes.id, :message_type => type)
+ # org_acts = OrgActivity.where("container_type='OrgSubfield' and container_id=? and org_act_type='Message' and org_act_id=?", field_id.to_i, @message.id)
+ # if org_acts.all.size() > 0
+ # org_acts.first.update_attribute(:updated_at, Time.now)
+ # else
+ OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'Message', :org_act_id => mes.id, :user_id => User.current.id)
+ # end
end
end
@@ -347,6 +386,9 @@ class MessagesController < ApplicationController
@project = @board.project
elsif @board.course_id
@course = @board.course
+ else
+ @org_subfield = @board.org_subfield
+ @organization = @org_subfield
end
rescue ActiveRecord::RecordNotFound
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index aba656750..466fbd8e3 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -14,7 +14,7 @@ class OrganizationsController < ApplicationController
include PollHelper
helper :user_score
helper :journals
-
+ helper :attachments
# added by liuping 关注
helper :watchers
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index f26f6c118..78d8e2b46 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -497,7 +497,7 @@ class UsersController < ApplicationController
#提交作品时,计算是否迟交
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
- student_work.late_penalty = 1
+ student_work.late_penalty = homework.late_penalty
else
student_work.late_penalty = 0
end
diff --git a/app/models/message.rb b/app/models/message.rb
index 19531e270..f59f778a8 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -23,8 +23,8 @@ class Message < ActiveRecord::Base
belongs_to :board,:touch => true
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
- has_many :org_subfield_messages, :dependent => :destroy
- has_many :org_subfields, :through => :org_subfield_messages
+ # has_many :org_subfield_messages, :dependent => :destroy
+ # has_many :org_subfields, :through => :org_subfield_messages
acts_as_tree :counter_cache => :replies_count, :order => "#{Message.table_name}.created_on ASC"
acts_as_attachable
@@ -150,6 +150,10 @@ class Message < ActiveRecord::Base
usr && usr.logged? && (usr.allowed_to?(:edit_messages, course) || (self.author == usr && usr.allowed_to?(:edit_own_messages, course)))
end
+ def org_subfield_editable_by?(usr)
+ usr && usr.logged? && (usr.admin? || self.author == usr ||usr.admin_of_org?(self.board.org_subfield.organization))
+ end
+
def course_destroyable_by?(usr)
usr && usr.logged? && (usr.allowed_to?(:delete_messages, course) || (self.author == usr && usr.allowed_to?(:delete_own_messages, course)))
end
@@ -192,7 +196,7 @@ class Message < ActiveRecord::Base
# Description
def act_as_forge_activity
# 如果project为空,那么就是课程相关的消息
- if !self.board.project.nil? && self.parent_id.nil?
+ if self.board.project_id != -1 && self.parent_id.nil?
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
:project_id => self.board.project.id)
end
@@ -227,7 +231,7 @@ class Message < ActiveRecord::Base
end
end
end
- else # 项目相关
+ elsif self.project # 项目相关
if self.parent_id.nil? # 主贴
self.project.members.each do |m|
if m.user_id != self.author_id
diff --git a/app/views/boards/_org_subfield_message_edit.html.erb b/app/views/boards/_org_subfield_message_edit.html.erb
new file mode 100644
index 000000000..ae22b225b
--- /dev/null
+++ b/app/views/boards/_org_subfield_message_edit.html.erb
@@ -0,0 +1,16 @@
+
+
\ No newline at end of file
diff --git a/app/views/boards/_org_subfield_new.html.erb b/app/views/boards/_org_subfield_new.html.erb
new file mode 100644
index 000000000..7664c5c32
--- /dev/null
+++ b/app/views/boards/_org_subfield_new.html.erb
@@ -0,0 +1,74 @@
+<%= content_for(:header_tags) do %>
+ <%= import_ke(enable_at: true, prettify: false) %>
+<% end %>
+
+<%= error_messages_for 'message' %>
+
+
+
+
+
+ <%if User.current.member_of_org?(org_subfield.organization)%>
+
+ <%= f.check_box :sticky, :value => topic.sticky%>
+ <%= label_tag 'message_sticky', l(:label_board_sticky) %>
+ <%= f.check_box :locked, :value => topic.locked%>
+ <%= label_tag 'message_locked', l(:label_board_locked) %>
+
+
+ <% end %>
+
+
+ <%= text_area :quote,:quote,:style => 'display:none' %>
+ <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
+
+ <%= f.kindeditor :content, :editor_id => 'message_content_editor',
+ :owner_id => topic.nil? ? 0: topic.id,
+ :owner_type => OwnerTypeHelper::MESSAGE,
+ :width => '100%',
+ :height => 300,
+ :minHeight=>300,
+ :class => 'talk_text fl',
+ :input_html => { :id => 'message_content',
+ :class => 'talk_text fl',
+ :maxlength => 5000 },
+ at_id: topic.id, at_type: topic.class.to_s
+ %>
+
+
+
+
+
+
+ <%= render :partial => 'attachments/form_course', :locals => {:container => topic, :isReply => @isReply} %>
+
+
+
+
+ <%if !edit_mode %>
+
确定
+
或
+
取消
+ <% else %>
+
确定
+
或
+ <%= link_to "取消",board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "fr mr10 mt3"%>
+ <% end %>
+
+
+
+
+ <%#= render :partial => 'course_new_topic', :locals => {:f => f, :topic => @message} %>
+
+
+
\ No newline at end of file
diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb
index 808e80239..83bcb4dc9 100644
--- a/app/views/layouts/base_org.html.erb
+++ b/app/views/layouts/base_org.html.erb
@@ -13,7 +13,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','courses','org' %>
- <%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','org'%>
+ <%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
<%= javascript_include_tag 'attachments' %>
<%= call_hook :view_layouts_base_html_head %>
diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb
index cc93d99b9..294f9b7d4 100644
--- a/app/views/messages/_course_show.html.erb
+++ b/app/views/messages/_course_show.html.erb
@@ -57,7 +57,7 @@
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if @message.course_destroyable_by?(User.current) %>
- <%#= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
+ <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb
new file mode 100644
index 000000000..9eb082d33
--- /dev/null
+++ b/app/views/messages/_org_subfield_show.html.erb
@@ -0,0 +1,199 @@
+<%= content_for(:header_tags) do %>
+ <%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
+<% end %>
+
+
+
+
+
+
+
+ <%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
+
+
+ <% if @topic.author.id == User.current.id%>
+
+
+
+
+
+ <%= link_to(
+ l(:button_edit),
+ {:action => 'edit', :id => @topic},
+ :class => 'postOptionLink'
+ ) if @message.org_subfield_editable_by?(User.current) %>
+
+
+ <%= link_to(
+ l(:button_delete),
+ {:action => 'destroy', :id => @topic},
+ :method => :post,
+ :data => {:confirm => l(:text_are_you_sure)},
+ :class => 'postOptionLink'
+ ) if @message.org_subfield_editable_by?(User.current) %>
+
+
+
+
+
+
+ <%end%>
+
+
+
+
+ <% if @topic.try(:author).try(:realname) == ' ' %>
+ <%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
+ <% else %>
+ <%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
+ <% end %>
+
+
<%= format_time( @topic.created_on)%>
+
+
+ <%= @topic.content.html_safe%>
+
+
+
+ <%= link_to_attachments_course @topic, :author => false %>
+
+
+
+
+
+
+ <% unless @replies.empty? %>
+
+
回复(<%=@reply_count %>)
+
+
+
+
+ <% @replies.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.content.html_safe%>
+
+
+ <%= format_time(reply.created_on) %>
+
+
+
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+ <% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
+
+
+
+
+ <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
+ <%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
+ <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %>
+ <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
+ <% end %>
+
+
+
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb
index a0a340a2a..1cbd606ab 100644
--- a/app/views/messages/_project_show.html.erb
+++ b/app/views/messages/_project_show.html.erb
@@ -112,8 +112,8 @@
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if @message.destroyable_by?(User.current) %>
- <%#= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
+ <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
diff --git a/app/views/messages/_show_org_subfields.html.erb b/app/views/messages/_show_org_subfields.html.erb
index 659e1230e..cbd316ea4 100644
--- a/app/views/messages/_show_org_subfields.html.erb
+++ b/app/views/messages/_show_org_subfields.html.erb
@@ -2,10 +2,14 @@
<% if !org.nil? %>
组织:<%= org.name %>
- <% org.org_subfields.where("field_type='Post'").each do |subfield| %>
-
- <%= subfield.name %>
-
+ <% if org.org_subfields.where("field_type='Post'").count > 0 %>
+ <% org.org_subfields.where("field_type='Post'").each do |subfield| %>
+
+ <%= subfield.name %>
+
+ <% end %>
+ <% else %>
+ 暂无资源栏目
<% end %>
<% else %>
请在左侧选择组织
diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb
index 7543e16e2..6e54a88e1 100644
--- a/app/views/messages/edit.html.erb
+++ b/app/views/messages/edit.html.erb
@@ -22,6 +22,18 @@
<%= render :partial => 'boards/course_message_edit',
:locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %>
<% end %>
+
+<% elsif @message.board.org_subfield %>
+ <%= form_for @message, {
+ :as => :message,
+ :url => {:action => 'edit'},
+ :html => {:multipart => true,
+ :id => 'message-form',
+ :method => :post}
+ } do |f| %>
+ <%= render :partial => 'boards/org_subfield_message_edit',
+ :locals => {:f => f, :edit_mode => true, :topic => @message, :org_subfield => @message.board.org_subfield} %>
+ <% end %>
<% end %>
diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb
index 518479344..c0da5ab9b 100644
--- a/app/views/messages/reply.js.erb
+++ b/app/views/messages/reply.js.erb
@@ -2,5 +2,7 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<%elsif @course%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
+<% elsif @org_subfield %>
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<%end%>
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
\ No newline at end of file
diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb
index 5996852ef..428c51f22 100644
--- a/app/views/messages/show.html.erb
+++ b/app/views/messages/show.html.erb
@@ -2,4 +2,6 @@
<%= render :partial => 'project_show', locals: {project: @project} %>
<% elsif @course %>
<%= render :partial => 'course_show', locals: {course: @course} %>
+<% else %>
+ <%= render :partial => 'org_subfield_show', :locals => {:org_subfield => @org_subfield} %>
<% end %>
diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb
index 4e4ee3d4c..2a5543a66 100644
--- a/app/views/organizations/_org_activities.html.erb
+++ b/app/views/organizations/_org_activities.html.erb
@@ -50,31 +50,22 @@
<% end %>
<% end %>
<% if act.container_type == 'OrgSubfield' %>
- <% if act.org_act_type == 'Message' %>
+ <% if act.org_act_type == 'Message' and act.org_act_id and Message.where("id=#{act.org_act_id}").count > 0 %>
<% message = Message.find(act.org_act_id) %>
<% if !message.board.course_id.nil? %>
<%= render :partial => 'org_course_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
- <% else %>
+ <% elsif message.board.project_id != -1 %>
<%= render :partial => 'organizations/project_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
+ <% elsif message.board.org_subfield_id %>
+ <%= render :partial => 'organizations/org_subfield_message', :locals => {:activity => message, :user_activity_id => act.id} %>
<% end %>
<% end %>
<% end %>
<% end %>
-
- <%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
+
<% 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 => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end%>
-
+
+
+ <% if activity.parent_id.nil? %>
+ <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey"
+ %>
+ <% else %>
+ <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey"
+ %>
+ <% end %>
+
+
+ 时间:<%= format_time(activity.created_on) %>
+
+
+
+ <% if activity.parent_id.nil? %>
+ <%= activity.content.to_s.html_safe%>
+ <% else %>
+ <%= activity.parent.content.to_s.html_safe%>
+ <% end %>
+
+
+
+
+
+
+
+
+
+ <% count = 0 %>
+ <% if activity.parent %>
+ <% count=activity.parent.children.count%>
+ <% else %>
+ <% count=activity.children.count%>
+ <% end %>
+
+
+
+
回复(
+ <%=count %>
+ )
+
<%#=format_date(activity.updated_on)%>
+ <%if count>3 %>
+
+ <% end %>
+
+
+ <% activity= activity.parent_id.nil? ? activity : activity.parent %>
+ <% replies_all_i = 0 %>
+ <% if count > 0 %>
+
+
+ <% activity.children.reorder("created_on desc").each do |reply| %>
+
+ <% replies_all_i=replies_all_i+1 %>
+
+
+ <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id), :alt => "用户头像" %>
+
+
+
+ <% if reply.try(:author).try(:realname) == ' ' %>
+ <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= format_time(reply.created_on) %>
+
+
+ <%= reply.content.html_safe %>
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
+
+
+ <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
+
+
+
+
+
发送
+
+
+ <% end%>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb
index 2b0f11cdd..25f6d5044 100644
--- a/app/views/organizations/_show_org_document.html.erb
+++ b/app/views/organizations/_show_org_document.html.erb
@@ -18,6 +18,9 @@
<%= document.content.html_safe %>
<% end %>
+
+ <%= link_to_attachments_course document, :author => false %>
+
diff --git a/app/views/organizations/org_subfield_message_edit.html.erb b/app/views/organizations/org_subfield_message_edit.html.erb
new file mode 100644
index 000000000..caa389945
--- /dev/null
+++ b/app/views/organizations/org_subfield_message_edit.html.erb
@@ -0,0 +1,16 @@
+
+
\ No newline at end of file
diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb
index 37f4d00ed..a79271add 100644
--- a/app/views/organizations/show.html.erb
+++ b/app/views/organizations/show.html.erb
@@ -69,10 +69,10 @@
<% end %>
<% if @org_activities %>
<%= render :partial => 'organizations/org_activities',
- :locals => {:org_activities =>@org_activities,
- :page=>@page,
- :org => @organization,
- :org_act_count=>@org_activities.count}%>
+ :locals => {:org_activities => @org_activities,
+ :page=> @page,
+ :org => @organization,
+ :org_act_count=> @org_activities.count} %>
<% end %>
diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb
index 7398dbee1..2ef5ee9af 100644
--- a/app/views/student_work/_evaluation_title.html.erb
+++ b/app/views/student_work/_evaluation_title.html.erb
@@ -1,19 +1,25 @@
-
-
- 作品名称
- <% if @homework.homework_type != 3 %>
- 姓名
- 学号
- <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
- 关联项目
- <% end %>
-
-
-
- 时间
-
-
-
- 我的评分
-
+
+
+ 作品名称
+ <% if @homework.homework_type != 3 %>
+ 姓名
+ 学号
+ <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
+ 关联项目
+ <% end %>
+
+
+
+ 时间
+
+
+ <% if @homework.homework_type == 2%>
+
+ 系统
+
+ <% end%>
+
+
+ 我的评分
+
\ No newline at end of file
diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb
index db680cbec..cc346361e 100644
--- a/app/views/student_work/_evaluation_work.html.erb
+++ b/app/views/student_work/_evaluation_work.html.erb
@@ -6,16 +6,16 @@
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
<% is_my_work = pro && pro.student_work_id == student_work.id%>
<% end %>
-
+
<% if is_my_work%>
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
-
+
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
- <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
+ <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w230"%>
@@ -40,9 +40,9 @@
<%= image_tag(url_to_avatar(""),width:"40", height: "40") %>
-
+
- <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
+ <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w230"%>
@@ -75,8 +75,15 @@
+ <% if @homework.homework_type == 2%>
+
+
+ <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
+
+ <% end%>
+
<% my_score = student_work_score(student_work,User.current) %>
-
+
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
点击查看详情
diff --git a/app/views/student_work/show.js.erb b/app/views/student_work/show.js.erb
index 1a133a5d3..477f06e0f 100644
--- a/app/views/student_work/show.js.erb
+++ b/app/views/student_work/show.js.erb
@@ -25,7 +25,7 @@ else{
indentUnit: 2,
matchBrackets: true,
readOnly: true,
- value: document.getElementById("work-src").innerText
+ value: $("#work-src").text()
}
);
diff --git a/config/routes.rb b/config/routes.rb
index be9843a80..9326ac61e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -62,6 +62,9 @@ RedmineApp::Application.routes.draw do
end
end
+ get '/', to: 'organizations#show', defaults: { id: 5 }, constraints: {subdomain: 'micros'}
+ get '/', to: 'organizations#show', defaults: { id: 23 }, constraints: {subdomain: 'nubot'}
+
resources :org_member do
member do
@@ -84,6 +87,7 @@ RedmineApp::Application.routes.draw do
match "quote_resource_show_org_subfield", :via => [:get]
end
end
+ resource :boards
end
resources :org_document_comments do
diff --git a/db/migrate/20151230015225_add_quotes_to_messages.rb b/db/migrate/20151229022049_add_quotes_to_messages.rb
similarity index 63%
rename from db/migrate/20151230015225_add_quotes_to_messages.rb
rename to db/migrate/20151229022049_add_quotes_to_messages.rb
index 4e19725d5..6311f0231 100644
--- a/db/migrate/20151230015225_add_quotes_to_messages.rb
+++ b/db/migrate/20151229022049_add_quotes_to_messages.rb
@@ -1,4 +1,5 @@
class AddQuotesToMessages < ActiveRecord::Migration
def change
+ add_column :messages, :quotes, :integer
end
end
diff --git a/db/schema.rb b/db/schema.rb
index 401a5980d..72ca3c649 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20151230015904) do
+ActiveRecord::Schema.define(:version => 20151229022049) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -198,7 +198,6 @@ ActiveRecord::Schema.define(:version => 20151230015904) do
t.integer "last_message_id"
t.integer "parent_id"
t.integer "course_id"
- t.integer "org_subfield_id"
end
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
@@ -1644,6 +1643,10 @@ ActiveRecord::Schema.define(:version => 20151230015904) do
t.string "extra"
end
+ create_table "temp", :id => false, :force => true do |t|
+ t.integer "id", :default => 0, :null => false
+ end
+
create_table "time_entries", :force => true do |t|
t.integer "project_id", :null => false
t.integer "user_id", :null => false
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 5bfaccf30..a0bce3099 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -813,7 +813,7 @@ function hidden_atert_form(cur_page,cur_type)
//当课程描述长度小于112px时,不显示更多按钮
$(function(){
- if($("#course_description_content").height()>112)
+ if($("#course_description_content").height()>400)
{
$("#lg-foot").show();
}
diff --git a/public/javascripts/organization.js b/public/javascripts/organization.js
new file mode 100644
index 000000000..e04a8b282
--- /dev/null
+++ b/public/javascripts/organization.js
@@ -0,0 +1,39 @@
+/**
+ * Created by ouyangxuhua on 2015/12/30.
+ */
+function submit_topic()
+{
+ if(regexTopicSubject() && regexTopicDescription())
+ {
+ message_content_editor.sync();
+ $("#message-form").submit();
+ }
+}
+
+function regexTopicSubject() {
+ var name = $("#message_subject").val();
+ if(name.length ==0)
+ {
+ $("#subjectmsg").text("标题不能为空");
+ $("#subjectmsg").css('color','#ff0000');
+ $("#message_subject").focus();
+ return false;
+ }
+ else if(name.length <= 255)
+ {
+ $("#subjectmsg").text("填写正确");
+ $("#subjectmsg").css('color','#008000');
+ return true;
+ }
+ else
+ {
+ $("#subjectmsg").text("标题超过255个字符");
+ $("#subjectmsg").css('color','#ff0000');
+ $("#message_subject").focus();
+ return false;
+ }
+}
+
+function reset_topic(){
+
+}
diff --git a/public/javascripts/project.js b/public/javascripts/project.js
index 24e864780..67fecaa3f 100644
--- a/public/javascripts/project.js
+++ b/public/javascripts/project.js
@@ -280,7 +280,7 @@ function submitComment()
//当项目描述长度小于112px时,不显示更多按钮
$(function () {
// alert($("#course_description_content").height());
- if ($("#course_description_content").height() > 112) {
+ if ($("#course_description_content").height() > 400) {
$("#lg-foot").show();
}
});
diff --git a/public/stylesheets/leftside.css b/public/stylesheets/leftside.css
index 26976343e..aded204d2 100644
--- a/public/stylesheets/leftside.css
+++ b/public/stylesheets/leftside.css
@@ -45,7 +45,7 @@ a:hover.subnav_green{ background:#14ad5a;}
/*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
-.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
+.course_description{max-height: 420px;overflow:hidden; word-break: break-all;word-wrap: break-word;line-height: 20px;}
.project_board_content{overflow: hidden;max-height: 212px;word-break: break-all;word-wrap: break-word;}
.project_board_content1{overflow: hidden;max-height: 72px;word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;}
diff --git a/public/stylesheets/leftside_new.css b/public/stylesheets/leftside_new.css
index 2f31a1f65..f7f0c139d 100644
--- a/public/stylesheets/leftside_new.css
+++ b/public/stylesheets/leftside_new.css
@@ -46,7 +46,7 @@ a:hover.subnav_green{ background:#14ad5a;}
/*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
-.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
+.course_description{max-height: 420px;overflow:hidden; word-break: break-all;word-wrap: break-word;line-height: 20px;}
.course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}
diff --git a/public/stylesheets/pleft.css b/public/stylesheets/pleft.css
index 1ce12bdda..2cd51d5ec 100644
--- a/public/stylesheets/pleft.css
+++ b/public/stylesheets/pleft.css
@@ -48,7 +48,7 @@ a:hover.subnav_green{ background:#14ad5a;}
/*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
-.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
+.course_description{max-height: 420px;overflow:hidden; word-break: break-all;word-wrap: break-word;line-height: 20px;}
.project_board_content{overflow: hidden;max-height: 212px;word-break: break-all;word-wrap: break-word;}
.project_board_content1{overflow: hidden;max-height: 72px;word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;}
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 51f0be25d..cf741476e 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -135,12 +135,16 @@ h4{ font-size:14px; color:#3b3b3b;}
.w100{width: 100px;}
.w210{ width:210px;}
.w150{ width:150px;}
+.w230{width:230px !important;}
+.w235{ width:235px !important;}
.w280{ width:280px;}
.w265{ width: 265px;}
.w270{ width: 270px;}
.w350 {width:350px;}
.w362 {width:362px;}
.w430{ width:470px;}
+.w455{width:455px !important;}
+.w465{width:465px !important;}
.w520{ width:520px;}
.w543{ width:543px;}
.w557{ width:557px;}
diff --git a/public/stylesheets/user_leftside.css b/public/stylesheets/user_leftside.css
index c8dfbe316..c0ff7c8a2 100644
--- a/public/stylesheets/user_leftside.css
+++ b/public/stylesheets/user_leftside.css
@@ -46,7 +46,7 @@ a:hover.subnav_green{ background:#14ad5a;}
/*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
-.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
+.course_description{max-height: 420px;overflow:hidden; word-break: break-all;word-wrap: break-word;line-height: 20px;}
.course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}