Conflicts:
	config/locales/zh.yml
memcached_alan
whimlex 11 years ago
commit 57237c76d8

@ -3,13 +3,13 @@ source 'http://rubygems.org'
unless RUBY_PLATFORM =~ /w32/
# unix-like only
gem 'iconv'
gem 'iconv'
gem 'rubyzip'
gem 'zip-zip'
end
gem 'grape', '~> 0.9.0'
gem 'grape-entity'
gem 'grape', '~> 0.9.0'
gem 'grape-entity'
gem 'seems_rateable', path: 'lib/seems_rateable'
gem "rails", "3.2.13"
gem "jquery-rails", "~> 2.0.2"
@ -20,13 +20,12 @@ gem "builder", "3.0.0"
gem 'acts-as-taggable-on', '2.4.1'
gem 'spreadsheet'
gem 'ruby-ole'
gem 'email_verifier'
gem 'newrelic_rpm'
#gem 'email_verifier', path: 'lib/email_verifier'
group :development do
gem 'grape-swagger'
gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git'
#gem 'puma'
gem 'grape-swagger'
gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git'
#gem 'puma'
gem 'better_errors', path: 'lib/better_errors'
gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler'
end

@ -91,6 +91,10 @@ GEM
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.2.5)
dnsruby (1.57.0)
email_verifier (0.0.7)
dnsruby (>= 1.5)
rails (>= 3.0.0)
equalizer (0.0.9)
erubis (2.7.0)
execjs (2.2.1)
@ -166,6 +170,7 @@ GEM
mysql2 (0.3.11-x86-mingw32)
nenv (0.2.0)
net-ldap (0.3.1)
newrelic_rpm (3.9.9.275)
nokogiri (1.6.3)
mini_portile (= 0.6.0)
nokogiri (1.6.3-x86-mingw32)
@ -315,6 +320,7 @@ DEPENDENCIES
capybara (~> 2.4.1)
coderay (~> 1.0.6)
coffee-rails (~> 3.2.1)
email_verifier
factory_girl (~> 4.4.0)
faker
fastercsv (~> 1.5.0)
@ -330,6 +336,7 @@ DEPENDENCIES
mocha (~> 1.1.0)
mysql2 (= 0.3.11)
net-ldap (~> 0.3.1)
newrelic_rpm
nokogiri (~> 1.6.3)
paperclip (~> 3.5.4)
rack-mini-profiler!

@ -35,6 +35,11 @@ module Mobile
#作业状态 0:新建1已开启匿评2已关闭匿评
#只有作业启用了匿评功能且当前用户是课程老师且已提交的作品数量大于或等于2才能开启匿评
homework_expose :homework_state
expose :homework_for_anonymous_comments,using: Mobile::Entities::HomeworkAttach do |f, opt|
f[:homework_for_anonymous_comments] if f.is_a?(Hash) && f.key?(:homework_for_anonymous_comments)
end
end
end
end

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

@ -0,0 +1,3 @@
// Place all the styles related to the Enterprises controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

@ -6,13 +6,18 @@ class AppliedProjectController < ApplicationController
@project = Project.find_by_id(params[:project_id])
if params[:project_join]
if @project
@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.applied_project(appliedproject).deliver
@status = 2
user = User.find @user_id
if user.member_of?(@project)
@status = 3
else
@status = 1
@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.applied_project(appliedproject).deliver
@status = 2
else
@status = 1
end
end
else
@status = 0

@ -828,6 +828,7 @@ class CoursesController < ApplicationController
end
def show
# try to redirect to the requested menu item
if params[:jump] && redirect_to_course_menu_item(@course, params[:jump])
return
@ -866,6 +867,7 @@ class CoursesController < ApplicationController
@activity.scope_select {|t| has["show_#{t}"]}
# modify by nwb
# 添加私密性判断
if User.current.member_of_course?(@course)|| User.current.admin?
events = @activity.events(@days, @course.created_at)
else
@ -890,14 +892,13 @@ class CoursesController < ApplicationController
@events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)}
# documents
@sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
#
@teachers= searchTeacherAndAssistant(@course)
@canShowRealName = isCourseTeacher(User.current.id,@course)
# 这写变量发现没有用而且拖慢速度
#@teachers= searchTeacherAndAssistant(@course)
#@canShowRealName = isCourseTeacher(User.current.id,@course)
if(User.find_by_id(CourseInfos.find_by_course_id(@course.id).try(:user_id)))
@user = User.find_by_id(CourseInfos.find_by_course_id(@course.id).user_id)
end
respond_to do |format|
format.html{render :layout => 'base_courses'}
format.api

