From f1a7631255d18a1cea39d3738a75eaa45d8fc872 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 13 Jul 2019 16:39:45 +0800 Subject: [PATCH] tiding add project package --- app/controllers/users_controller.rb | 6 ++++++ app/models/tiding.rb | 4 ++-- app/views/users/user_tidings.html.erb | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 66b6fde0..744b1d1f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -255,8 +255,14 @@ class UsersController < ApplicationController type_list = ["System"] when "interactive" type_list = ["Comment", "Mentioned", "Praise", "Fan"] + when 'project_package' + type_list = ['Created', 'Destroyed', 'Bidding', 'BiddingEnd', 'BiddingWon', 'BiddingLost'] end @tids = @tids.where(:tiding_type => type_list) + + if params[:type] == 'project_package' + @tids = @tids.where(container_type: 'ProjectPackage') + end else @new_tids_count = @tids.where("created_at > '#{@onclick_time}'").count @new_mess_count = @user.private_messages.where("status = 0").group(:target_id).length diff --git a/app/models/tiding.rb b/app/models/tiding.rb index 986d9cef..177946d8 100644 --- a/app/models/tiding.rb +++ b/app/models/tiding.rb @@ -150,9 +150,9 @@ class Tiding < ActiveRecord::Base else if container.parent.present? if container.parent_id == container.root_id - "评论了你的帖子:" + message_content(container.content) + "评论了你的帖子:" + message_content(container.subject) else - "评论了你的回复:" + message_content(container.content) + "评论了你的回复:" + message_content(container.subject) end else "发布了帖子:" + container.subject diff --git a/app/views/users/user_tidings.html.erb b/app/views/users/user_tidings.html.erb index b54f8f37..2ceea021 100644 --- a/app/views/users/user_tidings.html.erb +++ b/app/views/users/user_tidings.html.erb @@ -15,6 +15,9 @@
  • 项目提醒
  • +
  • + 众包 +
  • 审核