From 760203ebc7cedb41e5cf3a0277c80b6e453880e3 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 24 Nov 2014 16:59:56 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=86=85=E5=9B=9E=E5=A4=8D?=
=?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=AE=9E=E5=90=8D=E5=9B=9E=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/homework_attach/_jour.html.erb | 2 +-
app/views/words/_journal_reply.html.erb | 3 ++-
app/views/words/_journal_reply_items.html.erb | 13 +++++++++++--
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/app/views/homework_attach/_jour.html.erb b/app/views/homework_attach/_jour.html.erb
index d6a1f7fc4..055e1a015 100644
--- a/app/views/homework_attach/_jour.html.erb
+++ b/app/views/homework_attach/_jour.html.erb
@@ -46,7 +46,7 @@
- <%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name } %>
+ <%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name, :show_real_name => true } %>
diff --git a/app/views/words/_journal_reply.html.erb b/app/views/words/_journal_reply.html.erb
index 39321394c..2f823ebf6 100644
--- a/app/views/words/_journal_reply.html.erb
+++ b/app/views/words/_journal_reply.html.erb
@@ -1,7 +1,8 @@
<% id = "journal_reply_ul_" + journal.id.to_s%>
+<% show_real_name ||= false%>
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
- <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name} %>
+ <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name, :show_real_name => show_real_name} %>
<% end %>
diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb
index d2c94b094..ebca999a6 100644
--- a/app/views/words/_journal_reply_items.html.erb
+++ b/app/views/words/_journal_reply_items.html.erb
@@ -1,3 +1,4 @@
+<% show_real_name ||= false %>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
@@ -10,11 +11,19 @@
<% id = 'project_respond_form_'+ reply.id.to_s %>
- <%= link_to reply.user.name, user_path(reply.user) %>
+ <% if show_real_name%>
+ <%= link_to reply.user.lastname+reply.user.firstname, user_path(reply.user) %>
+ <% else %>
+ <%= link_to reply.user.name, user_path(reply.user) %>
+ <% end %>
回复
<% parent_jour = JournalsForMessage.find reply.m_reply_id %>
<% if show_name && parent_jour %>
- <%= link_to parent_jour.user.name,user_path(parent_jour.user) %>
+ <% if show_real_name%>
+ <%= link_to parent_jour.user.lastname+reply.user.firstname, user_path(parent_jour.user) %>
+ <% else %>
+ <%= link_to parent_jour.user.name, user_path(parent_jour.user) %>
+ <% end %>
<% else %>
<%= l(:label_anonymous) %>
<% end %>