Merge branch 'develop' into hjq_new_course
This commit is contained in:
commit
a165657915
2
Gemfile
2
Gemfile
|
@ -17,7 +17,7 @@ gem 'daemons'
|
|||
gem 'grape', '~> 0.9.0'
|
||||
gem 'grape-entity'
|
||||
gem 'seems_rateable', '~> 1.0.13'
|
||||
gem "rails", "3.2.13"
|
||||
gem "rails", "~> 3.2.13"
|
||||
gem "jquery-rails", "~> 2.0.2"
|
||||
gem "i18n", "~> 0.6.0"
|
||||
gem 'coderay', '~> 1.1.0'
|
||||
|
|
|
@ -24,7 +24,7 @@ class AdminController < ApplicationController
|
|||
before_filter :require_admin
|
||||
helper :sort
|
||||
helper :Users
|
||||
helper :Settings
|
||||
helper :Settings,SchoolHelper
|
||||
include SortHelper
|
||||
|
||||
def index
|
||||
|
@ -65,7 +65,17 @@ class AdminController < ApplicationController
|
|||
|
||||
#管理员界面课程资源列表
|
||||
def course_resource_list
|
||||
@resource = Attachment.where(:container_type => 'Course')
|
||||
|
||||
if params[:sort] == 'file_size'
|
||||
@resource = Attachment.where(:container_type => 'Course').order("filesize desc")
|
||||
elsif params[:sort] == 'file_upload'
|
||||
@resource = Attachment.where(:container_type => 'Course').order("created_on desc")
|
||||
elsif params[:sort] == 'file_download_times'
|
||||
@resource = Attachment.where(:container_type => 'Course').order("downloads desc")
|
||||
else
|
||||
@resource = Attachment.where(:container_type => 'Course').order("created_on desc")
|
||||
end
|
||||
|
||||
@resource = paginateHelper @resource,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
|
||||
|
@ -76,7 +86,17 @@ class AdminController < ApplicationController
|
|||
|
||||
#管理员界面項目资源列表
|
||||
def project_resource_list
|
||||
@pro_resource = Attachment.where(:container_type => 'Project')
|
||||
|
||||
if params[:sort] == 'file_size'
|
||||
@pro_resource = Attachment.where(:container_type => 'Project').order("filesize desc")
|
||||
elsif params[:sort] == 'file_upload'
|
||||
@pro_resource = Attachment.where(:container_type => 'Project').order("created_on desc")
|
||||
elsif params[:sort] == 'file_download_times'
|
||||
@pro_resource = Attachment.where(:container_type => 'Project').order("downloads desc")
|
||||
else
|
||||
@pro_resource = Attachment.where(:container_type => 'Project').order("created_on desc")
|
||||
end
|
||||
|
||||
@pro_resource = paginateHelper @pro_resource,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
|
||||
|
@ -92,9 +112,9 @@ class AdminController < ApplicationController
|
|||
|
||||
case params[:format]
|
||||
when 'xml', 'json'
|
||||
@offset, @limit = api_offset_and_limit({:limit => 15})
|
||||
@offset, @limit = api_offset_and_limit({:limit => 50})
|
||||
else
|
||||
@limit = 15#per_page_option
|
||||
@limit = 50 #per_page_option
|
||||
end
|
||||
|
||||
@status = params[:status] || 1
|
||||
|
@ -374,7 +394,13 @@ class AdminController < ApplicationController
|
|||
|
||||
#组织
|
||||
def organization
|
||||
@organizations = Organization.all
|
||||
@organizations = Organization.find_by_sql("SELECT * FROM organizations ORDER BY created_at DESC")
|
||||
#@organizations = Organization.all.order("created_at desc")
|
||||
@organization_count = @organizations.count
|
||||
@organization_pages = Paginator.new @organization_count, 30, params['page'] || 1
|
||||
@organizations = paginateHelper @organizations,30
|
||||
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
|
@ -382,17 +408,14 @@ class AdminController < ApplicationController
|
|||
|
||||
#学校列表
|
||||
def schools
|
||||
@school_name = params[:school_name]
|
||||
if @school_name && @school_name != ''
|
||||
@schools = School.where("name like '%#{@school_name}%'")
|
||||
elsif @school_name.nil?
|
||||
@schools = []
|
||||
else @school_name && @school_name == ' '
|
||||
@schools = School.where('1=1')
|
||||
end
|
||||
|
||||
@schools = School.find_by_sql("SELECT * FROM schools ORDER BY created_at DESC")
|
||||
@school_count = @schools.count
|
||||
@school_pages = Paginator.new @school_count, 100, params['page'] || 1
|
||||
@schools = paginateHelper @schools,100
|
||||
|
||||
@school_pages = Paginator.new @school_count, 30, params['page'] || 1
|
||||
@schools = paginateHelper @schools,30
|
||||
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
|
|
|
@ -8,6 +8,15 @@ class AtController < ApplicationController
|
|||
users = find_at_users(params[:type], params[:id])
|
||||
@users = users
|
||||
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }.sort{|x,y| to_pinyin(x.show_name) <=> to_pinyin(y.show_name)} if users
|
||||
|
||||
#加上all
|
||||
if @users.size > 0
|
||||
allUser = Struct.new(:id, :name).new
|
||||
allUser.id = @users.map{|u| u.id}.join(",")
|
||||
allUser.name = "all"
|
||||
@users.insert(0, allUser)
|
||||
end
|
||||
@users
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -570,7 +570,7 @@ class UsersController < ApplicationController
|
|||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
search = params[:name].to_s.strip.downcase
|
||||
type_ids = params[:property]=="" ? "(1, 2, 3)" : "(" + params[:property] + ")"
|
||||
type_ids = params[:property]=="" || params[:property].nil? ? "(1, 2, 3)" : "(" + params[:property] + ")"
|
||||
if(params[:type].blank? || params[:type] == "1") #全部
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
|
|
|
@ -1,2 +1,15 @@
|
|||
module SchoolHelper
|
||||
def schoolMember_num school
|
||||
count = student_num(school) + teacher_num(school)
|
||||
count.to_s
|
||||
end
|
||||
|
||||
def student_num school
|
||||
UserExtensions.find_by_sql("SELECT * FROM user_extensions WHERE occupation = '#{school.name}' AND identity = '1'").count
|
||||
end
|
||||
|
||||
def teacher_num school
|
||||
UserExtensions.find_by_sql("SELECT * FROM user_extensions AS ue, schools AS s WHERE ue.school_id = s.id AND s.name = '#{school.name}' AND ue.identity = '0'").count
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -84,7 +84,9 @@ class Issue < ActiveRecord::Base
|
|||
attr_reader :current_journal
|
||||
|
||||
# fq
|
||||
after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message, :act_as_at_message, :add_issues_count
|
||||
after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message,
|
||||
act_as_at_message(:description, :author_id), :add_issues_count
|
||||
|
||||
after_update :be_user_score,:update_activity
|
||||
after_destroy :down_user_score, :decrease_issues_count
|
||||
# after_create :be_user_score
|
||||
|
@ -165,12 +167,12 @@ class Issue < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# at 功能添加消息提醒
|
||||
def act_as_at_message
|
||||
users = self.description.scan /<span class="at" data-user-id="(\d+?)">/m
|
||||
users && users.flatten.uniq.each do |uid|
|
||||
self.at_messages << AtMessage.new(user_id: uid, sender_id: self.author_id)
|
||||
end
|
||||
end
|
||||
# def act_as_at_message
|
||||
# users = self.description.scan /<span class="at" data-user-id="(\d+?)">/m
|
||||
# users && users.flatten.uniq.each do |uid|
|
||||
# self.at_messages << AtMessage.new(user_id: uid, sender_id: self.author_id)
|
||||
# end
|
||||
# end
|
||||
|
||||
# 创建issue的时候,issues_count加1
|
||||
def add_issues_count
|
||||
|
|
|
@ -51,7 +51,7 @@ class Journal < ActiveRecord::Base
|
|||
before_create :split_private_notes, :add_journals_count
|
||||
|
||||
# fq
|
||||
after_save :act_as_activity,:be_user_score, :act_as_forge_message, :act_as_at_message
|
||||
after_save :act_as_activity,:be_user_score, :act_as_forge_message, act_as_at_message(:notes, :user_id)
|
||||
after_create :update_issue_time
|
||||
# end
|
||||
#after_destroy :down_user_score
|
||||
|
@ -186,13 +186,6 @@ class Journal < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def act_as_at_message
|
||||
users = self.notes.scan /<span class="at" data-user-id="(\d+?)">/m
|
||||
users && users.flatten.uniq.each do |uid|
|
||||
self.at_messages << AtMessage.new(user_id: uid, sender_id: self.user_id)
|
||||
end
|
||||
end
|
||||
|
||||
# 更新用户分数 -by zjc
|
||||
def be_user_score
|
||||
#新建了缺陷留言且留言不为空,不为空白
|
||||
|
|
|
@ -68,7 +68,9 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
has_many :at_messages, as: :at_message, dependent: :destroy
|
||||
|
||||
validates :notes, presence: true, if: :is_homework_jour?
|
||||
after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, :act_as_at_message, :act_as_user_feedback_message, :act_as_principal_activity, :act_as_student_score
|
||||
after_create :act_as_activity, :act_as_course_activity, :act_as_course_message,
|
||||
act_as_at_message(:notes, :user_id), :act_as_user_feedback_message,
|
||||
:act_as_principal_activity, :act_as_student_score
|
||||
after_create :reset_counters!
|
||||
#after_update :update_activity
|
||||
after_destroy :reset_counters!
|
||||
|
@ -253,12 +255,7 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def act_as_at_message
|
||||
users = self.notes.scan /<span class="at" data-user-id="(\d+?)">/m
|
||||
users && users.flatten.uniq.each do |uid|
|
||||
self.at_messages << AtMessage.new(user_id: uid, sender_id: self.user_id)
|
||||
end
|
||||
end
|
||||
|
||||
# 用户留言消息通知
|
||||
def act_as_user_feedback_message
|
||||
# 主留言
|
||||
|
|
|
@ -81,7 +81,8 @@ class Message < ActiveRecord::Base
|
|||
after_update :update_messages_board, :update_activity
|
||||
after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets, :decrease_boards_count, :down_course_score
|
||||
|
||||
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity, :act_as_system_message, :send_mail, :act_as_student_score, :act_as_at_message
|
||||
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity,
|
||||
:act_as_system_message, :send_mail, :act_as_student_score, act_as_at_message(:content, :author_id)
|
||||
#before_save :be_user_score
|
||||
|
||||
scope :visible, lambda {|*args|
|
||||
|
@ -287,13 +288,6 @@ class Message < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def act_as_at_message
|
||||
users = self.content.scan /<span class="at" data-user-id="(\d+?)">/m
|
||||
users && users.flatten.uniq.each do |uid|
|
||||
self.at_messages << AtMessage.new(user_id: uid, sender_id: self.author_id)
|
||||
end
|
||||
end
|
||||
|
||||
#更新用户分数 -by zjc
|
||||
def be_user_score
|
||||
#新建message且无parent的为发帖
|
||||
|
|
|
@ -10,16 +10,16 @@
|
|||
资源名称
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
资源大小
|
||||
<%= link_to "资源大小",admin_course_resource_list_path(:sort => "file_size") %>
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
资源类型
|
||||
</th>
|
||||
<th style="width: 23px;">
|
||||
上传时间
|
||||
<%= link_to "上传时间",admin_course_resource_list_path(:sort => "file_upload") %>
|
||||
</th>
|
||||
<th style="width: 15px;">
|
||||
下载次数
|
||||
<%= link_to "下载次数",admin_course_resource_list_path(:sort => "file_download_times") %>
|
||||
</th>
|
||||
<th style="width: 20px;">
|
||||
上传者
|
||||
|
@ -61,4 +61,6 @@
|
|||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_course_resource_list)) -%>
|
|
@ -72,4 +72,6 @@
|
|||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_excellent_courses_list)) -%>
|
|
@ -45,6 +45,9 @@
|
|||
<th style="width: 50px;">
|
||||
用户身份
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
用户单位
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -59,7 +62,7 @@
|
|||
<%=format_time(teacher.last_login_on) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=teacher.user_id %>
|
||||
<%= teacher.user_id %>
|
||||
</td>
|
||||
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if teacher.try(:realname) == ' '%><%= teacher.login%><% else %><%=teacher.try(:realname) %><% end %>'>
|
||||
<% if teacher.try(:realname) == ' '%>
|
||||
|
@ -69,11 +72,14 @@
|
|||
<% end %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=link_to(teacher.login, user_path(teacher.user_id)) %>
|
||||
<%= link_to(teacher.login, user_path(teacher.user_id)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
老师
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= teacher.school_id.nil? ? "" : (School.find teacher.school_id).try(:name) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
@ -82,3 +88,5 @@
|
|||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_latest_login_teacher_list)) -%>
|
|
@ -46,6 +46,9 @@
|
|||
<th style="width: 50px;">
|
||||
用户身份
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
用户单位
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -88,6 +91,17 @@
|
|||
<% end %>
|
||||
<% end%>
|
||||
</td>
|
||||
<td align="center">
|
||||
<% unless user.user_extensions.nil? %>
|
||||
<% if user.user_extensions.identity.to_i == 0 %>
|
||||
<!--优先取school中校名,如果校名不存在就取occupation-->
|
||||
<% occupation = user.user_extensions.school_id.nil? ? "" : (School.where("id =?", user.user_extensions.school_id)).first.try(:name) %>
|
||||
<%= occupation.blank? ? user.user_extensions.occupation : occupation %>
|
||||
<% else %>
|
||||
<%= user.user_extensions.occupation %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
|
|
@ -40,4 +40,8 @@
|
|||
</table>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_project_plural)) -%>
|
||||
<ul class="wlist" id="pages" style="float: right;margin-top: 10px;">
|
||||
<%= pagination_links_full @organization_pages, @organization_count ,:per_page_links => true, :remote => false, :flag => true %>
|
||||
</ul>
|
||||
|
||||
<!% html_title(l(:llabel_organization_list)) -%>
|
||||
|
|
|
@ -10,16 +10,16 @@
|
|||
资源名称
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
资源大小
|
||||
<%= link_to "资源大小",admin_project_resource_list_path(:sort => "file_size") %>
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
资源类型
|
||||
</th>
|
||||
<th style="width: 23px;">
|
||||
上传时间
|
||||
<%= link_to "上传时间",admin_project_resource_list_path(:sort => "file_upload") %>
|
||||
</th>
|
||||
<th style="width: 15px;">
|
||||
下载次数
|
||||
<%= link_to "下载次数",admin_project_resource_list_path(:sort => "file_download_times") %>
|
||||
</th>
|
||||
<th style="width: 20px;">
|
||||
上传者
|
||||
|
@ -61,4 +61,6 @@
|
|||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_project_resource_list)) -%>
|
|
@ -1,43 +1,64 @@
|
|||
<h3 style="float: left">
|
||||
<%=l(:label_school_plural)%>
|
||||
</h3>
|
||||
<%= form_tag({:controller => 'admin', :action => 'schools' }, :method => :get,:id=>"search_course_form") do %>
|
||||
<%= submit_tag "搜索",:style => "float: right;margin-right: 15px;"%>
|
||||
<input style="float: right;margin-right: 10px;" id="v_subject" placeholder="学校名称" type="text" name="school_name" value="<%= @school_name%>">
|
||||
<% end %>
|
||||
<!--<!%= form_tag({:controller => 'admin', :action => 'schools' }, :method => :get,:id=>"search_course_form") do %>-->
|
||||
<!-- <!%= submit_tag "搜索",:style => "float: right;margin-right: 15px;"%>-->
|
||||
<!--<input style="float: right;margin-right: 10px;" id="v_subject" placeholder="学校名称" type="text" name="school_name" value="<%= @school_name%>">-->
|
||||
<!% end %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="autoscroll" style="margin-top: 40px;">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 50px;">
|
||||
<th style="width: 35px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 100px;">
|
||||
<th style="width: 60px;">
|
||||
LOGO
|
||||
</th>
|
||||
<th>
|
||||
<th style="width: 100px;">
|
||||
学校名称
|
||||
</th>
|
||||
<th style="width: 100px;"></th>
|
||||
<th style="width: 35px;">
|
||||
用户数
|
||||
</th>
|
||||
<th style="width: 90px;">
|
||||
创建时间
|
||||
</th>
|
||||
<th style="width: 80px;">
|
||||
编辑高校信息
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @schools.each do |school|%>
|
||||
<% @count=@page * 30 %>
|
||||
<% @schools.each do |school| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align:center;vertical-align: middle;">
|
||||
<%= school.id %>
|
||||
<!td style="text-align:center;vertical-align: middle;">
|
||||
<!%= school.id %>
|
||||
<% @count +=1 %>
|
||||
<td align="center">
|
||||
<%=@count %>
|
||||
</td>
|
||||
|
||||
<td align="center">
|
||||
<%= image_tag(school.logo_link,width:40,height:40) %>
|
||||
<!%= school.name %>
|
||||
</td>
|
||||
|
||||
<td style="text-align:center;vertical-align: middle;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=school.name%>'>
|
||||
<span>
|
||||
<%= link_to school.name,"http://#{Setting.host_course}/?school_id=#{school.id}" %>
|
||||
<%= link_to school.name,"http://#{Setting.host_name}/?school_id=#{school.id}" %>
|
||||
</span>
|
||||
</td>
|
||||
<td class="buttons" style="vertical-align: middle;">
|
||||
<td style="vertical-align: middle;text-align:center">
|
||||
<%= schoolMember_num(school) %>
|
||||
</td>
|
||||
<td style="vertical-align: middle;text-align:center">
|
||||
<%= format_time(school.created_at) %>
|
||||
</td>
|
||||
<td class="buttons" style="vertical-align: middle;text-align:center">
|
||||
<%= link_to("修改", upload_logo_school_path(school.id,:school_name => @school_name), :class => 'icon icon-copy') %>
|
||||
<%#= link_to(l(:button_delete), organization_path(school.id), :method => :delete,:confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
|
||||
</td>
|
||||
|
@ -50,4 +71,4 @@
|
|||
<%= pagination_links_full @school_pages, @school_count ,:per_page_links => true, :remote => false, :flag => true %>
|
||||
</ul>
|
||||
|
||||
<% html_title(l(:label_project_plural)) -%>
|
||||
<% html_title(l(:label_school_plural)) -%>
|
||||
|
|
|
@ -40,7 +40,10 @@
|
|||
<%= sort_header_tag('admin', :caption => l(:field_admin), :default_order => 'desc') %>
|
||||
<%= sort_header_tag('created_on', :caption => l(:field_created_on), :default_order => 'desc') %>
|
||||
<%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on), :default_order => 'desc') %>
|
||||
<th style="width: 100px;"></th>
|
||||
<%#= sort_header_tag('user_occupation', :caption => l(:field_occupation), :default_order => 'desc') %>
|
||||
<th style="width: 100px;">用户单位</th>
|
||||
<th style="width: 40px;"></th>
|
||||
<th style="width: 40px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -53,8 +56,11 @@
|
|||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center" align="center"><%= checked_image user.admin? %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="created_on" align="center" title='<%=format_time(user.created_on)%>'><%= format_time(user.created_on) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="last_login_on" align="center" title='<%= format_time(user.last_login_on)%>'><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
|
||||
<td class="buttons"> <%= change_status_link(user) %>
|
||||
<%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %> </td>
|
||||
<% occupation = user.user_extensions.identity == 0 ? School.where("id=?",user.user_extensions.school_id).first.try(:name) : user.user_extensions.occupation %>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center" align="center" title="<%= occupation %>"> <%= truncate( occupation, :length => 12 ) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="buttons" align="center" title='<%=user.id %>'> <%= change_status_link(user) %></td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="buttons" align="center" title='<%=user.id %>'> <%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %></td>
|
||||
|
||||
</tr>
|
||||
<% end -%>
|
||||
</tbody>
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
[
|
||||
<% @users && @users.each_with_index do |person,index| %>
|
||||
<% if index == 0 %>
|
||||
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
|
||||
<%= index != @users.size-1 ? ',' : '' %>
|
||||
<% else %>
|
||||
{"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
|
||||
<%= index != @users.size-1 ? ',' : '' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
]
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<div class="fl">
|
||||
<p class="f12 mb5"><%=link_to e_course.name, course_path(e_course.id), :class => "hidden fl w170" %><div class="cl"></div> </p>
|
||||
<p class="f12">
|
||||
<% if visable_attachemnts(e_course.attachments).count > 0 %>
|
||||
<span class="fl mr15 fontGrey4"><%= l(:project_module_attachments) %>(<%= link_to visable_attachemnts(e_course.attachments).count, course_files_path(e_course), :class => "linkBlue2" %>)</span>
|
||||
<% if visable_attachemnts_incourse(e_course).count > 0 %>
|
||||
<span class="fl mr15 fontGrey4"><%= l(:project_module_attachments) %>(<%= link_to visable_attachemnts_incourse(e_course).count, course_files_path(e_course), :class => "linkBlue2" %>)</span>
|
||||
<% end %>
|
||||
<% if e_course.homework_commons.where("publish_time <= '#{Date.today}'").count > 0 %>
|
||||
<span class="fl fontGrey4"><%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.where("publish_time <= '#{Date.today}'").count, homework_common_index_path(:course=>e_course.id), :class => "linkBlue2" %>)</span>
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#Container").css("width","1000px");
|
||||
if(true == <%= @is_edit %>) {
|
||||
is_edit = <%= @is_edit.present? && @is_edit == true %>
|
||||
if(is_edit) {
|
||||
issueEditShow();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
<% end%>
|
||||
</li>
|
||||
<li class="fl subject-list-date">
|
||||
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "fl",:remote => true%>
|
||||
<% if @order == "created_at"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
|
||||
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "fl",:remote => true%>
|
||||
<% if @order == "publish_time"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12 fl" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
I18n.default_locale = 'en'
|
||||
I18n.backend = Redmine::I18n::Backend.new
|
||||
|
||||
require 'redmine'
|
||||
require 'trustie'
|
||||
require 'redmine'
|
||||
|
||||
# Load the secret token from the Redmine configuration file
|
||||
secret = Redmine::Configuration['secret_token']
|
||||
|
|
|
@ -1523,6 +1523,9 @@ en:
|
|||
label_excellent_courses_list: excellent_courses
|
||||
label_course_resource_list: course_resource_list
|
||||
label_project_resource_list: project_resource_list
|
||||
label_organization_list: organzation_list
|
||||
label_latest_login_teacher_list: latest_login_teacher_list
|
||||
label_latest_login_user_list: latest_login_teacher_list
|
||||
|
||||
#api
|
||||
label_recently_updated_notification: Recently updated notification
|
||||
|
@ -1535,3 +1538,12 @@ en:
|
|||
error_upload_avatar_to_large: "too big (%{max_size})"
|
||||
not_valid_image_file: not a valid image file
|
||||
|
||||
#resource
|
||||
label_resource_name: Resource_name
|
||||
label_resource_type: Rescource_type
|
||||
label_resource_size: Rescource_size
|
||||
label_resource_upload_date: Resource_upload_date
|
||||
label_resource_download_times: Resource_download_times
|
||||
label_resource_upload_author: Resource_upload_author
|
||||
label_resource_belongs_course: Resource_belongs_course
|
||||
label_resource_belongs_project: Resource_belongs_project
|
||||
|
|
|
@ -563,6 +563,7 @@ zh:
|
|||
label_overall_activity: 活动概览
|
||||
label_new: 新建
|
||||
label_latest_login_user_list: 最近登录用户列表
|
||||
label_latest_login_teacher_list: 最近登录教师列表
|
||||
|
||||
label_logged_as: 登录为
|
||||
label_environment: 环境
|
||||
|
@ -2111,4 +2112,14 @@ zh:
|
|||
|
||||
# 课程推荐
|
||||
label_homework_commont: 作业
|
||||
label_homework_recommendation: 课程推荐
|
||||
label_homework_recommendation: 课程推荐
|
||||
|
||||
#资源
|
||||
label_resource_name: 资源名称
|
||||
label_resource_type: 资源类型
|
||||
label_resource_size: 资源大小
|
||||
label_resource_upload_date: 上传时间
|
||||
label_resource_download_times: 下载次数
|
||||
label_resource_upload_author: 上传者
|
||||
label_resource_belongs_course: 所属课程
|
||||
label_resource_belongs_project: 所属项目
|
|
@ -2,3 +2,4 @@ require 'trustie/utils'
|
|||
require 'trustie/utils/image'
|
||||
require 'trustie/gitlab/api'
|
||||
require 'trustie/grack/grack'
|
||||
require 'trustie/at/at'
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
#coding=utf-8
|
||||
|
||||
module Trustie
|
||||
module At
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
module ClassMethods
|
||||
def act_as_at_message(content, send_id)
|
||||
self.send :define_method, :act_as_at_message_func do
|
||||
users = self[content].scan /<span class="at" data-user-id="(.+?)">/m
|
||||
users && users.flatten.uniq.each do |uids|
|
||||
uids.split(",").each do |uid|
|
||||
self.at_messages << AtMessage.new(user_id: uid, sender_id: self[send_id])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ActiveRecord::Base.send(:include, Trustie::At)
|
|
@ -32,30 +32,34 @@ $(function(){
|
|||
return;
|
||||
}
|
||||
|
||||
$.post(
|
||||
'/student_work/program_test',
|
||||
{homework: homework_id, student_work_id: student_work_id, src: src, title: title, is_test: is_test},
|
||||
function(data,status){
|
||||
tested = true;
|
||||
console.log(data);
|
||||
if(data.index <=0){
|
||||
data.index = $('.ProResultTop').length+1;
|
||||
}
|
||||
$.ajax({
|
||||
url: '/student_work/program_test',
|
||||
type: 'POST',
|
||||
timeout: 60*1000,
|
||||
data: {homework: homework_id, student_work_id: student_work_id, src: src, title: title, is_test: is_test}
|
||||
}).done(function(data){
|
||||
tested = true;
|
||||
console.log(data);
|
||||
if(data.index <=0){
|
||||
data.index = $('.ProResultTop').length+1;
|
||||
}
|
||||
if (typeof cb == 'function') {cb(data); return;}
|
||||
var html=bt('t:result-list',data);
|
||||
$('.ProResult').prepend(html);
|
||||
|
||||
if (typeof cb == 'function') {cb(data); return;}
|
||||
|
||||
|
||||
var html=bt('t:result-list',data);
|
||||
$('.ProResult').prepend(html);
|
||||
|
||||
if (data.status==0 && is_test != 'true') {
|
||||
var r=confirm("答题正确,是否立刻提交?");
|
||||
if (r) {
|
||||
$(".HomeWorkCon form").submit();
|
||||
}
|
||||
if (data.status==0 && is_test != 'true') {
|
||||
var r=confirm("答题正确,是否立刻提交?");
|
||||
if (r) {
|
||||
$(".HomeWorkCon form").submit();
|
||||
}
|
||||
}
|
||||
);
|
||||
}).fail(function(xhr, status){
|
||||
if(status == 'timeout'){
|
||||
alert("您的答案超时了, 请检查代码是否存在死循环的错误.");
|
||||
} else {
|
||||
alert("测试失败,服务器出错.")
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$('#test-program-btn').on('click', test_program);
|
||||
|
|
|
@ -1476,7 +1476,7 @@ a.choose-active {background-color:#269ac9; color:#ffffff;}
|
|||
.subject-list-search {border:1px solid #dddddd; height:32px; width:250px;}
|
||||
.subject-list-info {width:385px; background-color:#f1f1f1; border:1px solid #dddddd; height:32px; line-height:32px; vertical-align:middle; text-align:center; color:#7a7a7a;}
|
||||
.subject-list-wrap {border:1px solid #dddddd; border-top:none; padding:10px; width:365px; height:460px; overflow-y:auto;}
|
||||
.subject-content-wrapper {border:1px solid #dddddd; border-top:none; padding:10px; width:265px; height:430px; overflow-y:auto;}
|
||||
.subject-content-wrapper {border:1px solid #dddddd; border-top:none; padding:10px; width:265px; height:985px; overflow-y:auto;}
|
||||
.subject-list-type {width:50px; text-align:center;}
|
||||
.subject-list-count {width:60px; text-align:center;}
|
||||
.subject-list-from {width:145px; text-align:center;}
|
||||
|
@ -1486,4 +1486,4 @@ a.choose-active {background-color:#269ac9; color:#ffffff;}
|
|||
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_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;}
|
||||
a:hover.st_img { border:1px solid #1c9ec7; }
|
||||
a:hover.st_img { border:1px solid #1c9ec7; }
|
||||
|
|
Loading…
Reference in New Issue