- <%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %>
-
- <% if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %>
-
-
- -
-
- <% if @memo.author.id == User.current.id || User.current.admin? %>
- - 编辑
- <% end %>
- <% if User.current.admin? || User.current == @forum.creator %>
- <% if @memo.sticky %>
- - 取消置顶
- <% else %>
- - 置顶
- <% end %>
- <% end %>
- - 删除
-
-
-
-
-
- <% end %>
-
- <%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
-
-
- <%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
-
<%= format_date( @memo.created_at)%>
-
-
- <%= @memo.content.html_safe%>
-
-
-
- <% if @memo.attachments.any?%>
- <% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
- <%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
- <% end %>
-
-
-
更新时间:<%= format_date(@memo.updated_at)%>
+
+
+<% if false %>
+ <%= content_for(:header_tags) do %>
+ <%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
+ <%= javascript_include_tag 'forum' %>
+ <% end %>
+
+
+ <%= link_to "问吧", forums_path, :class => "c_blue" %> > <%= link_to @forum.name, forum_path(@forum), :class => "c_blue" %> > <%=h @memo.subject %>
-
-
-
-
回复(<%= @reply_count %>)
-
-
-
- <%= render :partial => 'memos/memo_all_replies' %>
-
-
-
-
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
-
- <% if User.current.logged? %>
-
- <%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%>
- <%= f.hidden_field :subject, :required => true, value: @memo.subject %>
- <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
- <%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
- <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
-
-
-
发送
-
-
- <% end%>
-
- <% else %>
- <%= render :partial => "users/show_unlogged" %>
- <% end %>
+
+
+
+
+
+ <%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %>
+
+
+ <% if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %>
+
+
+ -
+
+ <% if @memo.author.id == User.current.id || User.current.admin? %>
+ - 编辑
+ <% end %>
+ <% if User.current.admin? || User.current == @forum.creator %>
+ <% if @memo.sticky %>
+ - 取消置顶
+ <% else %>
+ - 置顶
+ <% end %>
+ <% end %>
+ - 删除
+
+
+
+
+
+ <% end %>
+
+ <%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
+
+
+
+ <%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
+
<%= format_date( @memo.created_at)%>
+
+
+ <%= @memo.content.html_safe%>
+
+
+
+ <% if @memo.attachments.any?%>
+ <% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
+ <%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
+ <% end %>
+
+
+
更新时间:<%= format_date(@memo.updated_at)%>
+
+
+
+
回复(<%= @reply_count %>)
+
+
+
+ <%= render :partial => 'memos/memo_all_replies' %>
+
+
+
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
+
+ <% if User.current.logged? %>
+
+ <%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%>
+ <%= f.hidden_field :subject, :required => true, value: @memo.subject %>
+ <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
+ <%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
+ <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
+
+
+
发送
+
+
+ <% end%>
+
+ <% else %>
+ <%= render :partial => "users/show_unlogged" %>
+ <% end %>
+
+
+
+
+
+
+
+ <%= render :partial => "memos/my_show_count_message" %>
-
-
-
- <%= render :partial => "memos/my_show_count_message" %>
-
-
\ No newline at end of file
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/praise_tread/_activity_praise.html.erb b/app/views/praise_tread/_activity_praise.html.erb
index 8f57ec0b6..8bbb6b6b8 100644
--- a/app/views/praise_tread/_activity_praise.html.erb
+++ b/app/views/praise_tread/_activity_praise.html.erb
@@ -4,8 +4,9 @@
:user_activity_id => user_activity_id,
:type => type }) %>' data-remote="true" class="white-btn orange-btn" title="点赞">
赞
- <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
-
<%= (num.nil? ? 0 : num) > 0 ? num : 0 %>
+ <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
+
+
<%= get_praise_num(activity) %>
<% else %>
赞
- <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
- <%= (num.nil? ? 0 : num) > 0 ? num : 0 %>
+ <%= get_praise_num(activity) %>
+ <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
+
<% end %>
\ No newline at end of file
diff --git a/app/views/praise_tread/_edu_praise.html.erb b/app/views/praise_tread/_edu_praise.html.erb
index afe83633d..0704eebad 100644
--- a/app/views/praise_tread/_edu_praise.html.erb
+++ b/app/views/praise_tread/_edu_praise.html.erb
@@ -4,8 +4,9 @@
:user_activity_id => user_activity_id,
:type => type }) %>' data-remote="true" class="fr mr5 color-grey" title="点赞">
赞
- <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
-
<%= (num.nil? ? 0 : num) > 0 ? num : 0 %>
+ <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
+
+
<%= get_praise_num(activity) %>
<% else %>
赞
- <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
- <%= (num.nil? ? 0 : num) > 0 ? num : 0 %>
+ <%= get_praise_num(activity) %>
+ <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
+
<% end %>
\ No newline at end of file
diff --git a/app/views/praise_tread/praise_minus.js.erb b/app/views/praise_tread/praise_minus.js.erb
index b187d75dc..3b974fe5c 100644
--- a/app/views/praise_tread/praise_minus.js.erb
+++ b/app/views/praise_tread/praise_minus.js.erb
@@ -5,6 +5,8 @@
<% else %>
$('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
<% end %>
+ <% elsif @type.to_s == 'Memo' %>
+ $('#praise_count_<%= @obj.id %>').html('<%= j(render :partial => 'praise_tread/activity_praise', :locals => {:activity => @obj, :user_activity_id => @obj.id, :type => "Memo"})%>');
<% else @type.to_s == 'reply' %>
<% if ((@obj_type == 'JournalsForMessage' && @obj.jour_type == 'HomeworkCommon') || @obj_type == 'Message') && @obj_id == @user_activity_id %>
$('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
diff --git a/app/views/praise_tread/praise_plus.js.erb b/app/views/praise_tread/praise_plus.js.erb
index beea6afae..082f0bf42 100644
--- a/app/views/praise_tread/praise_plus.js.erb
+++ b/app/views/praise_tread/praise_plus.js.erb
@@ -5,6 +5,8 @@
<% else %>
$('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
<% end %>
+ <% elsif @type.to_s == 'Memo' %>
+ $('#praise_count_<%= @obj.id %>').html('<%= j(render :partial => 'praise_tread/activity_praise', :locals => {:activity => @obj, :user_activity_id => @obj.id, :type => "Memo"})%>');
<% else @type.to_s == 'reply' %>
<% if ((@obj_type == 'JournalsForMessage' && @obj.jour_type == 'HomeworkCommon') || @obj_type == 'Message') && @obj_id == @user_activity_id %>
$('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
@@ -13,8 +15,8 @@
<% end %>
<% end %>
<% elsif @obj_type == 'Memo'%>
- $('#praise_tread_<%= @obj.id %>').html('<%= j(
- render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
+ $('#praise_count__<%= @obj.id %>').html('<%= j(
+ render :partial => 'praise_tread/activity_praise', :locals => {:activity => @obj, :user_activity_id => @obj.id, :type => "Memo"}
)%>');
<% elsif @obj_type == 'Discuss'%>
$('#dis_praise_<%= @obj.id %>').html('<%= j(
diff --git a/config/routes.rb b/config/routes.rb
index 403cf5eaa..18f6cbb08 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -734,6 +734,8 @@ RedmineApp::Application.routes.draw do
end
member do
get "change_sticky"
+ post "reply"
+ match "message_replies", :via => [:get, :post]
end
end
end
+ <% if comment.creator_user == User.current %> + 删除 + <% end %> + | + <%= link_to( + '回复'.html_safe, + {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => memo.class.to_s, :user_activity_id => memo.id}, + :remote => true, + :method => 'get', + :title => l(:button_reply),:class => "color-grey") %> + | + + <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + +
+