From 02146f7dcb866976cb4a094dcde971c2b6a5be5c Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 26 Jul 2019 16:46:36 +0800 Subject: [PATCH] modify library show page praise style when user unlogged --- app/views/libraries/index.html.erb | 2 +- app/views/praise_tread/_new_praise.html.erb | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/views/libraries/index.html.erb b/app/views/libraries/index.html.erb index 3a277f0b..f5bf570c 100644 --- a/app/views/libraries/index.html.erb +++ b/app/views/libraries/index.html.erb @@ -18,7 +18,7 @@
<%= hidden_field_tag(:type, params[:type]) %> - +
diff --git a/app/views/praise_tread/_new_praise.html.erb b/app/views/praise_tread/_new_praise.html.erb index facdabad..34a969ca 100644 --- a/app/views/praise_tread/_new_praise.html.erb +++ b/app/views/praise_tread/_new_praise.html.erb @@ -2,8 +2,12 @@ praised = PraiseTread.praised(object) praise_num = get_praise_num(object) || 0 %> -


<%= praise_num %>

-

已赞
<%= praise_num %>

+<% if User.current.try(:logged?) %> +


<%= praise_num %>

+

已赞
<%= praise_num %>

+<% else %> +


<%= praise_num %>

+<% end %>