Merge branch 'szzh' into develop

tmp v20170718_1
sw 10 years ago
commit c66e74dc82

@ -44,6 +44,9 @@ module ActivitiesHelper
end end
def get_container_type(activity) def get_container_type(activity)
if activity.act.nil?
return ['Unknow',0]
end
#问卷 #问卷
if activity.act_type == 'Poll' if activity.act_type == 'Poll'
return ['Course',activity.act.polls_group_id] return ['Course',activity.act.polls_group_id]
@ -54,7 +57,7 @@ module ActivitiesHelper
end end
#留言 #留言
if activity.act_type == 'JournalsForMessage' if activity.act_type == 'JournalsForMessage'
return [activity.act.jour_type,activity.act.jour_id] return [activity.act.jour_type,activity.act.jour_id,activity.act.user_id]
end end
# HomeworkCommon Issue Journal Message News # HomeworkCommon Issue Journal Message News

@ -66,7 +66,7 @@ module ApiHelper
(user.language.nil? || user.language == "") ? 'zh':user.language (user.language.nil? || user.language == "") ? 'zh':user.language
end end
# 获取课程作业的状态 # 学生获取课程作业的状态
def get_homework_status homework def get_homework_status homework
homework_status = "" homework_status = ""
if !homework.nil? if !homework.nil?
@ -75,9 +75,9 @@ module ApiHelper
when 1 when 1
homework_status = show_homework_deadline homework homework_status = show_homework_deadline homework
when 2 when 2
homework_status = "正在匿评" homework_status = "正在匿评"
when 3 when 3
homework_status = "匿评结束" homework_status = "匿评结束"
end end
elsif homework.homework_type == 0 elsif homework.homework_type == 0
homework_status = "未启用匿评" homework_status = "未启用匿评"

@ -434,6 +434,8 @@ module UsersHelper
def get_activity_act_showname_htmlclear(activity) def get_activity_act_showname_htmlclear(activity)
str = get_activity_act_showname(activity) str = get_activity_act_showname(activity)
str = str.gsub(/<.*>/,'') str = str.gsub(/<.*>/,'')
str = str.gsub(/\r/,'')
str = str.gsub(/\n/,'')
str = str.lstrip.rstrip str = str.lstrip.rstrip
if str == '' if str == ''
str = 'RE:' str = 'RE:'
@ -449,7 +451,9 @@ module UsersHelper
when "Journal" when "Journal"
arr = details_to_strings(activity.act.details,true) arr = details_to_strings(activity.act.details,true)
arr << activity.act.notes arr << activity.act.notes
return arr.to_s str = ''
arr.each { |item| str = str+item }
return str
when "JournalsForMessage" when "JournalsForMessage"
return activity.act.notes return activity.act.notes
when "Message" when "Message"

@ -14,8 +14,11 @@ class Activity < ActiveRecord::Base
#helper :activities #helper :activities
include ActivitiesHelper include ActivitiesHelper
def set_container_type_val def set_container_type_val
container_type,container_id =get_container_type(self) params =get_container_type(self)
self.activity_container_type = container_type self.activity_container_type = params[0]
self.activity_container_id = container_id self.activity_container_id = params[1]
if(self.act_type == 'JournalsForMessage')
self.user_id = params[2]
end
end end
end end

@ -77,11 +77,11 @@
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"> <li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<% if User.current.user_extensions.nil? %> <% if User.current.user_extensions.nil? %>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w70" type="text" value=<%= l(:field_occupation_click) %> readonly> <input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;width:130px;" class="w70" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" /> <input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" />
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/> <input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %> <% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w70" type="text" value=<%= l(:field_occupation_click) %> readonly> <input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;width:130px;" class="w70" type="text" value=<%= l(:field_occupation_click) %> readonly>
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" /> <input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/> <input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>
<% elsif User.current.user_extensions.school.nil? %> <% elsif User.current.user_extensions.school.nil? %>
@ -89,7 +89,7 @@
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" /> <input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" />
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/> <input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>
<% else %> <% else %>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w70" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/> <input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;width:130px;" class="w70" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/>
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/> <input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/> <input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>
<% end %> <% end %>

@ -1,4 +1,4 @@
#RSide{ min-height:860px;} #RSide{ min-height:1px;}
/* 左侧信息*/ /* 左侧信息*/
.users_info{background:#fff; padding:10px; width:230px; padding-right:0px; margin-bottom:10px; } .users_info{background:#fff; padding:10px; width:230px; padding-right:0px; margin-bottom:10px; }
.pic_head{ width:214px; height:214px; border:1px solid #cbcbcb; padding:2px; position:relative;} .pic_head{ width:214px; height:214px; border:1px solid #cbcbcb; padding:2px; position:relative;}

Loading…
Cancel
Save