Merge branch 'rep_quality' into cxt_course

Conflicts:
	db/schema.rb
This commit is contained in:
cxt 2016-07-29 14:36:18 +08:00
commit a1a2b3dd33
61 changed files with 812 additions and 149 deletions

View File

@ -51,7 +51,7 @@ gem 'elasticsearch-rails'
### profile
gem 'oneapm_rpm'
# gem 'oneapm_rpm'
group :development do
gem 'grape-swagger'

View File

@ -598,6 +598,66 @@ class AdminController < ApplicationController
format.html
end
end
# 获取申请的高校列表
# status: 0 未审批; 1 已批阅;
def applied_schools
@name = params[:name]
@apply_status = ApplyAddSchools.where(:status => 0).order('created_at desc')
@apply_count = @apply_status.count
@apply_pages = Paginator.new @apply_count, 30, params['page'] || 1
@apply_status = paginateHelper @apply_status, 30
@page = (params['page'] || 1).to_i - 1
respond_to do |format|
format.html
end
end
def has_applied_schools
@name = params[:name]
@has_apply_status = ApplyAddSchools.where(:status => 1).order('created_at desc')
@has_apply_count = @has_apply_status.count
@has_apply_pages = Paginator.new @has_apply_count, 30, params['page'] || 1
@has_apply_status = paginateHelper @has_apply_status, 30
@page = (params['page'] || 1).to_i - 1
respond_to do |format|
format.html
end
end
# 批准未审批的高校
# 消息发送,发送对象为申请人
# status: 0表示未批准 status1表示已批准 status 2表示已拒绝
def approve_applied_schools
applied_school = ApplyAddSchools.find params[:id]
applied_school.update_column('status', 1) unless applied_school.nil?
AppliedMessage.create(:user_id => applied_school.user_id, :status => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools")
respond_to do |format|
format.html{ redirect_to unapplied_schools_url }
end
end
# 更改申请的高校名称
# REDO: 修改该字段
# REDO: 同步修改使用了改名称的用户单位
def edit_applied_schools
@applied_schools = ApplyAddSchools.find params[:id]
@applied_schools.update_column('name', params[:name])
end
# 删除申请的高校
# REDO: destroy关联删除
# REDO: 删除确认提示,是否删除
# REDO: 给申请人发送消息
def delete_applied_schools
@applied_schools = ApplyAddSchools.find params[:id]
@applied_schools.destroy
end
#移动端版本管理
def mobile_version
@versions = PhoneAppVersion.reorder('created_at desc')

View File

@ -2,43 +2,63 @@ class AppliedProjectController < ApplicationController
#申请加入项目
def applied_join_project
@user_id = params[:user_id]
@project = Project.find_by_id(params[:project_id])
if params[:project_join]
if @project
user = User.find @user_id
if user.member_of?(@project)
@status = 3
else
@applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id])
if @applieds.count == 0
appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id])
Mailer.run.applied_project(appliedproject)
@status = 2
else
@status = 1
end
end
else
@status = 0
end
respond_to do |format|
format.js
end
return
end
@project = Project.find_by_id(params[:object_id])
# @user_id = params[:user_id]
# if params[:project_join]
# if @project
# user = User.find @user_id
# if user.member_of?(@project)
# @status = 3
# else
# @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id])
# if @applieds.count == 0
# appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id])
# Mailer.run.applied_project(appliedproject)
# @status = 2
# else
# @status = 1
# end
# end
# else
# @status = 0
# end
# respond_to do |format|
# format.js
# end
# return
# end
#
# @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id])
# if @applieds.count == 0
# appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id])
# Mailer.run.applied_project(appliedproject)
# end
#
# #redirect_to project_path(params[:project_id])
# #redirect_to_referer_or {render :text => ( 'applied success.'), :layout => true}
# respond_to do |format|
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
# format.js { render :partial => 'set_applied'}
# end
end
@applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id])
if @applieds.count == 0
appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id])
Mailer.run.applied_project(appliedproject)
end
#redirect_to project_path(params[:project_id])
#redirect_to_referer_or {render :text => ( 'applied success.'), :layout => true}
respond_to do |format|
format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
format.js { render :partial => 'set_applied'}
# @flage:提示语标志1邀请码错误2已经是项目成员 3角色没有选择; 4申请成功
# role:成员角色 => 01管理人员2开发人员3报告人员
# 申请成功则发送消息
def applied_project_info
@project = Project.find(params[:project_id])
if params[:invite_code].to_s != @project.invite_code
@flag = 1
elsif User.current.member_of?(@project)
@flag = 2
elsif params[:member].nil?
@flag = 3
else
@flag = 4
role = params[:member] == "member_manager" ? 1 : (params[:member] = "member_developer" ? 2 : 3)
applied_project = AppliedProject.create(:user_id => User.current.id, :project_id => params[:project_id], :role => role)
# 申请成功则给项目管理员发送邮件及发送消息
Mailer.run.applied_project(applied_project)
end
end

View File

@ -180,7 +180,7 @@ class SchoolController < ApplicationController
applyschool.city = params[:city]
applyschool.address = params[:address]
applyschool.remarks = params[:remarks]
applyschool.user_id = User.current.id
if applyschool.save
data[:school_id] = school.id
else

View File

