Merge branch 'cxt_course' into develop

This commit is contained in:
cxt 2016-03-25 15:37:05 +08:00
commit f4739b8ee7
8 changed files with 15 additions and 7 deletions

View File

@ -1223,7 +1223,7 @@ class UsersController < ApplicationController
@page = params[:page] ? params[:page].to_i + 1 : 0
user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
project_types = "('Message','Issue','ProjectCreateInfo')"
principal_types = "JournalsForMessage"
if params[:type].present?
@ -1236,6 +1236,8 @@ class UsersController < ApplicationController
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
when "course_poll"
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
when "course_journals"
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
when "project_issue"
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10)
when "project_message"

View File

@ -3,14 +3,14 @@
<div class="break_word">
<span class="fl">
<span title="<%= attachment.filename %>" id="attachment_<%=attachment.id %>">
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw400', :download => true -%>
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw380', :download => true -%>
</span>
</span>
<span class="postAttSize">(
<%= number_to_human_size attachment.filesize %>)
</span>
<span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
<%= link_to h(truncate(attachment.author.name, length: 15, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
<%= format_time(attachment.created_on) %>
</span>
</div>

View File

@ -59,7 +59,7 @@
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="width150"><pre><%=x["result"]%></pre></span>
<span class="width150"><pre><%=x["result"].force_encoding("UTF-8")%></pre></span>
<span class="w60">正确输出:</span>
<span class="width150"><pre><%=x["output"]%></pre></span>
<div class="cl"></div>

View File

@ -69,7 +69,9 @@
<% when 'Poll' %>
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
<% when 'Course'%>
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => act.id} %>
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
<% when 'JournalsForMessage'%>
<%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
<% end %>
<% end %>
<% when 'Project' %>

View File

@ -14,6 +14,7 @@
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<li><%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
<li><%= link_to "课程留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
</ul>
@ -30,7 +31,7 @@
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">更多</li>
<li class="mt-4"><%= link_to "留言动态", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li class="mt-4"><%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li class="mt-4"><%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
<li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
</ul>

View File

@ -419,6 +419,7 @@ a:hover.ping_sub{ background:#14a8b9;}
/*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
.list_style ul li{list-style-type: disc;margin-left: 20px;}
span.author { font-size: 0.9em; color: #888; }
/* 创建作品 work */
.Newwork{ width:668px; height:418px;}

View File

@ -99,6 +99,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
.mr40{ margin-right:40px !important;}
.mr65 {margin-right: 65px;}
.mw20{ margin: 0 20px;}
.mw380 {max-width: 380px !important;}
.mw400 {max-width: 400px !important;}
.mt-20 {margin-top:-20px;}
.mt-4 {margin-top: -4px;}

View File

@ -180,6 +180,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.h150{ height:150px;}
.p10 {padding-left:10px; padding-right:10px;}
.mw360 {max-width: 360px !important;}
.mw380 {max-width: 380px !important;}
.mw400 {max-width: 400px !important;}
.mh18 {max-height: 18px;}
@ -1136,4 +1137,4 @@ a.program-btn{background: url(../images/homepage_icon.png) -86px -393px no-repea
.mediaIco{margin: 30px 0 30px 20px;width: 200px;}
/*排序样式*/
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}