@ -101,13 +101,7 @@ class HomeworkAttachController < ApplicationController
#获取学生匿评列表
def get_student_batch_homework
@is_student_batch_homework = true
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id} AND is_teacher_score = 0) AS m_score
FROM homework_attaches
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY m_score DESC")
all_homework_list = get_student_batch_homework_list @bid,User.current
@cur_page = params[:page] || 1
@cur_type = 4
@homework_list = paginateHelper all_homework_list,10

@ -0,0 +1,6 @@
class OriginizationsController < ApplicationController
layout 'project_base'
def index
@enterprises = Project.find_by_sql("select distinct(enterprise_name) from projects")
end
end

File diff suppressed because it is too large Load Diff

@ -25,6 +25,17 @@ class WelcomeController < ApplicationController
before_filter :entry_select, :only => [:index]
def index
unless params[:originization].nil?
@originization = params[:originization]
@originization_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @originization])
@e_count = @originization_projects.count
if @e_count < 10
part_count = 10 -@e_count
# @part_projects = find_all_hot_project part_count, order
@part_projects = find_miracle_project(part_count, 3,"score desc")
limit = 10 - @e_count
end
end
if @first_page.nil? || @first_page.sort_type.nil?
@projects = find_miracle_project(10, 3,"score desc")
else

@ -119,4 +119,15 @@ module HomeworkAttachHelper
#end
ary
end
def get_student_batch_homework_list bid,user
student_batch_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id} AND is_teacher_score = 0) AS m_score
FROM homework_attaches
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
WHERE homework_attaches.bid_id = #{bid.id} AND homework_evaluations.user_id = #{user.id} ORDER BY m_score DESC")
student_batch_homework_list
end
end

@ -0,0 +1,2 @@
module EnterprisesHelper
end

@ -36,67 +36,8 @@ module ProjectsHelper
{:name => 'activities', :action => :manage_project_activities, :partial => 'projects/settings/activities', :label => :enumeration_activities}
]
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end
# added bu huang
def sort_project_enterprise(state, project_type)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type)))
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type)))
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
when 1
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type)))
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type)))
when 2
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1', :project_type => project_type)))
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0', :project_type => project_type)))
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs_enterprise")
end
def sort_course(state, project_type, school_id)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type), :school_id => school_id, :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
when 1
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id), :class=>"selected"), :class=>"selected")
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
when 2
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
#gcm
when 3
content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id), :class=>"selected"), :class=>"selected")
end
#gcmend
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs")
end
# end
def sort_project(state, project_type)
content = ''.html_safe
case state
@ -118,30 +59,7 @@ module ProjectsHelper
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs")
end
# def sort_course(state, project_type)
# content = ''.html_safe
# case state
# when 0
#
# content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type)))
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
# content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
# when 1
#
# content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected")
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
# content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type)))
# when 2
# content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type)))
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected")
# content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type)))
# end
# content = content_tag('ul', content)
# content_tag('div', content, :class => "tabs")
# end
# Added by young
def course_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
@ -153,9 +71,6 @@ module ProjectsHelper
end
# Ended by young
def parent_project_select_tag(project)
selected = project.parent
# retrieve the requested parent project
@ -375,4 +290,85 @@ module ProjectsHelper
end
end
end
# Time 2015-01-29 11:39:02
# Author lizanle
# Description 计算projects
def get_project_activity projects,activities
@project_ids=activities.keys()
days = Setting.activity_days_default.to_i
date_to ||= Date.today + 1
date_from = date_to - days-1.years
#issue_count
Issue.where(project_id: @project_ids).where("updated_on>?",date_from).each do |issue|
# activities[issue.project_id.to_s]+=1
activities[issue.project_id]+=issue.journals.where("created_on>?",date_from).count
end
#repository_count
Repository.where(project_id: @project_ids).each do |repository|
# activities[repository.project_id.to_s]+=1
activities[repository.project_id]+=repository.changesets.where("committed_on>?",date_from).count
end
#news_count
News.where(project_id: @project_ids).where("created_on>?",date_from).each do |news|
activities[news.project_id]+=1
end
#document_count
Document.where(project_id: @project_ids).where("created_on>?",date_from).each do |document|
activities[document.project_id]+=1
end
#file_count
Attachment.where(container_id: @project_ids, container_type: Project).where("created_on>?",date_from).each do |attachment|
activities[attachment.container_id]+=1
end
#message_count
Board.where(project_id: @project_ids).each do |board|
# activities[board.project_id]+=1
activities[board.project_id]+=board.messages.where("updated_on>?",date_from).count
end
#time_entry_count
TimeEntry.where(project_id: @project_ids).where("updated_on>?",date_from).each do |timeentry|
activities[timeentry.project_id]+=1
end
#feedbackc_count
JournalsForMessage.where(jour_id: @project_ids, jour_type: Project).each do |jourformess|
activities[jourformess.jour_id]+=1
end
#activities!=0
i=0;
projects.each do |project|
id=project.id
if activities[id]==0
activities[id]=1
end
end
return activities
end
def handle_project projects,activities
project_activity_count_array=activities.values()
project_array=[]
i=0;
projects.each do |project|
project_array[i]=project
i=i+1
end
projects=desc_sort_course_by_avtivity(project_activity_count_array,project_array)
return projects
end
end

