Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject

This commit is contained in:
daiao 2016-10-28 18:05:10 +08:00
commit d6927f1598
91 changed files with 1276 additions and 853 deletions

View File

@ -395,6 +395,7 @@ class CoursesController < ApplicationController
page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
@results = student_homework_score(0,page_from, 10,"desc")
end
@course_groups = @course.course_groups
@limit = 50
@page = params[:page].nil? ? 1 : params['page'].to_i
@members_count = @results.count

View File

@ -228,18 +228,18 @@ class NewsController < ApplicationController
@news.safe_attributes = params[:news]
@news.save_attachments(params[:attachments])
if @news.save
@course.members.each do |m|
if m.user_id != User.current.id
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{@news.course_id}").count
if count == 0
ws = WechatService.new
content = @news.title
name = @news.course.syllabus.nil? ? @news.course.name : @news.course.syllabus.title+""+@news.course.name
ws.class_notice m.user_id, "course_notice", @news.id, "#{l(:label_new_notice_template)}", name, @news.author.show_name, format_time(@news.created_on), content, "点击查看通知详情"
end
end
end
# @course.members.each do |m|
# if m.user_id != User.current.id
# #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
# count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{@news.course_id}").count
# if count == 0
# ws = WechatService.new
# content = @news.title
# name = @news.course.syllabus.nil? ? @news.course.name : @news.course.syllabus.title+" • "+@news.course.name
# ws.class_notice m.user_id, "course_notice", @news.id, "#{l(:label_new_notice_template)}", name, @news.author.show_name, format_time(@news.created_on), content, "点击查看通知详情"
# end
# end
# end
if params[:asset_id]
ids = params[:asset_id].split(',')

View File

@ -1,6 +1,6 @@
#encoding utf-8
class PollController < ApplicationController
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll,:save_poll]
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll,:save_poll,:update_question_num]
before_filter :find_container, :only => [:new,:create, :index]
before_filter :is_logged, :only => [:index, :show, :poll_result,:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll,:commit_answer,:commit_poll,:statistics_result,:save_poll]
before_filter :is_member_of_course, :only => [:index,:show,:poll_result]
@ -44,8 +44,7 @@ class PollController < ApplicationController
else
@can_edit_poll = (!has_commit_poll?(@poll.id,User.current.id)) || User.current.admin?
@percent = get_percent(@poll,User.current)
poll_questions = @poll.poll_questions
@poll_questions = paginateHelper poll_questions,5 #分页
@poll_questions = @poll.poll_questions
@left_nav_type = 7
respond_to do |format|
format.html {render :layout => 'base_courses'}
@ -133,16 +132,39 @@ class PollController < ApplicationController
def get_poll_everycount poll_answer
@every_answer_count = poll_answer.poll_votes.count
end
def update_question_num
@poll_question = PollQuestion.find params[:ques_id]
poll_questions = @poll.poll_questions
if @poll_question
if params[:opr] == 'up' && @poll_question.question_number > 1
@before_que = poll_questions.where("question_number = #{@poll_question.question_number - 1}").first
if @before_que && @poll_question.update_attribute('question_number', @poll_question.question_number - 1)
@before_que.update_attribute('question_number', @before_que.question_number + 1)
end
elsif params[:opr] == 'down' && @poll_question.question_number < poll_questions.count
@after_que = poll_questions.where("question_number = #{@poll_question.question_number + 1}").first
if @after_que && @poll_question.update_attribute('question_number', @poll_question.question_number + 1)
@after_que.update_attribute('question_number', @after_que.question_number - 1)
end
end
respond_to do |format|
format.js
end
end
end
#添加题目
def create_poll_question
@last_question = @poll.poll_questions.last
question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title]
option = {
:is_necessary => (params[:is_necessary]=="true" ? 1 : 0),
:question_title => question_title,
:question_type => params[:question_type] || 1,
:question_number => @poll.poll_questions.count + 1
:question_number => @poll.poll_questions.count + 1,
:max_choices => params[:max_choices].to_i || 0,
:min_choices => params[:min_choices].to_i || 0,
}
@poll_questions = @poll.poll_questions.new option
if params[:question_answer]
@ -164,17 +186,20 @@ class PollController < ApplicationController
end
# 如果是插入的话那么从插入的这个id以后的question_num都将要+1
if params[:quest_id]
@is_insert = true
@poll.poll_questions.where("question_number > #{params[:quest_num].to_i}").update_all(" question_number = question_number + 1")
@poll_question_num = params[:quest_num].to_i
@poll_questions.question_number = params[:quest_num].to_i + 1
end
if @poll_questions.save
respond_to do |format|
format.js
end
insert_poll = PollQuestion.find params[:quest_id]
if insert_poll
@is_insert = true
ques_num = insert_poll.question_number
@poll.poll_questions.where("question_number > #{ques_num}").update_all(" question_number = question_number + 1")
@poll_question_num = ques_num
@poll_questions.question_number = ques_num + 1
end
end
if @poll_questions.save
respond_to do |format|
format.js
end
end
end
#修改题目
@ -183,6 +208,8 @@ class PollController < ApplicationController
#@poll = @poll_question.poll
@poll_question.is_necessary = params[:is_necessary]=="true" ? 1 : 0
@poll_question.question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title]
@poll_question.max_choices = params[:max_choices].to_i || 0
@poll_question.min_choices = params[:min_choices].to_i || 0
################处理选项
if params[:question_answer]
@poll_question.poll_answers.each do |answer|
@ -299,24 +326,39 @@ class PollController < ApplicationController
pv = PollVote.find_by_poll_answer_id_and_user_id(params[:poll_answer_id],User.current.id)
if pv.nil?
#尚未答该题,添加答案
pv = PollVote.new
pv.user_id = User.current.id
pv.poll_question_id = params[:poll_question_id]
pv.poll_answer_id = params[:poll_answer_id]
pv.vote_text = params[:vote_text] if params[:vote_text]
if pv.save
@percent = get_percent(@poll,User.current)
render :json => {:text => "ok",:percent => format("%.2f" ,@percent)}
count = PollVote.where("poll_question_id = #{params[:poll_question_id].to_i} and user_id = #{User.current.id}").count
if pq.max_choices != 0 && count >= pq.max_choices
render :json => {:text => "over"}
else
render :json => {:text => "failure"}
pv = PollVote.new
pv.user_id = User.current.id
pv.poll_question_id = params[:poll_question_id]
pv.poll_answer_id = params[:poll_answer_id]
pv.vote_text = params[:vote_text] if params[:vote_text]
if pv.save
@percent = get_percent(@poll,User.current)
render :json => {:text => "ok",:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
end
else
#pv不为空则当前选项之前已被选择再次点击则是不再选择该项故删除该答案
if pv.delete
@percent = get_percent(@poll,User.current)
render :json => {:text => "false" ,:percent => format("%.2f" ,@percent)}
if params[:vote_text]
pv.vote_text = params[:vote_text]
if pv.save
@percent = get_percent(@poll,User.current)
render :json => {:text => "ok",:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
else
render :json => {:text => "failure"}
if pv.delete
@percent = get_percent(@poll,User.current)
render :json => {:text => "false" ,:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
end
end
elsif pq.question_type == 3
@ -564,16 +606,17 @@ class PollController < ApplicationController
end
@poll.save
end
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
if @is_teacher
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
else
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2")
end
@polls = paginateHelper polls,20 #分页
respond_to do |format|
format.js
end
redirect_to poll_index_path(:polls_type => "Course", :polls_group_id => @course.id)
# @is_teacher = User.current.allowed_to?(:as_teacher,@course)
# if @is_teacher
# polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
# else
# polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2")
# end
# @polls = paginateHelper polls,20 #分页
# respond_to do |format|
# format.js
# end
end
private

View File

@ -326,7 +326,7 @@ class ProjectsController < ApplicationController
else
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10);
end
@type = params[:type]
# 版本库统计图
# unless @project.gpid.nil? || @project.project_score.changeset_num == 0
# # rep_statics_commit = @project.rep_statics.order("commits_num desc")
@ -725,7 +725,7 @@ class ProjectsController < ApplicationController
GITLABTYPE = "Repository::Gitlab"
def archive
if request.post?
if @project.archive
if @project.archive && @project.gpid
# 删除版本库信息
begin
g = Gitlab.client
@ -838,7 +838,7 @@ class ProjectsController < ApplicationController
@project = Project.find params[:id]
if User.current.login?
members = Member.where(:user_id => User.current.id, :project_id=>params[:id]).first
if members != nil && members.roles.first.to_s != "Manager"
if User.current != @project.owner
members.destroy
# 移出的时候删除申请消息,不需要删除消息,所以不必要关联删除
applied_projects = AppliedProject.where(:project_id => @project.id, :user_id => members.user_id).first

View File

@ -17,19 +17,21 @@ class PullRequestsController < ApplicationController
@allow_to_pull_request = allow_pull_request(@project) > 0
type = params[:type]
merge_requests = @g.merge_requests(@project.gpid)
merge_requests_count = merge_requests.count
case type
when nil, "1"
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "opened" || request.state == "reopened"}
@requests = merge_requests.select{|request| request.state == "opened" || request.state == "reopened"}
# 更新统计数字
project_score = @project.project_score.update_column(:pull_request_num, @requests.count)
project_score = @project.project_score.update_column(:pull_request_num, merge_requests_count)
when "2"
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}
@requests = merge_requests.select{|request| request.state == "merged"}
when "3"
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "closed"}
@requests = merge_requests.select{|request| request.state == "closed"}
end
@requests_opened_count = @requests.count
@requests_merged_count = @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}.count
@requests_closed_count = @g.merge_requests(@project.gpid).select{|request| request.state == "closed"}.count
@requests_merged_count = merge_requests.select{|request| request.state == "merged"}.count
@requests_closed_count = merge_requests.select{|request| request.state == "closed"}.count
@limit = 10
@is_remote = true

View File

@ -567,6 +567,9 @@ update
# 每次提交对应的文件差异
def commit_diff
# 顶部导航
@project_menu_type = 5
@commit_diff = @g.commit_diff(@project.gpid, params[:changeset])
@commit_details = @g.commit(@project.gpid, params[:changeset])
render :layout => 'base_projects'

View File

@ -169,6 +169,7 @@ class VersionsController < ApplicationController
attributes = params[:version].dup
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
@version.safe_attributes = attributes
@version.user_id = User.current.id
end
if request.post?
if @version.save

View File

@ -36,7 +36,7 @@ module AttachmentsHelper
end
def link_to_attachment_project(container, options = {})
options.assert_valid_keys(:author, :thumbnails)
options.assert_valid_keys(:deletable, :author, :thumbnails)
if container.attachments.any?
options = {:deletable => container.attachments_deletable?, :author => true}.merge(options)

View File

@ -8,14 +8,17 @@ module AvatarHelper
FileUtils.cp(src_file, des_file) if File.exist?(src_file)
end
def avatar_image(source, copyed=false)
source_type = source.class
source_id = source.id
course = Course.find(source_id) rescue nil
if course && copyed
source_id = course.is_copy
# course = Course.find(source_id) rescue nil
# if course && copyed
# source_id = course.is_copy
# end
if source_type.to_s == 'Course' && copyed
source_id = source.is_copy
end
File.join(relative_path, avatar_directory(source_type), source_id.to_s)

View File

@ -87,4 +87,21 @@ module PollHelper
s.html_safe
end
#问卷的多选题上下限
def min_or_max_choices_option pq
type = []
count = pq.poll_answers.count
option = []
option << '不限'
option << 0
type << option
for i in 1 .. count do
option = []
option << i
option << i
type << option
end
type
end
end

View File

@ -65,7 +65,7 @@ class News < ActiveRecord::Base
:author_key => :author_id
acts_as_watchable
after_create :act_as_forge_activity, :act_as_course_activity, :add_author_as_watcher, :send_mail, :add_news_count, :act_as_student_score, :act_as_system_message, :delay_news_send
after_create :act_as_forge_activity, :act_as_course_activity, :add_author_as_watcher, :send_mail, :add_news_count, :act_as_student_score, :act_as_system_message,:delay_news_wechat_send,:delay_news_send
after_update :update_activity
after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score
@ -186,6 +186,26 @@ class News < ActiveRecord::Base
end
end
def delay_news_wechat_send
if self.course
self.delay.news_wechat_message
end
end
def news_wechat_message
self.course.members.each do |m|
if m.user_id != self.author_id
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
if count == 0
ws = WechatService.new
content = self.title
ws.class_notice m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.course.name, self.author.show_name, format_time(self.created_on), content, "点击查看通知详情"
end
end
end
end
def delay_news_send
if self.course
self.delay.contain_news_message

View File

@ -124,6 +124,7 @@ class User < Principal
has_one :api_token, :class_name => 'Token', :conditions => "action='api'"
belongs_to :auth_source
has_many :org_members
has_many :versions, :dependent => :destroy
has_many :organizations, :through => :org_members
belongs_to :ucourse, :class_name => 'Course', :foreign_key => :id #huang
## added by xianbo for delete
@ -253,10 +254,10 @@ class User < Principal
before_save :update_hashed_password
before_destroy :remove_references_before_destroy,:delete_user_ealasticsearch_index
# added by fq
after_create :act_as_activity, :add_onclick_time, :act_as_principal_activity,:create_user_ealasticsearch_index,:add_new_jour
after_create :add_onclick_time, :act_as_principal_activity,:create_user_ealasticsearch_index,:add_new_jour
# end
# 更新邮箱用户或用户名的同事,同步更新邀请信息
after_update :update_invite_list,:update_user_ealasticsearch_index
after_update :update_user_ealasticsearch_index
include Trustie::Gitlab::ManageUser

View File

@ -19,6 +19,7 @@ class Version < ActiveRecord::Base
include Redmine::SafeAttributes
after_update :update_issues_from_sharing_change
belongs_to :project
belongs_to :user
has_many :fixed_issues, :class_name => 'Issue', :foreign_key => 'fixed_version_id', :dependent => :nullify
acts_as_customizable
acts_as_attachable :view_permission => :view_files,
@ -47,7 +48,8 @@ class Version < ActiveRecord::Base
'wiki_page_title',
'status',
'sharing',
'custom_field_values'
'custom_field_values',
'user_id'
# Returns true if +user+ or current user is allowed to view the version
def visible?(user=User.current)

View File