@ -381,14 +381,32 @@ class StudentWorkController < ApplicationController
@is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
@show_all = false
course_group = CourseGroup.find_by_id(@group) if @group
if course_group
group_students = course_group.users
if group_students.empty?
student_in_group = '(0)'
# 0表示没有分组的学生-1表示所有分组的学生
if @group
if @group == "0"
none_group_students = @course.members.select{ |member| member.course_group_id == 0 }
if none_group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + none_group_students.map{ |member| member.user_id }.join(',') + ')'
end
elsif @group == "-1"
all_group_students = @course.members.select{ |member| member.course_group_id }
if all_group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + all_group_students.map{ |member| member.user_id }.join(',') + ')'
end
else
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
course_group = CourseGroup.find_by_id(@group)
group_students = course_group.users
if group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + group_students.map{ |user| user.id }.join(',') + ')'
end
end
#开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?)
if @order == 'lastname'

View File

@ -88,7 +88,7 @@ class SyllabusesController < ApplicationController
end
def destroy
if @syllabus && @syllabus.courses.empty?
if @syllabus && @syllabus.courses.not_deleted.empty?
@syllabus.destroy
redirect_to user_courselist_user_path(User.current.id)
end

View File

@ -33,7 +33,6 @@ module ApplicationHelper
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
# def user_blogs_path(resource,parameters={})
# super
# end

View File

@ -596,6 +596,26 @@ module CoursesHelper
Course.tagged_with(tag_name).order('updated_at desc')
end
# 获取动态列表名称
def get_acts_list_type type
case type
when "homework"
l(:label_homework_acts)
when "news"
l(:label_news_acts)
when "attachment"
l(:label_attachment_acts)
when "message"
l(:label_message_acts)
when "journalsForMessage"
l(:label_journalsForMessage_acts)
when "poll"
l(:label_poll_acts)
else
l(:label_all_cats)
end
end
#分班下拉框
def course_group_option course
type = []

View File

@ -101,6 +101,10 @@ module StudentWorkHelper
if course.course_groups && !course.course_groups.empty?
base = []
base << l(:label_chose_group)
base << -1
result << base
base = []
base << l(:label_no_group)
base << 0
result << base
course.course_groups.each do |group|

View File

@ -54,6 +54,18 @@ module UsersHelper
end
end
# 获取消息角色
def applied_project_message_type role
case role
when 1
"管理员"
when 2
"开发人员"
when 3
"报告人员"
end
end
def get_resource_origin attach
type = attach.container_type
content = attach.container

View File

@ -364,22 +364,29 @@ module WatchersHelper
:class => "pr_join_a" ,:id=>id
end
#申请加入项目
# 申请加入项目
def join_in_project_link(project, user, options=[])
return '' unless user && user.logged?
applied = project.applied_projects.find_by_user_id(user.id)
text = applied ? l(:label_unapply_project) : l(:label_apply_project)
@applied_flag = project.instance_of?(Project)
url = applied_join_project_path(:object_id => project.id)
method = 'post'
@applied_flag = project.instance_of?(Project)
if applied
appliedid = applied.id
link = "<a class ='pr_join_a'>#{text}</a>"
else
link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "pr_join_a")
end
id = applied_css(project)
url = appliedproject_path(
:id=>appliedid,
:user_id => user.id,
:project_id => project.id)
method = applied ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method , :class => "pr_join_a",:id => id
link.html_safe
# if applied
# appliedid = applied.id
# end
# id = applied_css(project)
# url = appliedproject_path(
# :id=>appliedid,
# :user_id => user.id,
# :project_id => project.id)
# method = applied ? 'delete' : 'post'
# link_to text, url, :remote => true, :method => method , :class => "pr_join_a",:id => id
end
def paginateHelper obj, pre_size=20

View File

@ -0,0 +1,21 @@
class AppliedMessage < ActiveRecord::Base
# status: 0表示未批准 status1表示已批准 status 2表示已拒绝
attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed
belongs_to :applied ,:polymorphic => true
belongs_to :apply_add_schools
belongs_to :user
has_many :message_alls, :class_name => 'MessageAll', :as =>:message, :dependent => :destroy
validates :user_id,presence: true
validates :applied_id,presence: true
validates :applied_type, presence: true
after_create :add_user_message
# 因为要排序所以需要写入总表
def add_user_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id, :viewed => false)
end
end
end

View File

@ -1,18 +1,16 @@
class AppliedProject < ActiveRecord::Base
attr_accessible :project_id, :user_id
attr_accessible :project_id, :user_id, :role
belongs_to :user
belongs_to :project
has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy
has_many :applied_messages, :class_name => 'AppliedMessage', :as => :applied, :dependent => :destroy
after_create :send_appliled_message
# 仅仅给项目管理人员发送消息
def send_appliled_message
# if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.project.members.each do |m|
if m.roles.first.to_s.include?("Manager")
self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.project_id, :viewed => false)
end
self.project.managers.each do |member|
self.applied_messages << AppliedMessage.new(:user_id => member.user_id, :status => true, :viewed => false)
end
# end
end

View File