@ -19,17 +19,23 @@ module SystemLogHelper
keywords = keywords.strip.split(/\s+/).collect! { |w| Regexp.new(w, 'i') }
# 一条记录应该匹配每个关键字 log =~ r 是对log记录进行判断是否符合r的正则表达式
logs = logs.find_all do |log|
keywords.all? { |r| log =~ r }
keywords.all? { |r| log =~ r && !(log =~ Regexp.new("SystemLogController#",'i')) }
end
#用Kaminari分页
logs = Kaminari.paginate_array(logs).page(page).per(per).collect! { |log| parse(log) }
#将分页后的记录的搜索结果添加样式,样式中的\0是给给r占位置的。
logs.collect! do |log|
keywords.each { |r| log.gsub!(r, '<span class="search_results">\0</span>') }
keywords.each { |r| log.gsub!(r, '<span class="search_results">\0</span>') }
log
end
else
logs = Kaminari.paginate_array(logs).page(page).per(per).collect! { |log| parse(log) }
# 过滤掉日志中日志分析请求
logs.collect! do |log|
log = "" if log =~ Regexp.new("SystemLogController",'i')
log
end
end
logs
end

@ -6,7 +6,7 @@ class Course < ActiveRecord::Base
STATUS_CLOSED = 5
STATUS_ARCHIVED = 9
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表

@ -12,8 +12,7 @@ class CourseGroup < ActiveRecord::Base
before_destroy :set_member_nil
attr_accessible :name
validates :name, :presence => true, :length => {:maximum => 20}
validate :unique_name_and_course
validates :name, :presence => true, :length => {:maximum => 20}, :uniqueness => { :scope => :course_id}
@ -22,10 +21,5 @@ class CourseGroup < ActiveRecord::Base
self.members.update_all("course_group_id = 0")
end
end
private
def unique_name_and_course
if CourseGroup.where("name=? and course_id=?", name, course_id).first
errors.add(:name, :groupname_repeat)
end
end
end

@ -114,9 +114,10 @@ class Project < ActiveRecord::Base
validates_presence_of :name, :identifier
validates_uniqueness_of :identifier
validates_uniqueness_of :name
validates_associated :repository, :wiki
# validates_length_of :description, :maximum => 255
validates_associated :wiki#, :repository
# validates_length_of :description, :maximum => 255
validates_length_of :name, :maximum => 255
validates_length_of :enterprise_name, :maximum => 255
validates_length_of :homepage, :maximum => 255
validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH
# donwcase letters, digits, dashes but not digits only
@ -763,7 +764,8 @@ class Project < ActiveRecord::Base
'issue_custom_field_ids',
'project_type',
'dts_test',
'attachmenttype'
'attachmenttype',
'enterprise_name'

