改留言

This commit is contained in:
yanxd 2014-03-07 16:49:45 +08:00
parent 8963cc3a3c
commit ce1e6c49f1
5 changed files with 26 additions and 9 deletions

View File

@ -150,6 +150,7 @@ class AttachmentsController < ApplicationController
attach_copied_obj = ori.copy
attach_copied_obj.container = obj
attach_copied_obj.created_on = Time.now
attach_copied_obj.author_id = User.current.id
@obj = obj
@save_flag = attach_copied_obj.save
@save_message = attach_copied_obj.errors.full_messages

View File

@ -64,8 +64,12 @@ class JournalsForMessage < ActiveRecord::Base
def act_as_activity
if self.jour_type == 'Principal'
unless self.user_id == self.jour.id && self.user_id != self.reply_id && self.reply_id != 0
self.acts << Activity.new(:user_id => self.user_id)
# self.acts << Activity.new(:user_id => self.user_id)
self.acts << Activity.new(:user_id => self.jour_id)
end
elsif self.jour_type == 'Project'
self.acts << Activity.new(:user_id => self.reply_id)
else
end
end

View File

@ -49,7 +49,9 @@
<td align="cneter">
</td>
<%= text_field_tag 'course_password', nil, :size => 45 %>
<div>
<%= text_field_tag 'course_password', nil, :style=>'width:100%'%>
</div>
<p class="buttons" style="padding-top: 10px; padding-bottom: 1px; margin-bottom: 1px">
<%= submit_tag l(:label_new_join), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %>

View File

@ -30,11 +30,11 @@
<% case e.act_type %>
<% when 'JournalsForMessage' %>
<% if User.current.login == @user.login %>
<% if e.user_id == act.jour.id %>
<tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">有了留言</span></td></tr>
<% else %>
<tr><td colspan="2" valign="top" class="font_lighter"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给 <%= link_to("#{act.jour.show_name}", user_path(act.jour.id)) %> 留言了</strong>&nbsp;</td></tr>
<% end %>
<%# if e.user_id == act.jour.id %>
<tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">有了<%= link_to("#{e.act.user.show_name}", user_path(e.user.id))%>的留言</span></td></tr>
<%# else %>
<!-- <tr><td colspan="2" valign="top" class="font_lighter"><strong><%#= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给 <%#= link_to("#{act.at_user.show_name if act.at_user}", user_path(act.jour.id)) %> 留言了</strong>&nbsp;</td></tr> -->
<%# end %>
<% else %>
<tr><td colspan="2" valign="top"><strong><%= link_to("#{@user.show_name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">有了新的动态</span></td></tr>
<% end %>
@ -209,8 +209,10 @@
<% if e.reply_id == User.current.id%>
<%if e.jour_type == 'Bid'%>
<%= l(:label_in_bids)%><%= link_to(e.jour.name, respond_path(e.jour))%>&nbsp;<%= l(:label_quote_my_words) %>
<% else %>
<% elsif e.jour_type == 'User' %>
<%= l(:label_in_users)%><%= link_to(e.jour.firstname, feedback_path(e.jour))%>&nbsp;<%= l(:label_quote_my_words) %>
<% elsif e.jour_type == 'Project' %>
<%= '在'<<l(:field_project)%><%= link_to(e.jour.name, feedback_path(e.jour))%>&nbsp;<%= l(:label_reply_plural) %>
<% end %>
<% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id))%>&nbsp;<%= l(:label_have_respond) %>

View File

@ -123,9 +123,17 @@
<p class="layout">
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}", :target => "_blank" )%>
<span style="cursor: pointer; display: inline-block; float: right; color: #ec6300; white-space: nowrap;">学生人数:<%= link_to "#{studentCount(project)}", project_member_path(project, :role => 2) ,:course =>'1', :target => "_blank" %></span>
<div id='join_in_course' style='margin: 0px 4px;display:inline-block;float:right;color:#ff4800;'>
<%if User.current.logged? %>
<%= join_in_course(project, User.current) unless project.course_extra.teacher.id == User.current.id %>
<% end %>
</div>
</p>
<p class="layout-1" >
<%= content_tag "div", "&nbsp;".html_safe<<project.course_extra.time.to_s<<project.course_extra.term.to_s, :class => "d-p-project-intro", :style => 'display:inline-block; position:relative;float:right;color:#ff4800;' %>
<%= content_tag "span", "&nbsp;".html_safe+project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description.to_s %>
</p>
</div>