@ -1,4 +1,16 @@
class ApplyAddSchools < ActiveRecord::Base
# status0 未审批 1 已批阅
attr_accessible :address, :city, :name, :province, :remarks, :school_id, :status
has_many :applied_messages, :class_name =>'AppliedMessage', :as => :applied, :dependent => :destroy
belongs_to :school
after_create :send_massage
#给系统所有管理发送消息
def send_massage
users = User.where(:admin => 1)
users.each do |user|
self.applied_messages << AppliedMessage.new(:user_id => user.id, :viewed => false, :status => false)
end
end
end

View File

@ -268,6 +268,11 @@ class Project < ActiveRecord::Base
notified.collect(&:mail)
end
# 返回为member类型数组
def managers
self.members.includes(:roles).select{|member| member.roles[0].try(:name) == "Manager"}
end
def initialize(attributes=nil, *args)
super
@ -904,6 +909,24 @@ class Project < ActiveRecord::Base
User.find(self.user_id)
end
# 延迟生成邀请码
def invite_code
return generate_invite_code
end
# 生成邀请码
# 如果已有改邀请码,则重新生成
CODES = %W(2 3 4 5 6 7 8 9 A B C D E F G H J K L N M O P Q R S T U V W X Y Z)
def generate_invite_code
code = read_attribute(:invite_code)
if !code || code.size <5
code = CODES.sample(5).join
return generate_invite_code if Project.where(invite_code: code).present?
update_attribute(:invite_code, code)
end
code
end
private
def after_parent_changed(parent_was)

View File

@ -0,0 +1,6 @@
<div class="tabs">
<ul>
<li><%= link_to '未审批', {:action => 'applied_schools'}, class: "#{current_page?(unapplied_schools_path)? 'selected' : nil }" %></li>
<li><%= link_to '已审批', {:action => 'has_applied_schools'}, class: "#{current_page?(applied_schools_path)? 'selected' : nil }" %></li>
</ul>
</div>

View File

@ -0,0 +1,78 @@
<h3>
<%=l(:label_applied_shcools)%>
</h3>
<%= render 'tab_has_applied_applied' %>
<%= form_tag({}, :method => :get) do %>
<fieldset>
<label for='name'>
单位名称:
</label>
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
</fieldset>
<% end %>
&nbsp;
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 20px;">
序号
</th>
<th style="width: 85px;">
单位名称
</th>
<th style="width: 75px;">
地区
</th>
<th style="width: 75px;">
详细地址
</th>
<th style="width: 20px;">
用户
</th>
<th style="width: 60px;">
创建时间
</th>
<th style="width: 75px;">
操作
</th>
</tr>
</thead>
<tbody>
<% @apply_status.each do |apply| %>
<% if apply.status == 0 %>
<tr class="odd">
<td style="text-align: center;">
<%= apply.id %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=apply.name%>' id="schools_title_<%= apply.id %>">
<%= apply.name %>
</td>
<td class="center">
<%= apply.province + apply.city %>
</td>
<td align="left" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%= apply.address %>
</td>
<td class="center">
<%= apply.user_id %>
</td>
<td class="center">
<%= format_date(apply.created_at) %>
</td>
<td class="center">
<%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }, :class => 'icon-del') %>
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id }, :class => 'icon-del') %>
<%= link_to( l(:button_change), { :controller => 'admin', :action => 'edit_applied_schools', :id => apply.id, :name => apply.name }, :class => 'icon-del') %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>

View File

@ -0,0 +1,77 @@
<h3>
<%=l(:label_applied_shcools)%>
</h3>
<%= render 'tab_has_applied_applied' %>
<%= form_tag({}, :method => :get) do %>
<fieldset>
<label for='name'>
单位名称:
</label>
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
</fieldset>
<% end %>
&nbsp;
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 20px;">
序号
</th>
<th style="width: 85px;">
单位名称
</th>
<th style="width: 75px;">
地区
</th>
<th style="width: 75px;">
详细地址
</th>
<th style="width: 20px;">
用户
</th>
<th style="width: 60px;">
创建时间
</th>
<th style="width: 75px;">
操作
</th>
</tr>
</thead>
<tbody>
<% @has_apply_status.each do |apply| %>
<% if apply.status == 1 %>
<tr class="odd">
<td style="text-align: center;">
<%= apply.id %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=apply.name%>' id="schools_title_<%= apply.id %>">
<%= apply.name %>
</td>
<td class="center">
<%= apply.province + apply.city %>
</td>
<td align="left" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%= apply.address %>
</td>
<td class="center">
<%= apply.user_id %>
</td>
<td class="center">
<%= format_date(apply.created_at) %>
</td>
<td class="center">
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id }, :class => 'icon-del') %>
<%= link_to( l(:button_change), { :controller => 'admin', :action => 'edit_applied_schools', :id => apply.id, :name => apply.name }, :class => 'icon-del') %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>

View File

