Merge branch 'develop' into 'develop'

个人主页 系统消息显示30天前



See merge request !66
This commit is contained in:
黄井泉 2016-12-16 19:40:51 +08:00
commit 7d31f5c7d4
3 changed files with 9 additions and 3 deletions

View File

@ -33,6 +33,12 @@ module UsersHelper
result = unsolved_issues_count + unfinished_homework_count + unfinished_test_count + unfinished_poll_count + anonymous_evaluation_count + unapproval_homework
end
# 判断某个时间再多少天前
# params[:num] 天数
def many_days_ago time, num
time > Time.now - 86400 * num
end
def issue_list(issues, &block)
ancestors = []
issues.each do |issue|

View File

@ -9,10 +9,10 @@
<div class="homepagePostTo break_word">
<%= link_to activity.try(:author).show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
TO
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.course), :class => "newsBlue ml15" %>
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.project), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %>
<%= link_to activity.filename, project_files_path(activity.project), :class => "postGrey" %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline mr15">

View File

@ -1,4 +1,4 @@
<% if ma.class == SystemMessage %>
<% if ma.class == SystemMessage && many_days_ago(ma.created_at, 30) %>
<%# @user_system_messages.each do |usm| %>
<ul class="homepageNewsList fl">
<div class="longMessageWidth">