@ -1,6 +1,7 @@
class CoursesService
include ApplicationHelper
include CoursesHelper
include HomeworkAttachHelper
#TODO:尚未整合权限系统
#参数school_id为0或不传时返回所有课程否则返回对应学校的课程
#参数per_page_count分页功能每页显示的课程数
@ -306,10 +307,8 @@ class CoursesService
bids = course.homeworks.order('deadline DESC')
bids = bids.like(params[:name]) if params[:name].present?
homeworks = []
if is_course_teacher(current_user,course)
bids.each do |bid|
homeworks << show_homework_info(course,bid)
end
bids.each do |bid|
homeworks << show_homework_info(course,bid,current_user,is_course_teacher(current_user,course))
end
homeworks
else
@ -318,7 +317,7 @@ class CoursesService
end
private
def show_homework_info course,bid
def show_homework_info course,bid,current_user,is_course_teacher
author = bid.author.lastname + bid.author.firstname
many_times = course.homeworks.index(bid) + 1
name = bid.name
@ -327,8 +326,27 @@ class CoursesService
description = bid.description
#if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
state = bid.comment_status
unless is_course_teacher
homework_for_anonymous_comments = get_student_batch_homework_list bid,current_user
end
#end
open_anonymous_evaluation = bid.open_anonymous_evaluation
{:course_name => course.name,:id => bid.id, :course_teacher => author, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => student_questions_count,
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation,:homework_for_anonymous_comments => homework_for_anonymous_comments}
end
#显示作业列表的同时显示分配给当前学生匿评的作业
def show_homework_info_with_batch course,bid
author = bid.author.lastname + bid.author.firstname
many_times = course.homeworks.index(bid) + 1
name = bid.name
homework_count = bid.homeworks.count #已提交的作业数量
student_questions_count = bid.commit.nil? ? 0 : bid.commit
description = bid.description
#if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
state = bid.comment_status
#end
open_anonymous_evaluation = bid.open_anonymous_evaluation
{:course_name => course.name,:id => bid.id, :course_teacher => author, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => student_questions_count,
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation}
end

@ -4,6 +4,8 @@
alert("请勿重复申请加入该项目");
<% elsif @status == 2%>
alert("申请成功");
<% elsif @status == 3%>
alert("您已加入该项目");
<%else%>
alert("申请失败");
<%end%>

@ -90,7 +90,7 @@
</td>
</tr>
<tr>
<td class="font_lighter" style="float: right">
<td class="font_lighter" >
<%= l :label_create_time %>:
<%= format_time(@course.created_at) %>
</table>

@ -36,13 +36,41 @@
<td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search" style="display:none">
<%= form_tag(projects_search_path, :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %>
</div>
<div class="top-content-search">
<script type="text/javascript">
function regexName()
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#project_name_span").text("<%= l(:label_search_conditions_not_null) %>");
$("#project_name_span").css('color','#ff0000');
$("#project_name_span").focus();
return false;
}
else
{
$("#project_name_span").text("");
return true;
}
}
function submitSerch()
{
if(regexName()){$("#project_search_form").submit();}
}
</script>
<%= form_tag(projects_search_path, :method => :get, :id => "project_search_form") do %>
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();", :style => "float:left" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
<br />
<span id="project_name_span" style="float: left"></span>
<% end %>
</div>
</td>
</tr>
<tr>

@ -12,7 +12,11 @@ hideOnLoad();
$("#member-<%= member.id %>").effect("highlight");
<% end %>
<% else %>
<% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ') %>
alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors))) %>');
<% if @members %>
<% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ')%>
alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors || ''))) %>');
<% else%>
// alert('');
<% end%>
<% end %>
<% end %>

@ -0,0 +1,25 @@
<div class="enterprise_all">
<p>
<%= link_to l(:label_all_enterprises) %>
<p>
<p>
<% if @enterprises.count == 0 %>
<h3><%= l(:label_enterprise_nil) %></h3>
<% else %>
<% @enterprises.each do |enterprise| %>
<% unless enterprise.enterprise_name.blank? %>
<ul>
<li>
<%= link_to enterprise.enterprise_name, home_path(:originization => enterprise.enterprise_name) %>
</li>
</ul>
<% end %>
<% end %>
<% end %>
</p>
</div>
<div style="clear: both"></div>
<div class="school-index">
<ul id="schoollist" style="line-height: 25px"></ul>
</div>
<% html_title(l(:label_enterprise_all)) -%>

@ -22,9 +22,9 @@
<% end %>
<%if @is_teacher%>
<% if poll.polls_status == 1 || poll.polls_status == 3 %>
<% if poll.polls_status == 1%>
<li class="pollsbtn fl ml10 pollsbtn_grey">统计结果</li>
<% elsif poll.polls_status == 2%>
<% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
<li>
<%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
</li>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save