Merge branch 'develop' into szzh

This commit is contained in:
alan 2015-06-01 10:43:43 +08:00
commit ac637d8bf0
52 changed files with 2986 additions and 2676 deletions

2
.gitignore vendored
View File

@ -5,7 +5,7 @@
*.swp *.swp
/config/database.yml /config/database.yml
/config/configuration.yml /config/configuration.yml
/config/additional_environment.rb
/files/* /files/*
/log/* /log/*
/public/tmp/* /public/tmp/*

View File

@ -91,6 +91,7 @@ module Mobile
desc '课程留言列表' desc '课程留言列表'
params do params do
optional :token, type: String optional :token, type: String
optional :page,type:Integer,desc:'页数'
end end
get ':id/course_message' do get ':id/course_message' do
cs = CommentService.new cs = CommentService.new

View File

@ -336,9 +336,11 @@ class AccountController < ApplicationController
:expires => 1.month.from_now, :expires => 1.month.from_now,
:path => (Redmine::Configuration['autologin_cookie_path'] || '/'), :path => (Redmine::Configuration['autologin_cookie_path'] || '/'),
:secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false), :secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false),
:domain => Redmine::Configuration['cookie_domain'],
:httponly => true :httponly => true
} }
if Redmine::Configuration['cookie_domain'].present?
cookie_options = cookie_options.merge(domain: Redmine::Configuration['cookie_domain'])
end
cookies[autologin_cookie_name] = cookie_options cookies[autologin_cookie_name] = cookie_options
end end

View File

@ -199,7 +199,11 @@ class ApplicationController < ActionController::Base
# Logs out current user # Logs out current user
def logout_user def logout_user
if User.current.logged? if User.current.logged?
cookies.delete(autologin_cookie_name, domain: :all) if Redmine::Configuration['cookie_domain'].present?
cookies.delete(autologin_cookie_name, domain: Redmine::Configuration['cookie_domain'])
else
cookies.delete autologin_cookie_name
end
# Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) # Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
self.logged_user = nil self.logged_user = nil
end end

View File

@ -80,19 +80,19 @@ class BoardsController < ApplicationController
if @project if @project
@topic_pages = Paginator.new @topic_count, per_page_option, params['page'] @topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@topics = @board.topics. @topics = @board.topics.
reorder("#{Message.table_name}.sticky DESC"). reorder("#{Message.table_name}.sticky DESC, #{Message.table_name}.created_on desc").
includes(:last_reply). includes(:last_reply).
limit(@topic_pages.per_page). limit(@topic_pages.per_page).
offset(@topic_pages.offset). offset(@topic_pages.offset).
order("last_replies_messages.created_on desc").
preload(:author, {:last_reply => :author}). preload(:author, {:last_reply => :author}).
all all
elsif @course elsif @course
board_topics = @board ? @board.topics.reorder("#{Message.table_name}.sticky DESC"). board_topics = @board ? @board.topics.reorder("#{Message.table_name}.sticky DESC, #{Message.table_name}.created_on desc").
includes(:last_reply). includes(:last_reply).
# limit(@topic_pages.per_page). # limit(@topic_pages.per_page).
# offset(@topic_pages.offset). # offset(@topic_pages.offset).
order("last_replies_messages.created_on desc").
preload(:author, {:last_reply => :author}). preload(:author, {:last_reply => :author}).
all : [] all : []
@topics = paginateHelper board_topics,10 @topics = paginateHelper board_topics,10

View File

@ -193,7 +193,7 @@ class MessagesController < ApplicationController
else else
redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)) redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id))
end end
elsif request.get? elsif request.get? || request.post?
if params[:is_board] if params[:is_board]
if @project if @project
redirect_to project_boards_path(@project) redirect_to project_boards_path(@project)

View File

@ -243,14 +243,7 @@ class ProjectsController < ApplicationController
# Author lizanle # Author lizanle
# Description 项目动态展示方法,删除了不必要的代码 # Description 项目动态展示方法,删除了不必要的代码
def show def show
# params[:login]为邮箱邀请用户加入,主要功能:
# 1、自动注册
# 2、加入项目、创建角色
# 3、用户得分
if params[:mail]
Member.create(:role_ids => [4], :user_id => params[:user],:project_id => params[:id])
UserGrade.create(:user_id =>params[:user], :project_id => params[:id])
end
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump]) if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
return return
end end
@ -399,6 +392,26 @@ class ProjectsController < ApplicationController
# by young # by young
# include CoursesHelper # include CoursesHelper
def member def member
# params[:login]为邮箱邀请用户加入,主要功能:
# 1、自动注册
# 2、加入项目、创建角色
# 3、用户得分
if params[:mail]
user = User.find(params[:user_id])
user.activate!
Member.create(:role_ids => [4], :user_id => params[:user_id],:project_id => params[:id])
UserGrade.create(:user_id => params[:user_id], :project_id => params[:id])
token = Token.get_token_from_user(user, 'autologin')
#user = User.try_to_autologin(token.value)
if user
start_user_session(user)
user.save
redirect_to project_member_path(params[:id])
return
# account_ project_member_path(params[:id])
flash[:notice] = l(:label_mail_invite_success)
end
end
## 有角色参数的才是课程,没有的就是项目 ## 有角色参数的才是课程,没有的就是项目
@render_file = 'project_member_list' @render_file = 'project_member_list'
# 判断是否课程 # 判断是否课程

View File

@ -16,16 +16,18 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WelcomeController < ApplicationController class WelcomeController < ApplicationController
# layout "base_welcome"
include ApplicationHelper include ApplicationHelper
include WelcomeHelper include WelcomeHelper
helper :project_score helper :project_score
caches_action :robots caches_action :robots, :course, :contest, expires_in: 2.hours, layout: false
#before_filter :find_first_page, :only => [:index] #before_filter :find_first_page, :only => [:index]
# before_filter :fake, :only => [:index, :course] # before_filter :fake, :only => [:index, :course]
before_filter :entry_select, :only => [:index] before_filter :entry_select, :only => [:index]
def index def index
# 企业版定制: params[:project]为传过来的参数 # 企业版定制: params[:project]为传过来的参数
unless params[:organization].nil? unless params[:organization].nil?
@organization = Organization.find params[:organization] @organization = Organization.find params[:organization]
# @organization_projects = Project.joins(:project_status).joins("LEFT JOIN project_scores ON projects.id = project_scores.project_id").where("projects.organization_id = ?", @organization.id).order("score DESC").limit(10).all # @organization_projects = Project.joins(:project_status).joins("LEFT JOIN project_scores ON projects.id = project_scores.project_id").where("projects.organization_id = ?", @organization.id).order("score DESC").limit(10).all
@ -84,6 +86,7 @@ class WelcomeController < ApplicationController
@projects = @projects_all.order("score desc") @projects = @projects_all.order("score desc")
end end
end end
rescue Exception => e rescue Exception => e
render_404 render_404
end end

View File

@ -0,0 +1,5 @@
class InviteList < ActiveRecord::Base
attr_accessible :project_id, :user_id
# belongs_to :user
# belongs_to :project
end

View File

@ -60,8 +60,8 @@ class Mailer < ActionMailer::Base
user = us.register_auto(login, @email, @password) user = us.register_auto(login, @email, @password)
User.current = user unless User.current.nil? User.current = user unless User.current.nil?
@user = user @user = user
@token = Token.get_token_from_user(user, 'autologin')
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id, :user => user.id, :mail => true, :token => @token.value) @project_url = url_for(:controller => 'projects', :action => 'member', :id => project.id, :user_id => user.id, :mail => true)
mail :to => email, :subject => @subject mail :to => email, :subject => @subject
end end
@ -72,8 +72,9 @@ class Mailer < ActionMailer::Base
@invitor_name = "#{invitor.name}" @invitor_name = "#{invitor.name}"
@project_name = "#{project.name}" @project_name = "#{project.name}"
@user = user @user = user
@project = project
@token = Token.get_token_from_user(user, 'autologin') @token = Token.get_token_from_user(user, 'autologin')
@project_url = url_for(:controller => 'projects', :action => 'show', :id => project.id, :user => user.id, :mail => true, :token => @token.value) @project_url = url_for(:controller => 'projects', :action => 'member', :id => project.id, :user_id => user.id, :mail => true, :token => @token.value)
mail :to => email, :subject => @subject mail :to => email, :subject => @subject
end end

View File

@ -67,7 +67,7 @@ class Project < ActiveRecord::Base
has_many :student, :through => :students_for_courses, :source => :user has_many :student, :through => :students_for_courses, :source => :user
has_one :course_extra, :class_name => 'Course', :foreign_key => :extra,:primary_key => :identifier, :dependent => :destroy has_one :course_extra, :class_name => 'Course', :foreign_key => :extra,:primary_key => :identifier, :dependent => :destroy
has_many :applied_projects has_many :applied_projects
# has_many :invite_lists
# end # end
#ADDED BY NIE #ADDED BY NIE

View File

@ -125,6 +125,10 @@ class User < Principal
has_many :documents # 项目中关联的文档再次与人关联 has_many :documents # 项目中关联的文档再次与人关联
# end # end
# 邮件邀请状态
# has_many :invite_lists
# end
######added by nie ######added by nie
has_many :project_infos, :dependent => :destroy has_many :project_infos, :dependent => :destroy
has_one :user_status, :dependent => :destroy has_one :user_status, :dependent => :destroy

View File

@ -94,7 +94,7 @@ class CommentService
def course_messages params,current_user def course_messages params,current_user
@course = ::Course.find(params[:id]) @course = ::Course.find(params[:id])
if (current_user.admin? || @course.is_public == 1 || (@course.is_public == 0 && current_user.member_of_course?(@course))) if (current_user.admin? || @course.is_public == 1 || (@course.is_public == 0 && current_user.member_of_course?(@course)))
@jours = @course.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') @jours = @course.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC').page(params[:page] ||= 1).per(10)
else else
raise '403' raise '403'
end end

View File

@ -62,7 +62,7 @@ class UsersService
else else
@user.password = "" @user.password = ""
end end
@user = automatically_register(@user) @user = automatically_register_lock(@user)
if @user.id != nil if @user.id != nil
ue = @user.user_extensions ||= UserExtensions.new ue = @user.user_extensions ||= UserExtensions.new
ue.user_id = @user.id ue.user_id = @user.id
@ -292,6 +292,7 @@ class UsersService
jours jours
end end
# 所有的与我相关
def reply_my_messages params,current_user def reply_my_messages params,current_user
jours = my_personal_messages params,current_user jours = my_personal_messages params,current_user
jours1 = my_course_messages params,current_user jours1 = my_course_messages params,current_user

View File

@ -1,9 +1,12 @@
<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %> <%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %>
<li> <li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a> <div class="ml55 fl" nhname="toolbar_container"></div>
<a href="#" onclick="submitProjectsBoard('<%= @message.id %>')" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a> <a href="javascript:void(0);" nhname="cancelbtn" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0);" nhname="submitbtn" class="blue_btn fr " style="margin-left: 55px">
<%= l(:button_submit)%>
</a>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>

View File

@ -1,6 +1,4 @@
<div nhname="container_board">
<!--display the board-->
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2 fl"> <h2 class="project_h2 fl">
<% if User.current.language == "zh"%> <% if User.current.language == "zh"%>
@ -10,17 +8,22 @@
<% end %> <% end %>
</h2> </h2>
<a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a> <% if User.current.logged? %>
<a href="javascript:void(0)" class="green_btn fr newtalk " id="new_topic_btn" nhname="showbtn"><%= l(:label_message_new) %></a>
<% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<!-- 发布新帖部分 -->
<div class="cl"></div> <div class="cl"></div>
<div class=" talklist_box" > <div class=" talklist_box" >
<div class="talk_new ml15 mb10" id="about_newtalk" style="display:<%= !@flag.nil? && @flag=='true' ? 'block' : 'none' %>;" > <div class="talk_new ml15 mb10" nhname="about_talk" id="about_newtalk" style="display:none;" >
<ul> <ul>
<%= render :partial => 'course_new' %> <%= render :partial => 'course_new' %>
</ul> </ul>
</div><!--talknew end--> </div><!--talknew end-->
</div>
</div>
<!-- 发布新帖部分 -->
<div class=" talklist_box" >
<% if !User.current.logged?%> <% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;"> <div style="font-size: 14px;margin:20px;">
@ -32,15 +35,19 @@
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p> <p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;" id="topic<%= topic.id %>"> <div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;" id="topic<%= topic.id %>" nhname="container_board" mhname="container_board_reply">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5"> <div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %> <% author = topic.author.to_s %>
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %> <div style="max-width:60px;white-space:nowrap;overflow:hidden;float:left;text-overflow:ellipsis;">
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl ",:title=>author,
:style=>'max-width:60px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;' %>
</div>
<p style="float:left;color:#ff5722;">&nbsp;&nbsp;:</p>
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p> <p class="talkmain_tit fl fb break_word" title="<%= h(topic.subject) %>" style="width:auto;float:left;max-width:415px;white-space:nowrap;overflow:hidden;float:left;text-overflow:ellipsis;">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.course_editable_by?(User.current) %> <% if topic.course_editable_by?(User.current) %>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right; <a href="javascript:void(0)" nhname="showbtn" style="color: #426e9a;float: right;
margin-right: 10px;"><%= l(:button_edit) %></a> margin-right: 10px;"><%= l(:button_edit) %></a>
<% end %> <% end %>
@ -59,7 +66,7 @@
<div class="cl"></div> <div class="cl"></div>
<script> <script>
$(function(){if($("#contentmessage<%=topic.id %>").height()>55){$("#project_show_<%= topic.id%>").show();}}); $(function(){if($("#contentmessage<%=topic.id %>").height()>182){$("#project_show_<%= topic.id%>").show();}});
</script> </script>
<div class="project_board_content break_word" id="content_<%=topic.id%>"> <div class="project_board_content break_word" id="content_<%=topic.id%>">
<div id="contentmessage<%=topic.id %>" class="upload_img"> <div id="contentmessage<%=topic.id %>" class="upload_img">
@ -70,7 +77,7 @@
<p style="display: none" id="project_show_<%= topic.id%>"> <p style="display: none" id="project_show_<%= topic.id%>">
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label> <a id="expend_more_information<%= topic.id%>" href="javascript:void(0)" style="color: #0781b4;" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</a>
<span class="g-arr-down"> <span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" /> <img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span> </span>
@ -81,83 +88,53 @@
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %> <%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
</div> </div>
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %> <a href="javascript:void(0)" nhname="showbtn_reply" class="c_dblue fr" style="margin-right:10px;"><%= l(:button_reply) %></a>
<div class="cl"></div> <div class="cl"></div>
<div class="talk_new ml15 mb10" nhname='about_talk' id="about_newtalk<%=topic.id%>" style="display: none">
</div><!--讨论主类容 end-->
<div class="talk_new ml15 mb10" id="about_newtalk<%=topic.id%>" style="display: none">
<ul> <ul>
<%= render :partial => 'edit',locals: {:topic => topic} %> <%= render :partial => 'edit',locals: {:topic => topic} %>
</ul> </ul>
</div> </div>
<div class="cl"></div>
<div class="talkWrapBox"> <div class="talkWrapBox">
<% reply = Message.new(:subject => "RE: #{@message.subject}")%> <% reply = Message.new(:subject => "RE: #{topic.subject}")%>
<% if !topic.locked? && authorize_for('messages', 'reply') %> <% if !topic.locked? && authorize_for('messages', 'reply') %>
<div class="talkWrapMsg" nhname="about_talk_reply" style="display: none;">
<em class="talkWrapArrow"></em> <em class="talkWrapArrow"></em>
<div class="cl"></div> <div class="cl"></div>
<div class="talkConIpt ml15 mb10" style="display: none" id="reply<%= topic.id %>"> <div class="talkConIpt ml15 mb10" style="margin-left:30px;" id="reply<%= topic.id %>">
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %> <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'},
:html => {:nhname=>"form",:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %> <div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a> <div style="padding-top:5px;" class="fr">
<a href="javascript:void(0)" nhname="cancelbtn" class="grey_btn fr ml10" style=""><%= l(:button_cancel)%></a>
<a href="javascript:void(0)" nhname="submitbtn" class="blue_btn fr " style=""><%= l(:button_submit)%></a>
</div>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %>
<% replies_all = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").offset(2).
all %>
<% replies_show = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").limit(2).
all %>
<% unless replies_show.empty? %>
<% reply_count = 0 %>
<div class="talkWrapMsg">
<ul>
<% replies_show.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
</div> </div>
<div class="cl"></div>
</li><!---留言内容-->
<% end %> <% end %>
</ul> <% replies_all = topic.children.includes(:author, :attachments, {:board => :project}).
</div> reorder("#{Message.table_name}.created_on DESC").all %>
<div class="talkWrapMsg" id="talkWrapMsg<%= topic.id %>" style="display: none"> <% unless replies_all.empty? %>
<% replies_all_i = 0 %>
<div class="talkWrapMsg" nhname="nh_reply_div" id="nh_reply_div_<%= topic.id %>">
<ul> <ul>
<% replies_all.each do |message| %> <% replies_all.each do |message| %>
<% replies_all_i=replies_all_i+1 %>
<li> <li nhname="reply_rec" style="display:<%= replies_all_i>2?'none':'' %>">
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %> <%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt"> <div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %> <%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/> <br/>
<p class="fl"><%= textAreailizable message,:content,:attachments => message.attachments %></p> <div class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></div>
<input nhname="nh_content_val" value="<%= message.content %>" type="hidden"/>
<br/> <br/><div class="cl"></div>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span> <span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to( <%= link_to(
@ -168,6 +145,13 @@
:title => l(:button_delete), :title => l(:button_delete),
:class => ' c_dblue fr' :class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %> ) if message.course_destroyable_by?(User.current) %>
<%= link_to(
l(:button_reply),
'javascript:;',
:nhname =>'showbtn_child_reply',
:class => ' c_dblue fr',
:style => 'margin-right: 10px;',
:title => l(:button_reply)) if !topic.locked? && authorize_for('messages', 'reply') %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -175,11 +159,14 @@
<% end %> <% end %>
</ul> </ul>
</div> </div>
<%if replies_all.first %> <%if topic.replies_count>2 %>
<div class="talkWrapMsg"><a class=" ml258" id="showgithelp<%= topic.id%>" value="show_help" onclick ="showhelpAndScrollToMessage('talkWrapMsg<%= topic.id %>','#showgithelp<%= topic.id%>','<%=topic.replies_count%>'); " class="c_dblue lh23">展开回复(<%= topic.replies_count.to_s%>)</a></div> <div class="talkWrapMsg"><a nhname="reply_ex_btn" data-count="<%= topic.replies_count %>" data-init="0" class=" ml258" href="javascript:void(0)" id="showgithelp<%= topic.id%>" value="show_help" class="c_dblue lh23" style="color: #0781b4;" >展开回复(<%= topic.replies_count.to_s%>)</a></div>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="cl"></div>
</div><!--讨论主类容 end-->
<% end %> <% end %>
<% else %> <% else %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata"><%= l(:label_no_data) %></p>
@ -196,3 +183,81 @@
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@course}: #{@board}") %> <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@course}: #{@board}") %>
<% end %> <% end %>
</div>
<div style="display:none;"><a href="#" id="nhjump"></a></div>
<script type="text/javascript">
$(function(){
$(".talkmain_box").each(function(){
var target = $("li[nhname='reply_rec']",$(this));
var btn = $("a[nhname='reply_ex_btn']",$(this));
var jumpobj = $("div[nhname='nh_reply_div']",$(this));
btn.click(function(){
if($(this).data('init')=='0'){
$(this).data('init',1);
$(this).html('收起回复('+$(this).data('count')+')');
target.show();
}else{
$(this).data('init',0);
$(this).html('展开回复('+$(this).data('count')+')');
target.hide();
target.eq(0).show();
target.eq(1).show();
$("#nhjump").attr('href','#'+jumpobj.attr('id'));
$("#nhjump")[0].click();
}
});
});
KindEditor.ready(function(K){
$("div[nhname='container_board']").each(function(){
var container = $(this);
var about_talk = $("div[nhname='about_talk']",container);
var params = ({
kindutil:K,
showbtn:$("a[nhname='showbtn']",container),
about_talk:about_talk,
inputsubject:$("input[nhname='inputsubject']",about_talk),
subjectmsg:$("p[nhname='subjectmsg']",about_talk),
textarea:$("textarea[nhname='textarea']",about_talk),
contentmsg:$("p[nhname='contentmsg']",about_talk),
submitbtn:$("a[nhname='submitbtn']",about_talk),
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
form:$("form[nhname='form']",about_talk),
toolbar_container:$("div[nhname='toolbar_container']",about_talk),
init_content_val:$("input[nhname='init_content_val']",about_talk)
});
nh_init_board(params);
});
$("div[mhname='container_board_reply']").each(function(){
var container = $(this);
var about_talk = $("div[nhname='about_talk_reply']",container);
var params = {
type:'reply',
kindutil:K,
showbtn:$("a[nhname='showbtn_reply']",container),
showbtn_child:$("a[nhname='showbtn_child_reply']",container),
about_talk:about_talk,
inputsubject:$("input[nhname='inputsubject']",about_talk),
subjectmsg:$("p[nhname='subjectmsg']",about_talk),
textarea:$("textarea[nhname='textarea']",about_talk),
contentmsg:$("p[nhname='contentmsg']",about_talk),
submitbtn:$("a[nhname='submitbtn']",about_talk),
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
form:$("form[nhname='form']",about_talk),
quote_show:$("div[nhname='quote_show']",about_talk),
quote_input:$("textarea[nhname='quote_input']",about_talk),
toolbar_container:$("div[nhname='toolbar_container']",about_talk),
jumphref:$("#nhjump")
};
params.get_ref_str_call=function(btn){
var div = btn.parent('div');
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'</blockquote>';
return str;
}
nh_init_board(params);
});
<% if(!@flag.nil? && @flag=='true') %>
if($("#new_topic_btn")!=undefined)$("#new_topic_btn").click();
<% end %>
});
});
</script>

View File

@ -2,18 +2,19 @@
<% if topic.project %> <% if topic.project %>
<%#= board_breadcrumb(@message) %> <%#= board_breadcrumb(@message) %>
<!--<h3><%#= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%#=h @topic.subject %></span></h3>--> <!--<h3><%#= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%#=h @topic.subject %></span></h3>-->
<div class="talk_new ml15" name='containerxxoo'> <div class="talk_new ml15">
<ul> <ul>
<%= form_for topic, { :as => :message, <%= form_for topic, { :as => :message,
:url => {:controller => 'messages',:action => 'edit', :is_board => 'true',:id => topic.id, :board_id => topic.board_id}, :url => {:controller => 'messages',:action => 'edit', :is_board => 'true',:id => topic.id, :board_id => topic.board_id},
:html => {:multipart => true, :name=>'message-form', :html => {:multipart => true, :name=>'message-form',
:id => 'message-form' + topic.id.to_s, :id => 'message-form' + topic.id.to_s,
:method => :post} :method => :post,:nhname=>'form'}
} do |f| %> } do |f| %>
<%= render :partial => 'form_project', <%= render :partial => 'form_project',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<a href="javascript:void(0)" name='submitbtn' class="blue_btn fl c_white" ><%= l(:button_submit)%></a> <div class="ml55 fl" nhname="toolbar_container"></div>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white" ><%= l(:button_submit)%></a>
<%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %> <%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %>
</ul> </ul>
</div> </div>
@ -25,14 +26,15 @@
<%= form_for topic, { <%= form_for topic, {
:as => :message, :as => :message,
:url => {:controller => 'messages',:action => 'edit', :is_board => 'true',:id => topic.id, :board_id => topic.board_id}, :url => {:controller => 'messages',:action => 'edit', :is_board => 'true',:id => topic.id, :board_id => topic.board_id},
:html => {:multipart => true, :html => {:multipart => true, :name=>'message-form',
:id => 'message-form' + topic.id.to_s, :id => 'message-form' + topic.id.to_s,
:method => :post} :method => :post,:nhname=>'form'}
} do |f| %> } do |f| %>
<%= render :partial => 'form_course', <%= render :partial => 'form_course',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<a href="javascript:void(0)" onclick="submitProjectsBoard('<%= topic.id%>');"class="blue_btn fl c_white"><%= l(:button_submit)%></a> <div class="ml55 fl" nhname="toolbar_container"></div>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white"><%= l(:button_submit)%></a>
<% end %> <% end %>
</ul> </ul>

View File

@ -5,19 +5,19 @@
<li style="display: none"> <li style="display: none">
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585", :nhname=>'inputsubject' }.merge(extra_option) %>
<p id="subject_span<%= topic.id%>" class="ml55"></p> <p nhname="subjectmsg" class="ml55"></p>
</li> </li>
<% else %> <% else %>
<li > <li >
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585", :nhname=>'inputsubject' }.merge(extra_option) %>
<p id="subject_span<%= f.object.id%>" class="ml55"></p> <p nhname="subjectmsg" class="ml55"></p>
</li> </li>
<% end %> <% end %>
<li class="ml60 mb5"> <li class="ml60 mb5">
@ -34,18 +34,42 @@
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<li> <li>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div> <div nhname="quote_show" id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<% unless replying %> <% unless replying %>
<label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label> <label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label>
<% end %> <% end %>
<%= text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none',:nhname=>"quote_input" %>
<div class="content">
<% if replying%> <% if replying%>
<%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
<%= f.text_area :content,
:width => '89%',
:height => 300,
:id => "message_content#{f.object.id}",
:nhname => 'textarea',
:onkeyup => "regexContent('#{f.object.id}');",
:class => 'talk_text fl',
:placeholder => "最多3000个汉字(或6000个英文字符)",
:maxlength => 5000 %>
<% else %> <% else %>
<%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> <input nhname="init_content_val" value="<%=topic.content%>" type="hidden"/>
<%= f.text_area :content,
:width => '90%',
:height => 300,
:class => 'talk_text fl',
:editor_id => "message_content#{f.object.id}_edit",
:id => "message_content#{f.object.id}",
:onkeyup => "regexContent('#{f.object.id}');",
:class => 'talk_text fl',
:nhname => 'textarea',
:placeholder => "最多3000个汉字(或6000个英文字符)",
:maxlength => 5000 %>
<% end %> <% end %>
</div>
<div class="cl"></div> <div class="cl"></div>
<p id="message_content_span<%= f.object.id%>" class="ml55"></p> <p id="message_content_span<%= f.object.id%>" nhname="contentmsg" class="ml55"></p>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li> <li>

View File

@ -1,4 +1,3 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
<style> <style>
.comment{ .comment{
position: relative; position: relative;
@ -15,22 +14,22 @@
<% replying ||= false %> <% replying ||= false %>
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %> <% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
<% if replying %> <% if replying %>
<li style="display: none"> <li style="display: none;">
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}",:class=>"talk_input w585", :nhname=>'inputsubject' }.merge(extra_option) %>
<p id="subject_span<%= f.object.id%>" class="ml55"></p> <p nhname="subjectmsg" class="ml55"></p>
</li> </li>
<% else %> <% else %>
<li> <li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", :class=>"talk_input w585", :nhname=>'inputsubject' }.merge(extra_option) %>
<p id="subject_span<%= f.object.id%>" class="ml55"></p> <p nhname="subjectmsg" class="ml55"></p>
</li> </li>
<% end %> <% end %>
<li class="ml60 mb5"> <li class="ml60 mb5">
@ -47,25 +46,27 @@
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<li> <li>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div> <div nhname="quote_show" id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<% unless replying %> <% unless replying %>
<label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label> <label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label>
<% end %> <% end %>
<%= f.text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none',:nhname=>"quote_input" %>
<div class="content">
<div class="content <%= replying ? '':'ml55' %>">
<% if replying%> <% if replying%>
<%= f.text_area :content, <%= f.text_area :content,
:width => '89%', :width => '89%',
:height => 300, :height => 300,
:id => "message_content#{f.object.id}", :id => "message_content#{f.object.id}",
:name => 'content', :nhname => 'textarea',
:onkeyup => "regexContent('#{f.object.id}');", :onkeyup => "regexContent('#{f.object.id}');",
:class => 'talk_text fl', :class => 'talk_text fl',
:placeholder => "最多3000个汉字(或6000个英文字符)", :placeholder => "最多3000个汉字(或6000个英文字符)",
:maxlength => 5000 %> :maxlength => 5000 %>
<% else %> <% else %>
<input nhname="init_content_val" value="<%=topic.content%>" type="hidden"/>
<%= f.text_area :content, <%= f.text_area :content,
:width => '90%', :width => '90%',
:height => 300, :height => 300,
@ -74,14 +75,18 @@
:id => "message_content#{f.object.id}", :id => "message_content#{f.object.id}",
:onkeyup => "regexContent('#{f.object.id}');", :onkeyup => "regexContent('#{f.object.id}');",
:class => 'talk_text fl', :class => 'talk_text fl',
:name => 'content', :nhname => 'textarea',
:placeholder => "最多3000个汉字(或6000个英文字符)", :placeholder => "最多3000个汉字(或6000个英文字符)",
:maxlength => 5000 %> :maxlength => 5000 %>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<p id="message_content_span<%= f.object.id%>" class="ml55"></p> <% if replying%>
<p nhname="contentmsg"></p>
<% else %>
<p nhname="contentmsg" class="ml55"></p>
<%end %>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li> <li>

View File

@ -1,10 +1,11 @@
<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message-form', :name=>'message-form'} do |f| %> <%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},:html => {:nhname=>'form', :multipart => true, :id => 'message-form', :name=>'message-form'} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :topic => @message} %> <%= render :partial => 'form_project', :locals => {:f => f, :topic => @message} %>
<li> <li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a> <div class="ml55 fl" nhname="toolbar_container"></div>
<a href="javascript:void(0)" nhname="cancelbtn" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="javascript:;" name="submitbtn" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a> <a href="javascript:void(0)" nhname="submitbtn" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>

View File

@ -1,3 +1,4 @@
<div nhname="container_board">
<div class="project_r_h" xmlns="http://www.w3.org/1999/html"> <div class="project_r_h" xmlns="http://www.w3.org/1999/html">
<h2 class="project_h2 fl"> <h2 class="project_h2 fl">
<% if User.current.language == "zh"%> <% if User.current.language == "zh"%>
@ -5,47 +6,46 @@
<% else %> <% else %>
<%= l(:project_module_boards) %> <%= l(:project_module_boards) %>
<% end %> <% end %>
</h2> </h2>
<a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a> <% if User.current.logged? %>
<a href="javascript:void(0)" class="green_btn fr newtalk " id="new_topic_btn" nhname="showbtn"><%= l(:label_message_new) %></a>
<% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<!--display the board-->
<% if !User.current.logged? %> <% if !User.current.logged? %>
<div class="c_grey f14"> <div class="c_grey f14">
<%= l(:label_user_login_project_board) %> <%= l(:label_user_login_project_board) %>
<%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %> <%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %>
</div> </div>
<% end %> <% end %>
<!-- 发布新帖部分 -->
<div class="cl"></div> <div class="cl"></div>
<div class=" talklist_box" > <div class=" talklist_box" >
<div class="talk_new ml15 mb10" name="containerxxoo" id="about_newtalk" style="display:<%= !@flag.nil? && @flag=='true' ? 'block' : 'none' %>;"> <div class="talk_new ml15 mb10" nhname="about_talk" style="display:none;">
<ul> <ul>
<%= render :partial => 'project_new_topic' %> <%= render :partial => 'project_new_topic' %>
</ul> </ul>
</div><!--talknew end--> </div><!--talknew end-->
</div>
<!-- 帖子内容显示 --> </div>
<div class=" talklist_box" >
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p> <p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<div class="talkmain_box" id="topic<%= topic.id %>" nhname="container_board" mhname="container_board_reply" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;">
<div class="talkmain_box" id="topic<%= topic.id %>" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5"> <div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %> <% author = topic.author.to_s %>
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %> <div style="max-width:60px;white-space:nowrap;overflow:hidden;float:left;text-overflow:ellipsis;">
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl ",:title=>author,
:style=>'max-width:60px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;' %>
</div>
<p style="float:left;color:#ff5722;">&nbsp;&nbsp;:</p>
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p> <p class="talkmain_tit fl fb break_word" title="<%= h(topic.subject) %>" style="width:auto;float:left;max-width:415px;white-space:nowrap;overflow:hidden;float:left;text-overflow:ellipsis;">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<div style="float:right;max-width:110px;">
<% if topic.editable_by?(User.current) %> <% if topic.editable_by?(User.current) %>
<a href="javascript:void(0)" nhname="showbtn" style="color: #426e9a;float: right;margin-right: 10px;"><%= l(:button_edit) %></a>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
margin-right: 10px;"><%= l(:button_edit) %></a>
<% end %> <% end %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
{:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'},
@ -54,124 +54,75 @@
:class => 'talk_edit fr', :class => 'talk_edit fr',
:style => ' margin-right: 10px;' :style => ' margin-right: 10px;'
) if topic.destroyable_by?(User.current) %> ) if topic.destroyable_by?(User.current) %>
<% if topic.sticky? %> <% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a> <a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %> <% end %>
<div class="cl"></div>
<script> <script>
$(function(){if($("#contentmessage<%=topic.id %>").height()>55){$("#project_show_<%= topic.id%>").show();}}); $(function(){if($("#contentmessage<%=topic.id %>").height()>182){$("#project_show_<%= topic.id%>").show();}});
</script> </script>
</div>
<div class="cl"></div>
<div class="project_board_content break_word" id="content_<%=topic.id%>"> <div class="project_board_content break_word" id="content_<%=topic.id%>">
<div id="contentmessage<%=topic.id %>" class="upload_img"> <div id="contentmessage<%=topic.id %>" class="upload_img">
<%= topic.content %> <%= topic.content.html_safe %>
</div> </div>
</div> </div>
<p style="display: none;" id="project_show_<%= topic.id%>">
<a id="expend_more_information<%= topic.id%>" style="color: #0781b4;" href="javascript:void(0)" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</a>
<p style="display: none" id="project_show_<%= topic.id%>">
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
<span class="g-arr-down"> <span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" /> <img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span> </span>
</p> </p>
<%= link_to_attachments_course topic, :author => false %> <%= link_to_attachments_course topic, :author => false %>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %> <%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
</div> </div>
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => "about_newtalk#{topic.id}",:class => ' c_dblue fr' %> <% if User.current.logged? %>
<a href="javascript:void(0)" nhname="showbtn_reply" class="c_dblue fr" style="margin-right:10px;"><%= l(:button_reply) %></a>
<% end %>
<div class="cl"></div> <div class="cl"></div>
<div class="talk_new ml15 mb10" nhname='about_talk' id="about_newtalk<%=topic.id%>" style="display: none">
</div><!--讨论主类容 end-->
<div class="talk_new ml15 mb10" id="about_newtalk<%=topic.id%>" style="display: none">
<ul> <ul>
<%= render :partial => 'edit',locals: {:topic => topic} %> <%= render :partial => 'edit',locals: {:topic => topic} %>
</ul> </ul>
</div> </div>
<div class="cl"></div>
<div class="talkWrapBox"> <div class="talkWrapBox">
<% reply = Message.new(:subject => "RE: #{@message.subject}")%> <% reply = Message.new(:subject => "RE: #{topic.subject}")%>
<% if !topic.locked? && authorize_for('messages', 'reply') %> <% if !topic.locked? && authorize_for('messages', 'reply') %>
<div class="talkWrapMsg" nhname="about_talk_reply" style="display: none;">
<em class="talkWrapArrow"></em> <em class="talkWrapArrow"></em>
<div class="cl"></div> <div class="cl"></div>
<div class="talkConIpt ml15 mb10" style="display: none" name="containerxxoo" id="reply<%= topic.id %>"> <div class="talkConIpt ml15 mb10" style="margin-left:30px;" id="reply<%= topic.id %>">
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %> <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'},
:html => {:nhname=>"form",:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %> <div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
<a href="javascript:(0)" name="submitbtn" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a> <div style="padding-top:5px;" class="fr">
<a href="javascript:void(0)" nhname="cancelbtn" class="grey_btn fr ml10" style=""><%= l(:button_cancel)%></a>
<a href="javascript:void(0)" nhname="submitbtn" class="blue_btn fr " style=""><%= l(:button_submit)%></a>
</div>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %>
<% replies_all = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.id asc").offset(2).
all %>
<% replies_show = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.id asc").limit(2).
all %>
<% unless replies_show.empty? %>
<% reply_count = 0 %>
<div class="talkWrapMsg">
<ul>
<% replies_show.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
<%= link_to(
l(:button_quote),
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:class => ' c_dblue fr',
:style => 'margin-right: 10px;',
:remote => true,
:method => 'get',
:onclick => "$('#reply#{topic.id}').slideToggle(); return false;",
:focus => "about_newtalk#{topic.id}",
:title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %>
</div> </div>
<% end %>
<div class="cl"></div> <div class="cl"></div>
<% replies_all = topic.children.includes(:author, :attachments, {:board => :project}).
</li><!---留言内容--> reorder("#{Message.table_name}.id desc").all %>
<% end %> <% unless replies_all.empty? %>
</ul> <div class="talkWrapMsg" nhname="nh_reply_div" id="nh_reply_div_<%= topic.id %>">
</div>
<div class="talkWrapMsg" id="talkWrapMsg<%= topic.id %>" style="display: none">
<ul> <ul>
<% replies_all_i = 0 %>
<% replies_all.each do |message| %> <% replies_all.each do |message| %>
<% replies_all_i=replies_all_i+1 %>
<li> <li nhname="reply_rec" style="display:<%= replies_all_i>2?'none':'' %>">
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %> <%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt"> <div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %> <%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/> <br/>
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p> <div class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></div>
<input nhname="nh_content_val" type="hidden" value="<%= message.content %>"/>
<br/> <br/><div class="cl"></div>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span> <span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to( <%= link_to(
@ -180,31 +131,29 @@
:method => :post, :method => :post,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete), :title => l(:button_delete),
:class => ' c_dblue fr' :class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %> ) if message.course_destroyable_by?(User.current) %>
<%= link_to( <%= link_to(
l(:button_quote), l(:button_reply),
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id, :is_board => 'true'}, 'javascript:;',
:remote => true, :nhname =>'showbtn_child_reply',
:method => 'get',
:focus => "about_newtalk#{topic.id}",
:class => ' c_dblue fr', :class => ' c_dblue fr',
:style => 'margin-right: 10px;', :style => 'margin-right: 10px;',
:title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %> :title => l(:button_reply)) if !topic.locked? && authorize_for('messages', 'reply') %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li>
</li><!---留言内容-->
<% end %> <% end %>
</ul> </ul>
</div> </div>
<%if replies_all.first %> <%if topic.replies_count>2 %>
<div class="talkWrapMsg"><a class=" c_blue ml258" id="showgithelp<%= topic.id%>" value="show_help" onclick ="showhelpAndScrollToMessage('talkWrapMsg<%= topic.id %>','#showgithelp<%= topic.id%>','<%=topic.replies_count%>'); " class="c_dblue lh23">展开回复(<%= topic.replies_count.to_s%>)</a></div> <div class="talkWrapMsg">
<a nhname="reply_ex_btn" data-count="<%= topic.replies_count %>" data-init="0" href="javascript:void(0)" class="ml258 c_dblue lh23">展开回复(<%= topic.replies_count.to_s%>)</a>
</div>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
</div>
<% end %> <% end %>
<% else %> <% else %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata"><%= l(:label_no_data) %></p>
@ -217,54 +166,86 @@
<%# other_formats_links do |f| %> <%# other_formats_links do |f| %>
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<%# end %> <%# end %>
<% html_title @board.name %> <% html_title @board.name %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %> <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
<% end %> <% end %>
</div> </div>
<script type="text/javascript"> <div style="display:none;"><a href="#" id="nhjump"></a></div>
// var flag = false;
// jQuery(document).ready(function($) {
// transpotUrl('#content');
// });
function submit_message_replay()
{
if(flag)
{
$("#message_form").submit();
}
}
</script>
<script type="text/javascript"> <script type="text/javascript">
//submitProjectsBoard() $(function(){
$(".talkmain_box").each(function(){
var target = $("li[nhname='reply_rec']",$(this));
var btn = $("a[nhname='reply_ex_btn']",$(this));
var jumpobj = $("div[nhname='nh_reply_div']",$(this));
btn.click(function(){
if($(this).data('init')=='0'){
$(this).data('init',1);
$(this).html('收起回复('+$(this).data('count')+')');
target.show();
}else{
$(this).data('init',0);
$(this).html('展开回复('+$(this).data('count')+')');
target.hide();
target.eq(0).show();
target.eq(1).show();
$("#nhjump").attr('href','#'+jumpobj.attr('id'));
$("#nhjump")[0].click();
}
});
});
KindEditor.ready(function(K){ KindEditor.ready(function(K){
$("div[name='containerxxoo']").each(function(){ $("div[nhname='container_board']").each(function(){
var container = $(this); var container = $(this);
var about_talk = $("div[nhname='about_talk']",container);
var textarea= $("textarea[name='content']",container); var params = ({
var editor = K.create(textarea, { kindutil:K,
resizeType : 1, showbtn:$("a[nhname='showbtn']",container),
allowPreviewEmoticons : false, about_talk:about_talk,
allowImageUpload : false, inputsubject:$("input[nhname='inputsubject']",about_talk),
width:"89%", subjectmsg:$("p[nhname='subjectmsg']",about_talk),
items : ['emoticons'] textarea:$("textarea[nhname='textarea']",about_talk),
contentmsg:$("p[nhname='contentmsg']",about_talk),
submitbtn:$("a[nhname='submitbtn']",about_talk),
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
form:$("form[nhname='form']",about_talk),
toolbar_container:$("div[nhname='toolbar_container']",about_talk),
init_content_val:$("input[nhname='init_content_val']",about_talk)
}); });
nh_init_board(params);
$("a[name='submitbtn']",container).click(function(){ });
textarea[0].value = editor.html(); $("div[mhname='container_board_reply']").each(function(){
var id = textarea[0].id.toString().substr(15); var container = $(this);
var about_talk = $("div[nhname='about_talk_reply']",container);
if(this.parentNode.name == 'message-form') { var params = {
this.parentNode.submit(); type:'reply',
kindutil:K,
showbtn:$("a[nhname='showbtn_reply']",container),
showbtn_child:$("a[nhname='showbtn_child_reply']",container),
about_talk:about_talk,
inputsubject:$("input[nhname='inputsubject']",about_talk),
subjectmsg:$("p[nhname='subjectmsg']",about_talk),
textarea:$("textarea[nhname='textarea']",about_talk),
contentmsg:$("p[nhname='contentmsg']",about_talk),
submitbtn:$("a[nhname='submitbtn']",about_talk),
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
form:$("form[nhname='form']",about_talk),
quote_show:$("div[nhname='quote_show']",about_talk),
quote_input:$("textarea[nhname='quote_input']",about_talk),
toolbar_container:$("div[nhname='toolbar_container']",about_talk),
jumphref:$("#nhjump")
};
params.get_ref_str_call=function(btn){
var div = btn.parent('div');
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'</blockquote>';
return str;
} }
else nh_init_board(params);
this.parentNode.parentNode.submit();
}); });
<% if(!@flag.nil? && @flag=='true') %>
if($("#new_topic_btn")!=undefined)$("#new_topic_btn").click();
<% end %>
}); });
}); });
</script> </script>

View File

@ -1,3 +1,13 @@
<style>
.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
.ke-toolbar-icon-url{background-image:url( '/images/public_icon.png' )}
.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
.ke-toolbar .ke-outline{border:none;}
.break_word {width:100%;}
</style>
<script type="text/javascript"> <script type="text/javascript">
//头部导航 //头部导航
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
@ -21,54 +31,182 @@
else if (window.attachEvent) else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus) window.attachEvent("onload", buildsubmenus)
</script> </script>
<%= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
<script type="text/javascript">//侧导航
window.onload = function () {
var topic_id = getParam('topic_id');
document.getElementById(topic_id).focus();
}
var getParam = function(name){
var search = document.location.search;
var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
var matcher = pattern.exec(search);
var items = null;
if(null != matcher){
try{
items = decodeURIComponent(decodeURIComponent(matcher[1]));
}catch(e){
try{
items = decodeURIComponent(matcher[1]);
}catch(e){
items = matcher[1];
}
}
}
return items;
};
function show_newtalk()
{
$("#about_newtalk").toggle();
}
function show_newtalk1(id)
{
$(id).toggle();
}
</script>
<% if @project %> <% if @project %>
<%= render :partial => 'project_show', locals: {project: @project} %> <%= render :partial => 'project_show', locals: {project: @project} %>
<% elsif @course %> <% elsif @course %>
<%= render :partial => 'course_show', locals: {course: @course} %> <%= render :partial => 'course_show', locals: {course: @course} %>
<% end %> <% end %>
<script type="text/javascript">//侧导航
//window.onload = function () {
// var topic_id = getParam('topic_id');
// document.getElementById(topic_id).focus();
//}
//
//var getParam = function(name){
// var search = document.location.search;
// var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
// var matcher = pattern.exec(search);
// var items = null;
// if(null != matcher){
// try{
// items = decodeURIComponent(decodeURIComponent(matcher[1]));
// }catch(e){
// try{
// items = decodeURIComponent(matcher[1]);
// }catch(e){
// items = matcher[1];
// }
// }
// }
// return items;
//};
//
//function show_newtalk()
//{
// $("#about_newtalk").toggle();
//
//
//
//}
//
//function show_newtalk1(id)
//{
// $(id).toggle();
// $(id).focus();
//
//
//}
function nh_check_field(params){
var result=true;
if(params.subject!=undefined){
if($.trim(params.subject.val()) == ""){
params.subjectmsg.html('主题不能为空');
params.subjectmsg.css({color:'#ff0000'});
result=false;
}else{
params.subjectmsg.html('填写正确');
params.subjectmsg.css({color:'#008000'});
}
params.subjectmsg.show();
}
if(params.content!=undefined){
if(params.content.isEmpty()){
result=false;
}
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html());
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
}else{
params.contentmsg.html('填写正确');
params.contentmsg.css({color:'#008000'});
}
params.contentmsg.show();
}
}
return result;
}
function nh_init_board(params){
//发帖/编辑/回复按钮的click
params.showbtn.click(function(){
if(params.textarea.data('init') == undefined){
//初始化编辑器
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
minWidth:"1px",
width:"565px",
items : ['emoticons'],
afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.about_talk);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
}
});
//主题输入框按键事件
params.inputsubject.keyup(function(){
nh_check_field({subject:params.inputsubject,subjectmsg:params.subjectmsg});
})
//表单提交
params.form.submit(function(){
var is_checked = nh_check_field({
issubmit:true,
subject:params.inputsubject,
subjectmsg:params.subjectmsg,
content:editor,
contentmsg:params.contentmsg,
textarea:params.textarea
});
if(is_checked){
//return true 居然不提交 fuck your sister
$(this)[0].submit();
// return true;
}
return false;
});
//提交按钮click
params.submitbtn.click(function(){
params.form.submit();
});
//取消按钮click
params.cancelbtn.click(function(){
params.about_talk.toggle();//显示/隐藏编辑区
if(params.about_talk.is(':hidden')){//隐藏时reset表单数据
params.form[0].reset();
if(params.type=='reply'){
params.textarea.empty();
}else{
params.textarea.html(params.init_content_val.val());
}
var str = params.textarea.html();
str=str.replace(new RegExp(/&lt;/g),'<');
str=str.replace(new RegExp(/&gt;/g),'>');
editor.html(str);
params.subjectmsg.hide();
params.contentmsg.hide();
if(params.quote_show!=undefined)params.quote_show.empty();
if(params.quote_input!=undefined)params.quote_input.empty();
}else{
if(params.type=='reply'){
params.jumphref.attr('href','#'+params.form.attr('id'));
params.jumphref[0].click();
}else params.inputsubject.focus();
}
});
params.textarea.data('init','1');//标记为已经初始化
}
params.cancelbtn.click();//显示/隐藏编辑区
});
if(params.type == 'reply'){
params.showbtn_child.click(function(){
if(params.textarea.data('init') == undefined){
params.showbtn.click();
}else{
params.cancelbtn.click();
if(params.about_talk.is(':hidden')){
params.cancelbtn.click();
}
}
var ref_str = params.get_ref_str_call($(this));
params.quote_show.html(ref_str);
params.quote_input.html(ref_str);
});
}
}
</script>

View File

@ -31,7 +31,7 @@
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<script> <script>
$(function(){if($("#bid_description_<%= bid.id%>_content").height()>38){$("#bid_show_more_des_button<%= bid.id%>").show();}}); $(function(){if($("#bid_description_<%= bid.id%>_content").height()>360){$("#bid_show_more_des_button<%= bid.id%>").show();}});
</script> </script>
<div id="bid_description_<%= bid.id%>" class="news_description mt5"> <div id="bid_description_<%= bid.id%>" class="news_description mt5">
<div id="bid_description_<%= bid.id%>_content" class="upload_img"> <div id="bid_description_<%= bid.id%>_content" class="upload_img">

View File

@ -1,11 +1,13 @@
<%= render :partial => "layouts/base_feedback" %> <%= render :partial => "layouts/base_feedback" %>
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;"> <div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
<div class="welcome_logo"> <div class="welcome_logo">
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px")%> <%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px")%>
</div> </div>
<div id="account"> <div id="account">
<%= render_menu :account_menu -%> <%= render_menu :account_menu -%>
</div> </div>
<% if User.current.logged? -%> <% if User.current.logged? -%>
<div id="loggedas"> <div id="loggedas">
<ul style="padding:0 0; margin:0 0;display:inline;"> <ul style="padding:0 0; margin:0 0;display:inline;">

View File

@ -3,12 +3,14 @@
<%=link_to l(:label_my_course), user_courses_user_path(User.current.id) %> <%=link_to l(:label_my_course), user_courses_user_path(User.current.id) %>
<ul class="course_sub_menu"> <ul class="course_sub_menu">
<% course_index = 0 %> <% course_index = 0 %>
<% User.current.courses.each do |course| %> <% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %> <% if !course_endTime_timeout?(course) %>
<%= render :partial => 'layouts/user_homework_list', :locals => {:course => course,:course_index => course_index} %> <%= render :partial => 'layouts/user_homework_list', :locals => {:course => course,:course_index => course_index} %>
<% course_index += 1 %> <% course_index += 1 %>
<% end %> <% end %>
<% end %> <% end %>
</ul> </ul>
</li> </li>
<% end %> <% end %>

View File

@ -23,6 +23,7 @@
<!--add by huang--> <!--add by huang-->
<body> <body>
<div id="Container"> <div id="Container">
<%= render :partial => 'layouts/new_header'%> <%= render :partial => 'layouts/new_header'%>
<div class="cl"></div> <div class="cl"></div>
@ -50,6 +51,7 @@
<% end %> <% end %>
</div> </div>
</div><!--TopBar end--> </div><!--TopBar end-->
<div id="content"> <div id="content">
<div id="LSide" class="fl"> <div id="LSide" class="fl">
<div class="project_info"> <div class="project_info">
@ -115,6 +117,7 @@
<% end %><!--end--> <% end %><!--end-->
<!--menu 左侧工具栏 --> <!--menu 左侧工具栏 -->
<%#--project_new_type: 1为开发组2为科研组3为朋友圈子--%> <%#--project_new_type: 1为开发组2为科研组3为朋友圈子--%>
<div id="project_memu_list"> <div id="project_memu_list">
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %> <% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
<%= render :partial => 'projects/development_group', :locals => {:project => @project, :attaments_num => attaments_num} %> <%= render :partial => 'projects/development_group', :locals => {:project => @project, :attaments_num => attaments_num} %>
@ -124,6 +127,7 @@
<%= render :partial => 'projects/friend_group', :locals => {:project => @project, :attaments_num => attaments_num} %> <%= render :partial => 'projects/friend_group', :locals => {:project => @project, :attaments_num => attaments_num} %>
<% end %> <% end %>
</div> </div>
<!-- end --> <!-- end -->
</div><!--项目侧导航 end--> </div><!--项目侧导航 end-->
<div class="cl"></div> <div class="cl"></div>

View File

@ -5,10 +5,9 @@
<title><%=h html_title %></title> <title><%=h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" /> <meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'public', 'pleft', 'project', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_include_tag "jquery.leanModal.min" %> <%= javascript_include_tag "jquery.leanModal.min" %>
<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
@ -18,32 +17,26 @@
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<body class="<%=h body_css_classes %>"> <body id="Container">
<div id="wrapper"> <div id="Container">
<div id="wrapper2"> <%= render :partial => 'layouts/new_header' %>
<div id="wrapper3"> <div class="cl"></div>
<%=render :partial => 'layouts/base_header'%>
<div id="main" class="nosidebar"> <div id="main" class="nosidebar">
<div id="content_"> <div id="content_">
<%= render_flash_messages %> <%= render_flash_messages %>
<%= yield %> <%= yield %>
<%= call_hook :view_layouts_base_content %> <%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div> <div style="clear:both;"></div>
<%=render :partial => 'layouts/base_footer'%> <%=render :partial => 'layouts/new_footer'%>
</div> </div>
</div> </div>
</div> </div>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span> <span><%= l(:label_loading) %></span>
<%= l(:label_loading) %>
</span>
</div> </div>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>
</div>
</div>
<%= call_hook :view_layouts_base_body_bottom %> <%= call_hook :view_layouts_base_body_bottom %>
</body> </body>
</html> </html>

View File

@ -3,10 +3,10 @@
<% end %> <% end %>
<div class="resource_sum" id="IE_resource_sum_css"> <div class="resource_sum" id="IE_resource_sum_css">
<% @attach_array.each do |k|%> <% @attach_array.each_with_index do |k, index|%>
<div class="line_block" > <div class="line_block" >
<p> <p>
<%= @str_arr.shift %> <%= @str_arr[index] %>
</p> </p>
<div class="table1"> <div class="table1">
@ -24,10 +24,12 @@
</div> </div>
<div class="table1"> <div class="table1">
<% if index == 2%>
<% k.each do |c1|%> <% k.each do |c1|%>
<div class="table_row1 <%= cycle 'odd', 'even' %>"> <div class="table_row1 <%= cycle 'odd', 'even' %>">
<div class="filename table_cell1 filename1" > <div class="filename table_cell1 filename1" >
<%= link_to c1.filename, (attachFromUrl c1), {:title => c1.filename, :target => "_blank"} %>
<%= link_to_attachment c1, {:download => true}%>
</div> </div>
<div class="table_cell1 filedown1"> <div class="table_cell1 filedown1">
<%= c1.downloads %> <%= c1.downloads %>
@ -37,6 +39,23 @@
</div> </div>
</div> </div>
<% end -%> <% end -%>
<%else%>
<% k.each do |c1|%>
<div class="table_row1 <%= cycle 'odd', 'even' %>">
<div class="filename table_cell1 filename1" >
<%= link_to c1.filename, (attachFromUrl c1), {:title => c1.filename, :target => "_blank"} %>
</div>
<div class="table_cell1 filedown1">
<%= c1.downloads %>
</div>
<div class="table_cell1 downicon1 filename download_icon" >
<%= link_to_attachment c1, {:download => true, :text => image_tag("/images/button/download.png", width: "22px", alt: l(:button_download)) }%>
</div>
</div>
<% end -%>
<% end %>
</div> </div>
</div> </div>

View File

@ -25,7 +25,7 @@
<%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %> <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
<% end %> <% end %>
(<%= course.members.count %>人) (<%= course.members.count %>人)
<% files_count = course.attachments.count %> <% files_count = visable_attachemnts_incourse(course).count %>
<% if files_count > 0%> <% if files_count > 0%>
(<%= link_to "#{files_count.to_s}份", course_files_path(course) %>公开资料) (<%= link_to "#{files_count.to_s}份", course_files_path(course) %>公开资料)
<% end %> <% end %>

View File

@ -129,6 +129,7 @@
<%# User.current.logged? ? course_count = 9 : course_count = 10 %> <%# User.current.logged? ? course_count = 9 : course_count = 10 %>
<% course_count = 9 %> <% course_count = 9 %>
<% all_new_hot_course = find_all_new_hot_course(course_count, @school_id, year_now, course_term)%> <% all_new_hot_course = find_all_new_hot_course(course_count, @school_id, year_now, course_term)%>
<% while all_new_hot_course.count < course_count%> <% while all_new_hot_course.count < course_count%>
<% if course_term == "春季学期" <% if course_term == "春季学期"
year_now -= 1 year_now -= 1
@ -139,10 +140,13 @@
<%break if Time.new.strftime("%Y").to_i - year_now >= 2%> <%break if Time.new.strftime("%Y").to_i - year_now >= 2%>
<% all_new_hot_course += find_all_new_hot_course(course_count-all_new_hot_course.count, @school_id, year_now, course_term)%> <% all_new_hot_course += find_all_new_hot_course(course_count-all_new_hot_course.count, @school_id, year_now, course_term)%>
<% end%> <% end%>
<% cache all_new_hot_course.max().created_at do %>
<%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %>
<% end %>
</ul> </ul>
</div> </div>
<% else %> <% else %>
<% if cur_school_course.count < 9 %> <% if cur_school_course.count < 9 %>
<span> <span>
<%= render :partial => 'more_course', :locals => {:school_id => nil}%> <%= render :partial => 'more_course', :locals => {:school_id => nil}%>
@ -160,6 +164,7 @@
<%= render :partial => 'no_course_title', :locals => {:course_title => l(:label_school_less_course)} %> <%= render :partial => 'no_course_title', :locals => {:course_title => l(:label_school_less_course)} %>
</li> </li>
<% all_new_hot_course = find_all_new_hot_course(9-cur_school_course.count, @school_id, year_now, course_term)%> <% all_new_hot_course = find_all_new_hot_course(9-cur_school_course.count, @school_id, year_now, course_term)%>
<% while (all_new_hot_course.count + cur_school_course.count) < 9%> <% while (all_new_hot_course.count + cur_school_course.count) < 9%>
<% if course_term == "春季学期" <% if course_term == "春季学期"
year_now -= 1 year_now -= 1
@ -170,10 +175,13 @@
<%break if Time.new.strftime("%Y").to_i - year_now >= 2%> <%break if Time.new.strftime("%Y").to_i - year_now >= 2%>
<% all_new_hot_course += find_all_new_hot_course(9-(all_new_hot_course.count + cur_school_course.count), @school_id, year_now, course_term)%> <% all_new_hot_course += find_all_new_hot_course(9-(all_new_hot_course.count + cur_school_course.count), @school_id, year_now, course_term)%>
<% end%> <% end%>
<% cache all_new_hot_course.max().created_at do %>
<%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %>
<% end %> <% end %>
<% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
</div> </div>
@ -186,10 +194,12 @@
</h3> </h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span> <span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
<% topics = find_new_forum_topics(10) %>
<%# cache topics.maximum(:created_at) do%>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% find_new_forum_topics(10).each do |topic| %>
<% topics.each do |topic| %>
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; border-bottom: 1px dashed; padding-bottom: 3px"> <li class="message-brief-intro" style="min-height: 65px; line-height:2em; border-bottom: 1px dashed; padding-bottom: 3px">
<div style="display: inline-block; width: 100%;"> <div style="display: inline-block; width: 100%;">
<span class="memo_activity text_nowrap" title="<%= topic.subject%>" <span class="memo_activity text_nowrap" title="<%= topic.subject%>"
@ -220,8 +230,10 @@
</div> </div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<%# end %>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>

View File

@ -68,7 +68,7 @@
</div> </div>
<div style="clear:both"></div> <div style="clear:both"></div>
<% cache :expire_in => 2.hours do%>
<div id="J_Slide" class="d-p-index-box d-p-index-hot"> <div id="J_Slide" class="d-p-index-box d-p-index-hot">
<h3 style="margin-left: 5px; color: #e8770d;"><strong> <%= l(:lable_hot_projects)%> </strong></h3> <h3 style="margin-left: 5px; color: #e8770d;"><strong> <%= l(:lable_hot_projects)%> </strong></h3>
<span style="margin-top: -20px;float: right; display: block;"> <% if User.current.logged? %> <span style="margin-top: -20px;float: right; display: block;"> <% if User.current.logged? %>
@ -113,7 +113,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<% end %>
<div class="right" style="float: right; width: 48%; padding-top: 8px;"> <div class="right" style="float: right; width: 48%; padding-top: 8px;">
<ul class="welcome-message-list"> <ul class="welcome-message-list">
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;"> <div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
@ -123,6 +123,7 @@
</div> </div>
<div class="welcome-box-list-new memo_activity"> <div class="welcome-box-list-new memo_activity">
<% topics = find_new_forum_topics(12) %> <% topics = find_new_forum_topics(12) %>
<% cache topics.maximum(:created_at) do%>
<% topics.includes(:forum, :last_reply, :author).each do |topic|%> <% topics.includes(:forum, :last_reply, :author).each do |topic|%>
<li class="message-brief-intro" style="line-height:1.4em;"> <li class="message-brief-intro" style="line-height:1.4em;">
<div class='memo_title text_nowrap'> <div class='memo_title text_nowrap'>
@ -151,6 +152,7 @@
</span> </span>
</div> </div>
</li> </li>
<% end %>
<% end %> <% end %>
</div> </div>
</ul> </ul>

View File

@ -0,0 +1,3 @@
if Rails.env.production?
config.cache_store = :redis_store, 'redis://localhost:6379/0/cache', { expires_in: 90.minutes }
end

View File

@ -1,10 +0,0 @@
# Copy this file to additional_environment.rb and add any statements
# that need to be passed to the Rails::Initializer. `config` is
# available in this context.
#
# Example:
#
# config.log_level = :debug
# ...
#

View File

@ -31,7 +31,7 @@ module RedmineApp
end end
# Custom directories with classes and modules you want to be autoloadable. # Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += %W(#{config.root}/lib) config.autoload_paths += %W(#{config.root}/lib)
config.autoload_paths += %w(#{RAILS_ROOT}/app/sweepers)
# Only load the plugins named here, in the order given (default is alphabetical). # Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named. # :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ] # config.plugins = [ :exception_notification, :ssl_requirement, :all ]

View File

@ -90,7 +90,6 @@ default:
user_name: "huang.jingquan@163.com" user_name: "huang.jingquan@163.com"
password: 'xinhu1ji2qu366' password: 'xinhu1ji2qu366'
cookie_domain: ".trustie.net"
# Absolute path to the directory where attachments are stored. # Absolute path to the directory where attachments are stored.
# The default is the 'files' directory in your Redmine instance. # The default is the 'files' directory in your Redmine instance.
# Your Redmine instance needs to have write permission on this # Your Redmine instance needs to have write permission on this
@ -104,7 +103,7 @@ default:
# autologin_cookie_name: the name of the cookie (default: autologin) # autologin_cookie_name: the name of the cookie (default: autologin)
# autologin_cookie_path: the cookie path (default: /) # autologin_cookie_path: the cookie path (default: /)
# autologin_cookie_secure: true sets the cookie secure flag (default: false) # autologin_cookie_secure: true sets the cookie secure flag (default: false)
autologin_cookie_name: autologin_cookie_name: "autologin_trustie"
autologin_cookie_path: autologin_cookie_path:
autologin_cookie_secure: autologin_cookie_secure:
@ -201,7 +200,7 @@ default:
# specific configuration options for production environment # specific configuration options for production environment
# that overrides the default ones # that overrides the default ones
production: production:
# CJK support cookie_domain: ".trustie.net"
rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
email_delivery: email_delivery:
delivery_method: :smtp delivery_method: :smtp

View File

@ -10,8 +10,9 @@ RedmineApp::Application.configure do
config.logger = Logger.new('log/development.log', 'daily') # daily, weekly or monthly config.logger = Logger.new('log/development.log', 'daily') # daily, weekly or monthly
# Show full error reports and disable caching # Show full error reports and disable caching
config.consider_all_requests_local = true config.consider_all_requests_local = true
config.action_controller.perform_caching = false config.action_controller.perform_caching = true
config.cache_store = :file_store, "#{Rails.root }/files/cache_store/" config.cache_store = :file_store, "#{Rails.root }/files/cache_store/"
#config.cache_store = :dalli_store
# Don't care if the mailer can't send # Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true config.action_mailer.raise_delivery_errors = true

View File

@ -0,0 +1 @@
$redis = Redis.new(:host => "127.0.0.1", :port => 6379)

View File

@ -342,6 +342,7 @@ zh:
label_invite_trustie_user_tips: "输入姓名、邮箱、昵称" label_invite_trustie_user_tips: "输入姓名、邮箱、昵称"
label_user_role_null: 用户和角色不能留空! label_user_role_null: 用户和角色不能留空!
label_invite_project: 邀请您加入项目 label_invite_project: 邀请您加入项目
label_mail_invite_success: 您已成功加入项目!
label_invite_success: 邀请成功 label_invite_success: 邀请成功
label_invite_members: 邀请用户 label_invite_members: 邀请用户
# #

View File

@ -0,0 +1,10 @@
class CreateInviteLists < ActiveRecord::Migration
def change
create_table :invite_lists do |t|
t.integer :project_id
t.integer :user_id
t.timestamps
end
end
end

View File

@ -438,13 +438,6 @@ ActiveRecord::Schema.define(:version => 20150514133640) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
create_table "discuss_demos", :force => true do |t|
t.string "title"
t.text "body"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "documents", :force => true do |t| create_table "documents", :force => true do |t|
t.integer "project_id", :default => 0, :null => false t.integer "project_id", :default => 0, :null => false
t.integer "category_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false
@ -659,16 +652,6 @@ ActiveRecord::Schema.define(:version => 20150514133640) do
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
create_table "journal_details_copy", :force => true do |t|
t.integer "journal_id", :default => 0, :null => false
t.string "property", :limit => 30, :default => "", :null => false
t.string "prop_key", :limit => 30, :default => "", :null => false
t.text "old_value"
t.text "value"
end
add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
create_table "journal_replies", :id => false, :force => true do |t| create_table "journal_replies", :id => false, :force => true do |t|
t.integer "journal_id" t.integer "journal_id"
t.integer "user_id" t.integer "user_id"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -67,15 +67,34 @@ function show_more_reply(contentid, id2, id3) {
if (val == "show_more") { if (val == "show_more") {
$(id2).text("[收起]"); $(id2).text("[收起]");
information.attr("value", "hide_more"); information.attr("value", "hide_more");
information.attr("style", "color:#3ca5c6");
arrow.attr("src", "/images/jiantouup.jpg") arrow.attr("src", "/images/jiantouup.jpg")
} }
else { else {
$(id2).text("[展开]"); $(id2).text("[展开]");
information.attr("value", "show_more"); information.attr("value", "show_more");
arrow.attr("src", "/images/jiantou.jpg") arrow.attr("src", "/images/jiantou.jpg")
information.attr("style", "color:#0781b4;");
}
}
function show_more_reply1(contentid, id2, id3) {
$(contentid).toggleClass("course_description_none");
var information = $(id2);
var arrow = $(id3);
var val = information.attr("value");
if (val == "show_more") {
$(id2).text("[收起]");
information.attr("value", "hide_more");
information.attr("style", "color:#3ca5c6");
arrow.attr("src", "/images/jiantouup.jpg")
}
else {
$(id2).text("[展开]");
information.attr("value", "show_more");
arrow.attr("src", "/images/jiantou.jpg")
information.attr("style", "color:#0781b4;");
} }
} }
//项目版本库git帮助文档显示 //项目版本库git帮助文档显示
function showhelpAndScrollTo(id) { function showhelpAndScrollTo(id) {
$('#' + id).toggle(); $('#' + id).toggle();
@ -116,11 +135,13 @@ function showhelpAndScrollToMessage(id, id1, count) {
{ {
$(id1).text("收起回复(" + count + ")" ); $(id1).text("收起回复(" + count + ")" );
information.attr("value", "hide_help"); information.attr("value", "hide_help");
information.attr("style", "color:#3ca5c6");
} }
else else
{ {
$(id1).text("展开回复(" + count + ")"); $(id1).text("展开回复(" + count + ")");
information.attr("value", "show_help"); information.attr("value", "show_help");
information.attr("style", "color:#0781b4;");
} }
} }

View File

@ -19,7 +19,7 @@ a:hover.project_name{ color:#016f33;}
a.project_txt02{ color:#0781b4; width:618px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a.project_txt02{ color:#0781b4; width:618px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
a:hover.project_txt{ color:#066e9a;} a:hover.project_txt{ color:#066e9a;}
.noline{ border-bottom:none;} .noline{ border-bottom:none;}
.news_description{max-height: 38px;overflow:hidden; } .news_description{max-height: 360px;overflow:hidden; }
.news_description_none{max-height: none;} .news_description_none{max-height: none;}
a.news_foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:600px; height:20px; padding-top:3px; cursor:pointer;} a.news_foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:600px; height:20px; padding-top:3px; cursor:pointer;}
a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}

View File

@ -45,7 +45,8 @@ a:hover.subnav_green{ background:#14ad5a;}
/*简介*/ /*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;} .project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;} .course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.project_board_content{overflow: hidden;max-height: 55px;word-break: break-all;word-wrap: break-word;} .project_board_content{overflow: hidden;max-height: 182px;word-break: break-all;word-wrap: break-word;}
.project_board_content1{overflow: hidden;max-height: 72px;word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;} .course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;} .lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;} .lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}

View File

@ -49,7 +49,8 @@ a:hover.subnav_green{ background:#14ad5a;}
/*简介*/ /*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;} .project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;} .course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.project_board_content{overflow: hidden;max-height: 55px;word-break: break-all;word-wrap: break-word;} .project_board_content{overflow: hidden;max-height: 182px;word-break: break-all;word-wrap: break-word;}
.project_board_content1{overflow: hidden;max-height: 72px;word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;} .course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;} .lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;} .lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}

View File

@ -0,0 +1,7 @@
FactoryGirl.define do
factory :invite_list do
project_id 1
user_id 1
end
end

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe InviteList, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end