个人主页动态

This commit is contained in:
cxt 2015-08-26 17:58:48 +08:00
parent 7c3544dfec
commit caec5e5490
4 changed files with 19 additions and 4 deletions

View File

@ -74,6 +74,8 @@ class UsersController < ApplicationController
include WordsHelper
include GitlabHelper
include UserScoreHelper
include PollHelper
helper :user_score
helper :journals
@ -575,7 +577,7 @@ class UsersController < ApplicationController
@type = params[:type]
user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")"
user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
course_types = "('Message','News','HomeworkCommon')"
course_types = "('Message','News','HomeworkCommon','poll')"
project_types = "('Message','Issue')"
if @type
case @type

View File

@ -23,7 +23,13 @@
<div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline">时间:<%= format_date(activity.created_on) %></div>
</div>
<div class="homepagePostIntro" style="word-break:break-all">(描述)<%= activity.content.html_safe %></div>
<div class="homepagePostIntro" style="word-break:break-all">(描述)
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
<% else %>
<%= activity.parent.content.to_s.html_safe%>
<% end %>
</div>
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
<ul>
<li class="homepagePostSettingIcon">

View File

@ -1,3 +1,5 @@
<%# has_commit = has_commit_poll?(activity.id ,User.current)%>
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
<div class="resources mt15">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
@ -16,7 +18,12 @@
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
</div>
<div class="homepagePostTitle" style="word-break:break-all;">
<a href="javascript:void(0);" class="postGrey"><%=activity.polls_name.to_s%>(问卷名称)</a>
<%#= link_to activity.polls_name.to_s+"(问卷名称)", %>
<%# if has_commit %>
<%#= link_to poll_name, poll_result_poll_path(activity.id), :class => "polls_title polls_title_w fl c_dblue"%>
<%# else %>
<%= link_to poll_name+"(问卷名称)", poll_path(activity.id), :class => "postGrey"%>
<%# end %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline">时间:<%= format_date(activity.created_at) %></div>

View File

@ -1311,6 +1311,7 @@ ActiveRecord::Schema.define(:version => 20150826061843) do
t.datetime "updated_at", :null => false
t.integer "late_penalty", :default => 0
t.integer "absence_penalty", :default => 0
t.integer "system_score"
end
create_table "student_works_evaluation_distributions", :force => true do |t|
@ -1528,7 +1529,6 @@ ActiveRecord::Schema.define(:version => 20150826061843) do
t.string "identity_url"
t.string "mail_notification", :default => "", :null => false
t.string "salt", :limit => 64
t.integer "gid"
end
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"