@ -106,14 +106,14 @@
<% end %>
</p>
<% end %>
<div class="thumbnails">
<% if defined?(thumbnails) && thumbnails %>
<% if defined?(thumbnails) && thumbnails %>
<div class="thumbnails">
<% images = attachments.select(&:thumbnailable?) %>
<% if images.any? %>
<% images.each do |attachment| %>
<div class="pro_pic fl " width="100" height="73"><%= thumbnail_issue_tag(attachment) %></div>
<% end %>
<% end %>
<% end %>
</div>
</div>
<% end %>
</div>

View File

@ -35,6 +35,8 @@
<div nhname='toolbar_container_' ></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
<p nhname='contentmsg_'></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10 ml10 mb10">取消</a>
<a href="javascript:void(0);" class="blue_btn fr mt10" id="new_message_submit_btn_" >留言</a>
<% end %>
@ -53,7 +55,6 @@
<div style="display:none;"><a href="#" id="nhjump"></a></div>
<script type="text/javascript">
$(function(){
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
@ -69,6 +70,7 @@
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
params.height = 55;
params.editor = init_editor(params);
course_feedback_editor = params.editor;
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
@ -89,5 +91,11 @@
});
});
});
</script>
<script type="text/javascript">
$(function(){
setTimeout(function(){
elocalStorage(main_editor,'course_feedback_<%=User.current.id %>_<%=@course.id %>');
}, 10000);
});
</script>

View File

@ -116,7 +116,7 @@
<% if @course.course_groups.empty? %>
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
<% else %>
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id, :group_id => @group ? @group.id : -1},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id, :group_id => @group && @group != -1 ? @group.id : -1},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
<div class="select-class-option">
<span class="hidden" style="display:inline-block; vertical-align:middle; max-width:70px;"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
<a href="javascript:void(0)" class="sy_icons_edit pic_edit_icon" alt="编辑" style="background-position:0 5px;"></a>

View File

@ -1,5 +1,6 @@
<div class="conbox">
<h2 class="conbox-h2">查重结果</h2>
<h2 class="conbox-h2" style="border-bottom:1px solid #ddd;">查重结果</h2>
<p class="nodata mt10 ml10 mr10" style="text-align: left;">代码量少的作品,误报率高,因此不参与查重</p>
<div class="chabox">
<ul class="chabox-header">
<li class="chabox-w-500" style = "width:437px" >被查作品</li>

View File

@ -1,47 +1,45 @@
<div class="project_r_h02">
<div class="project_r_h02" style="width: 980px;">
<h2 class="project_h2"><%= l(:permission_new_course)%></h2>
</div>
<div class="hwork_new">
<div class="hwork_new pr">
<ul>
<%= labelled_form_for @course do |f| %>
<li class="ml45 mb10">
<li class="mt5 ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label>
<% if @syllabus.nil? %>
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
<span class="c_red" id="new_syllabus_notice">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%>,然后【刷新】</span>
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input w300 h28"} %>
<% else %>
<span><%=@syllabus.title %></span>
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
<% end %>
</li>
<div class="cl"></div>
<li class="ml45">
<li class="mt10 ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如计算机系2016秋季A班" onkeyup="regex_course_name('new');">
<input type="text" name="course[name]" id="new_course_name" class="courses_input w289" maxlength="100" placeholder="例如计算机系2016秋季A班" onkeyup="regex_course_name('new');">
<span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
</li>
<div class="cl"></div>
<li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例计算机系2016秋季A班</span></li>
<li class="ml125 mb10 fontGrey3"><span class="error-icon">错误示例:软件工程 - 计算机系2016秋季A班</span></li>
<li class="ml125 mt10 mb10 fontGrey2" style="max-width: 544px;">班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。</li>
<li class="ml45">
<!--<li class="ml125 mt10 mb10 fontGrey2" style="max-width: 544px;">班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。</li>-->
<li class="mt10 ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label>
<input type="text" name="class_period" id="new_class_period" class="hwork_input02" onkeyup="regex_course_class_period('new');" placeholder="例如54" maxlength="6">
<input type="text" name="class_period" id="new_class_period" class="hwork_input02 w289" onkeyup="regex_course_class_period('new');" placeholder="例如54" maxlength="6">
<span class="c_red" id="new_course_class_period_notice" style="display: none;"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<li class="mt10 ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_course_term)%>&nbsp;&nbsp;</label>
<%= select_tag :time,options_for_select(course_time_option(@course.time),Time.now.year), {:id=>"new_time"} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"new_term"} %>
<%= select_tag :time,options_for_select(course_time_option(@course.time),Time.now.year), {:id=>"new_time", :class => "h28 w145 mr8"} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"new_term", :class => "h28 w145"} %>
<span class="c_red" id="new_course_time_term_notice"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<li class="mt5 ml45 mb10">
<label><span class="c_red">*</span>&nbsp;结束学期&nbsp;&nbsp;</label>
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),Time.now.year), {:id=>"new_end_time"} %>
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"new_end_term"} %>
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则与开始学期保持一致。</span>
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),Time.now.year), {:id=>"new_end_time", :class => "h28 w145 mr8"} %>
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"new_end_term", :class => "h28 w145"} %>
</li>
<div class="cl"></div>
<!--<li class="ml45 mb10">
@ -53,36 +51,58 @@
<div class="cl"></div>
<span class="ml80 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>-->
<li class="ml45">
<label class="fl" >&nbsp;&nbsp;<%= l(:label_new_course_description)%>&nbsp;&nbsp;</label>
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>
<div class="cl"></div>
</li>
<li class=" mb5 ml80">
<!--<li class="ml45">-->
<!--<label class="fl" >&nbsp;&nbsp;<%#= l(:label_new_course_description)%>&nbsp;&nbsp;</label>-->
<!--<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>-->
<!--<div class="cl"></div>-->
<!--</li>-->
<li class="mt10 mb5 ml78">
<label >公开&nbsp;&nbsp;</label>
<input id="course_is_public" name="course[is_public]" type="checkbox" value="1">
<span class="c_grey">(选中后对所有用户可见,否则仅对本班级成员可见)</span>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">
<li class="mt5 mb5 ml30">
<label >学生列表公开&nbsp;&nbsp;</label>
<input id="course_open_student" name="course[open_student]" type="checkbox" value="1">
<span class="c_grey">(选中后对所有用户可见,否则仅对本班级成员可见)</span>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">
<li class="mt5 mb5 ml30">
<label >学生上传资源&nbsp;&nbsp;</label>
<input <%= @course.publish_resource == 1 ? 'checked' : ''%> id="course_publish_resource" name="course[publish_resource]" type="checkbox" />
<span class="c_grey">(选中后允许学生上传班级资源,否则不允许)</span>
<div class="cl"></div>
</li>
<li class=" ml30" >
<li class="mt10 ml30" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_course();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<div class="cl"></div>
</li>
<% end%>
</ul>
<div class="ye_tips_box_inner" style="left: 460px; top: 0px; text-align: left;">
<em style="top: 5px;"></em>
<span style="top: 5px;"></span>
<p>
如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%>,然后【刷新】
</p>
</div>
<div class="ye_tips_box_inner" style="left: 460px; top: 40px; text-align: left;">
<em style="top: 10px;"></em>
<span style="top: 10px;"></span>
<p>
班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个<br/>学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。<br/><br/>
<font class="c_red">特别注意:</font>如果您同时开设了教学内容完全同步的多个班级,强烈建议您:只需创建一个班<br/>级,然后在这个班级中新建多个小班,这样您发布的所有信息就能够在不同小班中共享了。
</p>
</div>
<div class="ye_tips_box_inner" style="left: 460px; top: 223px; text-align: left;">
<em style="top: 5px;"></em>
<span style="top: 5px;"></span>
<p>
仅针对跨越多个学期的班级,否则与开始学期保持一致。
</p>
</div>
</div><!--talknew end-->
<div class="cl"></div>
<script>

View File

@ -2,4 +2,5 @@
* Created by Administrator on 2014/12/3.
*/
$("#search_members").html("<%= escape_javascript( render :partial => 'searchmembers')%>");
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");

View File

@ -1,4 +1,6 @@
/**
* Created by Administrator on 2014/12/2.
*/
$('#new_group_name').hide();
$('#edit_group_form').hide();
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @results})%>");

View File

@ -76,11 +76,11 @@
<div class="cl"></div>
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>-->
<li class="ml45">
<label class="fl" >&nbsp;&nbsp;<%= l(:label_new_course_description)%>&nbsp;&nbsp;</label>
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" maxlength="6000"><%= @course.description%></textarea>
<div class="cl"></div>
</li>
<!--<li class="ml45">-->
<!--<label class="fl" >&nbsp;&nbsp;<%#= l(:label_new_course_description)%>&nbsp;&nbsp;</label>-->
<!--<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" maxlength="6000"><%#= @course.description%></textarea>-->
<!--<div class="cl"></div>-->
<!--</li>-->
<li class=" mb5 ml80">
<label >公开&nbsp;&nbsp;</label>
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox">
@ -99,7 +99,7 @@
<span class="c_grey">(选中后允许学生上传班级资源,否则不允许)</span>
<div class="cl"></div>
</li>
<li class=" ml90" >
<li class="mt10 ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_edit_course(<%= @course.id%>);" >提交</a>
<%= link_to l(:button_cancel), course_path(@course), :class => "grey_btn fl c_white ml10" %>
<div class="cl"></div>

View File

