From 0b3ec0322f80c7036a88af1dcc9295491e958a4c Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 2 Jun 2016 18:41:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B3=E4=B8=80=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 29 +++++++++ .../organizations/_org_custom_right1.html.erb | 62 ++++++++----------- .../_organization_content_extension.html.erb | 13 +--- 3 files changed, 57 insertions(+), 47 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4c6089b51..a5a3d6aaa 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -66,11 +66,40 @@ module OrganizationsHelper def org_user_by_type obj case obj.act_type when "Message" + user = obj.act.author when "News" + user = obj.act.author when "HomeworkCommon" + user = obj.act.user when "Issue" + user = obj.act.author end + end + def org_title_by_type obj + case obj.act_type + when "Message" + user = obj.act.parent_id.nil? ? obj.act.subject : obj.act.parent.subject + when "News" + user = obj.act.title + when "HomeworkCommon" + user = obj.act.name + when "Issue" + user = obj.act.subject + end + end + + def org_content_by_type obj + case obj.act_type + when "Message" + user = obj.act.parent_id.nil? ? obj.act.content : obj.act.parent.content + when "News" + user = obj.act.description + when "HomeworkCommon" + user = obj.act.description + when "Issue" + user = obj.act.description + end end #排列下拉框 diff --git a/app/views/organizations/_org_custom_right1.html.erb b/app/views/organizations/_org_custom_right1.html.erb index 4fed81a6b..882c994cc 100644 --- a/app/views/organizations/_org_custom_right1.html.erb +++ b/app/views/organizations/_org_custom_right1.html.erb @@ -5,44 +5,32 @@ <% else %> <% end %> \ No newline at end of file diff --git a/app/views/organizations/_organization_content_extension.html.erb b/app/views/organizations/_organization_content_extension.html.erb index be5343d61..48abd48b9 100644 --- a/app/views/organizations/_organization_content_extension.html.erb +++ b/app/views/organizations/_organization_content_extension.html.erb @@ -1,16 +1,9 @@ -<% if cl.nil? %> - +

<%= content.to_s.html_safe%> - -<% else %> -

- - <%= content.to_s.html_safe%> - -

-<% end %> +

+