Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
This commit is contained in:
commit
1b0bcd0c05
|
@ -1,6 +1,6 @@
|
|||
class OrgDocumentCommentsController < ApplicationController
|
||||
before_filter :find_organization, :only => [:new, :create, :show, :index]
|
||||
helper :attachments
|
||||
helper :attachments,:organizations
|
||||
layout 'base_org'
|
||||
|
||||
def new
|
||||
|
|
|
@ -5,9 +5,8 @@ class OrgSubfieldsController < ApplicationController
|
|||
def create
|
||||
if OrgSubfield.where("organization_id=#{params[:organization_id]} and name=?",params[:name]).count == 0
|
||||
@res = true
|
||||
@subfield = OrgSubfield.create(:name => params[:name])
|
||||
@organization = Organization.find(params[:organization_id])
|
||||
@organization.org_subfields << @subfield
|
||||
@subfield = OrgSubfield.create(:name => params[:name], :organization_id => params[:organization_id],:priority => @organization.org_subfields.order("priority").last.priority + 1)
|
||||
if !params[:sub_dir].blank?
|
||||
sql = "select subfield_subdomain_dirs.* from subfield_subdomain_dirs, org_subfields where subfield_subdomain_dirs.org_subfield_id = org_subfields.id "+
|
||||
"and org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir]}'"
|
||||
|
@ -15,7 +14,7 @@ class OrgSubfieldsController < ApplicationController
|
|||
SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir])
|
||||
end
|
||||
end
|
||||
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type])
|
||||
@subfield.update_attributes(:field_type => params[:field_type])
|
||||
else
|
||||
@res = false
|
||||
end
|
||||
|
@ -125,6 +124,12 @@ class OrgSubfieldsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def update_priority
|
||||
@org_subfield = OrgSubfield.find(params[:id])
|
||||
@org_subfield.update_attribute(:priority, params[:priority].to_i)
|
||||
@organization = @org_subfield.organization
|
||||
end
|
||||
|
||||
def show_attachments obj
|
||||
@attachments = []
|
||||
obj.each do |container|
|
||||
|
|
|
@ -317,7 +317,7 @@ class OrganizationsController < ApplicationController
|
|||
@organization = Organization.find(params[:id])
|
||||
admins = User.where("admin=1")
|
||||
admins.each do |admin|
|
||||
OrgMessage.create(:user_id => admin.id, :organization_id => @organization.id, :message_type => 'ApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:domain])
|
||||
OrgMessage.create(:user_id => admin.id, :organization_id => @organization.id, :message_type => 'ApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:domain].downcase)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2069,7 +2069,7 @@ module ApplicationHelper
|
|||
candown = User.current.member_of?(project) || (project.is_public && attachment_history.is_public == 1)
|
||||
elsif attachment_history.container_type == "OrgSubfield"
|
||||
org = OrgSubfield.find(attachment_history.container_id)
|
||||
candown = User.current.member_of_org?(org) || (org.organization.is_public && attachment_history.is_public == 1)
|
||||
candown = User.current.member_of_org?(org) || (org.organization.is_public && attachment_history.is_public == 1 && (User.current.logged? || org.organization.allow_guest_download?))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -2943,37 +2943,86 @@ int main(int argc, char** argv){
|
|||
end
|
||||
|
||||
def user_url_in_org(user_id)
|
||||
if Rails.env.development?
|
||||
return "http://localhost:3000/users/" + user_id.to_s
|
||||
else
|
||||
return "https://" + Setting.host_name + "/users/" + user_id.to_s
|
||||
end
|
||||
Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s
|
||||
end
|
||||
|
||||
def project_issues_url_in_org(project_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/projects/" + project_id.to_s + "/issues"
|
||||
end
|
||||
|
||||
def issue_url_in_org(id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/issues/" + id.to_s
|
||||
end
|
||||
|
||||
def project_boards_url_in_org(id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/projects/" + id.to_s + "/boards"
|
||||
end
|
||||
|
||||
def board_message_url_in_org(board_id, message_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/boards/" + board_id.to_s + "/topics/" + message_id.to_s
|
||||
end
|
||||
|
||||
def project_url_in_org(id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/projects/" + id.to_s
|
||||
end
|
||||
|
||||
def homework_common_index_url_in_org(course_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/homework_common?course=" + course_id.to_s
|
||||
end
|
||||
|
||||
def student_work_index_url_in_org(homework_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s
|
||||
end
|
||||
|
||||
def course_url_in_org(course_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/courses/" + course_id.to_s
|
||||
end
|
||||
|
||||
def user_watchlist_url_in_org(id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/users/" + id.to_s + "/user_watchlist"
|
||||
end
|
||||
|
||||
def user_fanslist_url_in_org(id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/users/" + id.to_s + "/user_fanslist"
|
||||
end
|
||||
|
||||
def user_blogs_url_in_org(user_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s + "/blogs"
|
||||
end
|
||||
|
||||
def feedback_url_in_org(user_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s + "/user_newfeedback"
|
||||
end
|
||||
|
||||
def user_activities_url_in_org(user_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/users/" + user_id.to_s + "/user_activities"
|
||||
end
|
||||
|
||||
def course_news_index_url_in_org(course_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/courses/" + course_id.to_s + "/news"
|
||||
end
|
||||
|
||||
def news_url_in_org(news_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/news/" + news_id.to_s
|
||||
end
|
||||
|
||||
def course_boards_url_in_org(course_id)
|
||||
Setting.protocol + "://" + Setting.host_name + "/courses/" + course_id.to_s + "/boards"
|
||||
end
|
||||
|
||||
def logout_url_without_domain
|
||||
if Rails.env.development?
|
||||
return "http://localhost:3000/logout"
|
||||
else
|
||||
return "https://" + Setting.host_name + "/logout"
|
||||
end
|
||||
Setting.protocol + "://" + Setting.host_name + "/logout"
|
||||
end
|
||||
|
||||
def signin_url_without_domain
|
||||
if Rails.env.development?
|
||||
return "http://localhost:3000/login?login=true"
|
||||
elsif Rails.env.test?
|
||||
return "https://test.forge.trustie.net/login?login=true"
|
||||
else
|
||||
return "https://www.trustie.net/login?login=true"
|
||||
end
|
||||
Setting.protocol + "://" + Setting.host_name + "/login?login=true"
|
||||
end
|
||||
|
||||
def register_url_without_domain
|
||||
if Rails.env.development?
|
||||
return "http://localhost:3000/login?login=false"
|
||||
elsif Rails.env.test?
|
||||
return "https://test.forge.trustie.net/login?login=false"
|
||||
else
|
||||
return "https://www.trustie.net/login?login=false"
|
||||
end
|
||||
Setting.protocol + "://" + Setting.host_name + "/login?login=false"
|
||||
end
|
||||
#判断是否为默认的组织栏目
|
||||
def is_default_field? field
|
||||
(field.name == 'activity' || field.name == 'course' || field.name == 'project') && field.field_type == 'default'
|
||||
end
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ class CourseActivity < ActiveRecord::Base
|
|||
belongs_to :course
|
||||
belongs_to :user
|
||||
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
|
||||
after_save :add_user_activity, :add_course_activity
|
||||
after_save :add_user_activity, :add_org_activity
|
||||
after_create :add_course_lead
|
||||
before_destroy :destroy_user_activity, :destroy_org_activity
|
||||
|
||||
|
@ -31,14 +31,16 @@ class CourseActivity < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def add_course_activity
|
||||
def add_org_activity
|
||||
org_activity = OrgActivity.where("org_act_type = '#{self.course_act_type.to_s}' and org_act_id = '#{self.course_act_id}'").first
|
||||
if org_activity
|
||||
org_activity.updated_at = self.updated_at
|
||||
org_activity.save
|
||||
else
|
||||
if self.course_act_type == 'Message' && !self.course_act.parent_id.nil?
|
||||
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.course_act.parent.id}").first
|
||||
org_activity.created_at = self.created_at
|
||||
org_activity.updated_at = self.updated_at
|
||||
org_activity.save
|
||||
else
|
||||
OrgActivity.create(:user_id => self.user_id,
|
||||
|
@ -66,7 +68,7 @@ class CourseActivity < ActiveRecord::Base
|
|||
# 导语要放置在课程创建信息之后
|
||||
# 导语
|
||||
def add_course_lead
|
||||
if self.course_act_type == "Course"
|
||||
if self.course_act_type == "Course" and Message.where("id=12440").any?
|
||||
lead_message = Message.find(12440)
|
||||
name = lead_message.subject
|
||||
content = lead_message.content
|
||||
|
|
|
@ -48,7 +48,7 @@ class ForgeActivity < ActiveRecord::Base
|
|||
def add_org_activity
|
||||
org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
|
||||
if org_activity
|
||||
org_activity.created_at = self.created_at
|
||||
org_activity.updated_at = self.updated_at
|
||||
org_activity.save
|
||||
else
|
||||
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
|
||||
|
|
|
@ -9,6 +9,7 @@ class OrgSubfield < ActiveRecord::Base
|
|||
has_many :news, :dependent => :destroy
|
||||
acts_as_attachable
|
||||
after_create :create_board_sync
|
||||
after_destroy :update_priority
|
||||
# 创建资源栏目讨论区
|
||||
def create_board_sync
|
||||
@board = self.boards.build
|
||||
|
@ -25,4 +26,11 @@ class OrgSubfield < ActiveRecord::Base
|
|||
|
||||
def project
|
||||
end
|
||||
|
||||
def update_priority
|
||||
OrgSubfield.where("organization_id=? and priority>?", self.organization_id, self.priority).each do |field|
|
||||
field.decrement(:priority)
|
||||
field.save
|
||||
end
|
||||
end
|
||||
end
|
|
@ -16,8 +16,8 @@ class Organization < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def add_default_subfields
|
||||
OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default')
|
||||
OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default')
|
||||
OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default')
|
||||
OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default', :priority => 1)
|
||||
OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default', :priority => 2)
|
||||
OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default', :priority => 3)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -822,6 +822,9 @@ class User < Principal
|
|||
end
|
||||
|
||||
def member_of_org?(org)
|
||||
if !self.logged?
|
||||
return false
|
||||
end
|
||||
OrgMember.where("user_id =? and organization_id =?", self.id, org.id).count > 0
|
||||
end
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
}
|
||||
<% else %>
|
||||
<% if @course.is_public? %>
|
||||
$("#set_course_public_<%= @course.id %>").text("设为私有");
|
||||
$("#show_course_<%= @course.id %>").attr("title","公开课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||
<% else %>
|
||||
$("#set_course_public_<%= @course.id %>").text("设为公开");
|
||||
$("#show_course_<%= @course.id %>").attr("title","私有课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||
<% end %>
|
||||
$("#set_course_public_<%= @course.id %>").replaceWith('<%= escape_javascript(link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => "courses", :action => "private_or_public", :id => @course,:user_page => true},
|
||||
:id => "set_course_public_#{@course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗") %>');
|
||||
<% end %>
|
|
@ -41,9 +41,10 @@
|
|||
<%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%>
|
||||
<%= submit_tag "栏目内搜索", :class => "blueBtn mr5 fl",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
|
||||
<%#= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||
<input class="blueBtn fr mr5" value="上传资源" onclick="org_upload_files(<%= org_subfield.id %>);">
|
||||
<%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :subfield_file_id => @org_subfield.id), :class => "blue-btn fr mr5", :remote => true) %>
|
||||
<%#= link_to "上传资源",subfield_upload_file_org_subfield_files_path(@org_subfield.id, :in_org => 1),:method => "post",:class=>"blueBtn fr mr5",:remote => true %>
|
||||
<% if User.current.member_of_org?(org_subfield.organization) %>
|
||||
<input class="blueBtn fr mr5" value="上传资源" onclick="org_upload_files(<%= org_subfield.id %>);">
|
||||
<%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :subfield_file_id => @org_subfield.id), :class => "blue-btn fr mr5", :remote => true) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div><!---re_top end-->
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% courses.each do |course|%>
|
||||
<%# pro = Project.find course.course_id %>
|
||||
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
|
||||
<%= link_to course.name, course_path(course.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => course.name%>
|
||||
<%= link_to course.name, course_url_in_org(course.id), :class => "coursesLineGrey hidden", :title => course.name%>
|
||||
<!--<div class="homepagePostSetting mt5 mr10">-->
|
||||
<!--<ul>-->
|
||||
<!--<li class="menuSetting">-->
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% projects.each do |project|%>
|
||||
<%# pro = Project.find project.project_id %>
|
||||
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
|
||||
<%= link_to project.name, project_url_in_org(project.id), :class => "coursesLineGrey hidden", :title => project.name%>
|
||||
<!--<div class="homepagePostSetting mt5 mr10">-->
|
||||
<!--<ul>-->
|
||||
<!--<li class="menuSetting">-->
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% courses.each do |course|%>
|
||||
<li class="homepageLeftMenuCoursesLine pr">
|
||||
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
|
||||
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
|
||||
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
||||
|
|
|
@ -227,6 +227,7 @@
|
|||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% if @course.description && !@course.description.blank? %>
|
||||
<div class="project_intro">
|
||||
<div id="course_description" class="course_description">
|
||||
<h4 ><%= l(:label_course_brief_introduction)%>:</h4>
|
||||
|
@ -241,6 +242,7 @@
|
|||
</span>
|
||||
</div>
|
||||
</div><!--项目简介 end-->
|
||||
<% end %>
|
||||
<div class="project_Label">
|
||||
<h4 class="mb5" ><%= l(:label_tag)%>:</h4>
|
||||
<div class="tag_h" >
|
||||
|
|
|
@ -44,14 +44,14 @@
|
|||
</li>
|
||||
<% if User.current.logged? %>
|
||||
<li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;">
|
||||
<%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), request.local? ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %>
|
||||
<%= link_to User.current, (request.local? || request.subdomain.blank?) ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %>
|
||||
<%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), user_url_in_org(User.current.id),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %>
|
||||
<%= link_to User.current, user_url_in_org(User.current.id),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %>
|
||||
<%= link_to "退出",logout_url_without_domain, :class =>"menuGrey", :method => 'post', :rel => "nofollow" %>
|
||||
</li>
|
||||
<!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>-->
|
||||
<% else %>
|
||||
<li class="navOrgMenu fr"><a href="<%= (request.local? || request.subdomain.blank?) ? signin_path(:login=>true):'https://www.trustie.net/login?login=true' %>" class="linkGrey8 f14">登录</a></li>
|
||||
<li class="navOrgMenu fr"><a href="<%= (request.local? || request.subdomain.blank?) ? signin_path(:login=>false):'https://www.trustie.net/login?login=false' %>" class="linkGrey8 f14 mr15">注册</a></li>
|
||||
<li class="navOrgMenu fr"><a href="<%= signin_url_without_domain %>" class="linkGrey8 f14">登录</a></li>
|
||||
<li class="navOrgMenu fr"><a href="<%= register_url_without_domain %>" class="linkGrey8 f14 mr15">注册</a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<!--<div class="navHomepageProfile">
|
||||
|
|
|
@ -193,7 +193,7 @@
|
|||
<% end%>
|
||||
<% end%>
|
||||
</div>
|
||||
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
|
||||
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
<div class="resources" id="organization_document_<%= @document.id %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_path(@document.creator_id) %>
|
||||
<%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to User.find(@document.creator_id), user_path(@document.creator.id), :class => "newsBlue mr15" %>
|
||||
<%= link_to User.find(@document.creator_id), user_url_in_org(@document.creator_id), :class => "newsBlue mr15" %>
|
||||
TO <%= link_to @document.organization.name, organization_path(@document.organization), :class => "newsBlue" %>
|
||||
|
|
||||
<% if @document.organization.home_id == @document.id %>
|
||||
|
@ -89,10 +89,10 @@
|
|||
<% user = User.find(reply.creator_id) %>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id %>').hide();">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => 33,:height => 33), user_path(user) %>
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => 33,:height => 33), user_url_in_org(user.id) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<%= link_to User.find(reply.creator_id).realname, user_path(reply.creator_id), :class => "newsBlue mr10 f14" %>
|
||||
<%= link_to User.find(reply.creator_id).realname, user_url_in_org(reply.creator_id), :class => "newsBlue mr10 f14" %>
|
||||
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe unless reply.content.nil? %>
|
||||
</div>
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<% if @res %>
|
||||
$("#org_subfield_list").html("");
|
||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
|
||||
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
|
||||
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
|
||||
:locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
|
||||
$("#sub_field_left_lists").html("");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
||||
$("#subfield_name").val("");
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
$("#org_subfield_list").html("");
|
||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
|
||||
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
|
||||
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
|
||||
:locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
|
||||
$("#sub_field_left_lists").html("");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
|
@ -0,0 +1,2 @@
|
|||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields.order("priority")}) %>");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
|
@ -12,10 +12,10 @@
|
|||
<%= link_to activity.try(:teacher).try(:realname), user_url_in_org(activity.tea_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.name.to_s+" | 课程", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
|
||||
<%= link_to activity.name.to_s+" | 课程", course_url_in_org(activity.id), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
<%= link_to activity.name, course_url_in_org(activity.id), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(activity.created_at) %>
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
<% else %>
|
||||
<%= link_to activity.try(:user).try(:realname), user_url_in_org(activity.user_id), :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"%>
|
||||
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_url_in_org(activity.course.id), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle hidden m_w505 fl"> <!--+"(作业名称)"-->
|
||||
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>
|
||||
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :class => "postGrey"%>
|
||||
</div>
|
||||
<% if activity.homework_detail_manual%>
|
||||
<% if activity.homework_detail_manual.comment_status == 1%>
|
||||
|
@ -47,7 +47,7 @@
|
|||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", "https://www.trustie.net/projects/new",:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
|
||||
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
|
||||
<% end %>
|
||||
|
@ -73,7 +73,7 @@
|
|||
|
||||
<% if activity.homework_type == 2 && is_teacher%>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
<%= link_to "模拟答题", "https://www.trustie.net/new_user_commit_homework?homework_id="+activity.id.to_s + "&is_test=true", class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.homework_type == 2%>
|
||||
|
@ -129,7 +129,7 @@
|
|||
<% if activity.student_works.count != 0 %>
|
||||
<% sw = activity.student_works.reorder("created_at desc").first %>
|
||||
<div class="mt10 homepagePostDeadline mb10">
|
||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_url_in_org(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
@ -141,7 +141,7 @@
|
|||
<% last_score = student_work_scores.first %>
|
||||
<div>
|
||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||
<%= link_to last_score.user.show_name, user_activities_url_in_org(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -154,18 +154,8 @@
|
|||
<% end %>
|
||||
<% student_works.each_with_index do |sw, i| %>
|
||||
<div class="fl mr10 w100" style="text-align:center;">
|
||||
<a href="javascript:void(0);" class="linkBlue">
|
||||
<% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %>
|
||||
<%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
||||
<p class="w100 hidden">
|
||||
<%= link_to sw.user.show_name, student_work_index_path(:homework => activity.id)%>
|
||||
</p>
|
||||
<% else %>
|
||||
<%= image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40", :title => '该作业的作品暂未公开') %>
|
||||
<p class="w100 hidden">
|
||||
<a href="javascript:void(0);" title="该作业的作品暂未公开"><%=sw.user.show_name %></a>
|
||||
</p>
|
||||
<% end %>
|
||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
||||
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_url_in_org(activity.id)%></p>
|
||||
</a>
|
||||
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
||||
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分</span></p>
|
||||
|
@ -175,7 +165,7 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<% if student_works.count > 5 %>
|
||||
<%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
||||
<%= link_to "更多>>", student_work_index_url_in_org(activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -187,7 +177,7 @@
|
|||
<% sort_projects = project_sort_update projects %>
|
||||
<div class="mt10 relatePWrap" id="relatePWrap_<%=user_activity_id %>">
|
||||
<div class="mr5 fontGrey2">
|
||||
# <%=time_from_now sort_projects.first.updated_at %><%= link_to User.find(sort_projects.first.user_id).show_name, user_activities_path(sort_projects.first.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
# <%=time_from_now sort_projects.first.updated_at %><%= link_to User.find(sort_projects.first.user_id).show_name, user_activities_url_in_org(sort_projects.first.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% sort_projects.each_with_index do |pro, i| %>
|
||||
|
@ -204,7 +194,7 @@
|
|||
|
||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||
<% 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 =>"项目头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_url_in_org(project.id),: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 %>
|
||||
|
@ -237,17 +227,17 @@
|
|||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%>
|
||||
<%= link_to l(:button_edit),Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/edit?", :class => "postOptionLink"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= 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(l(:label_bid_respond_delete), Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "?is_in_course=-1&course_activity=" + course_activity.to_s,:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => 0),:class => "postOptionLink", :remote => true) %>
|
||||
<%= link_to("评分设置", Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/score_rule_set?is_in_course=0&user_activity_id=" + user_activity_id.to_s,:class => "postOptionLink", :remote => true) %>
|
||||
</li>
|
||||
<% if activity.anonymous_comment == 0 %>
|
||||
<li>
|
||||
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
|
||||
<%= link_to("匿评设置", Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/start_evaluation_set",:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
|
||||
</li>
|
||||
<li>
|
||||
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>
|
||||
|
@ -255,17 +245,17 @@
|
|||
<% end %>
|
||||
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
||||
<li>
|
||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink",
|
||||
<%= link_to("禁用匿评", Setting.host_name + "/homework_common/" + activity.id.to_s + "/alert_forbidden_anonymous_comment?user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s,:class => "postOptionLink",
|
||||
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品",:remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
|
||||
<li>
|
||||
<%= link_to("公开作品", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
|
||||
<%= link_to("公开作品", Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/alert_open_student_works?is_in_course=-1&user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s,:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% elsif activity.is_open == 1 %>
|
||||
<li>
|
||||
<%= link_to("取消公开", alert_open_student_works_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
|
||||
<%= link_to("取消公开", Setting.protocol + "://" + Setting.host_name + "/homework_common/" + activity.id.to_s + "/alert_open_student_works?is_in_course=-1&user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s,:class => "postOptionLink", :remote => true)%>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
@ -356,7 +346,7 @@
|
|||
<%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_url_in_org(activity.course.id), :class => "newsBlue ml15 mr5"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle hidden m_w530 fl">
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %>
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :class=> "postGrey" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey"%>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :class=> "postGrey"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if activity.sticky == 1%>
|
||||
|
|
|
@ -1,123 +1,123 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %> TO <!--+"(课程名称)"-->
|
||||
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
|
||||
</div>
|
||||
<% if activity.sticky == 1%>
|
||||
<span class="sticky_btn_cir ml10">置顶</span>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostDate fl">
|
||||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=activity.comments.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.comments.reorder("created_on desc").each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.author == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.comments.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %> TO <!--+"(课程名称)"-->
|
||||
<%= link_to activity.course.name.to_s+" | 课程通知", course_news_index_url_in_org(activity.course.id), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :class => "postGrey" %>
|
||||
</div>
|
||||
<% if activity.sticky == 1%>
|
||||
<span class="sticky_btn_cir ml10">置顶</span>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostDate fl">
|
||||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=activity.comments.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.comments.reorder("created_on desc").each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(comment.created_on) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.author == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.comments.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<%= link_to activity.try(:user).try(:realname), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to Course.find(activity.polls_group_id).name.to_s+" | 问卷", poll_index_path(:polls_type => "Course", :polls_group_id => activity.polls_group_id), :class => "newsBlue ml15" %>
|
||||
<%= link_to Course.find(activity.polls_group_id).name.to_s+" | 问卷", Setting.protocol + "://" + Setting.host_name + "/poll?polls_type=Course&polls_group_id=" + activity.polls_group_id.to_s, :class => "newsBlue ml15" %>
|
||||
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word" >
|
||||
|
|
|
@ -34,71 +34,76 @@
|
|||
})
|
||||
})
|
||||
</script>
|
||||
<% org_activity_field = organization.org_subfields.where('field_type="default" and name="activity" and field_type="default"').first %>
|
||||
<% org_course_field = organization.org_subfields.where('field_type="default" and name="course" and field_type="default"').first %>
|
||||
<% org_project_field = organization.org_subfields.where('field_type="default" and name="project" and field_type="default"').first %>
|
||||
<div class="homepageLeftMenuBlock" style="display:<%= is_hide_org_left(org_activity_field) ? 'block':'none' %>;" id="org_subfield_<%= org_activity_field.id %>">
|
||||
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
|
||||
</div>
|
||||
<div style="display:<%= is_hide_org_left(org_project_field) ? 'block':'none' %>;" id="org_subfield_<%= org_project_field.id %>">
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>
|
||||
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
||||
<%=link_to "", join_project_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuProjects" style="display:<%= organization.projects.count == 0?'none':'' %>">
|
||||
<ul >
|
||||
|
||||
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:<%= is_hide_org_left(org_course_field) ? 'block':'none' %>;" id="org_subfield_<%= org_course_field.id %>">
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
||||
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
||||
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
|
||||
<ul >
|
||||
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% organization.org_subfields.where("field_type != 'default'").each do |field| %>
|
||||
<div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||
<% if field.field_type == "Post" %>
|
||||
<% if !field.subfield_subdomain_dir.nil? %>
|
||||
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
|
||||
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
|
||||
<% organization.org_subfields.order("priority").each do |field| %>
|
||||
<% if is_default_field?(field) %>
|
||||
<% case field.name %>
|
||||
<% when 'activity' %>
|
||||
<div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
|
||||
</div>
|
||||
<% when 'course' %>
|
||||
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
||||
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
||||
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
|
||||
<ul >
|
||||
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% when 'project' %>
|
||||
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>
|
||||
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
||||
<%=link_to "", join_project_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuProjects" style="display:<%= organization.projects.count == 0?'none':'' %>">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||
<% if field.field_type == "Post" %>
|
||||
<% if !field.subfield_subdomain_dir.nil? %>
|
||||
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
|
||||
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
|
||||
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
|
||||
<% end %>
|
||||
<% if User.current.member_of_org?organization %>
|
||||
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
|
||||
<% if !field.subfield_subdomain_dir.nil? %>
|
||||
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
|
||||
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
|
||||
<% end %>
|
||||
<% if User.current.member_of_org?organization %>
|
||||
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
|
||||
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->
|
||||
<% end %>
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuText"><%#= field.name %></a>-->
|
||||
<% end %>
|
||||
<% if User.current.member_of_org?organization %>
|
||||
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if !field.subfield_subdomain_dir.nil? %>
|
||||
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
|
||||
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
|
||||
<% end %>
|
||||
<% if User.current.member_of_org?organization %>
|
||||
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
|
||||
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->
|
||||
<% end %>
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuText"><%#= field.name %></a>-->
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -14,7 +14,7 @@
|
|||
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
|
||||
</a>
|
||||
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
|
||||
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml5 c_blue02") %><br />
|
||||
<%= link_to(member.user.show_name, user_url_in_org(member.user_id),:class => "ml5 c_blue02") %><br />
|
||||
<span class="fl c_grey ml10">身份:<%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %></span>
|
||||
<% if member.created_at %>
|
||||
<span class="fr c_grey"><%= format_time(member.created_at) %></span>
|
||||
|
|
|
@ -1,141 +1,141 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %> TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %>
|
||||
<span class='<%#= get_issue_priority(activity.priority_id)[0] %>'>
|
||||
<%#= get_issue_priority(activity.priority_id)[1] %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostAssignTo">指派给
|
||||
<% unless activity.assigned_to_id.nil? %>
|
||||
<% if activity.try(:assigned_to).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:assigned_to), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:assigned_to).try(:realname), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDeadline fl">
|
||||
发布时间:
|
||||
<%=format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = activity.journals.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<% if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.journals.reorder("created_on desc").each do |reply| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.user == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||
<% if reply.details.any? %>
|
||||
<% details_to_strings(reply.details).each do |string| %>
|
||||
<p><%= string %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<P><%= reply.notes.nil? ? "" : reply.notes.html_safe %></P>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %> TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_url_in_org(activity.project.id), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :class => "postGrey" %>
|
||||
<span class='<%#= get_issue_priority(activity.priority_id)[0] %>'>
|
||||
<%#= get_issue_priority(activity.priority_id)[1] %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostAssignTo">指派给
|
||||
<% unless activity.assigned_to_id.nil? %>
|
||||
<% if activity.try(:assigned_to).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:assigned_to), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:assigned_to).try(:realname), user_url_in_org(activity.assigned_to_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDeadline fl">
|
||||
发布时间:
|
||||
<%=format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = activity.journals.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<% if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.journals.reorder("created_on desc").each do |reply| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.user == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||
<% if reply.details.any? %>
|
||||
<% details_to_strings(reply.details).each do |string| %>
|
||||
<p><%= string %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<P><%= reply.notes.nil? ? "" : reply.notes.html_safe %></P>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,21 +3,21 @@
|
|||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user), :alt => "用户头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user.id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if user.try(:realname) == ' ' %>
|
||||
<%= link_to user, user_url_in_org(user), :class => "newsBlue mr15" %>
|
||||
<%= link_to user, user_url_in_org(user.id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to user.try(:realname), user_url_in_org(user), :class => "newsBlue mr15" %>
|
||||
<%= link_to user.try(:realname), user_url_in_org(user.id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to project.to_s+" | 项目", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
|
||||
<%= link_to project.to_s+" | 项目", project_url_in_org(project.id), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
<%= link_to project.name, project_url_in_org(project.id), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(project.created_on) %>
|
||||
|
|
|
@ -1,136 +1,135 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
|
||||
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<% 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 %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content%>
|
||||
<% else %>
|
||||
<% content = activity.parent.content%>
|
||||
<% end %>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = 0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||
<%= reply.content.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= 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|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_url_in_org(activity.project.id), :class => "newsBlue ml15 mr5"%>
|
||||
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board.id,activity.id), :class=> "postGrey"
|
||||
%>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board.id,activity.id), :class=> "postGrey" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content%>
|
||||
<% else %>
|
||||
<% content = activity.parent.content%>
|
||||
<% end %>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = 0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<% if activity.author == User.current %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<% if reply.author == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||
<%= reply.content.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= 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|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,152 +1,152 @@
|
|||
<div class="resources mt10" id="organization_document_<%= document.id %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(document.creator_id) %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
|
||||
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
||||
|
|
||||
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
|
||||
</div>
|
||||
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
||||
<div class="homepagePostDate fl">
|
||||
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(OrgActivity.where("org_act_type='#{document.class}' and org_act_id =#{document.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% unless document.content.blank? %>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
|
||||
</div>
|
||||
<!-- <%# if defined?(home_id) %>
|
||||
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
||||
<%# end %>-->
|
||||
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %>
|
||||
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => flag, :org_subfield_id => params[:org_subfield_id] ), :class => "postOptionLink" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:remote => true, :class => 'postOptionLink' %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% comments_for_doc = document.children.reorder("created_at desc") %>
|
||||
<% count = document.children.count() %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=document.id %>">
|
||||
<% if document.creator_id.to_i == User.current.id.to_i %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "(#{get_praise_num(document)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
||||
<ul>
|
||||
<% reply_id = 0 %>
|
||||
<% comments_for_doc.each do |comment| %>
|
||||
<% reply_id += 1 %>
|
||||
<li style="display:<%= reply_id > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %>
|
||||
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.creator_id.to_i == User.current.id.to_i %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% unless comment.content.blank? %>
|
||||
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>">
|
||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= act.id %>' style="display:none;">
|
||||
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
|
||||
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
|
||||
<div nhname='toolbar_container_<%= act.id %>'></div>
|
||||
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
|
||||
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
|
||||
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= act.id %>'></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
}
|
||||
<div class="resources mt10" id="organization_document_<%= document.id %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(document.creator_id) %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
|
||||
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
||||
|
|
||||
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
|
||||
</div>
|
||||
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
||||
<div class="homepagePostDate fl">
|
||||
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(OrgActivity.where("org_act_type='#{document.class}' and org_act_id =#{document.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% unless document.content.blank? %>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
|
||||
</div>
|
||||
<!-- <%# if defined?(home_id) %>
|
||||
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
||||
<%# end %>-->
|
||||
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %>
|
||||
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => flag, :org_subfield_id => params[:org_subfield_id] ), :class => "postOptionLink" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:remote => true, :class => 'postOptionLink' %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% comments_for_doc = document.children.reorder("created_at desc") %>
|
||||
<% count = document.children.count() %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=document.id %>">
|
||||
<% if document.creator_id.to_i == User.current.id.to_i %>
|
||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "(#{get_praise_num(document)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
||||
<ul>
|
||||
<% reply_id = 0 %>
|
||||
<% comments_for_doc.each do |comment| %>
|
||||
<% reply_id += 1 %>
|
||||
<li style="display:<%= reply_id > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %>
|
||||
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<% if comment.creator_id.to_i == User.current.id.to_i %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
||||
<% else %>
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<% unless comment.content.blank? %>
|
||||
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>">
|
||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current.id) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= act.id %>' style="display:none;">
|
||||
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
|
||||
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
|
||||
<div nhname='toolbar_container_<%= act.id %>'></div>
|
||||
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
|
||||
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
|
||||
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= act.id %>'></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -1,4 +1,5 @@
|
|||
<ul class="orgListRow">
|
||||
<li class="orgOrder fb">顺序</li>
|
||||
<li class="orgListUser fb">已有栏目</li>
|
||||
<li class="orgListStatus fb">状态</li>
|
||||
<li class="orgListStatus fb">类型</li>
|
||||
|
@ -6,48 +7,64 @@
|
|||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
||||
<% default_fields.each do |field| %>
|
||||
<% name = get_default_name(field) %>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgListUser"><%= name %></li>
|
||||
<li class="orgListStatus">默认</li>
|
||||
<li class="orgListStatus">默认</li>
|
||||
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% subfields.each do |field| %>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgListUser">
|
||||
<div id="subfield_show_<%= field.id %>"><%= field.name %></div>
|
||||
<div id="subfield_edit_<%= field.id %>" style="display:none;">
|
||||
<input type="text" name="name" onblur="update_subfield('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.name %>" style="width:70px;"/>
|
||||
</div>
|
||||
</li>
|
||||
<li class="orgListStatus">新增</li>
|
||||
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
|
||||
<li class="orgListUser hidden">
|
||||
<% if Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 %>
|
||||
<div id="sub_dir_show_<%= field.id %>" ondblclick="edit_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3;" title="双击可编辑">
|
||||
<%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
|
||||
<% if is_default_field?(field) %>
|
||||
<% name = get_default_name(field) %>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgOrder">
|
||||
<div id="show_priority_<%= field.id %>" ondblclick="edit_priority('#show_priority_<%= field.id %>','#edit_priority_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3;" title="双击可编辑">
|
||||
<%= field.priority %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="sub_dir_show_<%= field.id %>" >
|
||||
<%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
|
||||
<div id="edit_priority_<%= field.id %>" style="display:none;width:30px;">
|
||||
<input type="text" onblur="update_priority('#show_priority_<%= field.id %>','#edit_priority_<%= field.id %>','<%= field.id %>',$(this).val());" style="width:20px;" value="<%= field.priority %>"/>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="sub_dir_edit_<%= field.id %>" style="display:none;">
|
||||
<input type="text" name="name" onblur="update_sub_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.subfield_subdomain_dir.nil? ? '': field.subfield_subdomain_dir.name %>" style="width:70px;"/>
|
||||
</div>
|
||||
</li>
|
||||
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
|
||||
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
|
||||
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %>
|
||||
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
|
||||
</li>
|
||||
<li class="orgListUser"><%= name %></li>
|
||||
<li class="orgListStatus">默认</li>
|
||||
<li class="orgListStatus">默认</li>
|
||||
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% else %>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgOrder">
|
||||
<div id="show_priority_<%= field.id %>" ondblclick="edit_priority('#show_priority_<%= field.id %>','#edit_priority_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3;" title="双击可编辑">
|
||||
<%= field.priority %>
|
||||
</div>
|
||||
<div id="edit_priority_<%= field.id %>" style="display:none;width:30px;">
|
||||
<input type="text" onblur="update_priority('#show_priority_<%= field.id %>','#edit_priority_<%= field.id %>','<%= field.id %>',$(this).val());" style="width:20px;" value="<%= field.priority %>"/>
|
||||
</div>
|
||||
</li>
|
||||
<li class="orgListUser">
|
||||
<div id="subfield_show_<%= field.id %>"><%= field.name %></div>
|
||||
<div id="subfield_edit_<%= field.id %>" style="display:none;">
|
||||
<input type="text" name="name" onblur="update_subfield('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.name %>" style="width:70px;"/>
|
||||
</div>
|
||||
</li>
|
||||
<li class="orgListStatus">新增</li>
|
||||
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
|
||||
<li class="orgListUser hidden">
|
||||
<% if Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 %>
|
||||
<div id="sub_dir_show_<%= field.id %>" ondblclick="edit_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3;" title="双击可编辑">
|
||||
<%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="sub_dir_show_<%= field.id %>" >
|
||||
<%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="sub_dir_edit_<%= field.id %>" style="display:none;">
|
||||
<input type="text" name="name" onblur="update_sub_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.subfield_subdomain_dir.nil? ? '': field.subfield_subdomain_dir.name %>" style="width:70px;"/>
|
||||
</div>
|
||||
</li>
|
||||
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
|
||||
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
|
||||
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %>
|
||||
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
|
||||
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
|
@ -96,6 +113,35 @@
|
|||
$(show_id).show();
|
||||
$(edit_id).hide();
|
||||
}
|
||||
|
||||
function edit_priority(show_id, edit_id){
|
||||
$(show_id).toggle();
|
||||
$(edit_id).toggle();
|
||||
$(edit_id).find("input").focus();
|
||||
$(edit_id).find("input").on('keypress',function(e){
|
||||
if (e.keyCode == 13){
|
||||
this.blur();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function update_priority(show_id, edit_id, field_id, input_value){
|
||||
var re = /^[0-9]*[1-9]*[0-9]$/
|
||||
if(re.test(input_value) && $(show_id).html().trim() != input_value.trim() && input_value.trim() != ''){
|
||||
if(confirm("确定修改为" + input_value + "?")){
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/update_priority?priority=" + input_value,
|
||||
type: 'put'
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$(edit_id).find("input").val($(show_id).html().trim());
|
||||
}
|
||||
$(show_id).show();
|
||||
$(edit_id).hide();
|
||||
}
|
||||
function hide(content, id){
|
||||
if (content.text() == '设为隐藏')
|
||||
$.ajax({
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开 : </span>
|
||||
<input type="checkbox" id="is_public" onblur="disable_down($(this), $('#allow_download'),$('#allow_down_hint'));" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
|
||||
<input type="checkbox" id="is_public" onclick="disable_down($(this), $('#allow_download'),$('#allow_down_hint'));" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
|
||||
</div>
|
||||
<div class="orgRow mb10 mt5"><span style="margin-left:10px;">下载支持 : </span>
|
||||
<input id="allow_download" type="checkbox" style="margin-top:5px;" <%= @organization.is_public? ? "":"DISABLED" %> name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
|
||||
|
@ -119,8 +119,7 @@
|
|||
</div>
|
||||
<div class="undis ml15 mr15" id="orgContent_3">
|
||||
<div class="orgMemberList" id="org_subfield_list">
|
||||
<%= render :partial => 'organizations/subfield_list', :locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
|
||||
:subfields => @organization.org_subfields.where("field_type != 'default'") } %>
|
||||
<%= render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority")} %>
|
||||
</div>
|
||||
<div class="fr orgMemContainer">
|
||||
<div class="fr">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% if @project.is_public? %>
|
||||
$("#set_project_public_<%= @project.id %>").text("设为私有");
|
||||
$("#show_project_<%= @project.id %>").attr("title","公开项目:<%= @project.name %>");
|
||||
<% else %>
|
||||
$("#set_project_public_<%= @project.id %>").text("设为公开");
|
||||
$("#show_project_<%= @project.id %>").attr("title","私有项目:<%= @project.name %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
$("#set_project_public_<%= @project.id %>").replaceWith('<%= escape_javascript(link_to @project.is_public? ? "设为私有" : "设为公开", {:controller => "projects", :action => "set_public_or_private", :id => @project.id,:user_page => true},
|
||||
:id => "set_project_public_"+ @project.id.to_s,:method => "post",:remote=>true,:confirm=>"您确定要设置为"+(@project.is_public? ? "私有" : "公开")+"吗") %>');
|
|
@ -1,7 +1,7 @@
|
|||
<ul class="subject-list-banner">
|
||||
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
|
||||
<li class="subject-list-from fl">
|
||||
<%= link_to "来源",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "course_name", :sort => @r_sort),:class => "fl ml30",:remote => true%>
|
||||
<%= link_to "来源",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "course_name", :sort => @r_sort),:class => "fl ml55",:remote => true%>
|
||||
<% if @order == "course_name"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "course_name", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
|
||||
<% end%>
|
||||
|
|
|
@ -21,18 +21,18 @@
|
|||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="homepageImageBlock mb10">
|
||||
<div><%= link_to User.watched_by(user.id).count, {:controller=>"users", :action=>"user_watchlist",:id=>user.id}, :class => 'homepageImageNumber',:target => "_blank" %></div>
|
||||
<div class="homepageImageText"><%= link_to '关注',{:controller=>"users", :action=>"user_watchlist",:id=>user.id},:target => "_blank" %></div>
|
||||
<div><%= link_to User.watched_by(user.id).count, user_watchlist_url_in_org(user.id), :class => 'homepageImageNumber',:target => "_blank" %></div>
|
||||
<div class="homepageImageText"><%= link_to '关注',user_watchlist_url_in_org(user.id),:target => "_blank" %></div>
|
||||
</div>
|
||||
<div class="homepageVerDiv"></div>
|
||||
<div class="homepageImageBlock">
|
||||
<div><%= link_to user.watcher_users.count,{:controller=>"users", :action=>"user_fanslist",:id=>user.id}, :class => "homepageImageNumber fans_count_#{user.id}",:target => "_blank" %></div>
|
||||
<div class="homepageImageText"><%= link_to '粉丝', {:controller=>"users", :action=>"user_fanslist",:id=>user.id},:target => "_blank" %></div>
|
||||
<div><%= link_to user.watcher_users.count,user_fanslist_url_in_org(user.id), :class => "homepageImageNumber fans_count_#{user.id}",:target => "_blank" %></div>
|
||||
<div class="homepageImageText"><%= link_to '粉丝', user_fanslist_url_in_org(user.id),:target => "_blank" %></div>
|
||||
</div>
|
||||
<div class="homepageVerDiv"></div>
|
||||
<div class="homepageImageBlock">
|
||||
<div><%= link_to user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count, user_blogs_path(user), :class => 'homepageImageNumber',:target => "_blank" %></div>
|
||||
<div class="homepageImageText"><%= link_to '博客', user_blogs_path(user),:target => "_blank" %></div>
|
||||
<div><%= link_to user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count, user_blogs_url_in_org(user.id), :class => 'homepageImageNumber',:target => "_blank" %></div>
|
||||
<div class="homepageImageText"><%= link_to '博客', user_blogs_url_in_org(user.id),:target => "_blank" %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if User.current != user %>
|
||||
|
@ -40,8 +40,8 @@
|
|||
<%= render :partial => 'users/watch_btn_for_picture', :locals => {:user => user} %>
|
||||
</div>
|
||||
<!--<a href="javascript:void(0);" class="userFollow mr27 fl">添加关注</a> <a href="javascript:void(0);" class="userCancel mr27 fl" style="display:none;">取消关注</a>-->
|
||||
<%= link_to "留言", feedback_path(user), :class => 'greyBtn fr', :target => "_blank" %>
|
||||
<%= link_to "私信", feedback_path(user), :class => 'greyBtn fr', :style => 'margin-right:20px;', :target => "_blank" %>
|
||||
<%= link_to "留言", feedback_url_in_org(user.id), :class => 'greyBtn fr', :target => "_blank" %>
|
||||
<%= link_to "私信", feedback_url_in_org(user.id), :class => 'greyBtn fr', :style => 'margin-right:20px;', :target => "_blank" %>
|
||||
<!--<a href="javascript:void(0);" class="greyBtn fl">私信</a><a href="javascript:void(0);" class="greyBtn fr">留言</a> -->
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,8 +2,8 @@
|
|||
<%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn") %>
|
||||
<% else %>
|
||||
<%if(user.watched_by?(User.current))%>
|
||||
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id),:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%>
|
||||
<%= link_to "取消关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%>
|
||||
<% else %>
|
||||
<%= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id),:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%>
|
||||
<%= link_to "添加关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -111,6 +111,7 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
member do
|
||||
match 'update_sub_dir', :via => [:put]
|
||||
match 'update_priority', :via => [:put]
|
||||
end
|
||||
resource :boards
|
||||
end
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
class SetPriorityForOrgSubfields < ActiveRecord::Migration
|
||||
def up
|
||||
Organization.all.each do |org|
|
||||
org.transaction do
|
||||
org.org_subfields.where("field_type='default'").each do|field|
|
||||
case field.name
|
||||
when 'activity'
|
||||
field.update_attribute(:priority, 1)
|
||||
when 'course'
|
||||
field.update_attribute(:priority, 2)
|
||||
when 'project'
|
||||
field.update_attribute(:priority, 3)
|
||||
end
|
||||
end
|
||||
org.org_subfields.where("field_type!='default'").each_with_index do |field, index|
|
||||
field.update_attribute(:priority, index + 4)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -37,3 +37,120 @@ function regexTopicSubject() {
|
|||
function reset_topic(){
|
||||
|
||||
}
|
||||
(function(){
|
||||
//提交匿评参数设置
|
||||
function submit_set_evaluation_attr(end_time){
|
||||
if(!regex_evaluation_start(end_time)){
|
||||
$("#evaluation_start_time").focus();
|
||||
}
|
||||
else if(!regex_evaluation_end()){
|
||||
$("#evaluation_end_time").focus();
|
||||
}
|
||||
else if(!regex_evaluation_num()){
|
||||
$("#evaluation_num").focus();
|
||||
}
|
||||
else{
|
||||
$('#popbox02 form').submit();
|
||||
hideModal();
|
||||
}
|
||||
}
|
||||
|
||||
//验证匿评开启时间:大于截止时间,或者为空
|
||||
function regex_evaluation_start(end_time){
|
||||
var evaluation_start = $.trim($("#evaluation_start_time").val());
|
||||
if(evaluation_start == ""){
|
||||
$("#homework_evaluation_start_time").text("开启匿评日期不能为空");
|
||||
return false;
|
||||
}
|
||||
var end_time = new Date(end_time);
|
||||
var evaluation_start_time = new Date(evaluation_start);
|
||||
if(evaluation_start_time > end_time){
|
||||
$("#homework_evaluation_start_time").text("");
|
||||
return true;
|
||||
}else{
|
||||
$("#homework_evaluation_start_time").text("开启匿评日期必须大于截止日期");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//验证匿评结束时间:大于匿评开启时间,或者为空。当匿评开启时间为空时,匿评结束时间必须为空
|
||||
function regex_evaluation_end(){
|
||||
var evaluation_start = $.trim($("#evaluation_start_time").val());
|
||||
var evaluation_end = $.trim($("#evaluation_end_time").val());
|
||||
if(evaluation_end == ""){
|
||||
$("#homework_evaluation_end_time").text("关闭匿评日期不能为空");
|
||||
return true;
|
||||
}
|
||||
var evaluation_start_time = new Date(evaluation_start);
|
||||
var evaluation_end_time = new Date(evaluation_end);
|
||||
if(evaluation_end_time >= evaluation_start_time){
|
||||
$("#homework_evaluation_end_time").text("");
|
||||
return true;
|
||||
}else{
|
||||
$("#homework_evaluation_end_time").text("关闭匿评日期不能小于开启匿评日期");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//验证匿评数量
|
||||
function regex_evaluation_num(){
|
||||
var evaluation_num = $.trim($("#evaluation_num").val());
|
||||
var regex = /^\d+$/;
|
||||
if(evaluation_num==""){
|
||||
$("#evaluation_num_notice").text("匿评人数不能为空");
|
||||
return false;
|
||||
}
|
||||
else if(regex.test(evaluation_num)){
|
||||
if(evaluation_num > 0){
|
||||
$("#evaluation_num_notice").html("");
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
$("#evaluation_num_notice").text("匿评人数必须为大于0");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$("#evaluation_num_notice").text("匿评人数只能为数字");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.submit_set_evaluation_attr=submit_set_evaluation_attr;
|
||||
})();
|
||||
|
||||
|
||||
//处理迟交、缺评扣分
|
||||
function check_late_penalty(id)
|
||||
{
|
||||
var obj = $("#" + id);
|
||||
var regex = /^\d+$/;
|
||||
if(regex.test(obj.val()))
|
||||
{
|
||||
if(obj.val() > 50)
|
||||
{
|
||||
obj.val("50");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.val("0");
|
||||
}
|
||||
}
|
||||
|
||||
//匿评弹框确定按钮
|
||||
function clickOK(path)
|
||||
{
|
||||
clickCanel();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: path,
|
||||
data: 'text',
|
||||
success: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//匿评弹框取消按钮
|
||||
function clickCanel(){hideModal("#popbox02");}
|
||||
|
||||
|
|
|
@ -1205,7 +1205,6 @@ a:hover.memberBtn{background: url(/images/course/hwork_icon.png) -80px -90px no-
|
|||
.addMemberC li:hover {cursor:pointer; background-color:#cccccc;}
|
||||
.addMemberCP {width:514px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:fixed !important;left:50%;top:50%;margin:-100px 0 0 -150px; -moz-border-radius:5px;}
|
||||
.rightArrow {margin:50px 15px 0px 15px; float:left;}
|
||||
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}
|
||||
.maxHeight100 {max-height:100px; overflow-x:hidden; overflow-y:auto;}
|
||||
.resubAtt {border-top:1px solid #dddddd; position:relative; margin-top:15px;}
|
||||
.resubTitle {position:absolute; top:-10px; left:5px; background-color:#ffffff; display:block; font-weight:bold; padding:0px 2px;}
|
||||
|
|
|
@ -22,6 +22,7 @@ a.saveBtn:hover {background-color:#297fb8;}
|
|||
.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;}
|
||||
.orgListUser {width:85px; float:left;}
|
||||
.orgListRole {width:180px; float:left;}
|
||||
.orgOrder {width:30px; float:left;margin-right:10px;text-align:center;}
|
||||
.orgMemContainer {width:228px;}
|
||||
.orgMemberAdd {float:right;}
|
||||
.orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;}
|
||||
|
|
|
@ -50,4 +50,6 @@ a.resourcesTypeAll {background:url(images/homepage_icon.png) -180px -89px no-rep
|
|||
.codeIcon {background:url(../images/hwork_icon.png) -78px -160px no-repeat; padding-left:23px;}
|
||||
.othersIcon {background:url(../images/hwork_icon.png) -3px -210px no-repeat; padding-left:23px;}
|
||||
.thesisIcon {background:url(../images/hwork_icon.png) -78px -212px no-repeat; padding-left:23px;}
|
||||
.softwareIcon {background:url(../images/hwork_icon.png) -5px -254px no-repeat; padding-left:23px;}
|
||||
.softwareIcon {background:url(../images/hwork_icon.png) -5px -254px no-repeat; padding-left:23px;}
|
||||
|
||||
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}
|
Loading…
Reference in New Issue