exceptionHandle
yanxd 12 years ago
parent 8963cc3a3c
commit ce1e6c49f1

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

@ -64,8 +64,12 @@ class JournalsForMessage < ActiveRecord::Base
def act_as_activity def act_as_activity
if self.jour_type == 'Principal' if self.jour_type == 'Principal'
unless self.user_id == self.jour.id && self.user_id != self.reply_id && self.reply_id != 0 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)
end 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
end end

@ -49,7 +49,9 @@
<td align="cneter"> <td align="cneter">
</td> </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"> <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);" %> <%= submit_tag l(:label_new_join), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %>

@ -30,11 +30,11 @@
<% case e.act_type %> <% case e.act_type %>
<% when 'JournalsForMessage' %> <% when 'JournalsForMessage' %>
<% if User.current.login == @user.login %> <% if User.current.login == @user.login %>
<% if e.user_id == act.jour.id %> <%# 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> <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 %> <%# 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> <!-- <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 %> <%# end %>
<% else %> <% 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> <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 %> <% end %>
@ -209,8 +209,10 @@
<% if e.reply_id == User.current.id%> <% if e.reply_id == User.current.id%>
<%if e.jour_type == 'Bid'%> <%if e.jour_type == 'Bid'%>
<%= l(:label_in_bids)%><%= link_to(e.jour.name, respond_path(e.jour))%>&nbsp;<%= l(:label_quote_my_words) %> <%= 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) %> <%= 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 %> <% end %>
<% else %> <% else %>
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id))%>&nbsp;<%= l(:label_have_respond) %> <%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id))%>&nbsp;<%= l(:label_have_respond) %>

@ -123,9 +123,17 @@
<p class="layout"> <p class="layout">
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}", :target => "_blank" )%> <%= 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> <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>
<p class="layout-1" > <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 "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 %> <%= content_tag "span", "&nbsp;".html_safe+project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description.to_s %>
</p> </p>
</div> </div>

Loading…
Cancel
Save