@ -3,7 +3,6 @@
<script type="text/javascript">
function resetQuestion<%=exercise_question.id%>()
{
$("#poll_questions_title_<%=exercise_question.id%>").val("<%= exercise_question.question_title%>")
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>")
$("#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| %>" +
@ -20,9 +19,9 @@
<div class="questionContainer" style="width: 680px;">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
<input name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入单选题题目" type="text" value="<%=exercise_question.question_title %>">
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入单选题题目" type="text" onfocus="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
</div>
<div class="ur_editor_content">
<ul>

View File

@ -3,7 +3,6 @@
<script type="text/javascript">
function resetQuestion<%=exercise_question.id%>()
{
$("#poll_questions_title_<%=exercise_question.id%>").val("<%= exercise_question.question_title%>")
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>")
$("#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| %>" +
@ -20,9 +19,9 @@
<div class="questionContainer" style="width: 680px;">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
<input name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入多选题题目" type="text" value="<%=exercise_question.question_title %>">
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入多选题题目" type="text" onfocus="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
</div>
<div class="ur_editor_content">
<ul>

View File

@ -3,7 +3,6 @@
<script type="text/javascript">
function resetQuestion<%=exercise_question.id%>()
{
$("#poll_questions_title_<%=exercise_question.id%>").val("<%= exercise_question.question_title%>")
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>" +
"<li class='ur_item'>" +
@ -20,9 +19,9 @@
<div class="questionContainer" style="width: 680px;">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
<input name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text" value="<%=exercise_question.question_title %>">
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text" onfocus="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
</div>
<div class="ur_editor_content" id="edit_single">
<ul>

View File

@ -4,9 +4,9 @@
:remote=>true ) do |f| %>
<div class="questionContainer">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="1" type="hidden">
<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入单选题题目" type="text">
<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入单选题题目" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
</div>
<div class="ur_editor_content">
<ul>

View File

@ -4,9 +4,9 @@
:remote=>true ) do |f| %>
<div class="questionContainer">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="2" type="hidden">
<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入多选题题目" type="text">
<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入多选题题目" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
</div>
<div class="ur_editor_content">
<ul>

View File

@ -4,9 +4,9 @@
:remote=>true ) do |f| %>
<div class="questionContainer">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="3" type="hidden">
<input maxlength="250" class="questionTitle" name="question_title" id="poll_questions_title" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text">
<textarea maxlength="250" class="questionTitle" name="question_title" id="poll_questions_title" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
</div>
<div class="ur_editor_content" id="new_single">
<ul>

View File

@ -1,6 +1,7 @@
<div>
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
<%= exercise_question.question_title %>
<div class="testEditTitle">
<div>第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)</div>
<span class="formatContainer break_word" style="max-width:534px;"><%= exercise_question.question_title %></span>
<span class="ml10">(<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>)</span>
</div>
@ -46,7 +47,7 @@
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="1"/>'+
'<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入单选题题目" type="text"/>'+
'<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入单选题题目" type="text"></textarea>'+
'</div>'+
'<div class="ur_editor_content">'+
'<ul>'+
@ -105,6 +106,11 @@
$("#add_new_question").one('click', function(){
add_poll_question($(this),1);
});
$(".questionTitle").on("input",function(){
$(this).height(30);
var scrollVal = $(this)[0].scrollHeight;
$(this).height(scrollVal);
});
}
}
else {

View File

@ -1,6 +1,7 @@
<div>
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
<%= exercise_question.question_title %>
<div class="testEditTitle">
<div>第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)</div>
<span class="formatContainer break_word" style="max-width:534px;"><%= exercise_question.question_title %></span>
<span class="ml10">(<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>)</span>
</div>
<%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id, :quest_num => exercise_question.question_number),
@ -45,7 +46,7 @@
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="2"/>'+
'<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入多选题题目" type="text"/>'+
'<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入多选题题目" type="text"></textarea>'+
'</div>'+
'<div class="ur_editor_content">'+
'<ul>'+
@ -104,6 +105,11 @@
$("#add_new_question").one('click', function(){
add_poll_question($(this),2);
});
$(".questionTitle").on("input",function(){
$(this).height(30);
var scrollVal = $(this)[0].scrollHeight;
$(this).height(scrollVal);
});
}
}else {
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html("");

View File

@ -1,6 +1,7 @@
<div>
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
<%= exercise_question.question_title %>
<div class="testEditTitle">
<div>第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)</div>
<span class="formatContainer break_word"><%= exercise_question.question_title %></span>
</div>
<%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id, :quest_num => exercise_question.question_number),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de",:title => "删除") %>
@ -33,7 +34,7 @@
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="3"/>'+
'<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text"/>'+
'<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text"></textarea>'+
'</div>'+
'<div class="ur_editor_content" id="new_single">'+
'<ul>'+
@ -80,6 +81,11 @@
$("#add_new_question").one('click', function(){
add_poll_question($(this),3);
});
$(".questionTitle").on("input",function(){
$(this).height(30);
var scrollVal = $(this)[0].scrollHeight;
$(this).height(scrollVal);
});
}
} else {
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html("");

View File

@ -38,7 +38,7 @@
</style>
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner mb10">
<div class="homepageRightBanner">
<!--<div class="NewsBannerName">作业</div>-->
<div id="menu_r" class="NewsBannerName" style="margin-bottom: -10px;">
<ul class="menu_r b_w" style="padding-left: 0px; margin-top: -5px;">
@ -66,7 +66,7 @@
<% if @is_teacher%>
<!-- 老师身份才可以发布作业 -->
<div class="HomeWork mb10" nhname='homework_common_form'>
<div class="HomeWork mt10" nhname='homework_common_form'>
<%= labelled_form_for @new_homework,:url => user_new_homework_users_path,:method => "post" do |f| %>
<div id="HomeWorkCon">
<%= render :partial => 'users/user_homework_form', :locals => { :homework => @new_homework,:f => f,:edit_mode => false,:select_course => false } %>

View File

@ -40,20 +40,15 @@
<label class="label"><span class="c_red f12">*</span><%= l(:field_status) %></label>
<%# if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
<%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }),
{:no_label => true},
# ajax 刷新
#:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
:class => "w150" %>
<%# else %>
<%#= h(@issue.status.name) %>
<%# end %>
{:no_label => true},
:class => "w150" %>
</li>
<li>
<label class="label"><span class="c_red f12">*</span><%= l(:field_priority) %></label>
<% if @issue.safe_attribute? 'priority_id' %>
<%= f.select :priority_id, (@priorities.collect { |p| [p.name, p.id] }),
{:required => true, :no_label => true}, :disabled => !@issue.leaf?,
:class => "w150" %>
{:required => true, :no_label => true}, :disabled => !@issue.leaf?,
:class => "w150" %>
<% end %>
</li>
<li class="clear">
@ -66,7 +61,7 @@
<% else %>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="sy_btn_grey mr5 fr" > 取消 </a>
<% end %>
<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>
<!--<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>-->
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a>
</li>
</ul>
@ -81,25 +76,17 @@
<li class=" clear">
<% if @issue.safe_attribute? 'assigned_to_id' %>
<%= f.select :assigned_to_id, assigned_options_for_select(@issue.assignable_users, @issue.assigned_to),
{:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
{:onchange => "change_assigned_tip();",:class => "w150"} %>
{:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
{:onchange => "change_assigned_tip();",:class => "w150"} %>
<% end %>
</li>
<li class=" clear" id="assigned_to_tips">
<%= @issue.assigned_to.nil? ? "未指派" : "已指派" %>
</li>
<li class=" clear" id="versions_choise_id">
<%#= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
{:onchange => "change_milestone_tip();",:class => "w150"} %>
<%= render :partial => 'issues/versions_choise' %>
<%#= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
new_project_version_path(@issue.project),
:remote => true,
:method => 'get',
:title => l(:label_version_new),
:tabindex => 200) if User.current.allowed_to?(:manage_versions, @issue.project) %>
<!--<a href="javascript:viod(0)" class="pic_add mt5 ml5"></a>-->
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
{:onchange => "change_milestone_tip();",:class => "w150"} %>
</li>
<li class=" clear" id="milestone_option_tips">
<%= @issue.fixed_version.nil? ? "无里程碑" : "已指派里程碑" %>

View File

@ -7,10 +7,10 @@
<% update_visiti_count @project %>
<div class="pro_new_top clear mb10">
<div class="fl pro_new_name ml15">
<span class="icons_newpro_lock"></span>
<%=link_to "#{@project.owner.try(:show_name)}<span class='ml5 mr5'>/</span>".html_safe, user_path(@project.owner), :class => "pro_new_username" %>
<%=link_to @project.name, project_path(@project), :class => "pro_new_proname" %>
<div class="fl pro_new_name ml15 clear">
<% unless @project.is_public? %><span class="icons_newpro_lock fl"></span><% end %>
<%=link_to "#{@project.owner.try(:show_name)}<span class='ml5 mr5'>/</span>".html_safe, user_path(@project.owner), :class => "pro_new_username fl" %>
<%=link_to @project.name, project_path(@project), :class => "pro_new_project_name fl" %>
</div>
<!--加入、退出、关注项目-->
@ -56,7 +56,7 @@
<% end %>
<!--里程碑-->
<li id="project_menu_07">
<%= link_to @project.versions.count >0 ? "#{l(:label_roadmap)}<span class='issues_nav_tag ml5'>#{switch_integer_into_k @project.versions.count}</span>".html_safe : l(:label_roadmap) ,project_roadmap_path(@project), :class => "pro_new_proname" %>
<%= link_to @project.versions.count >0 ? "#{l(:label_roadmap)}<span class='issues_nav_tag ml5'>#{switch_integer_into_k @project.versions.count}</span>".html_safe : l(:label_roadmap) ,project_roadmap_path(@project), :class => "pro_new_proname", :title => "#{@project.versions.count}" %>
</li>
<!--日历-->
<% unless @project.enabled_modules.where("name = 'calendar'").empty? %>

View File

@ -4,7 +4,9 @@
<li id="board_children_<%=board.id %>">
<% count = board ? (board.topics.count + Message.where("board_id =? and parent_id is not ?", board.id, nil).count) : 0 %>
<a href="<%=course_boards_path(@course, :board_id =>board.id) %>"><font class="hidden dis" style="max-width: 120px;"><%=board.name %></font><span style="vertical-align: top;"><%=count %></span></a>
<%= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
<% if User.current.logged? %>
<%= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
<% end %>
</li>
<% end %>
</ul>

View File

@ -4,7 +4,9 @@
<li id="course_group_<%=group.id %>">
<% count = group.members.count %>
<a href="<%= group_member_course_path(course, :group_id => group.id) %>"><font class="hidden dis" style="max-width: 120px;"><%=group.name %></font><span style="vertical-align: top;"><%=count %></span></a>
<%#= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
<% if is_teacher %>
<%= link_to '', search_not_group_member_course_path(@course,:group_id => group.id),:remote => true, :class => "sy_class_add", :title => "添加成员" %>
<% end %>
</li>
<% end %>
</ul>

View File

@ -121,7 +121,7 @@
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
</li>
<div id="group_children_list">
<%= render :partial => 'layouts/group_children_list', :locals => {:course => @course} %>
<%= render :partial => 'layouts/group_children_list', :locals => {:course => @course, :is_teacher => is_teacher} %>
</div>
<% end %>
<% statistics_count = 0 %>

View File

@ -99,7 +99,7 @@
</div>
<div class="content-big pr">
<% if User.current.logged? %>
<div class="homepagePostSetting" id="message_setting_<%= @topic.id%>" style="display: none">
<div class="homepagePostSetting" id="message_setting_<%= @topic.id %>" style="display: none">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
@ -123,7 +123,7 @@
</div>
<%end%>
<div class="fl mb5" style="width:877px;">
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
<a href="javascript:void(0);" class="f14 linkGrey4 fb break_word" style="overflow:hidden;">主题: <%= @topic.subject%></a>
</div>
<div class="cl"></div>

View File

@ -14,7 +14,7 @@
<div id="users_tb_" class="users_tb_">
<ul>
<li id="users_tb_1" class="users_hovertab" onclick="x:HoverLi(1);">基本资料</li>
<li id="users_tb_2" class="users_normaltab" onclick="i:HoverLi(2);">账号管理</li>
<li id="users_tb_2" class="users_normaltab" onclick="i:HoverLi(2);">密码管理</li>
</ul>
</div><!--tb_ end-->
<div class="cl"></div>
@ -29,10 +29,10 @@
<li><span style="color:red;">*</span>&nbsp;&nbsp;登录名&nbsp;:&nbsp;</li>
<li><span style="color:red;">*</span>&nbsp;&nbsp;邮箱&nbsp;:&nbsp;</li>
<li><span style="color:red;">*</span>&nbsp;&nbsp;职业&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><span style="color:red;">*</span>&nbsp;&nbsp;姓名&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" ><span style="color:red;">*</span>&nbsp;&nbsp;姓名&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_2="true" style="display:none;">组织名&nbsp;:&nbsp;<span style="color:red;">*</span></li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><span style="color:red;">*</span>&nbsp;&nbsp;性别&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;" ><span style="color:red;">*</span>&nbsp;&nbsp;单位名称&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" ><span style="color:red;">*</span>&nbsp;&nbsp;性别&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" ><span style="color:red;">*</span>&nbsp;&nbsp;单位名称&nbsp;:&nbsp;</li>
<li>地区&nbsp;:&nbsp;</li>
<li>邮件通知&nbsp;:&nbsp;</li>
<!--<li>个人签名&nbsp;:&nbsp;</li>-->
@ -62,13 +62,13 @@
<%= l(:label_account_identity_developer) %>
</option>
</select>
<select nhname="tag" nh_tag_0="true" name="technical_title" id="userTechnical_title" class="w70" style='display:none;height:28px;'>
<select nhname="tag_1" nh_tag_0="true" name="technical_title" id="userTechnical_title" class="w70" style='display:none;height:28px;'>
<option value="教授">教授</option>
<option value="副教授">副教授</option>
<option value="讲师">讲师</option>
<option value="助教">助教</option>
</select>
<span nhname="tag" nh_tag_1="true" style='display:none;'>
<span nhname="tag_1" nh_tag_1="true" style='display:none;'>
<% if !User.current.user_extensions.nil? && !User.current.user_extensions.student_id.nil? %>
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => l(:label_account_identity_studentID),:style => "width:127px;" %>
<% else %>
@ -78,9 +78,9 @@
<span id="identity_hint" style="display: none"></span>
</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= text_field_tag :lastname, @user.lastname+@user.firstname, :no_label => true, :required => true, :nh_required => "1",:class => "w210" %><span id="last_name_notice" class="none c_red">姓名不能为空</span>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" ><%= text_field_tag :lastname, @user.lastname+@user.firstname, :no_label => true, :required => true, :nh_required => "1",:class => "w210" %><span id="last_name_notice" class="none c_red">姓名不能为空</span>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" >
<% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %>
<input type="radio" id="sex" value="0" name="sex" class="fl "><label class="fl mr10">男</label> <input type="radio" id="sex" value="1" name="sex" checked="checked" class="fl "><label class="fl ">女</label>
<% else %>
@ -89,10 +89,10 @@
<select style = "display: none;" class="w70" style="height:28px;margin-left:2px;" id="gender" name="gender"><option value="0">男</option><option value="1">女</option></select>
</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" >
<!-- 基本资料页面单位审核显示 -->
<% if User.current.user_extensions.nil? %>
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/>
<p class="fl ml10">
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
@ -102,10 +102,10 @@
<!-- 从业者选择单位名称 -->
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
<% if User.current.user_extensions.school_id.nil? %>
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<% else %>
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text"value="<%= User.current.user_extensions.school %>" >
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" class="w210 fl" type="text"value="<%= User.current.user_extensions.school %>" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.school.id %>" /> <!-- 单位名称的test框选中下拉列表框的id -->
<% end %>
<p class="fl ml10">
@ -114,7 +114,7 @@
</p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
<% elsif User.current.user_extensions.school.nil? %>
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" placeholder=" --请选择您所属的单位--" />
<p class="fl ml10">
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
@ -187,7 +187,7 @@
<%=link_to '查看', user_homepages_path(:user_id => @user.id),:target => '_blank', :class => 'linkBlue' %>
<% end %>
<% else %>
<p class="nodata" style="height: 22px; font-size: 14px; text-align: left; line-height: 20px;">您还没有创建属于自己的个人主页。<%=link_to '新建', new_user_homepage_article_homepage_path(:user_id=> @user.id, :homepage_id => @user.homepage.id), :target => "_blank", :class => 'linkBlue' %></p>
<p class="nodata" style="height: 22px; font-size: 14px; text-align: left; line-height: 20px;">您还没有创建属于自己的个人主页。<%=link_to '新建', new_user_homepage_article_homepage_path(:user_id=> @user.id, :homepage_id => @user.homepage.id),:onclick=>"my_account_form_submit();", :target => "_blank", :class => 'linkBlue' %></p>
<% end %>
<!--<textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%#= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea>-->
</li>
@ -280,7 +280,7 @@
<script type="text/javascript">
function showtechnical_title(val){
$("*[nhname='tag']").each(function(){
$("*[nhname='tag_1']").each(function(){
$("*[nh_required='1']",$(this)).attr("required",false);
$(this).hide()
});

View File

@ -333,17 +333,19 @@
<% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 3 %>
<% if length <= 2 %>
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div id="comment_reply_<%=parents_rely[length - 1].id %>">
<%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
<!--<div id="comment_reply_<%=parents_rely[length - 1].id %>">-->
<!--<%#=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
<!--</div>-->
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<div class="orig_cont_hide clearfix"><span class="orig_icon" >&darr; </span><span class="orig_icon" style="display:none;" > &uarr;</span><%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %></div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<span class="orig_icon" style="display:none;" > &uarr;</span><%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment),:remote=>true, :class => 'linkBlue2' %></div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
</div>
<% end %>

View File

@ -52,6 +52,22 @@
<% end%>
</ul>
<ul>
<li class='ur_item'>
<div class="fl mr30">
<label>下限<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>
<%= select_tag :min_choices,options_for_select(min_or_max_choices_option(poll_question),poll_question.min_choices), {:id=>"min_choices", :class=>"poll-multiple-limit"} %>
<span class="fontGrey2">(可选)答题时最少选几项</span>
</div>
</li>
<div class="cl"></div>
<li class='ur_item'>
<div class="fl mr30">
<label>上限<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>
<%= select_tag :max_choices,options_for_select(min_or_max_choices_option(poll_question),poll_question.max_choices), {:id=>"max_choices", :class=>"poll-multiple-limit"} %>
<span class="fontGrey2">(可选)答题时最多选几项</span><span class="c_red ml10" id="choices_notice"></span>
</div>
</li>
<div class="cl"></div>
<li class="ur_item">
<div class="dash-block new-question" onclick='add_single_answer($(this));'>新建选项</div>
</li>

View File

@ -29,6 +29,32 @@
<div class='cl'></div>
</ul>
<ul>
<li class='ur_item'>
<div class="fl mr30">
<label>下限<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>
<select name="min_choices" class="poll-multiple-limit">
<option value="0">不限</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<span class="fontGrey2">(可选)答题时最少选几项</span>
</div>
</li>
<div class="cl"></div>
<li class='ur_item'>
<div class="fl mr30">
<label>上限<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>
<select name="max_choices" class="poll-multiple-limit">
<option value="0">不限</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<span class="fontGrey2">(可选)答题时最多选几项</span><span class="c_red ml10" id="choices_notice"></span>
</div>
</li>
<div class="cl"></div>
<li class="ur_item">
<div class="dash-block new-question" onclick='add_single_answer($(this));'>新建选项</div>
</li>

View File

@ -3,7 +3,7 @@
<div class="ur_editor_title">
<label for="ur_question_title" class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="3"/>
<textarea maxlength="250" id="poll_questions_title_new" class="questionTitle w590" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行主观题" oninput="autoHeight('#poll_questions_title_new',30)"></textarea>
<textarea maxlength="250" id="poll_questions_title_new" class="questionTitle w590" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入主观题" oninput="autoHeight('#poll_questions_title_new',30)"></textarea>
<label>
<input name="is_necessary" value="true" checked type="checkbox">
必答

View File

@ -1,11 +1,10 @@
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
<div class="upload_con">
<h2>选择问卷导入本课程</h2>
<h2>选择问卷导入本班级</h2>
<div class="upload_box">
<div id="error_show" style="color: red;"></div>
<%= form_tag import_other_poll_poll_index_path,
method: :post,
remote: true,
id: "relation_file_form" do %>
<input type="hidden" name="course_id" value="<%= polls_group_id%>" />
<%= content_tag('div', poll_check_box_tags('polls[]', polls,polls_group_id), :id => 'courses',:style=> 'width: 300px;')%>

View File

@ -1,56 +1,26 @@
<% mc_question_list = poll.poll_questions.where("question_type=1") %>
<% mcq_question_list = poll.poll_questions.where("question_type=2") %>
<% single_question_list = poll.poll_questions.where("question_type=3") %>
<% multi_question_list = poll.poll_questions.where("question_type=4") %>
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单选题</h3>
<% mc_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_MC', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<%= render :partial => 'edit_MC', :locals => {:poll_question => poll_question} %>
</div>
<% poll.poll_questions.each do |poll_question|%>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<% if poll_question.question_type == 1%>
<%= render :partial => 'show_MC', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 2%>
<%= render :partial => 'show_MCQ', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 3%>
<%= render :partial => 'show_single', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 4%>
<%= render :partial => 'show_mulit', :locals => {:poll_question => poll_question} %>
<% end%>
</div>
<% end %>
</div>
<div class="testStatus" id="mcq_question_list" style="display: <%=mcq_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多选题</h3>
<% mcq_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_MCQ', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<%= render :partial => 'edit_MCQ', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<% if poll_question.question_type == 1%>
<%= render :partial => 'edit_MC', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 2%>
<%= render :partial => 'edit_MCQ', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 3%>
<%= render :partial => 'edit_single', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 4%>
<%= render :partial => 'edit_mulit', :locals => {:poll_question => poll_question} %>
<% end%>
</div>
<% end %>
</div>
<div class="testStatus" id="single_question_list" style="display: <%=single_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单行主观题</h3>
<% single_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_single', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<%= render :partial => 'edit_single', :locals => {:poll_question => poll_question} %>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="multi_question_list" style="display: <%=multi_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多行主观题</h3>
<% multi_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_mulit', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<%= render :partial => 'edit_mulit', :locals => {:poll_question => poll_question} %>
</div>
</div>
<% end %>
</div>
</div>
<% end %>

View File

@ -62,7 +62,7 @@ function add_MC(){
}
}
function insert_MC(quest_type,quest_num,quest_id){
function insert_MC(quest_type,quest_id){
var forms = $("form.new_poll_question");
if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") {
if(forms.length > 0){
@ -74,7 +74,6 @@ function add_MC(){
'<div class="ur_editor_title"> '+
'<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="1"/>'+
'<textarea maxlength="250" class="questionTitle w570" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入单选题题目"></textarea>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
@ -152,7 +151,7 @@ function add_MCQ(){
}
}
function insert_MCQ(quest_type,quest_num,quest_id){
function insert_MCQ(quest_type,quest_id){
var forms = $("form.new_poll_question");
if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") {
if(forms.length > 0){
@ -164,7 +163,6 @@ function insert_MCQ(quest_type,quest_num,quest_id){
'<div class="ur_editor_title">'+
'<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="2"/>'+
'<textarea maxlength="250" class="questionTitle w570" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入多选题题目"></textarea>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
@ -193,6 +191,32 @@ function insert_MCQ(quest_type,quest_num,quest_id){
'</ul>'+
'<ul>'+
'<li class="ur_item">'+
'<div class="fl mr30">'+
'<label>下限<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<select name="min_choices" class="poll-multiple-limit">'+
'<option value="0">不限</option>'+
'<option value="1">1</option>'+
'<option value="2">2</option>'+
'<option value="3">3</option>'+
'</select>'+
'<span class="fontGrey2">(可选)答题时最少选几项</span>'+
'</div>'+
'</li>'+
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<div class="fl mr30">'+
'<label>上限<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>' +
'<select name="max_choices" class="poll-multiple-limit">'+
'<option value="0">不限</option>'+
'<option value="1">1</option>'+
'<option value="2">2</option>'+
'<option value="3">3</option>'+
'</select>'+
'<span class="fontGrey2">(可选)答题时最多选几项</span><span class="c_red ml10" id="choices_notice"></span>'+
'</div>' +
'</li>' +
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<div class="dash-block new-question" onclick="add_single_answer($(this));">新建选项</div>'+
'</li>'+
'<div class="cl"></div>'+
@ -242,7 +266,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){
}
}
function insert_SINGLE(quest_type,quest_num,quest_id){
function insert_SINGLE(quest_type,quest_id){
var forms = $("form.new_poll_question");
if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") {
if(forms.length > 0){
@ -254,7 +278,6 @@ function insert_MCQ(quest_type,quest_num,quest_id){
'<div class="ur_editor_title">'+
'<label for="ur_question_title" class="questionLabel mt8">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="3"/>'+
'<textarea maxlength="250" id="poll_questions_title" class="questionTitle w570" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行主观题"></textarea>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
@ -299,7 +322,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){
}
}
function insert_MULIT(quest_type,quest_num,quest_id){
function insert_MULIT(quest_type,quest_id){
var forms = $("form.new_poll_question");
if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") {
if(forms.length > 0){
@ -311,7 +334,6 @@ function insert_MCQ(quest_type,quest_num,quest_id){
'<div class="ur_editor_title">'+
'<label for="ur_question_title" class="questionLabel mt8">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="4"/>'+
'<textarea maxlength="250" id="poll_questions_title" class="questionTitle w570" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入多行主观题的问题描述"></textarea>'+
'<label><input type="checkbox" name="is_necessary" value="true" checked/>'+
@ -388,7 +410,6 @@ function insert_MCQ(quest_type,quest_num,quest_id){
return;
}
}
}
//添加标题时确定按钮
@ -400,7 +421,13 @@ function insert_MCQ(quest_type,quest_num,quest_id){
doc.one('click', function(){
add_poll_question($(this));
});
}else if(doc.parent().parent().find("select[name='min_choices']").length > 0 && doc.parent().parent().find("select[name='min_choices']").find("option:selected").val() != '0' && doc.parent().parent().find("select[name='max_choices']").length > 0 && doc.parent().parent().find("select[name='max_choices']").find("option:selected").val() != '0' && parseInt(doc.parent().parent().find("select[name='min_choices']").find("option:selected").val()) > parseInt(doc.parent().parent().find("select[name='max_choices']").find("option:selected").val())){
doc.parent().parent().find("#choices_notice").html("下限不能大于上限");
doc.one('click', function(){
add_poll_question($(this));
});
}else{
doc.parent().parent().find("#choices_notice").html("");
doc.parent().parent().parent().submit();
}
}
@ -413,7 +440,14 @@ function insert_MCQ(quest_type,quest_num,quest_id){
doc.one('click', function(){
add_poll_question_new($(this));
});
}else{
}else if(doc.parent().parent().find("select[name='min_choices']").length > 0 && doc.parent().parent().find("select[name='min_choices']").find("option:selected").val() != '0' && doc.parent().parent().find("select[name='max_choices']").length > 0 && doc.parent().parent().find("select[name='max_choices']").find("option:selected").val() != '0' && parseInt(doc.parent().parent().find("select[name='min_choices']").find("option:selected").val()) > parseInt(doc.parent().parent().find("select[name='max_choices']").find("option:selected").val())){
doc.parent().parent().find("#choices_notice").html("下限不能大于上限");
doc.one('click', function(){
add_poll_question_new($(this));
});
}
else{
doc.parent().parent().find("#choices_notice").html("");
doc.parent().parent().parent().submit();
}
}
@ -421,7 +455,14 @@ function insert_MCQ(quest_type,quest_num,quest_id){
function edit_poll_question(doc,id)
{
var title = $.trim($("#poll_questions_title_" + id).val());
if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
if(title.length == 0){
alert("标题不能为空");
}else if(doc.parent().parent().find("select[name='min_choices']").length > 0 && doc.parent().parent().find("select[name='min_choices']").find("option:selected").val() != '0' && doc.parent().parent().find("select[name='max_choices']").length > 0 && doc.parent().parent().find("select[name='max_choices']").find("option:selected").val() != '0' && parseInt(doc.parent().parent().find("select[name='min_choices']").find("option:selected").val()) > parseInt(doc.parent().parent().find("select[name='max_choices']").find("option:selected").val())){
doc.parent().parent().find("#choices_notice").html("下限不能大于上限");
}else{
doc.parent().parent().find("#choices_notice").html("");
doc.parent().parent().parent().submit();
}
}
//问卷头
@ -463,9 +504,13 @@ function insert_MCQ(quest_type,quest_num,quest_id){
// doc.parent().before("<li class='ur_item new_answer'><label>选项<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='输入选项内容'/>" +
// "<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
// "</li><div class='cl'></div>");
var count = doc.parent().parent().prev().children('li').length;
multiLimit(doc.parent().siblings("li").children("div").children("select:first"), count);
multiLimit(doc.parent().siblings("li").children("div").children("select:last"), count);
}
function remove_single_answer(doc)
{
var ul = doc.parent().parent();
if(doc.parent().siblings("li.new_answer").length == 0)
{
alert("至少有一个选项");
@ -474,7 +519,30 @@ function insert_MCQ(quest_type,quest_num,quest_id){
{
doc.parent().remove();
}
var count = ul.children('li').length;
multiLimit(ul.siblings("ul").children("li").children("div").children("select:first"), count);
multiLimit(ul.siblings("ul").children("li").children("div").children("select:last"), count);
}
//多选题答题限制数实时更新
function multiLimit(doc, count){
var upperLimit = $(".ur_editor_content .new_answer").size();
var option_count = doc.children('option').length;
if (option_count == 0){
doc.append("<option value='"+ 0 +"'>" + '' + "</option>");
}
var option_count = doc.children('option').length;
if(count > option_count - 1){
for(var i = option_count; i <= count; i++){
doc.append("<option value='"+ i +"'>" + i + "</option>");
}
} else if(count < option_count - 1){
for(var i = count + 1; i <= option_count - 1; i++){
doc.children("option[value='" + i + "']").remove();
}
}
}
//其他选项
function add_other_answer(doc)
{
@ -483,6 +551,10 @@ function insert_MCQ(quest_type,quest_num,quest_id){
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
"</li><div class='cl'></div>");
}
var count = doc.parent().parent().prev().children('li').length;
multiLimit(doc.parent().siblings("li").children("div").children("select:first"), count);
multiLimit(doc.parent().siblings("li").children("div").children("select:last"), count);
}
function poll_cancel()
{
@ -543,26 +615,26 @@ function insert_MCQ(quest_type,quest_num,quest_id){
<div class="testQuestion">
<span class="fl mt10 mr18">题型</span>
<ul class="tabs_list fl">
<li class="tab_item02 ">
<li class="tab_item02 mr95">
<a title="<%= l(:label_MC) %>" class="tab_icon icon_radio" onclick="add_MC();">
<%= l(:label_MC) %>
</a>
</li>
<li class="tab_item02 " >
<li class="tab_item02 mr95" >
<a title="<%= l(:label_MCQ) %>" class=" tab_icon icon_checkbox" onclick="add_MCQ();">
<%= l(:label_MCQ) %>
</a>
</li>
<li class="tab_item02 " >
<a title="<%= l(:label_single) %>" class="tab_icon icon_text" onclick="add_single();">
<%= l(:label_single) %>
</a>
</li>
<li class="tab_item02 " >
<a title="<%= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">
<%= l(:label_mulit)%>
<a title="<%= l(:label_subjective) %>" class="tab_icon icon_text" onclick="add_single();">
<%= l(:label_subjective) %>
</a>
</li>
<!--<li class="tab_item02 " >-->
<!--<a title="<%#= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">-->
<!--<%#= l(:label_mulit)%>-->
<!--</a>-->
<!--</li>-->
</ul>
<div class="cl"></div>
</div><!--选项 end-->

View File

@ -0,0 +1,24 @@
<p class="mt10 mb10">
<span class="questionLabel" id="poll_question_number_<%=poll_question.id %>"><%= poll_question.question_number%></span>
<%if poll_question.is_necessary == 1%>
<span class="c_red questionLabel ml5" title="必答">*</span>
<%end%>
</p>
<% poll = poll_question.poll %>
<% count = poll.poll_questions.count %>
<% unless poll_question.question_number == 1 %>
<%= link_to('', {:controller => 'poll', :action => 'update_question_num', :id => poll.id, :ques_id => poll_question.id, :opr => 'up'},:remote => true, :method => 'post', :class => "poll-up mb8", :title => '上移') %>
<% end %>
<% if poll_question.question_number < count %>
<%= link_to('', {:controller => 'poll', :action => 'update_question_num', :id => poll.id, :ques_id => poll_question.id, :opr => 'down'},:remote => true, :method => 'post', :class => "poll-down mb8", :title => '下移') %>
<% end %>
<div class="poll-add mb8 pr">
<ul class="poll-add-menu fontGrey3">
<li><a href="javascript:void(0);" onclick=" dismiss('<%=type %>',<%=poll_question.id%>);insert_MC('<%=type %>',<%=poll_question.id%>);">单选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('<%=type %>',<%=poll_question.id%>);insert_MCQ('<%=type %>',<%=poll_question.id%>);">多选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('<%=type %>',<%=poll_question.id%>);insert_SINGLE('<%=type %>',<%=poll_question.id%>);">主观题</a></li>
</ul>
</div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "poll-delete", :title => "删除") %>

View File

@ -1,41 +1,52 @@
<div>
<div class="testEditTitle">
<span class="questionLabel">第<%= poll_question.question_number%>题:</span>
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<%if poll_question.is_necessary == 1%>
<span class="c_red questionLabel ml5" title="必答">*</span>
<%end%>
<div class="poll-container">
<div class="poll-tool-bar" id="poll_tool_bar_<%= poll_question.id%>">
<%= render :partial => "poll_tool_bar", :locals => {:type => 'mc', :poll_question => poll_question}%>
</div>
<div class="poll-content">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[单选题]</span>
</div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mc_<%=poll_question.id%>" onclick="dismiss('mc',<%=poll_question.id%>);insert_MC('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<% if poll_answer.answer_text != '' %>
<label>
<input class="ur_radio" type="radio" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
<% else %>
<label>
<input class="ur_radio" name="<%= poll_question %>" value="" type="radio">
</label>
<input placeholder="其它" readonly="readonly" class="disabled questionnaire-input w300" type="text">
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="ur_inputs">
<table class="ur_table" style="width:647px;">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<% if poll_answer.answer_text != '' %>
<label>
<input class="ur_radio" type="radio" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
<% else %>
<label>
<input class="ur_radio" name="<%= poll_question %>" value="" type="radio">
</label>
<input placeholder="其它" readonly="readonly" class="disabled questionnaire-input w300" type="text">
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div><!--单选题显示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mc_<%=poll_question.id%>">
</div>
<script>
$(".poll-add").mouseover(function(){
$(this).children('ul').show();
}).mouseout(function(){
$(this).children('ul').hide();
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>

View File

@ -1,40 +1,62 @@
<div>
<div class="testEditTitle">
<span class="questionLabel">第<%= poll_question.question_number%>题:</span>
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required questionLabel ml5" title="必答">*</span>
<%end%>
</div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mcq_<%=poll_question.id%>" onclick="dismiss('mcq',<%=poll_question.id%>);insert_MCQ('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs" style="width:675px;">
<table class="ur_table" style="width:675px;">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<% if poll_answer.answer_text != '' %>
<label>
<input class="ur_radio" type="checkbox" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
<% else %>
<label>
<input class="ur_radio" name="<%= poll_question %>" value="" type="checkbox">
</label>
<input placeholder="其它" readonly="readonly" class="disabled questionnaire-input w300" type="text">
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="poll-container">
<div class="poll-tool-bar" id="poll_tool_bar_<%= poll_question.id%>">
<%= render :partial => "poll_tool_bar", :locals => {:type => 'mcq', :poll_question => poll_question}%>
</div>
<div class="poll-content">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[多选题]</span>
<% if poll_question.min_choices != 0 || poll_question.max_choices != 0 %>
<p class="fontGrey2">
<% if poll_question.min_choices != 0 && poll_question.max_choices != 0 %>
答题时最少选<%=poll_question.min_choices %>项、最多选<%=poll_question.max_choices %>项
<% elsif poll_question.min_choices != 0 %>
答题时最少选<%=poll_question.min_choices %>项
<% elsif poll_question.max_choices != 0 %>
答题时最多选<%=poll_question.max_choices %>项
<% end %>
</p>
<% end %>
</div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:647px;">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<% if poll_answer.answer_text != '' %>
<label>
<input class="ur_radio" type="checkbox" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
<% else %>
<label>
<input class="ur_radio" name="<%= poll_question %>" value="" type="checkbox">
</label>
<input placeholder="其它" readonly="readonly" class="disabled questionnaire-input w300" type="text">
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div><!--多选题显示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mcq_<%=poll_question.id%>">
</div>
</div>
<script>
$(".poll-add").mouseover(function(){
$(this).children('ul').show();
}).mouseout(function(){
$(this).children('ul').hide();
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>

View File

@ -1,23 +1,35 @@
<div>
<div class="testEditTitle">
<span class="questionLabel">第<%= poll_question.question_number%>题:</span>
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required questionLabel ml5" title="必答">*</span>
<%end%>
<div class="poll-container">
<div class="poll-tool-bar" id="poll_tool_bar_<%= poll_question.id%>">
<%= render :partial => "poll_tool_bar", :locals => {:type => 'mulit', :poll_question => poll_question}%>
</div>
<div class="poll-content">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[多行主观题]</span>
</div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<% poll_question.poll_answers.reorder("answer_position").each_with_index do |poll_answer, i| %>
<div class="ml20 mb10">
<p class="mb10"><%= i + 1 %>.<%= poll_answer.answer_text%></p>
<input type="text" class="questionnaire-input" name="<%= poll_question %>" style="width:620px;" />
</div>
<% end %>
</div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mulit_<%=poll_question.id%>" onclick="dismiss('mulit',<%=poll_question.id%>);insert_MULIT('mulit',<%=poll_question.question_number%>,<%=poll_question.id%>);"></a>
<div class="cl"></div>
<% poll_question.poll_answers.reorder("answer_position").each_with_index do |poll_answer, i| %>
<div class="ml40 mb10">
<p class="mb10"><%= i + 1 %>.<%= poll_answer.answer_text%></p>
<input type="text" class="questionnaire-input" name="<%= poll_question %>" style="width:652px;" />
</div>
<% end %>
</div><!--多行展示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mulit_<%=poll_question.id%>">
</div>
</div>
<script>
$(".poll-add").mouseover(function(){
$(this).children('ul').show();
}).mouseout(function(){
$(this).children('ul').hide();
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>

View File

@ -1,20 +1,32 @@
<div>
<div class="testEditTitle">
<span class="questionLabel">第<%= poll_question.question_number%>题:</span>
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required questionLabel ml5" title="必答">*</span>
<%end%>
<div class="poll-container">
<div class="poll-tool-bar" id="poll_tool_bar_<%= poll_question.id%>">
<%= render :partial => "poll_tool_bar", :locals => {:type => 'single', :poll_question => poll_question}%>
</div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_single_<%=poll_question.id%>" onclick="dismiss('single',<%=poll_question.id%>);insert_SINGLE('single',<%=poll_question.question_number%>,<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<input class="questionnaire-input" type="text" size="" maxlength="" value="" style="width:692px;">
<div class="poll-content">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[主观题]</span>
</div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<textarea type="text" size="" maxlength="" value="" style="width:640px; border:1px solid #ddd;" rows="3" readonly="readonly"></textarea>
</div>
</div>
</div><!--单行文字展示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_single_<%=poll_question.id%>">
</div>
</div>
<script>
$(".poll-add").mouseover(function(){
$(this).children('ul').show();
}).mouseout(function(){
$(this).children('ul').hide();
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>

View File

@ -2,41 +2,39 @@
$("#poll_content").html('<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>');
<% else %>
$("#new_poll_question_new").html("");
<%if @poll_questions.question_type == 1%>
$("#mc_question_list").show().append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"</div>");
<%elsif @poll_questions.question_type == 2%>
$("#mcq_question_list").show().append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"</div>");
<%elsif @poll_questions.question_type == 3%>
$("#single_question_list").show().append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"</div>");
<%elsif @poll_questions.question_type == 4%>
$("#multi_question_list").show().append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<%= escape_javascript(render :partial => 'edit_mulit', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"</div>");
<% if @last_question %>
<% if @last_question.question_type == 1%>
$("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @last_question}) %>");
<% elsif @last_question.question_type == 2%>
$("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @last_question}) %>");
<% elsif @last_question.question_type == 3%>
$("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @last_question}) %>");
<% elsif @last_question.question_type == 4%>
$("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @last_question}) %>");
<% end%>
<% end %>
$("#poll_content").append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<% if @poll_questions.question_type == 1%>" +
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 2%>" +
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 3%>" +
"<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 4%>" +
"<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_questions}) %>" +
"<% end%>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<% if @poll_questions.question_type == 1%>" +
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 2%>" +
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 3%>" +
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 4%>" +
"<%= escape_javascript(render :partial => 'edit_mulit', :locals => {:poll_question => @poll_questions}) %>" +
"<% end%>" +
"</div>" +
"</div>");
<% end %>

View File

@ -1,303 +1,347 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<div class="homepageRight mt0 ml10">
<div class="resources" id="polls">
<div class="testStatus" >
<h1 class="ur_page_title">
<%= @poll.polls_name%>
</h1>
<div class="testDesEdit mt5"><%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%></div>
</div>
<div class="testStatus">
<h1 class="ur_page_title">
<%= @poll.polls_name %>
</h1>
<% mc_question_list = @poll.poll_questions.where("question_type=1") %>
<% mcq_question_list = @poll.poll_questions.where("question_type=2") %>
<% single_question_list = @poll.poll_questions.where("question_type=3") %>
<% multi_question_list = @poll.poll_questions.where("question_type=4") %>
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单选题</h3>
<% mc_question_list.each_with_index do |pq, list_index| %>
<div id="poll_questions_<%= pq.id%>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number,:question_number => pq.question_number) %>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label>
<script>
function onblur_<%= pa.id %>(obj)
{
$(window).unbind('beforeunload');
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
document.getElementById("poll_vote_<%=pq.id %>poll_answer_id_<%=pa.id %>").checked = true;
var span = $('#percent');
span.html(dataObj.percent);
}
});
<div class="testDesEdit mt5"><%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe %></div>
</div>
}
function click_<%= pa.id %>(obj)
{
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_answer_id: <%= pa.id %>,
poll_question_id: <%= pq.id %>
},
success: function (data) {
var dataObj = eval(data);
if(dataObj.text == "ok")
{
obj.checked = true;
}
else
{
obj.checked = false;
}
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
</script>
<%= radio_button "poll_vote",pq.id.to_s+"poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"click_#{pa.id}(this);return false;",:checked => answer_be_selected?(pa,User.current),:disabled => !@can_edit_poll %>
<% if pa.answer_text == "" %>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 93%" value="<%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %> placeholder="其他">
<% else %>
<%= pa.answer_text %>
<% end %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="mcq_question_list" style="display: <%=mcq_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多选题</h3>
<% mcq_question_list.each do |pq| %>
<div id="poll_questions_<%= pq.id%>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number,:question_number => pq.question_number) %>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label>
<script>
function onblur_<%= pa.id %>(obj)
{
$(window).unbind('beforeunload');
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
document.getElementById("poll_vote_<%=pq.id %>poll_answer_id_<%=pa.id %>").checked = true;
var span = $('#percent');
span.html(dataObj.percent);
}
});
}
function click_<%= pa.id %>(obj)
{
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_answer_id: <%= pa.id %>,
poll_question_id: <%= pq.id %>
},
success: function (data) {
var dataObj = eval(data);
if(dataObj.text == "ok")
{
obj.checked = true;
}
else
{
obj.checked = false;
}
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
</script>
<input class="ur_radio" id="poll_vote_<%=pq.id %>poll_answer_id_<%=pa.id %>" type="checkbox" onclick="click_<%= pa.id %>(this);return false;" <%= answer_be_selected?(pa,User.current) ? "checked":"" %> <%= @can_edit_poll?"":"disabled=disabled" %> >
<% if pa.answer_text == "" %>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 93%" value="<%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %> placeholder="其他">
<% else %>
<%= pa.answer_text %>
<% end %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div><!--多选题显示 end-->
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="single_question_list" style="display: <%=single_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单行主观题</h3>
<% single_question_list.each do |pq| %>
<div id="poll_questions_<%= pq.id%>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number,:question_number => pq.question_number) %>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<% @poll_questions.each do |pq| %>
<% if pq.question_type == 1 %>
<!-- 单选题 -->
<div class="testStatus">
<div id="poll_questions_<%= pq.id %>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<script>
function onblur_<%= pq.id %>(obj)
{
$(window).unbind('beforeunload');
var val = $(obj).val().trim();
if(val != "") {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %> ,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
obj.value = dataObj.text;
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
}
</script>
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %>>
<div class="testEditTitle">
<%= l(:label_question_number, :question_number => pq.question_number) %>
<%= pq.question_title %>
<span class="fontBlue">[单选题]</span>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label>
<script>
function onblur_<%= pa.id %>(obj) {
$(window).unbind('beforeunload');
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
//document.getElementById("poll_vote_<%#=pq.id %>poll_answer_id_<%#=pa.id %>").checked = true;
//var span = $('#percent');
//span.html(dataObj.percent);
}
});
}
function click_<%= pa.id %>(obj) {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_answer_id: <%= pa.id %>,
poll_question_id: <%= pq.id %>
},
success: function (data) {
var dataObj = eval(data);
if (dataObj.text == "ok") {
obj.checked = true;
$(obj).parent().parent().parent().parent().find("input[type='text']").attr("disabled", "disabled");
$(obj).next('input').removeAttr("disabled");
}
else {
obj.checked = false;
$(obj).next('input').attr("disabled", "disabled");
}
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
</script>
<%= radio_button "poll_vote", pq.id.to_s+"poll_answer_id", pa.id, :class => "ur_radio", :onclick => "click_#{pa.id}(this);return false;", :checked => answer_be_selected?(pa, User.current), :disabled => !@can_edit_poll %>
<% if pa.answer_text == "" %>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 93%" value="<%= get_anwser_vote_text(pq.id, User.current.id, pa.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= (@can_edit_poll && answer_be_selected?(pa, User.current)) ? "" : "disabled=disabled" %> placeholder="其他">
<% else %>
<%= pa.answer_text %>
<% end %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="multi_question_list" style="display: <%=multi_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多行主观题</h3>
<% multi_question_list.each do |pq| %>
<div id="poll_questions_<%= pq.id%>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number,:question_number => pq.question_number) %>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% elsif pq.question_type == 2 %>
<!-- 多选题 -->
<div class="testStatus">
<div id="poll_questions_<%= pq.id %>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number, :question_number => pq.question_number) %>
<%= pq.question_title %>
<span class="fontBlue">[多选题]</span>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
<% if pq.min_choices != 0 || pq.max_choices != 0 %>
<p class="fontGrey2">
<% if pq.min_choices != 0 && pq.max_choices != 0 %>
答题时最少选<%=pq.min_choices %>项、最多选<%=pq.max_choices %>项
<% elsif pq.min_choices != 0 %>
答题时最少选<%=pq.min_choices %>项
<% elsif pq.max_choices != 0 %>
答题时最多选<%=pq.max_choices %>项
<% end %>
<span class="c_red ml10" id="mcq_notice_<%=pq.id %>"></span>
</p>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label>
<script>
function onblur_<%= pa.id %>(obj) {
$(window).unbind('beforeunload');
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
//document.getElementById("poll_vote_<%#=pq.id %>poll_answer_id_<%#=pa.id %>").checked = true;
//var span = $('#percent');
//span.html(dataObj.percent);
}
});
}
function click_<%= pa.id %>(obj) {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_answer_id: <%= pa.id %>,
poll_question_id: <%= pq.id %>
},
success: function (data) {
var dataObj = eval(data);
if (dataObj.text == "ok") {
obj.checked = true;
$(obj).next('input').removeAttr("disabled");
$("#mcq_notice_<%=pq.id %>").html("");
}
else {
obj.checked = false;
$(obj).next('input').attr("disabled", "disabled");
if(dataObj.text == "over"){
$("#mcq_notice_<%=pq.id %>").html("该题最多只能选择<%=pq.max_choices %>个选项");
}else{
$("#mcq_notice_<%=pq.id %>").html("");
}
}
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
</script>
<input class="ur_radio" id="poll_vote_<%= pq.id %>poll_answer_id_<%= pa.id %>" type="checkbox" onclick="click_<%= pa.id %>(this);return false;" <%= answer_be_selected?(pa, User.current) ? "checked" : "" %> <%= @can_edit_poll ? "" : "disabled=disabled" %> >
<% if pa.answer_text == "" %>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 93%" value="<%= get_anwser_vote_text(pq.id, User.current.id, pa.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= (@can_edit_poll && answer_be_selected?(pa, User.current)) ? "" : "disabled=disabled" %> placeholder="其他">
<% else %>
<%= pa.answer_text %>
<% end %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<!--多选题显示 end-->
</div>
</div>
</div>
<% elsif pq.question_type == 3 %>
<!-- 单行文字-->
<div class="testStatus">
<div id="poll_questions_<%= pq.id %>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number, :question_number => pq.question_number) %>
<%= pq.question_title %>
<span class="fontBlue">[主观题]</span>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<div>
<script>
function onblur_<%= pq.id %>(obj) {
$(window).unbind('beforeunload');
var val = $(obj).val().trim();
if (val != "") {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
obj.value = dataObj.text;
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
}
</script>
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(pq.id, User.current.id).html_safe %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll ? "" : "disabled=disabled" %>>
</div>
</div>
</div>
</div>
</div>
<% elsif pq.question_type == 4 %>
<!-- 多行文字-->
<div class="testStatus">
<div id="poll_questions_<%= pq.id %>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number, :question_number => pq.question_number) %>
<%= pq.question_title %>
<span class="fontBlue">[多行主观题]</span>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<% pq.poll_answers.each_with_index do |pa, i| %>
<div class="ml20 mb10">
<script>
function onblur_<%= pa.id %>(obj) {
$(window).unbind('beforeunload');
var val = $(obj).val().trim();
if (val != "") {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
obj.value = dataObj.text;
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
}
</script>
<p class="mb10"><%= i + 1 %>.<%= pa.answer_text %></p>
<input class="questionnaire-input" placeholder="在此填入答案" style="width: 99%" type="text" value="<%= get_anwser_vote_text(pq.id, User.current.id, pa.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= @can_edit_poll ? "" : "disabled=disabled" %>>
</div>
<% end %>
</div>
<div class="cl"></div>
<% pq.poll_answers.each_with_index do |pa, i| %>
<div class="ml40 mb10">
<script>
function onblur_<%= pa.id %>(obj)
{
$(window).unbind('beforeunload');
var val = $(obj).val().trim();
if(val != "") {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
obj.value = dataObj.text;
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
}
</script>
<p class="mb10"><%= i + 1 %>.<%= pa.answer_text%></p>
<input class="questionnaire-input" placeholder="在此填入答案" style="width: 93%" type="text" value="<%= get_anwser_vote_text(pq.id,User.current.id,pa.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %>>
</div>
<% end %>
</div>
</div>
</div>
<% else %>
<!-- 未知题型 -->
<% end %>
</div>
<div class="ur_buttons" style="width: 77px;">
<% if @poll.polls_status == 2 %>
<%= link_to l(:button_submit),commit_poll_poll_path(@poll), :method => :post,:class => "BlueCirBtn",:format => 'js',:remote=>true %>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_progress_text">
<%= l(:label_complete_question) %>
<strong class="ur_progress_number">
<span id="percent"><%= format "%.2f" ,@percent %></span>%
</strong>
</div>
</div><!--问卷内容end-->
</div>
<% end %>
<div class="ur_buttons" style="width: 77px;">
<% if @poll.polls_status == 2 %>
<a href="javascript:void(0)" class="BlueCirBtn" onclick="commit_poll();"><%=l(:button_submit) %></a>
<%#= link_to l(:button_submit), commit_poll_poll_path(@poll), :method => :post, :class => "BlueCirBtn", :format => 'js', :remote => true %>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_progress_text">
<%= l(:label_complete_question) %>
<strong class="ur_progress_number">
<span id="percent"><%= format "%.2f", @percent %></span>%
</strong>
</div>
</div>
<!--问卷内容end-->
</div>
<script>
function check_mcq(){
var result = true;
<% @poll.poll_questions.where("question_type = 2").each do |pq| %>
$("#mcq_notice_<%=pq.id %>").html("");
<% if pq.min_choices != 0 %>
var count = $("#show_poll_questions_<%= pq.id %>").find("input[type='checkbox']:checked").length;
if(count < <%=pq.min_choices %>) {
$("#mcq_notice_<%=pq.id %>").html("该题最少选择<%=pq.min_choices %>个选项");
result = false;
} else{
$("#mcq_notice_<%=pq.id %>").html("");
}
<% end %>
<% end %>
if(!result){
alert("您的多选题答题不符合要求,请检查后再提交");
}
return result;
}
function commit_poll(){
if(check_mcq()){
$.post('<%=commit_poll_poll_path(@poll) %>');
}
}
</script>

View File

@ -0,0 +1,34 @@
//$("#poll_content").html('<%#= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>');
<% if @before_que %>
$("#poll_questions_<%= @poll_question.id%>").insertBefore($("#poll_questions_<%= @before_que.id%>"));
<% if @before_que.question_type == 1%>
$("#show_poll_questions_<%= @before_que.id %>").html("<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @before_que}) %>");
<% elsif @before_que.question_type == 2%>
$("#show_poll_questions_<%= @before_que.id %>").html("<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @before_que}) %>");
<% elsif @before_que.question_type == 3%>
$("#show_poll_questions_<%= @before_que.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @before_que}) %>");
<% elsif @before_que.question_type == 4%>
$("#show_poll_questions_<%= @before_que.id %>").html("<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @before_que}) %>");
<% end%>
<% elsif @after_que %>
$("#poll_questions_<%= @poll_question.id%>").insertAfter($("#poll_questions_<%= @after_que.id%>"));
$("#poll_question_number_<%=@after_que.id %>").html("<%=@after_que.question_number %>");
<% if @after_que.question_type == 1%>
$("#show_poll_questions_<%= @after_que.id %>").html("<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @after_que}) %>");
<% elsif @after_que.question_type == 2%>
$("#show_poll_questions_<%= @after_que.id %>").html("<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @after_que}) %>");
<% elsif @after_que.question_type == 3%>
$("#show_poll_questions_<%= @after_que.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @after_que}) %>");
<% elsif @after_que.question_type == 4%>
$("#show_poll_questions_<%= @after_que.id %>").html("<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @after_que}) %>");
<% end%>
<% end %>
<% if @poll_question.question_type == 1%>
$("#show_poll_questions_<%= @poll_question.id %>").html("<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>");
<% elsif @poll_question.question_type == 2%>
$("#show_poll_questions_<%= @poll_question.id %>").html("<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_question}) %>");
<% elsif @poll_question.question_type == 3%>
$("#show_poll_questions_<%= @poll_question.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_question}) %>");
<% elsif @poll_question.question_type == 4%>
$("#show_poll_questions_<%= @poll_question.id %>").html("<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_question}) %>");
<% end%>

View File

@ -0,0 +1,5 @@
<h2>项目简介
<% if User.current.member_of?(@project) %>
<span class="fr mr15" id="project_invite_code">邀请码:<span class="c_orange"><%= @project.invite_code %></span></span>
<% end %>
</h2>

View File

@ -1,26 +1,29 @@
<div class="container-big mt10">
<div class="pr">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="content-big">
<div class="homepagePostTo break_word">
<%= link_to activity.try(:author).show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
TO
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline mr15">
文件大小:
<%= number_to_human_size activity.filesize%>
<% unless activity.nil? %>
<div class="container-big mt10">
<div class="pr">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDeadline">上传时间:<%= format_time(activity.created_on) %></div>
<div class="content-big">
<div class="homepagePostTo break_word">
<%= link_to activity.try(:author).show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
TO
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline mr15">
文件大小:
<%= number_to_human_size activity.filesize%>
</div>
<div class="homepagePostDeadline">上传时间:<%= format_time(activity.created_on) %></div>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<% end %>

View File

@ -1,24 +1,25 @@
<div class="container-big mb10">
<div class="project_r_h" style="width:970px;">
<h2 class="project_h2 fl" style="width: 120px;">收藏用户列表</h2>
<h2 class="project_h2 fl">收藏用户</h2>
</div>
<div class="member_content">
<%= error_messages_for 'member' %>
<div class="st_list2" style="width:970px;">
<div class="st_box">
<a href="#" class="fr fb mb5" >加入时间</a>
<div class="cl"></div><!--st_box_top end-->
<% @stores.each do |member| %>
<div class="st_boxlist">
<a href="javascript:" class="st_img">
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<span class="fr ml10 c_grey"><%= l(:label_user_for_project_grade) %><span class="c_orange"><%= format("%.2f" ,read_user_project_scores(member.user,@project)).to_i %></span></span>
<% unless member.user.nil? %>
<div class="st_boxlist">
<a href="javascript:" class="st_img">
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<span class="fr ml10 c_grey"><%= l(:label_user_for_project_grade) %><span class="c_orange"><%= format("%.2f" ,read_user_project_scores(member.user,@project)).to_i %></span></span>
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= link_to(member.user.name, user_path(member.user),:class => "ml10 c_blue02") %><%= rolesToLanguage(member.roles.sort.collect(&:to_s)).join(', ') %><br/>
</div>
<div class="cl"></div>
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= link_to(member.user.name, user_path(member.user),:class => "ml10 c_blue02") %><br/>
</div>
<div class="cl"></div>
<% end %>
<% end%>
<div class="cl"></div>

View File

@ -1 +1,2 @@
$('#join_exit_project_div').html("<%= escape_javascript(render(:partial => 'layouts/join_exit_project')) %>");
$('#join_in_project_applied').html("<%= escape_javascript(render(:partial => 'projects/applied_status')) %>");
$('#project_invite_code').html("<%= escape_javascript(render(:partial => 'projects/invite_code')) %>");

View File

@ -1,7 +1,6 @@
<div class="pro_new_prompt ml15 mr15 mb10"><p>温馨提示:每个项目只能创建一个版本库</p></div>
<% if @gitlab_repository.nil? %>
<div class=" sy_new_tchbox clear " >
<a href="javascript:void(0);" class=" sy_btn_green mb10">新建版本库</a>
<div class="sy_new_tchbox clear">
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project), :html => {:id => 'repository-form', :method=>"post", :autocomplete => 'off'} do |f| %>
<ul class="pro_newsetting_con mb15">
<li style="display: none">

View File

@ -16,19 +16,19 @@
<tr>
<td colspan="2" valign="top">
<strong> <%= h(share.project) if @project.nil? || @project.id != share.project.id %></strong>
<span class="font_lighter">
<%= link_to_user(share.user) %> <%= l(:label_new_activity) %>
<span class="font_lighter">
<%= link_to_user(share.user) %> <%= l(:label_new_activity) %>
</span> <%= share.title%>
<br/> <br/>
<%= share.description %><%= link_to "查看详情", share.url, {:target=>"_blank"} %>
<%= share.description %><%= link_to "查看详情", share.url, {:target=>"_blank"} %>
</td>
</tr>
<tr>
<td colspan="2" width="580px" >
<p class="font_description">
<!-- modify by nyan -->
</p></td>
</tr>
<tr>

View File

@ -1,10 +1,10 @@
<!--新版项目头部结束-->
<div class="pro_new_info mb10">
<h2>项目简介<span class="fr mr15">邀请码:<span class="c_orange"><%= @project.invite_code %></span></span></h2>
<div id="project_invite_code"><%= render :partial => 'projects/invite_code' %></div>
<% if @project.description.blank? %>
<p><%= @project.name %><p>
<p class="break_word"><%= @project.name %><p>
<% else %>
<p><%= @project.description %><p>
<p class="break_word"><%= @project.description %><p>
<% end %>
</div>

View File

@ -8,7 +8,7 @@
<% commits.each do |commit| %>
<li class="clear">
<span class="fl c_grey ml15 "><%= time_tag(commit.created_at) %>前</span>
<a href="javascript:void(0);" target="_blank" class="pullreques_pull_name fl ml10"> <%= get_user_by_mail(commit.author_email).show_name %> </a>
<%= link_to get_user_by_mail(commit.author_email).show_name, user_path(get_user_by_mail(commit.author_email)), :target => "_blank", :class => "pullreques_pull_name fl ml10" %>
<p class="pullreques_pull_txt ml10 fl"><%= commit.title %></p>
<%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "fr mr15 c_grey" %>
</li>

View File

@ -2,7 +2,7 @@
<% if !user_commit_rep(changeset.author_email).nil? %>
<a class="commit-author-link has_tooltip"> <span class="commit-author-name">
<%= image_tag(url_to_avatar(user_commit_rep(changeset.author_email)), :width => "20", :height => "20", :class => "fl portraitRadius mt2 ml4 mr5") %>
<%= link_to user_commit_rep(changeset.author_email), user_path(user_commit_rep(changeset.author_email)), :length => 30 %></span></a>提交于
<%= link_to get_user_by_mail(changeset.author_email).try(:show_name), user_path(user_commit_rep(changeset.author_email)), :target => "_blank", :class => "pullreques_pull_name fl mr5" %></span></a> 提交于
<div class="committed_ago">
<time class="time_ago js-timeago" title="<%= changeset.created_at %>"><%= time_tag(changeset.created_at) %>前 </time>&nbsp;
</div>

View File

@ -80,7 +80,7 @@
<% memo = Memo.where(:id => 1232).first %>
<% unless memo.nil? %>
<a href="<%= Setting.protocol + "://" %><%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
<a href="<%= Setting.protocol + "://" %><%=Setting.host_name %>/forums/1/memos/1232" class="linkBlue2">如何提交代码</a>
<% end %>
<% unless @entries.blank? %>
<div class="fr">

View File

@ -79,9 +79,7 @@
<script type="text/javascript">
$(".student_work_<%= st.id%>").mouseenter(function(){
if($("#about_hwork_<%= st.id%>").html().trim() == "") {
$("#work_click_<%= st.id%>").show();
}
$("#work_click_<%= st.id%>").show();
}).mouseleave(function(){
$("#work_click_<%= st.id%>").hide();
}).mouse;

View File

@ -9,7 +9,7 @@
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %>&nbsp;&nbsp;(<%=revise_attachment_status @homework,revise_attachment %>)<br />
<% unless revise_attachment.description == "" %>
<span class="tit_fb">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<% end %>
</div>
<div class="cl"></div>
@ -24,7 +24,7 @@
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %><br />
<% unless revise_attachment.description == "" %>
<span class="tit_fb">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<% end %>
</div>
<% end %>

View File

@ -2,7 +2,7 @@
<span class="c_dark f14 fb fl mr15">
作品
<font class="f12 c_red">
(<span id="student_work_count"><%= @student_work_count%></span>人已交)
(<span id="student_work_count"><%= @student_work_count%></span><%=@homework.homework_type == 3 ? '组' : '' %>已交)
</font>
<%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %>
<% my_work = cur_user_works_for_homework @homework %>

View File

@ -1,7 +1,7 @@
<div class="project_r_h02">
<div class="project_r_h02" style="width: 980px;">
<h2 class="project_h2">新建课程</h2>
</div>
<div class="hwork_new">
<div class="hwork_new pr">
<ul>
<%= labelled_form_for @syllabus do |f| %>
<li class="ml45">
@ -11,19 +11,25 @@
</li>
<div class="cl"></div>
<li class="ml125 fontGrey3"><span class="success-icon mr25">正确示例:软件工程</span><span class="error-icon">错误示例2016软件工程</span></li>
<li class="ml125 mt10 mb10 fontGrey2">课程是针对一个具体的学科方向开展的教学内容与进程安排。<br/>本质上,一门课程就是一个教学计划。</li>
<li class="ml45">
<li class="mt10 ml45">
<label><span class="c_white">*</span>&nbsp;<%= l(:label_tags_course_eng_name)%>&nbsp;&nbsp;</label>
<input type="text" name="eng_name" id="new_syllabus_eng_name" placeholder="例如Software Engineering" class="name_input" maxlength="100">
<!--<span class="c_red" id="new_course_class_period_notice" style="display: none;"></span>-->
</li>
<div class="cl"></div>
<li class=" ml55" >
<li class="mt10 ml55" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_syllabus();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<div class="cl"></div>
</li>
<% end%>
</ul>
<div class="ye_tips_box_inner" style="left: 570px; top: -5px; text-align: left;">
<em style="top: 9px;"></em>
<span style="top: 9px;"></span>
<p>
课程是针对一个具体的学科方向开展的教学内容与进程安排。<br/>本质上,一门课程就是一个教学计划。
</p>
</div>
</div><!--talknew end-->
<div class="cl"></div>

View File

@ -16,5 +16,14 @@
%>
<div class="cl"></div>
<p id="jour_content_span"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
</li>
<div class="cl"></div>
<script type="text/javascript">
$(function(){
setTimeout(function(){
elocalStorage(jour_content_editor,'user_newfeedback_<%=User.current.id %>_<%=@user.id %>');
}, 10000);
});
</script>

View File

@ -7,20 +7,20 @@
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 3 %>
<% if length <= 2 %>
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div>
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
<!--<div>-->
<!--<%#=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
<!--</div>-->
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true, :class => 'linkBlue2' %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
</div>

View File

@ -7,20 +7,20 @@
<% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 3 %>
<% if length <= 2 %>
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div>
<%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
<!--<div>-->
<!--<%#=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
<!--</div>-->
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class), :remote=>true, :class => 'linkBlue2' %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
</div>

View File

@ -20,9 +20,9 @@
<div class="list-file">
<div><span class="item_list fl"></span>
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title fl" %>
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title fl", :style => "max-width:950px;" %>
<% else %>
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title f1" %>
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title f1", :style => "max-width:950px;" %>
<% end %>
<% if activity.sticky == 1 %>
<span class="fl ml10 red-cir-btn">顶</span>
@ -33,13 +33,13 @@
<% u = User.where("id=?",activity.author_id).first%>
<div class="cl"></div>
</div>
<div class="massages-content ml15">
<div class="ml15">
<% if activity.parent_id.nil? %>
<% content = activity.content %>
<% else %>
<% content = activity.parent.content %>
<% end %>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %></p>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>225, :maxwidth=>950} %></p>
</div>
<div class="ml15 mt10 f12">
<span class="grayTxt">

View File

@ -89,9 +89,18 @@
<% end %>
<% end %>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<% if activity.attachments.any? %>
<div id="div_issue_attachment_<%=user_activity_id %>" style="margin-top: -10px; margin-bottom: -20px;">
<div>
<a href="javascript:void(0)" class="link_img fl">
<!--显示附件、图片-->
<%= link_to_attachment_project activity,:deletable => false, :author => true, :thumbnails => false %>
</a><br/>
<%= call_hook(:view_issues_show_description_bottom, :issue => activity) %>
</div><!--pro_pic_box end-->
<div class="cl"></div>
</div>
<% end %>
</div>
<div class="cl"></div>
</div>

View File

@ -1,50 +0,0 @@
<div class="userCard boxShadow" style="<%= User.current == user ? 'top:-153px;':'' %>">
<div class="userAvatarWrap fl">
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_url_in_org(user.id), :alt => "用户头像", :target => '_blank' %>
<%#= image_tag(url_to_avatar(user), :width => "50", :height => "50") %>
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />-->
</div>
<div class="fl">
<p class="homepageImageName mb5 hidden" style="max-width:88px;font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;"><%= user %></p>
<% if (user.user_extensions && (user.user_extensions.identity != 2) ) %>
<span class="<%= user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></span>
<% end %>
<!--<span class="homepageImageSex"></span>-->
<div class="cl"></div>
<p class="mb8 c_dark f14">
<span class="mr15 hidden fl ml15" style="max-width:90px;"><%= user.show_name %></span>
<% if user.user_extensions && user.user_extensions.identity %>
<%= get_user_roll(user) %>
<% end %>
</p>
</div>
<div class="cl"></div>
<div>
<div class="homepageImageBlock mb10">
<div><%= link_to User.watched_by(user.id).count, user_watchlist_url_in_org(user.id), :class => 'homepageImageNumber',:target => "_blank" %></div>
<div class="homepageImageText"><%= link_to '关注',user_watchlist_url_in_org(user.id),:target => "_blank" %></div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div><%= link_to user.watcher_users.count,user_fanslist_url_in_org(user.id), :class => "homepageImageNumber fans_count_#{user.id}",:target => "_blank" %></div>
<div class="homepageImageText"><%= link_to '粉丝', user_fanslist_url_in_org(user.id),:target => "_blank" %></div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div><%= link_to user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count, user_blogs_url_in_org(user.id), :class => 'homepageImageNumber',:target => "_blank" %></div>
<div class="homepageImageText"><%= link_to '博客', user_blogs_url_in_org(user.id),:target => "_blank" %></div>
</div>
<div class="cl"></div>
<% if User.current != user %>
<div class="add_cancel_watch_<%= user.id %>">
<%= render :partial => 'users/watch_btn_for_picture', :locals => {:user => user} %>
</div>
<!--<a href="javascript:void(0);" class="userFollow mr27 fl">添加关注</a> <a href="javascript:void(0);" class="userCancel mr27 fl" style="display:none;">取消关注</a>-->
<%= link_to "留言", feedback_url_in_org(user.id), :class => 'greyBtn fr', :target => "_blank" %>
<%= link_to "私信", feedback_url_in_org(user.id), :class => 'greyBtn fr', :style => 'margin-right:20px;', :target => "_blank" %>
<!--<a href="javascript:void(0);" class="greyBtn fl">私信</a><a href="javascript:void(0);" class="greyBtn fr">留言</a> -->
<% end %>
</div>
<em></em>
<font></font>
</div>

View File

@ -25,6 +25,15 @@
<div class="c_grey">
<p><%= version.description %></p>
</div>
<div class="c_grey clear mt5">
<% if version.user_id.nil? %>
<p class="fl">创建时间:<%= format_time(version.updated_on) %> </p>
<span class="fl ml10">更新时间:<%= format_time(version.created_on) %></span>
<% else %>
<p class="fl">由 <%= link_to version.user.show_name, user_path(version.user), :class => "linkBlue2" %>于 <%= format_time(version.updated_on) %> 创建</p>
<span class="fl ml10">最近更新:<%= format_time(version.created_on) %></span>
<% end %>
</div>
</div>
<% end %>

View File

@ -13,12 +13,9 @@
{ :onchange =>"remote_function('#version-#{@version.id}-status-form');", :id =>"status", :name => "status",:class=>"fr new_roadmap_select"}) %>
<% end %>
<%#= link_to "", {:controller => "versions", :action => "destroy", :project_id => @version.project_id}, :data => {:confirm => l(:text_are_you_sure_version)}, :class => "roadmap_icons_del fr mt5 mr5" if User.current.allowed_to?(:manage_versions, version.project) %>
<%= link_to "", version_path(version, :is_show => true), :method => "delete", :data => {:confirm => l(:text_are_you_sure_version)},:onclick => "confirm_can_delte", :class => "roadmap_icons_del fr mt5 mr5" if User.current.allowed_to?(:manage_versions, version.project) %>
<% if params[:action] == "index" %>
<%= link_to( "", edit_version_path(@version, :is_index => true), :class => 'roadmap_icons_edit fr mt5', :remote => true) if User.current.allowed_to?(:manage_versions, @version.project) %>
<% else %>
<%= link_to( "", edit_version_path(@version, :is_create => true), :class => 'roadmap_icons_edit fr mt5', :remote => true) if User.current.allowed_to?(:manage_versions, @version.project) %>
<% end %>
<%= link_to "", version_path(version, :is_show => true), :method => "delete", :data => {:confirm => l(:text_are_you_sure_version)}, :onclick => "confirm_can_delte", :class => "roadmap_icons_del_show fr mt5 mr5" if User.current.allowed_to?(:manage_versions, version.project) %>
<%= link_to( "", edit_version_path(@version, :is_create => true), :class => 'roadmap_icons_edit_show fr mt5', :remote => true) if User.current.allowed_to?(:manage_versions, @version.project) %>
<%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>

View File

@ -27,6 +27,15 @@
<div class="c_grey02">
<p><%= @version.description %></p>
</div>
<div class="c_grey clear mt5">
<% if @version.user_id.nil? %>
<p class="fl">创建时间:<%= format_time(@version.updated_on) %> </p>
<span class="fl ml10">更新时间:<%= format_time(@version.created_on) %></span>
<% else %>
<p class="fl">由 <%= link_to @version.user.show_name, user_path(@version.user), :class => "linkBlue2" %>于 <%= format_time(@version.updated_on) %> 创建</p>
<span class="fl ml10">最近更新:<%= format_time(@version.created_on) %></span>
<% end %>
</div>
</div>
</div>
<div class="new_roadmap_conbox mb10" >

View File

@ -2020,6 +2020,7 @@ zh:
label_MCQ: 多选题
label_single: 单行主观
label_mulit: 多行主观
label_subjective: 主观题
label_enter_single_title: 请输入单选题标题
label_new_answer: 新建选项
label_poll_title: 问卷标题

View File

@ -269,7 +269,7 @@ RedmineApp::Application.routes.draw do
get 'close_poll'
get 'export_poll'
get 'import_poll'
post 'update_question_num'
end
collection do
delete 'delete_poll_question'

View File

@ -0,0 +1,6 @@
class AddColumnToPollQuestions < ActiveRecord::Migration
def change
add_column :poll_questions, :max_choices, :integer, :default => 0
add_column :poll_questions, :min_choices, :integer, :default => 0
end
end

View File

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

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20161019020422) do
ActiveRecord::Schema.define(:version => 20161028053000) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -2248,6 +2248,7 @@ ActiveRecord::Schema.define(:version => 20161019020422) do
t.string "wiki_page_title"
t.string "status", :default => "open"
t.string "sharing", :default => "none", :null => false
t.integer "user_id"
end
add_index "versions", ["project_id"], :name => "versions_project_id"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 205 KiB

View File

@ -1277,7 +1277,6 @@ function disable_down(source, des, hint){
des.attr("checked", false);
des.attr("disabled", true);
hint.html("(私有组织不允许游客下载资源)");
}
}
@ -1296,13 +1295,18 @@ function getRootPath(){
}
//自动保存草稿
var editor2;
function elocalStorage(editor,mdu){
function elocalStorage(editor,mdu,id){
if (window.sessionStorage){
editor2 = editor;
var oc = window.sessionStorage.getItem('content'+mdu);
if(oc !== null ){
var h = '您上次有已保存的数据,是否<a style="cursor: pointer;" onclick="rec_data(\'content\',\''+ mdu + '\')">恢复</a> ? / <a style="cursor: pointer;" onclick="clear_data(\'content\',\''+ mdu + '\')">不恢复</a>';
$('#e_tips').html(h);
if(arguments[2]){
var h = '您上次有已保存的数据,是否<a style="cursor: pointer;" onclick="rec_data(\'content\',\''+ mdu + '\',' + id + ')">恢复</a> ? / <a style="cursor: pointer;" onclick="clear_data(\'content\',\''+ mdu + '\',' + id + ')">不恢复</a>';
$("#e_tips_"+id).html(h);
}else{
var h = '您上次有已保存的数据,是否<a style="cursor: pointer;" onclick="rec_data(\'content\',\''+ mdu + '\')">恢复</a> ? / <a style="cursor: pointer;" onclick="clear_data(\'content\',\''+ mdu + '\')">不恢复</a>';
$("#e_tips").html(h);
}
}
setInterval(function() {
d = new Date();
@ -1315,8 +1319,10 @@ function elocalStorage(editor,mdu){
editor.sync();
if(!editor.isEmpty()){
add_data("content",mdu,editor.html());
$('#e_tip').html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 ");
//$('#e_tips').html("");
var id1 = arguments[2] ? "#e_tip_"+id : "#e_tip";
var id2 = arguments[2] ? "#e_tips_"+id : "#e_tips";
$(id1).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 ");
$(id2).html("");
}
},10000);
@ -1327,18 +1333,20 @@ function elocalStorage(editor,mdu){
function add_data(k,mdu,d){
window.sessionStorage.setItem(k+mdu,d);
}
function rec_data(k,mdu){
function rec_data(k,mdu,id){
if(window.sessionStorage.getItem(k+mdu) !== null){
editor2.html(window.sessionStorage.getItem(k+mdu));
clear_data(k,mdu);
clear_data(k,mdu,id);
}
}
function clear_data(k,mdu){
function clear_data(k,mdu,id){
window.sessionStorage.removeItem(k+mdu);
var id1 = arguments[2] ? "#e_tip_"+id : "#e_tip";
var id2 = arguments[2] ? "#e_tips_"+id : "#e_tips";
if(k == 'content'){
$("#e_tips").html("");
$(id2).html("");
}else{
$("#e_tip").html("");
$(id1).html("");
}
}

View File

@ -1,3 +1,4 @@
var main_editor;
function init_editor(params){
// var minHeight; //最小高度
var paramsHeight = params.height; //设定的高度
@ -34,6 +35,7 @@ function init_editor(params){
}
}).loadPlugin('paste');
main_editor = editor;
return editor;
}

View File

@ -132,6 +132,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.ml60{ margin-left:60px;}
.ml65{ margin-left:65px;}
.ml70{margin-left: 70px;}
.ml78{ margin-left:78px;}
.ml80{ margin-left:80px;}
.ml85{margin-left:85px;}
.ml90{ margin-left:90px;}
@ -164,7 +165,8 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mr60 {margin-right:60px;}
.mr65 {margin-right:65px;}
.mr70{margin-right: 70px;}
.mr100 {margin-right:100px;}
.mr95 {margin-right:95px !important;}
.mr100 {margin-right:100px !important;}
.mr118 {margin-right:118px !important;}
.mr130 {margin-right:130px;}
.mr150 {margin-right:150px;}
@ -236,6 +238,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w128{ width:128px;}
.w130{ width:130px;}
.w140{ width:140px;}
.w145{ width:145px;}
.w150{ width:150px;}
.w170{width:170px;}
.w180{width:180px;}
@ -249,7 +252,8 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w265{ width: 265px;}
.w270{ width: 270px;}
.w280{ width:280px;}
.w300{ width:300px;}
.w289{ width:289px !important;}
.w300{ width:300px !important;}
.w305{ width:305px;}
.w350 {width:350px;}
.w362 {width:362px;}
@ -286,6 +290,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w720{width:721px;}
.w730{width:730px;}
.w770{ width:770px;}
.h28{height: 28px;}
.h20{height: 20px;}
.h22{ height:22px;}
.h26{ height:26px;}

View File

@ -90,7 +90,7 @@ a:hover.tijiao{ background:#0f99a9;}
.hwork_new{ color:#4c4c4c;}
.hwork_input{ border:1px solid #64bdd9; height:22px; width:88%; background:#fff; margin-bottom:10px; padding:5px;}
.hwork_input02{ border:1px solid #64bdd9; height:15px; width:140px; background:#fff; margin-bottom:10px; padding:5px;}
.hwork_input02{ border:1px solid #ddd; height:15px; width:140px; background:#fff; margin-bottom:10px; padding:5px;}
.hwork_text{ border:1px solid #64bdd9; height:100px;width:555px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;}
.hwork_new ul li{ }
.hwork_ttl{height:24px;}
@ -270,7 +270,7 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re
/* 创建课程courses*/
.courses_input{ border:1px solid #64bdd9; height:16px; width:532px; background:#fff; margin-bottom:10px; padding:5px;}
.courses_input{ border:1px solid #ddd; height:16px; width:532px; background:#fff; margin-bottom:10px; padding:5px;}
.courses_input_w{ width:300px;}
.courses_text{ border:1px solid #64bdd9; height:100px;width:532px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;}
.upimg{ border:1px solid #eaeaea; display:block; width:60px; height:60px; padding:1px;}
@ -559,3 +559,25 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.new-question {width:324px; height:30px; color:#888; background-color:#fff; padding-left:5px; margin-left:46px; cursor:pointer;}
.new-subjective {width:550px; height:30px; color:#888; background-color:#fff; padding-left:5px; margin-left:96px; cursor:pointer;}
.questionnaire-input {height:30px; border:1px solid #cbcbcb; padding-left:5px;}
/*20161026问卷调查增加toolbar*/
.poll-container {width:718px; border:1px solid #ddd; margin-bottom:10px; background-color:#fff; position:relative; color:#767676; border:1px solid #ddd;}
.poll-tool-bar {width:50px; position:absolute; top:0; left:0; text-align:center;}
.poll-content {min-height:150px; margin-left:50px; padding:10px; border-left:1px solid #ddd;}
.poll-up{ background:url(/images/course/icons.png) 0px -479px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-up:hover{background:url(/images/course/icons.png) -23px -479px no-repeat;}
.poll-down{ background:url(/images/course/icons.png) 0px -502px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-down:hover{background:url(/images/course/icons.png) -23px -502px no-repeat;}
.poll-add{ background:url(/images/course/icons.png) 2px -317px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-add:hover{background:url(/images/course/icons.png) -18px -317px no-repeat;}
.poll-delete{ background:url(/images/course/icons.png) 3px -343px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-delete:hover{ background:url(/images/course/icons.png) -17px -343px no-repeat;}
.poll-edit{ background:url(/images/course/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right;}
.poll-edit:hover{ background:url(/images/course/icons.png) -21px -272px no-repeat;}
.poll-add-menu {border:1px solid #eaeaea; background:#fff; padding:5px 8px; width:50px; left:0px; top:20px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none;}
.poll-multiple-limit {width:70px; outline: none;}
/*黄色边框的提示信息 */
.ye_tips_box_inner{ position: absolute;line-height: 1.5;padding: 5px 10px; white-space: nowrap; background-color: #FFFEF4; left:30px; top: -5px; border: solid 1px #F3DDB3;}
.ye_tips_box_inner span { display: block; border-width: 10px;position: absolute;top: 15px; left: -18px; border-style: dashed solid dashed dashed;border-color: transparent #FFFEF4 transparent transparent;font-size: 0;line-height: 0;}
.ye_tips_box_inner em { display: block; border-width: 10px;position: absolute;top: 42px; left: -20px; border-style: dashed solid dashed dashed;border-color: transparent #F3DDB3 transparent transparent;font-size: 0;line-height: 0;}

View File

@ -853,11 +853,12 @@ input.pro_newissue_con_check{ width: 15px; height: 15px;}
/* 新版项目头部*/
.pro_new_top {padding-top:15px; border:1px solid #ddd; background-color:#fff; width: 998px;}
.icons_newpro_lock{width: 22px; height: 23px; display: inline-block; background: url("../images/project/icons_issue.png") 0 -113px no-repeat;}
.icons_newpro_lock{width: 22px; height: 23px; display: inline-block; background: url("/images/new_project/icons_issue.png") 0 -113px no-repeat;}
.pro_new_name{width: 600px; }
.pro_new_name a { font-size: 24px; color: #3b94d6; line-height: 24px;}
.pro_new_name a:hover{ color: #2783c7;}
a.pro_new_proname{ width: 150px; overflow: hidden;white-space: nowrap;text-overflow:ellipsis;}
a.pro_new_proname{ overflow: hidden;white-space: nowrap;text-overflow:ellipsis;display: inline-block;}
a.pro_new_project_name{ width: 250px; overflow: hidden;white-space: nowrap;text-overflow:ellipsis;display: inline-block;}
a.pro_new_topbtn{ padding: 3px 7px; font-size: 12px; line-height: 20px; color: #333;vertical-align: middle;background-color: #fff; border: 1px solid #ddd; border-left: 0; border-top-right-radius: 3px; border-bottom-right-radius: 3px; color: #333;}
a.pro_new_topbtn_left { padding: 3px 10px; font-size: 12px;line-height: 20px; background-image: linear-gradient(#fcfcfc, #eee); border: 1px solid #d5d5d5;border-radius: 3px;border-top-right-radius: 0;border-bottom-right-radius: 0; color: #333; }
a:hover.pro_new_topbtn_left{background-image: linear-gradient(#ededed, #dddddd);}
@ -952,6 +953,8 @@ p.pro_new_grey{ line-height: 1.9; }
.roadmap_greyicon{ background: url(/images/new_project/icons_issue.png) 0 -198px no-repeat; display: inline-block; width: 32px; height: 16px;}
.roadmap_icons_edit{ display: inline-block; padding:9px;}
.roadmap_icons_del{ display: inline-block;padding:9px;}
.roadmap_icons_edit_show{ display: inline-block; padding:9px;background:url(/images/new_project/icons_issue.png) -29px -227px no-repeat; }
.roadmap_icons_del_show{ display: inline-block;padding:9px;background:url(/images/new_project/icons_issue.png) -29px -249px no-repeat;}
.roadmap_icons_edit:hover{ background:url(/images/new_project/icons_issue.png) -29px -227px no-repeat; }
.roadmap_icons_del:hover{ background:url(/images/new_project/icons_issue.png) -29px -249px no-repeat;}
select.new_roadmap_select{border:1px solid #dbdbdb; color: #666;}
@ -988,7 +991,7 @@ a.sortdownbtn{background: url(/images/sy/liststyle.png) 0 -12px no-repeat; width
a.pullreques_reply_name{ font-weight: bold; color: #333;}
.pullreques_reply_txt{ width: 900px;color: #666;}
.pullreques_pull_top { width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;}
a.pullreques_pull_name{display: block; margin-left: 10px;max-width:80px; color:#3b94d6; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
a.pullreques_pull_name{display: block; margin-left: 10px;max-width:80px; color:#3b94d6 !important; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
.pullreques_pull_list li{ height: 30px; line-height: 30px; }
.pullreques_pull_txt{display: block; margin-left: 10px;max-width:740px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
.pullreques_change_list li{height: 40px; line-height: 40px;border-bottom:1px solid #e1e1e1; }

View File

@ -881,7 +881,7 @@ a.pro_mes_w{ height:20px; float:left;display:block; color:#999999;}
a.pro_mes_w_news{ height:20px; float:right;display:block; color:#999999;}
.pro_page_top{ font-size:14px; border-bottom:2px solid #64bdd9; margin-bottom:10px; padding-bottom:5px;}
.pro_page_tit{color:#3e4040; font-weight:bold;width:480px; float:left; font-size:14px; margin-bottom:5px;}
.pro_page_tit{color:#3e4040; font-weight:bold;width:510px; float:left; font-size:14px; margin-bottom:5px;}
.pro_pic_box{ margin-left:60px; }
.pro_pic{ width:100px; border:2px solid #CCC; margin:10px 0;}
.pro_info_box{ margin-left:60px; border:1px dashed #CCC; height:45px; padding:10px 0;}
@ -1398,7 +1398,7 @@ a:hover.comment_ding_link{ color:#269ac9;}
.orig_textarea{width:90%; margin-bottom:10px;}
.orig_sub{ float:right; background-color:#269ac9; color:#fff; height:25px; line-height:25px; text-align:center; width:80px; border:none;}
.orig_sub:hover{ background:#297fb8;}
.orig_cont_hide{ text-align:center; width:624px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:8px 0;}
.orig_cont_hide{ text-align:center; width:624px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:5px 0;}
.orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;}
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}

View File

@ -192,7 +192,7 @@ a.pro_mes_w{ height:20px; float:left;display:block; color:#999999;}
a.pro_mes_w_news{ height:20px; float:right;display:block; color:#999999;}
.pro_page_top{ font-size:14px; border-bottom:2px solid #64bdd9; margin-bottom:10px; padding-bottom:5px;}
.pro_page_tit{color:#3e4040; font-weight:bold;width:480px; float:left; font-size:14px; margin-bottom:5px;}
.pro_page_tit{color:#3e4040; font-weight:bold;width:510px; float:left; font-size:14px; margin-bottom:5px;}
.pro_pic_box{ margin-left:60px; }
.pro_pic{ width:100px; border:2px solid #CCC; margin:10px 0;}
.pro_info_box{ margin-left:60px; border:1px dashed #CCC; height:45px; padding:10px 0;}

View File

@ -73,7 +73,7 @@ a.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bott
/*新建页面*/
.name_input{ border:1px solid #64bdd9; height:16px; width:310px; background:#fff; margin-bottom:10px; padding:5px;}
.name_input{ border:1px solid #ddd; height:16px; width:400px; background:#fff; margin-bottom:10px; padding:5px;}
.homepageSyllabusName {font-size:16px; color:#484848; float:left; max-width:120px;}
.syllabusTitleTextarea {resize:none; width:120px; margin-left: 10px; height:80px; max-width:120px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 0px;}
@ -640,4 +640,5 @@ a:hover.sy_class_ltitle{ color:#333;}
.sy_tips_box:hover .sy_tips_box_inner{ display: block;}
.sy_tips_box_inner{ position: absolute;line-height: 2.0;padding: 5px 10px; white-space: nowrap; background-color: #fff; left:30px; top: -5px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
.sy_tips_box_inner span { display: block; border-width: 10px;position: absolute;top: 15px; left: -18px; border-style: dashed solid dashed dashed;border-color: transparent #fff transparent transparent;font-size: 0;line-height: 0;}
.sy_tips_box_inner em { display: block; border-width: 11px;position: absolute;top: 42px; left: -23px; border-style: dashed solid dashed dashed;border-color: transparent #eaeaea transparent transparent;font-size: 0;line-height: 0;}