@ -0,0 +1,29 @@
<div class="sy_popup_top">
<h3 class="fl">欢迎加入项目</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
<div class="cl"></div>
</div>
<div class="sy_popup_con" style="width:370px;">
<%= form_tag( url_for(:controller => 'applied_project', :action => 'applied_project_info', :project_id => @project.id), :remote => true, :id => 'project_applied_form') do %>
<ul class="sy_popup_add ">
<li>
<label >项目邀请码:</label>
<input name="invite_code" class=" sy_input_txt fl" placeholder="请输入六位项目邀请码" style="width:250px"/>
<div class="cl"></div>
</li>
<li>
<label >身份:</label>
<input name="member" value="member_manager" type="radio" class="ml5 mr5 " /><span class="mr10">管理人员</span>
<input name="member" value="member_developer" type="radio" class="ml5 mr5 " /><span class="mr10">开发人员</span>
<input name="member" value="member_reporter" type="radio" class="ml5 mr5 " /><span class="mr10">报告人员</span>
<div class="cl"></div>
</li>
<li>
<label>&nbsp;</label>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#project_applied_form').submit();hideModal()">确&nbsp;&nbsp;定</a></div>
<a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取&nbsp;&nbsp;消</a>
<div class="cl"></div>
</li>
</ul>
<% end %>
</div>

View File

@ -0,0 +1,25 @@
<div id="sy_popup_box" style="width:380px;">
<div class="sy_popup_top sy_popup_top_tishi">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close02 fr" onclick="hideModal()"></a>
<div class="cl"></div>
</div>
<div class="sy_popup_con02" >
<ul class="sy_popup_tishi ">
<li>
<% if @flag == 1 %>
<p>您输入的邀请码错误</p>
<% elsif @flag == 2 %>
<p>您已经是该项目成员</p>
<% elsif @flag == 3 %>
<p>请选择一个角色</p>
<% elsif @flag == 4 %>
<p>您的申请已提交,请等待项目管理员审批</p>
<% end %>
</li>
<li>
<a href="javascript:void(0);" class="sy_btn_blue " onclick="hideModal()">知道了</a>
</li>
</ul>
</div>
</div>

View File

@ -1,14 +1,3 @@
// @status: 0 该项目不存在1 不重复加入2 成功加入; 3 已是项目成员;其它 加入失败
<% if @status == 0%>
alert("<%= l('project.join.tips.notexist') %>");
<% elsif @status == 1%>
alert("<%= l('project.join.tips.repeat') %>");
<% elsif @status == 2%>
alert("<%= l('project.join.tips.success') %>");
hideModal($("#popbox"));
$("#applied_project_link_<%= @project.id%>").replaceWith("<%=escape_javascript(link_to '取消申请',appliedproject_applied_path(:project_id => @project.id,:user_id => User.current.id),:class => "blue_n_btn fr mt20", :remote => "true",:method => "delete",:id => "applied_project_link_#{@project.id}")%>");
<% elsif @status == 3%>
alert("<%= l('project.join.tips.has') %>");
<%else%>
alert("<%= l('project.join.tips.fail') %>");
<%end%>
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_join_project', locals: {:project_id => @project.id}) %>";
pop_box_new(htmlvalue,460,40,50);

View File

@ -0,0 +1,3 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'applied_project/applied_project_tip', locals: {:project_id => @project.id}) %>";
pop_box_new(htmlvalue,380,40,50);
//$("#join_in_project").attr('href','<%#= join_in_project_link(@project, User.current) %>');

View File

@ -92,7 +92,7 @@
<% end %>
<% if options[:author] %>
<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: 10, omission: '...')),user_path(attachment.author),:class => "link-blue" %>,
<%= format_time(attachment.created_on) %>
</span>
<% end %>

View File

@ -130,12 +130,14 @@
<p id="subjectmsg"></p>
</div>
<div id="topic_editor" style="display: none;">
<%if User.current.member_of_course?(course)%>
<%if User.current.member_of_course?(course) %>
<div class="mt10">
<%= f.check_box :sticky, :value => topic.sticky%>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked%>
<% if User.current.id == course.tea_id %>
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<div class="cl"></div>
</div>
<% end %>

View File

@ -1,7 +1,7 @@
<% @members.each do |member| %>
<li >
<%#= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %>
<%= link_to "#{member.principal}#{member.principal.show_name}", user_path(member.principal), :class => "w150 linkBlue fl" %>
<%= link_to "#{member.principal}#{member.principal.show_name}", user_path(member.principal), :class => "w150 linkBlue fl", :style=>"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;", :title => "#{member.principal}#{member.principal.show_name}" %>
<span class="w150 fl">
<%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %>
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),

View File

@ -5,8 +5,15 @@
<li>
<span class="sy_sq_orange fl mr5 mt5"><%= i+1 %></span>
<%=link_to e_course.name, course_path(e_course.id), :class => "sy_class_ltitle fl mb10" %>
<p class="sy_cgrey ml20">作业<span class="sy_cir_grey ml5 mr5"><%=e_course.homework_commons.where("publish_time <= '#{Date.today}'").count %></span>
资源<span class="sy_cir_grey ml5 mr5"><%=visable_attachemnts_incourse(e_course).count %></span>
<p class="sy_cgrey ml20">
<% homework_count = e_course.homework_commons.where("publish_time <= '#{Date.today}'").count %>
<% if homework_count > 0 %>
作业<span class="sy_cir_grey ml5 mr5"><%=homework_count %></span>
<% end %>
<% file_count = visable_attachemnts_incourse(e_course).count %>
<% if file_count > 0 %>
资源<span class="sy_cir_grey ml5 mr5"><%=file_count %></span>
<% end %>
</p>
</li>
<% end %>

View File

@ -1,3 +1,4 @@
<div class="courseRSide fl" id="homework_page_right">
<div class="project_r_h">
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
<% if User.current.allowed_to?(:as_teacher,@course) %>
@ -11,5 +12,6 @@
<% else%>
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
<% end%>
</div>

