This commit is contained in:
nieguanghui 2013-12-25 15:37:03 +08:00
parent 5b6f3b602a
commit fbf73de68b
3 changed files with 79 additions and 46 deletions

View File

@ -43,5 +43,9 @@ module WordsHelper
# content.present? ? content_tag('ul', content, :class => 'watchers') : content
content
end
def find_reply_message
JournalsForMessage.where("jour_id = 4").take(2)
end
end

View File

@ -1,9 +1,32 @@
<%= form_tag({:controller => 'words',
:action => 'create_reply'}) do %>
<%= text_area_tag 'project_respond', "", :class => 'noline', :style => "resize: none;", :rows => 4, :placeholder => l(:label_projects_feedback_respond_content) %>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn", :style => "margin-top: 1px;"%>
<% end %>
<style>
.avatar-3{
width: 35px;
height: 35px;
}
.inner-right{
float: left;
}
</style>
<ul>
<% fetch_user_leaveWord_reply.each do |reply|%>
<li style="display: block; padding-bottom: 4px;">
<div class="inner-right" style="float: left; height: 100%; ">
<%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %>
</div>
<div class="inner-right" style="float: left; width:86%; height: 100%; ">
<% id = reply.id %>
<span style="color: green;"><a href="/users/4245" style="color:green;"><%= reply.user.name %></a>:&nbsp;</span>
<%= reply.notes %>
<% if @user == User.current %>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<%= toggle_link l(:label_projects_feedback_respond), id, {:focus => 'project_respond'} %>
<% end %>
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= reply.created_on %></span></p>
</div>
<div id=<%= id %> style="display: none;">
<%= render :partial => "words/new_respond", :locals => {:journal => journal} %>
</div>
<div style="clear: both;"></div>
</li>
<% end %>
</ul>

View File

@ -1,48 +1,54 @@
<!-- fq -->
<style>
.portrait{
float: left;
width: 40px;
padding-top: 3px;
margin: 0px;
padding: 0px;
display: block;
}
.body{
float: left;
width: 405px;
overflow: hidden;
font-size: 9pt;
margin: 0px 10px;
padding: 0px;
display: block;
}
</style>
<% if jour.size >0 %>
<% remove_allowed = (User.current.id == jour.first.user_id) %>
<ul>
<% for journal in jour%>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= link_to journal.user, user_path(journal.user)%></strong>
<% if @user == User.current %>
<span class="font_lighter"><%= l(:label_leave_me_message) %></span>
<% else %>
<span class="font_lighter"><%= l(:label_leave_others_message) %></span>
<% end %> </td>
</tr>
<tr>
<td colspan="2" width="580px" >
<div class="info-break">
<%= textilizable journal.notes%>
</div></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= l :label_comment_time %>&nbsp; <%= format_time journal.created_on %></span></td>
<td width="200" align="right" class="a">
<li>
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
<span class="body">
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
<% if @user == User.current %>
<span class="font_lighter"><%= l(:label_leave_me_message) %></span>
<% else %>
<span class="font_lighter"><%= l(:label_leave_others_message) %></span>
<% end %>
<span>
<%= textilizable journal.notes%>
</span>
<span class="font_lighter"> <%= l :label_comment_time %>&nbsp; <%= format_time journal.created_on %></span>
<% if @user == User.current %>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<%= toggle_link l(:label_projects_feedback_respond), ids, {:focus => 'project_respond'} %>
<% end %>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id=<%= ids %> style="display: none;width: 80%; margin: auto;">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal} %>
</div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal} %>
</div>
<div class="line_under"></div>
</span>
<div style="clear: both;"></div>
<div id=<%= ids %> style="display: none; width: 80%; margin: auto;">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal} %>
</div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal} %>
</div>
</li>
<% end %>
</ul>
<% end %>