个人动态

This commit is contained in:
cxt 2015-08-20 17:24:34 +08:00
parent b52f607b68
commit 4c87071765
4 changed files with 50 additions and 30 deletions

View File

@ -419,20 +419,6 @@ class AdminController < ApplicationController
def messages_list
@memo = Memo.reorder("created_at desc")
=begin
case params[:format]
when 'xml', 'json'
@offset, @limit = api_offset_and_limit({:limit => 30})
else
@limit = 30#per_page_option
end
@memo_count = @memo.count
@memo_pages = Paginator.new @memo_count, @limit, params['page']
@offset ||= @memo_pages.offset
@memo = @memo.limit(@limit).offset(@offset).all
=end
respond_to do |format|
format.html
end

View File

@ -534,6 +534,12 @@ class UsersController < ApplicationController
end
def show
if @user == User.current
@user_activities = UserActivity.where("(container_type='Course' and container_id in (select course_id FROM members WHERE user_id=#{@user.id})) or (container_type='Project' and container_id in (SELECT project_id FROM members WHERE user_id=#{@user.id}))").order('created_at desc')
=begin
SELECT * FROM user_activities WHERE (container_type='Course' AND container_id IN (SELECT course_id FROM members WHERE user_id=4)) OR (container_type='Project' AND container_id IN (SELECT project_id FROM members WHERE user_id=4))
=end
end
render :layout=>'new_base_user'
end

View File

@ -10,7 +10,7 @@
<li><a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a></li>
<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>
<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
</ul>
</li>
<li>
@ -24,7 +24,40 @@
</li>
</ul>
</div>
<div class="homepagePostBrief">
<% @user_activities.each do |user_activity| unless @user_activities.nil? %>
<% case user_activity.act_type.to_s%>
<% when 'CourseActivity'%>
<% @course_act= CourseActivity.where("id=#{user_activity.act_id}").first%>
<% case @course_act.course_act_type.to_s %>
<% when 'HomeworkCommon'%>
<div class="homepagePostBrief" onmouseover="$('.homepagePostSetting').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
<div class="homepagePostPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像" /></a></div>
<div class="homepagePostDes">
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO <a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
<div class="homepagePostTitle"><a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理作业名称</a></div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交10</a></div>
<div class="homepagePostDeadline">截止时间2015-08-20</div>
</div>
<div class="homepagePostIntro">作业描述系统中有多个ckeditor且每个ckeditor的id未知怎么样做到当光标聚焦某个ckeditor的文本框中该编辑器的默认值应自动消失的处理网络拓扑图开发</div>
<div class="homepagePostSetting" style="visibility: hidden">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
<% end %>
<div class="homepagePostBrief" onmouseover="$('.homepagePostSetting').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
<div class="homepagePostPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像" /></a></div>
<div class="homepagePostDes">
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO <a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
@ -34,7 +67,7 @@
<div class="homepagePostDeadline">截止时间2015-08-20</div>
</div>
<div class="homepagePostIntro">作业描述系统中有多个ckeditor且每个ckeditor的id未知怎么样做到当光标聚焦某个ckeditor的文本框中该编辑器的默认值应自动消失的处理网络拓扑图开发</div>
<div class="homepagePostSetting">
<div class="homepagePostSetting" style="visibility: hidden">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
@ -48,7 +81,8 @@
</div>
<div class="cl"></div>
</div>
<div class="homepagePostReply">
<!-- <div class="homepagePostReply">
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复5</div>
<div class="homepagePostReplyBannerTime">2015-07-28</div>
@ -96,7 +130,7 @@
</div>
<div class="cl"></div>
</div>
</div>
</div>-->
</div>
<div class="resources mt15">
<div class="homepagePostBrief">
@ -139,7 +173,7 @@
<div class="homepagePostReplyContainer">
<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a></div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">黄井泉 学生</a> 2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><a href="javascript:void(0);" class="newsBlue fr">回复</a></div>
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">黄井泉 学生</a> 2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><!--<a href="javascript:void(0);" class="newsBlue fr">回复</a>--></div>
<div class="homepagePostReplyContent">很开心!</div>
</div>
<div class="cl"></div>
@ -147,7 +181,7 @@
<div class="homepagePostReplyContainer borderBottomNone">
<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a></div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">陈正东 学生</a> 2015-08-02<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><a href="javascript:void(0);" class="newsBlue fr">回复</a></div>
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">陈正东 学生</a> 2015-08-02<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><!--<a href="javascript:void(0);" class="newsBlue fr">回复</a>--></div>
<div class="homepagePostReplyContent">假期好热,没出去。</div>
</div>
<div class="cl"></div>
@ -199,7 +233,7 @@
<div class="homepagePostReplyContainer">
<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a></div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">尹教授</a> 2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><a href="javascript:void(0);" class="newsBlue fr">回复</a></div>
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">尹教授</a> 2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><!--<a href="javascript:void(0);" class="newsBlue fr">回复</a>--></div>
<div class="homepagePostReplyContent">请大家说下软件工程是什么!</div>
</div>
<div class="cl"></div>
@ -207,7 +241,7 @@
<div class="homepagePostReplyContainer">
<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a></div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">Tang 学生</a> 2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><a href="javascript:void(0);" class="newsBlue fr">回复</a></div>
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">Tang 学生</a> 2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><!--<a href="javascript:void(0);" class="newsBlue fr">回复</a>--></div>
<div class="homepagePostReplyContent">软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。</div>
</div>
<div class="cl"></div>

View File

@ -474,13 +474,6 @@ ActiveRecord::Schema.define(:version => 20150820025358) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
create_table "discuss_demos", :force => true do |t|
t.string "title"
t.text "body"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "documents", :force => true do |t|
t.integer "project_id", :default => 0, :null => false
t.integer "category_id", :default => 0, :null => false
@ -893,6 +886,7 @@ ActiveRecord::Schema.define(:version => 20150820025358) do
t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false
t.integer "course_id"
t.datetime "updated_on"
end
add_index "news", ["author_id"], :name => "index_news_on_author_id"