View File

@ -9,7 +9,8 @@
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner">
<div class="NewsBannerName">班级动态</div>
<div class="NewsBannerName">
<%= get_acts_list_type @type %></div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType" style="width:90px; left:-80px;">

View File

@ -8,7 +8,7 @@
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
"<li class='ur_item'>" +
"<label name='select_items' class='w56'>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" +
"<label name='select_items' class='w60'>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" +
"<input maxlength='200' type='text' name='question_answer[<%=exercise_choice.id %>]' placeholder='输入选项内容' value='<%=exercise_choice.choice_text %>'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +

View File

@ -8,7 +8,7 @@
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
"<li class='ur_item'>" +
"<label name='select_items' class='w56'>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" +
"<label name='select_items' class='w60'>选项<%=convert_to_char (index+1).to_s %><span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>" +
"<input maxlength='200' type='text' name='question_answer[<%= exercise_choice.id %>]' placeholder='输入选项内容' value='<%=exercise_choice.choice_text %>'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
@ -34,7 +34,7 @@
<div id="poll_answers_<%=exercise_question.id%>">
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<li class="ur_item">
<label name='select_items' class='w56'>选项<%=convert_to_char (index+1).to_s %><span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项<%=convert_to_char (index+1).to_s %><span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[<%= exercise_choice.id %>]' placeholder='输入选项内容' value="<%=exercise_choice.choice_text %>">
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>

View File

@ -171,7 +171,7 @@
//单选题
function add_single_answer(doc)
{
var li = doc.parent().after("<li class='ur_item'><label name='select_items' class='w56'>选项&nbsp;<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='输入选项内容'/>" +
var li = doc.parent().after("<li class='ur_item'><label name='select_items' class='w60'>选项&nbsp;<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='输入选项内容'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
"</li><div class='cl'></div>");
var select_items =$("label[name='select_items']",li.parent());

View File

@ -18,28 +18,28 @@
<div class="cl"></div>
<div>
<li class="ur_item">
<label name='select_items' class='w56'>选项A<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项A<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[0]' placeholder='输入选项内容'>
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
<div class="cl"></div>
<li class="ur_item">
<label name='select_items' class='w56'>选项B<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项B<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[1]' placeholder='输入选项内容'>
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
<div class="cl"></div>
<li class="ur_item">
<label name='select_items' class='w56'>选项C<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项C<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[2]' placeholder='输入选项内容'>
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
<div class="cl"></div>
<li class="ur_item">
<label name='select_items' class='w56'>选项D<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项D<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[3]' placeholder='输入选项内容'>
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>

View File

@ -54,28 +54,28 @@
'<input value="<%= score %>" id="question_score" type="text" name="question_score" style="width:40px; text-align:center; padding-left:0px;"/>分'+
'</li><div>'+
'<li class="ur_item">'+
'<label name="select_items" class="w56">选项A<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<label name="select_items" class="w60">选项A<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="输入选项内容"/>'+
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
'</li>'+
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<label name="select_items" class="w56">选项B<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<label name="select_items" class="w60">选项B<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="输入选项内容"/>'+
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
'</li>'+
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<label name="select_items" class="w56">选项C<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<label name="select_items" class="w60">选项C<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="输入选项内容"/>'+
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
'</li>'+
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<label name="select_items" class="w56">选项D<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<label name="select_items" class="w60">选项D<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<input maxlength="200" type="text" name="question_answer[3]" placeholder="输入选项内容"/>'+
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+

View File

@ -20,7 +20,7 @@
<span class='<%= "#{get_issue_priority(@issue.priority_id)[0]} " %>'><%= get_issue_priority(@issue.priority_id)[1] %></span></p>
<br>
<div class="cl"></div>
由<a href="javascript:void(0)" class="problem_name"><%= @issue.author %></a>添加于 <%= format_time(@issue.created_on).html_safe %>
由<%=link_to @issue.author, user_path(@issue.author), :class => "link-blue" %>添加于 <%= format_time(@issue.created_on).html_safe %>
</div>
<!--talk_txt end-->

View File

@ -2,10 +2,10 @@
<!--关注:非项目成员-->
<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<span><%= watcher_link_for_project(@project, User.current) %></span>
<% end %>
<!--加入项目 -->
<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<%= join_in_project_link(@project, User.current) %>
<span id="join_in_project">
<%= join_in_project_link(@project, User.current) %>
</span>
<% end %>
<!--配置项目-->
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>

View File

@ -53,7 +53,8 @@
<%= image_tag(url_to_avatar(@project), :width => "60", :height => "60") %>
</div>
<div class="pr_info_id fl mb5 f14">
<%= l(:label_project_id)%><%= @project.id %>
<%= l(:label_project_ivite_code)%>
<%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %>
</div>
<!--关注、申请加入/退出项目-->
<div id="join_exit_project_div">

View File

@ -38,7 +38,7 @@
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(act.user_id)} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo"><%= link_to User.find(act.user_id), user_url_in_org(act.user_id) %>&nbsp;&nbsp;创建了 <a href="<%= organization_path(@organization)%>" class="newsBlue ml10"><%= Organization.find(act.org_act_id).name %>
<div class="homepagePostTo"><%= link_to User.find(act.user_id), user_url_in_org(act.user_id),:class => "newsBlue mr15" %>&nbsp;&nbsp;创建了 <a href="<%= organization_path(@organization)%>" class="newsBlue ml10"><%= Organization.find(act.org_act_id).name %>
| 组织</a></div>
<div class="homepagePostDate"> 创建时间:<%= format_activity_day(act.created_at) %> <%= format_time(act.created_at, false) %> </div>
</div>
@ -46,7 +46,7 @@
</div>
</div>
<% end %>
<% if act.org_act && act.org_act_type == 'OrgDocumentComment' && act.org_act.organization.home_id != act.org_act.id %>
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act && act.org_act.organization.home_id != act.org_act.id %>
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %>
<% end %>
<% end %>

View File

@ -59,9 +59,14 @@
<li >
<span class="tit_fb ">内容:</span>
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
<%= work.description.html_safe if work.description%>
</div>
<% com_contents = work.work_status %>
<% if com_contents != 0 && work.description %>
<div class="showHworkP break_word upload_img" id="student_work_img_<%= work.id %>">
<%= work.description.html_safe %>
</div>
<% else %>
<span style="color: #999999">该作品未在线下完成提交</span>
<% end %>
<div class="cl"></div>
</li>
<li >

View File

@ -1,6 +1,6 @@
<br>
<div style='width:470px;text-align:center;font-family: "微软雅黑","宋体"' class="f14">
<% if @syllabus.courses.empty? %>
<% if @syllabus.courses.not_deleted.empty? %>
确认删除该课程吗?
<% else %>
该课程下已经存在班级,不能删除。
@ -8,7 +8,7 @@
</div>
</br>
<div style='width:164px; margin:0 auto; text-align:center; font-family: "微软雅黑","宋体"'>
<% if @syllabus.courses.empty? %>
<% if @syllabus.courses.not_deleted.empty? %>
<%=link_to '确认', syllabus_path(@syllabus), :class => 'Blue-btn fl', :method => 'delete'%>
<a href='javascript:void(0);' class='Blue-btn fl' onclick='hideModal()'>关闭</a>
<% else %>

View File

@ -16,7 +16,7 @@
<input type="checkbox" class="mr5" name="base_on_project" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.base_on_project : 1 %>" id="base_on_project"/>
<span class="f14 fontGrey3 mr10">基于项目实施</span>
</label>
<p class="c_red">提醒勾选后各小组必须在Trustie平台创建项目教师可随时观察平台对各小组最新进展的实时统计</p>
<p class="c_red">提醒勾选后各小组必须在Trustie平台创建项目教师可随时观察平台对各小组最新进展的实时统计</p>
</div>
<div class="courseSendSubmit">
<a href="javascript:void(0);" class="group_save_btn sendSourceText">确定</a>

View File

@ -0,0 +1,35 @@
<% if ma.class == AppliedMessage %>
<!--申请加入项目-->
<% if ma.applied_type == "ApplyAddSchools" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">批准你加入项目:</span>
</li>
<li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'><%= ma.applied.name %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% elsif ma && ma.applied_type == "AppliedProject" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.applied.user), :width => "30", :height => "30"), user_path(ma.applied.user), :target => '_blank' %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.applied.user, user_path(ma.applied.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
以“<%= applied_project_message_type(ma.applied.role) %>”身份加入
<%= link_to ma.applied.project, settings_project_path(:id => ma.applied.project.id, :tab => "members"), :class => "link-blue", :target => '_blank' %>
:同意 | 拒绝
</a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>

View File

@ -34,6 +34,8 @@
<%= render :partial => 'users/user_message_org', :locals => {:ma => ma} %>
<%# 申请类消息 %>
<%= render :partial => 'users/user_message_applied', :locals => {:ma => ma} %>
<% end %>
<ul class="wlist" style=" border:none; padding-top: 15px;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>

View File

@ -29,6 +29,16 @@ zh:
label_upload_files: 上传资源
label_apply_join_course: 申请加入班级
label_apply_for_homework: 申请引用作业
#动态名称
label_homework_acts: 作业动态
label_news_acts: 通知动态
label_attachment_acts: 资源库动态
label_message_acts: 论坛动态
label_journalsForMessage_acts: 留言动态
label_poll_acts: 问卷动态
label_all_cats: 全部动态
#
# 课程托管平台主页
#

View File

@ -48,6 +48,7 @@ zh:
# 左边栏
#
label_project_id: "项目ID:"
label_project_ivite_code: "邀请码:"
label_agree_join_project: 同意加入
label_apply_project: "+申请加入"
@ -55,7 +56,7 @@ zh:
label_exit_project: 退出项目
label_apply_project_waiting: 已处理申请,请等待管理员审核
label_member_of_project: 该用户已经是项目成员了!
label_unapply_project: 取消申请
label_unapply_project: 等待审批
lable_sure_exit_project: 是否确认退出该项目
label_friend_organization: 圈子模式
label_research_group: 研讨模式

View File

@ -388,6 +388,7 @@ zh:
label_organization_name: 组织名称
label_organization_list: 组织列表
label_school_plural: 学校列表
label_applied_shcools: 单位名称列表
label_organization_new: 新建组织
label_edit_organization: 编辑组织
label_organization_edit: 修改组织
@ -909,6 +910,7 @@ zh:
button_test: 测试
button_edit: 编辑
button_delete: 删除
button_approve: 批准
button_set_homepage: 设为首页
button_cancel_homepage: 取消首页
button_edit_homepage: 编辑首页
@ -2101,6 +2103,7 @@ zh:
label_file_lost_list: 缺失文件列表
lable_unset: 未设置
label_chose_group: 请选择分班
label_no_group: 暂无
label_hostedz_organization: 主办单位
label_hosted_by: 国防科学技术大学并行与分布处理国家重点实验室

View File

@ -724,8 +724,9 @@ RedmineApp::Application.routes.draw do
post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
post 'appliedproject/applied', :to => 'applied_project#applied_join_project', :as => 'appliedproject'
delete 'appliedproject/applied', :to => 'applied_project#unapplied_join_project'
post 'applied_project/applied_join', :to => 'applied_project#applied_join_project', :as => 'applied_join_project'
post 'applied_project/applied_project_info', :to => 'applied_project#applied_project_info', :as => 'applied_project_info'
delete 'applied_project/applied', :to => 'applied_project#unapplied_join_project', :as => 'unapplied_join_project'
resources :projects do
member do
@ -1072,6 +1073,10 @@ RedmineApp::Application.routes.draw do
match 'admin/default_configuration', :via => :post
get 'admin/organization'
get 'admin/schools'
get 'admin/applied_schools', as: :unapplied_schools
get 'admin/has_applied_schools', as: :applied_schools
get 'admin/approve_applied_schools'
get 'admin/leave_messages'
match 'admin/messages_list', as: :messages_list
match 'admin/project_messages', as: :project_messages

View File

@ -0,0 +1,5 @@
class AddInviteCodeToProject < ActiveRecord::Migration
def change
add_column :projects, :invite_code, :string
end
end

View File

@ -0,0 +1,5 @@
class AddStudentIdToApplyAddSchool < ActiveRecord::Migration
def change
add_column :apply_add_schools, :user_id, :integer
end
end

View File

@ -0,0 +1,13 @@
class CreateAppliedMessages < ActiveRecord::Migration
def change
create_table :applied_messages do |t|
t.integer :user_id
t.integer :applied_id
t.string :applied_type
t.integer :viewed, :default => false
t.integer :status, :default => false
t.timestamps
end
end
end

View File

@ -0,0 +1,5 @@
class AddQrcodeToProject < ActiveRecord::Migration
def change
add_column :projects, :qrcode, :string
end
end

View File

@ -0,0 +1,5 @@
class AddRoleToAppliedProject < ActiveRecord::Migration
def change
add_column :applied_projects, :role, :integer, :default => 0
end
end

View File

@ -10,11 +10,7 @@ module Redmine
def acts_as_watchable(options = {})
return if self.included_modules.include?(Redmine::Acts::Watchable::InstanceMethods)
class_eval do
if self.name == 'User'
has_many :watchers, :dependent => :delete_all
else
has_many :watchers, :as => :watchable, :dependent => :delete_all
end
has_many :watchers, :as => :watchable, :dependent => :delete_all
has_many :watcher_users, :through => :watchers, :source => :user, :validate => false
scope :watched_by, lambda { |user_id|

View File

@ -371,6 +371,7 @@ Redmine::MenuManager.map :admin_menu do |menu|
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
menu.push :messages, {:controller => 'admin', :action => 'messages'}, :caption => :label_system_message
menu.push :schools, {:controller => 'admin', :action => 'schools'}, :caption => :label_school_plural
menu.push :applied_schools, {:controller => 'admin', :action => 'applied_schools'}, :caption => :label_applied_shcools
menu.push :first_page_made, {:controller => 'admin',:action => 'first_page_made'},:caption => :label_first_page_made
menu.push :mobile_version, {:controller => 'admin',:action => 'mobile_version'},:caption => :label_mobile_version
menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural

View File

@ -1,5 +1,6 @@
#coding=utf-8
#
require 'uglifier'
def compress(srcs, outfile)
wechat_path = File.join(Rails.root, "public", "javascripts", "wechat")

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1492,6 +1492,24 @@ function pop_up_box(value,tWidth,tTop,tLeft){
}
}
// 公共弹框样式
function pop_box_new(value, Width, Top, Left){
$("#ajax-modal").html(value);
showModal('ajax-modal', Width + 'px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css({"top": Top+"%","left": Left+"%","transform":"translate(-50%,-50%)","padding":"0","border":"none"});
$('#ajax-modal').css({"padding":"0"});
}
// 公共提示弹框样式
//function pop_box_tip_new(value, Width, Top, Left){
// $("#ajax-modal").html(value);
// showModal('ajax-modal', Width + 'px');
// $('#ajax-modal').siblings().remove();
// $('#ajax-modal').parent().css({"top": Top+"%","left": Left+"%","transform":"translate(-50%,-50%)","padding":"0","border":"none"});
// $('#ajax-modal').css({"padding":"0"});
//}
//显示的时候根据当前网址是http 还是https 选择视频显示方式直接显示还是弹框
function autoMedia(id){
var rootPath = getRootPath();

View File

@ -542,6 +542,37 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;}
.borderRadius {border-radius:5px;}
a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a:hover.Blue-btn{ background:#3598db; color:#fff;}
/*20160725 项目申请按钮*/
a.sy_btn_grey{
color: #333;
background: #e1e1e1;
text-align: center;
font-size: 12px;
padding:0 15px;
height: 30px;
line-height: 30px;
-webkit-border-radius:3px;
-moz-border-radius:3px;
-o-border-radius:3px;
border-radius:3px;
}
a:hover.sy_btn_grey{ background: #c3c3c3;}
a.sy_btn_blue{
display:block;
width:80px;
height: 30px;
text-align:center;
color: #fff;
background: #3b94d6;
font-size: 12px;
line-height: 30px;
-webkit-border-radius:3px;
-moz-border-radius:3px;
-o-border-radius:3px;
border-radius:3px;
}
a:hover.sy_btn_blue{ background: #2788d0;}
/* commonpic */
.pic_date{ display:block; background:url(/images/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; }
.pic_add{ display:block; background:url(/images/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; }

View File

@ -332,4 +332,97 @@ a.contributor_course{float: right; color: #888; font-size: 12px; font-weight: no
.relatePWrap{max-height: 210px;overflow:hidden;}
/*20160622代码分析弹窗*/
.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;}
.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;}
/*公共弹框*/
/* 按钮*/
/* 加入班级弹窗 */
#sy_popup_box{
width:460px;
background:#fff;
padding-bottom:30px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);
}
.sy_popup_top{
background:#3b94d6;
height:40px;
-webkit-border-radius: 5px 5px 0px 0px;
-moz-border-radius: 5px 5px 0px 0px;
-o-border-radius: 5px 5px 0px 0px;
border-radius: 5px 5px 0px 0px;
}
.sy_popup_top h3{
font-size:18px;
color:#fff;
font-weight:normal;
line-height:40px;
padding-left:10px;
}
a.sy_icons_close{
width:20px;
height:20px;
display:block;
background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat;
margin:8px 10px 0 0;
}
a:hover.sy_icons_close{
background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat;
}
.sy_popup_con{
margin:30px auto 0;
font-size:14px;
width:330px;
}
.sy_popup_add label{
display:block;
float:left;
width:85px;
text-align:right;
line-height:40px;
}
.sy_popup_add li{
line-height:40px;
}
.sy_input_txt{
border:1px solid #dedede;
height:36px;
background:#fff;
padding:0 5px;
width:220px;
}
.sy_popup_con02{
margin:30px auto 0;
font-size:14px;
text-align:center;
width:360px;
}
.sy_popup_con02 ul li p{
margin-bottom:15px;
text-align:center;
font-size:14px;
color:#616161;
}
.sy_popup_con02 a{ margin:0 auto;}
.sy_popup_top_tishi{ background:#ededed; }
.sy_popup_top_tishi h3{color:#616161; font-size:16px;}
a.sy_icons_close02{
width:20px;
height:20px;
display:block;
background: url(/images/sy/sy_icons_close02.png) 0 0px no-repeat;
margin:8px 10px 0 0;
border: none;
outline: none;
}
a:hover.sy_icons_close02{
background: url(/images/sy/sy_icons_close02.png) -40px 0px no-repeat;
}

View File

@ -62,34 +62,34 @@ a.sy_btn_green{
border-radius:3px;
}
a:hover.sy_btn_green{ background: #51a74f;}
a.sy_btn_grey{
color: #333;
background: #e1e1e1;
text-align: center;
font-size: 12px;
padding:0 15px;
height: 30px;
line-height: 30px;
-webkit-border-radius:3px;
-moz-border-radius:3px;
-o-border-radius:3px;
border-radius:3px;
}
a:hover.sy_btn_grey{ background: #c3c3c3;}
a.sy_btn_blue{
color: #fff;
background: #3b94d6;
text-align: center;
font-size: 12px;
padding:0 15px;
height: 30px;
line-height: 30px;
-webkit-border-radius:3px;
-moz-border-radius:3px;
-o-border-radius:3px;
border-radius:3px;
}
a:hover.sy_btn_blue{ background: #2788d0;}
/*a.sy_btn_grey{*/
/*color: #333;*/
/*background: #e1e1e1;*/
/*text-align: center;*/
/*font-size: 12px;*/
/*padding:0 15px;*/
/*height: 30px;*/
/*line-height: 30px;*/
/*-webkit-border-radius:3px;*/
/*-moz-border-radius:3px;*/
/*-o-border-radius:3px;*/
/*border-radius:3px;*/
/*}*/
/*a:hover.sy_btn_grey{ background: #c3c3c3;}*/
/*a.sy_btn_blue{*/
/*color: #fff;*/
/*background: #3b94d6;*/
/*text-align: center;*/
/*font-size: 12px;*/
/*padding:0 15px;*/
/*height: 30px;*/
/*line-height: 30px;*/
/*-webkit-border-radius:3px;*/
/*-moz-border-radius:3px;*/
/*-o-border-radius:3px;*/
/*border-radius:3px;*/
/*}*/
/*a:hover.sy_btn_blue{ background: #2788d0;}*/
/* 排序 */
.sy_category{
height: 50px;

View File

@ -0,0 +1,10 @@
FactoryGirl.define do
factory :applied_message do
user_id 1
applied_id 1
applied_type "MyString"
viewed 1
status 1
end
end

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe AppliedMessage, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end