This commit is contained in:
alan 2015-01-18 00:25:19 +08:00
commit 092265d53c
69 changed files with 1990 additions and 109 deletions

View File

@ -2,6 +2,7 @@
<launchConfiguration type="com.aptana.js.debug.core.webbrowserLaunchConfigurationType">
<booleanAttribute key="advancedRunEnabled" value="false"/>
<booleanAttribute key="appendProjectName" value="true"/>
<stringAttribute key="browserCmdLine" value=""/>
<stringAttribute key="browserExecutable" value=""/>
<stringAttribute key="browserNature" value="Firefox"/>
<stringAttribute key="externalBaseUrl" value=""/>

View File

@ -2,6 +2,7 @@
<launchConfiguration type="com.aptana.js.debug.core.webbrowserLaunchConfigurationType">
<booleanAttribute key="advancedRunEnabled" value="false"/>
<booleanAttribute key="appendProjectName" value="true"/>
<stringAttribute key="browserCmdLine" value=""/>
<stringAttribute key="browserExecutable" value="C:\Program Files (x86)\Internet Explorer\iexplore.exe"/>
<stringAttribute key="browserNature" value="Internet Explorer"/>
<stringAttribute key="externalBaseUrl" value=""/>

View File

@ -275,7 +275,12 @@ class ApplicationController < ActionController::Base
end
end
end
def auth_login1(token = params[:token])
if(!User.current.logged? && !token.nil?)
User.current =try_to_autologin1
end
end
def authorize_allowed(ctrl = params[:controller], action = params[:action], global = false)
#modify by NWB
if @project

View File

@ -500,8 +500,7 @@ class CoursesController < ApplicationController
end
end
def
course
def course
@school_id = params[:school_id]
per_page_option = 10
if @school_id == "0" or @school_id.nil?

View File

@ -17,6 +17,9 @@
class MyController < ApplicationController
layout "users_base"
# edit
before_filter :auth_login1, :only => [:account]
#
before_filter :require_login
helper :issues

View File

@ -1,2 +0,0 @@
class PollAnswerController < ApplicationController
end

View File

@ -1,2 +1,391 @@
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]
before_filter :find_container, :only => [:new,:create, :index]
before_filter :is_member_of_course, :only => [:index,:show]
before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll]
include PollHelper
def index
if @course
@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.html{render :layout => 'base_courses'}
end
elsif @project
#项目的问卷调查相关代码
end
end
def show
@poll = Poll.find params[:id]
#已提交问卷的用户不能再访问该界面
if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?)
render_403
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 #分页
respond_to do |format|
format.html {render :layout => 'base_courses'}
end
end
end
def new
if @course
option = {
:polls_name => l(:label_poll_new),
:polls_type => @course.class.to_s,
:polls_group_id => @course.id,
:polls_status => 1,
:user_id => User.current.id,
:published_at => Time.now,
:closed_at => Time.now,
:polls_description => ""
}
@poll = Poll.create option
if @poll
redirect_to edit_poll_url @poll.id
end
elsif @project
#项目的问卷调查相关代码
end
end
def create
end
def edit
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
end
def update
@poll.polls_name = params[:polls_name].empty? ? l(:label_poll_title) : params[:polls_name]
@poll.polls_description = params[:polls_description].empty? ? l(:label_poll_description) : params[:polls_description]
if @poll.save
respond_to do |format|
format.js
end
else
render_404
end
end
def destroy
if @poll && @poll.destroy
respond_to do |format|
format.js
end
end
end
def statistics_result
@poll = Poll.find(params[:id])
poll_questions = @poll.poll_questions
@poll_questions = paginateHelper poll_questions, 5
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
end
def get_poll_totalcount poll_question
@total_questions_count = poll_question.poll_votes.count
end
def get_poll_everycount poll_answer
@every_answer_count = poll_answer.poll_votes.count
end
#添加题目
def create_poll_question
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
}
@poll_questions = @poll.poll_questions.new option
if params[:question_answer]
for i in 1..params[:question_answer].count
answer = (params[:question_answer].values[i-1].nil? || params[:question_answer].values[i-1].empty?) ? l(:label_new_answer) : params[:question_answer].values[i-1]
question_option = {
:answer_position => i,
:answer_text => answer
}
@poll_questions.poll_answers.new question_option
end
end
if @poll_questions.save
respond_to do |format|
format.js
end
end
end
#修改题目
def update_poll_question
@poll_question = PollQuestion.find params[:poll_question]
#@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]
################处理选项
if params[:question_answer]
@poll_question.poll_answers.each do |answer|
answer.destroy unless params[:question_answer].keys.include? answer.id.to_s
end
for i in 1..params[:question_answer].count
question = @poll_question.poll_answers.find_by_id params[:question_answer].keys[i-1]
answer = (params[:question_answer].values[i-1].nil? || params[:question_answer].values[i-1].empty?) ? l(:label_new_answer) : params[:question_answer].values[i-1]
if question
question.answer_position = i
question.answer_text = answer
question.save
else
question_option = {
:answer_position => i,
:answer_text => answer
}
@poll_question.poll_answers.new question_option
end
end
end
@poll_question.save
respond_to do |format|
format.js
end
end
#删除题目
def delete_poll_question
@poll_question = PollQuestion.find params[:poll_question]
@poll = @poll_question.poll
poll_questions = @poll.poll_questions.where("question_number > #{@poll_question.question_number}")
poll_questions.each do |question|
question.question_number -= 1
question.save
end
if @poll_question && @poll_question.destroy
respond_to do |format|
format.js
end
end
end
#发布问卷
def publish_poll
@poll.polls_status = 2
@poll.published_at = Time.now
if @poll.save
redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id)
end
end
#提交答案
def commit_answer
pq = PollQuestion.find(params[:poll_question_id])
if has_commit_poll?(@poll.id,User.current.id) && (!User.current.admin?)
render :json => {:text => "failure"}
return
end
if pq.question_type == 1
#单选题
pv = PollVote.find_by_poll_question_id_and_user_id(params[:poll_question_id],User.current.id)
if pv.nil?
#尚未答该题,添加答案
pv = PollVote.new
pv.user_id = User.current.id
pv.poll_question_id = params[:poll_question_id]
end
#修改该题对应答案
pv.poll_answer_id = params[:poll_answer_id]
if pv.save
#保存成功返回成功信息及当前以答题百分比
@percent = get_percent(@poll,User.current)
render :json => {:text => "ok" ,:percent => format("%.2f" ,@percent)}
else
#返回失败信息
render :json => {:text => "failure"}
end
elsif pq.question_type == 2
#多选题
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]
if pv.save
@percent = get_percent(@poll,User.current)
render :json => {:text => "true",:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
else
#pv不为空则当前选项之前已被选择再次点击则是不再选择该项故删除该答案
if pv.delete
@percent = get_percent(@poll,User.current)
render :json => {:text => "false" ,:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
end
elsif pq.question_type == 3 || pq.question_type == 4
#单行文本,多行文本题
pv = PollVote.find_by_poll_question_id_and_user_id(params[:poll_question_id],User.current.id)
if pv.nil?
#pv为空之前尚未答题添加答案
if params[:vote_text].nil? || params[:vote_text].blank?
#用户提交空答案,视作不作答
@percent = get_percent(@poll,User.current)
render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)}
else
#添加答案
pv = PollVote.new
pv.user_id = User.current.id
pv.poll_question_id = params[:poll_question_id]
pv.vote_text = params[:vote_text]
if pv.save
@percent = get_percent(@poll,User.current)
render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
end
else
#pv不为空说明用户之前已作答
if params[:vote_text].nil? || params[:vote_text].blank?
#用户提交空答案,视为删除答案
if pv.delete
@percent = get_percent(@poll,User.current)
render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
else
#用户修改答案
pv.vote_text = params[:vote_text]
if pv.save
@percent = get_percent(@poll,User.current)
render :json => {:text => pv.vote_text,:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
end
end
else
render :json => {:text => "failure"}
end
end
#提交问卷
def commit_poll
@uncomplete_question = get_uncomplete_question(@poll,User.current)
if @uncomplete_question.count < 1
pu = get_poll_user(@poll.id,User.current.id)
pu.user_id = User.current.id
pu.poll_id = @poll.id
if pu.save
#redirect_to poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course')
@status = 0 #提交成功
else
@status = 2 #未知错误
end
else
@status = 1 #有未做得必答题
end
respond_to do |format|
format.js
end
end
private
def find_poll_and_course
@poll = Poll.find params[:id]
@course = Course.find @poll.polls_group_id
rescue Exception => e
render_404
end
def find_container
if params[:polls_type] && params[:polls_group_id]
case params[:polls_type]
when "Course"
@course = Course.find_by_id params[:polls_group_id]
when "Project"
@project = Project.find_by_id params[:polls_group_id]
end
else
render_404
end
end
def is_member_of_course
render_403 unless(@course && User.current.member_of_course?(@course))
end
def is_course_teacher
render_403 unless(@course && User.current.allowed_to?(:as_teacher,@course))
end
#获取未完成的题目
def get_uncomplete_question poll,user
necessary_questions = poll.poll_questions.where("#{PollQuestion.table_name}.is_necessary = 1")
uncomplete_question = []
necessary_questions.each do |question|
answers = get_user_answer(question,user)
if answers.nil? || answers.count < 1
uncomplete_question << question
end
end
uncomplete_question
end
#获取用户对某个问题的答案
def get_user_answer(question,user)
user_answer = question.poll_votes.where("#{PollVote.table_name}.user_id = #{user.id}")
user_answer
end
def get_complete_question(poll,user)
questions = poll.poll_questions
complete_question = []
questions.each do |question|
answers = get_user_answer(question,user)
if !(answers.nil? || answers.count < 1)
complete_question << question
end
end
complete_question
end
def get_percent poll,user
complete_count = get_complete_question(poll,user).count
if poll.poll_questions.count == 0
return 0
else
return (complete_count.to_f / poll.poll_questions.count.to_f)*100
end
end
#PollUser记录用户是否已提交问卷有对应的记录则已提交没有则新建一个
def get_poll_user poll_id,user_id
pu = PollUser.find_by_poll_id_and_user_id(poll_id,user_id)
if pu.nil?
pu = PollUser.new
end
pu
end
end

View File

@ -1,2 +0,0 @@
class PollQuestionController < ApplicationController
end

View File

@ -1,2 +0,0 @@
class PollUserController < ApplicationController
end

View File

@ -1,2 +0,0 @@
class PollVoteController < ApplicationController
end

View File

@ -31,14 +31,16 @@ class ProjectsController < ApplicationController
menu_item :feedback, :only => :feedback
menu_item l(:label_course_file), :only => :index
menu_item l(:label_course_news), :only => :index
# edit
before_filter :authorize1, :only => [:show]
#
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches]
# before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file,
# :statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share,
# :show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index]
#此条勿删 课程相关权限 ,:new_homework,:homework,:feedback,,:member
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
before_filter :authorize, :only => [:settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
before_filter :file, :statistics, :watcherlist
@ -116,8 +118,8 @@ class ProjectsController < ApplicationController
joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").joins("LEFT JOIN #{ProjectScore.table_name} ON #{Project.table_name}.id = #{ProjectScore.table_name}.project_id").
where("#{Project.table_name}.project_type = ? ", Project::ProjectType_project)
@project_count = @projects_all.count
@project_pages = Paginator.new @project_count, per_page_option, params['page']
@poll_questions_count = @projects_all.count
@poll_questions_pages = Paginator.new @project_count, per_page_option, params['page']
#gcm activity count

View File

@ -15,8 +15,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class UsersController < ApplicationController
layout :setting_layout
#Added by young
before_filter :auth_login1, :only => [:show, :user_activities]
menu_item :activity
menu_item :user_information, :only => :info
menu_item :user_course, :only => :user_courses
@ -29,6 +31,9 @@ class UsersController < ApplicationController
#Ended by young
# edit
#
before_filter :can_show_course, :only => [:user_courses,:user_homeworks]
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info,
:user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index,

View File

@ -0,0 +1,77 @@
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module PollHelper
#判断选项是否被选中
def answer_be_selected?(answer,user)
pv = answer.poll_votes.where("#{PollVote.table_name}.user_id = #{user.id} ")
if !pv.nil? && pv.count > 0
true
else
false
end
end
#获取文本题答案
def get_anwser_vote_text(question_id,user_id)
pv = PollVote.find_by_poll_question_id_and_user_id(question_id,user_id)
if pv.nil?
''
else
pv.vote_text
end
end
#判断用户是否已经提交了问卷
def has_commit_poll?(poll_id,user_id)
pu = PollUser.find_by_poll_id_and_user_id(poll_id,user_id)
if pu.nil?
false
else
true
end
end
#统计答题百分比,统计结果保留两位小数
def statistics_result_percentage(e, t)
e = e.to_f
t = t.to_f
t == 0 ? 0 : format("%.2f", e*100/t)
end
#多选的时候查询去重
def total_answer id
total = PollVote.find_by_sql("SELECT distinct(user_id) FROM `poll_votes` where poll_question_id = #{id}").count
end
#页面体型显示
def options_show pq
case pq
when 1
"单选题"
when 2
"多选题"
when 3
"单行主观题"
else
"多行主观题"
end
end
end

View File

@ -105,13 +105,18 @@ class Mailer < ActionMailer::Base
@author = issue.author
@issue = issue
user = User.find_by_mail(recipients)
token = Token.new(:user => User.find_by_mail(recipients), :action => 'autologin')
token = Token.new(:user =>user , :action => 'autologin')
token.save
@token = token
@token = token
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :token => @token.value)
# edit
@issue_author_url = url_for(user_activities_url(@author,:token => @token.value))
@project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value)
@user_url = url_for(my_account_url(user,:token => @token.value))
cc = issue.watcher_recipients - issue.recipients
subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}"
@ -144,10 +149,18 @@ class Mailer < ActionMailer::Base
references issue
@author = journal.user
user = User.find_by_mail(recipients)
token = Token.new(:user =>user , :action => 'autologin')
token.save
@token = token
# edit
@issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id, :token => @token.value)
@project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value)
@user_url = url_for(my_account_url(user,:token => @token.value))
token = Token.new(:user => User.find_by_mail(recipients), :action => 'autologin')
token.save
@token = token
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}", :token => @token.value)

View File

@ -3,7 +3,7 @@ class Poll < ActiveRecord::Base
include Redmine::SafeAttributes
belongs_to :user
has_many :poll_questions, :dependent => :destroy
has_many :poll_questions, :dependent => :destroy,:order => "#{PollQuestion.table_name}.question_number"
has_many :poll_users, :dependent => :destroy
has_many :users, :through => :poll_users #该文件被哪些用户提交答案过
end

View File

@ -3,6 +3,6 @@ class PollQuestion < ActiveRecord::Base
include Redmine::SafeAttributes
belongs_to :poll
has_many :poll_answers, :dependent => :destroy
has_many :poll_answers, :order => "#{PollAnswer.table_name}.answer_position",:dependent => :destroy
has_many :poll_votes, :dependent => :destroy
end

View File

@ -60,18 +60,18 @@ function f_submit()
</script>
<style type="text/css">
/*浮窗*/
body{ height:3000px; font-family:'微软雅黑';}
a{ text-decoration:none;}
/*浮窗*/
/*body{ height:3000px; font-family:'微软雅黑';}*/
/*div,ul,li,body,h3,p{margin:0; padding:0;}*/
#roll a{ text-decoration:none;}
#roll{ background:url(/images/f_opnion.jpg) 0 0 no-repeat;width:157px; height:332px; position:absolute;}
.opnionBox{ width: 130px; height:146px; margin:76px auto 20px; }
.opnionBox{ width: 130px; height:146px; margin:76px auto 20px; }
.opnionText{ width: 120px !important; height:130px; outline:none; border:none !important;padding: 0 5px !important; color: #03a8bb;line-height:1.5; font-size:12px; }
a.opnionButton{ width:40px; height:20px; display:block; margin:0 auto;font-size:14px; color:#fd6e2a; font-weight: bold; }
a:hover.opnionButton{ text-decoration:underline;}
.opnionCall{ color:#03a8bb; font-size:12px; width:105px; margin:0 auto;}
.opnionCall .tectitle{ font-size:14px; alignment-adjust: central; color:#03a8bb; margin-bottom:8px,}
/*提示框*/
/*提示框*/
.ui-mask{background-color:#000;opacity:0.5;filter:alpha(opacity=50);width:100%;height:100%;position:fixed;_position:absolute;left:0;top:0;z-index:9999998;display:none;}
.change_success{
display:block;
@ -100,7 +100,7 @@ a:hover.opnionButton{ text-decoration:underline;}
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<div class="actions" style="max-width:680px">
<div class="actions" style="max-width:680px;">
<p style="margin:0; padding:0;">
<%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%>
</p>
@ -119,7 +119,7 @@ a:hover.opnionButton{ text-decoration:underline;}
<div class="opnionCall">
<div class="tectitle">技术支持:</div>
<p ><%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/12/user_newfeedback">黄井泉</a><br>
<p style="margin:0; padding:0;" ><%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/12/user_newfeedback">黄井泉</a><br>
<%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/34/user_newfeedback">白羽</a></p>
</div>

View File

@ -275,6 +275,15 @@
</div>
<div class="user_underline"></div>
<div class="polls_btn">
<!--<a href="#">问卷调查<span >12</span></a>-->
<style type="text/css">
.polls_btn{ height:33px;border-top:1px solid #15bed1; border-bottom:1px solid #15bed1;border-right:1px solid #cee6e6; width:224px !important; padding:7px 0 0 15px; }
.polls_btn a{font-size:14px; color:#444444;font-weight:bold;}
</style>
<%= link_to l(:label_poll), poll_index_path(:polls_type => "Course", :polls_group_id => @course.id)%>
</div>
</div>
</div>
<div id="content">

View File

@ -1,33 +1,46 @@
<html>
<head>
<title>Trustie项目邮件</title>
<style>
body {
font-family: Verdana, sans-serif;
font-size: 0.8em;
color:#484848;
}
h1, h3, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin: 0px; }
h1 { font-size: 1.2em; }
h3, h3 { font-size: 1.1em; }
a, a:link, a:visited { color: #2A5685;}
a:hover, a:active { color: #c61a1a; }
a.wiki-anchor { display: none; }
hr {
width: 100%;
height: 1px;
background: #ccc;
border: 0;
}
.footer {
/*font-size: 0.8em;*/
/*font-style: italic;*/
}
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,ol{ margin:0; padding:0;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; }
a:hover{ text-decoration:underline; }
.mail_box,ul,li{ list-style-type:none}
.mail{ width:600px; margin:20px; height:auto; color:#4b4b4b; font-size:14px; }
.mail a{color:#1b55a7; font-weight: bold; }
.mail_content{ margin-top:30px;}
.c_blue{ color:#1b55a7;}
.mail_box{ border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;}
.mail_box_p{ float:left; display: block; width:527px;}
a.mail_reply{ display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px;}
a:hover.mail_reply{ background:#06a9bc; text-decoration:none;}
.mail_fujian{ float:left; width:527px; display: block; }
.mail_fujian a{ font-weight:normal; font-size:12px;}
.mail_foot a{ font-size:12px; font-weight:normal;}
</style>
</head>
<body>
<span class="header"><%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_header).html_safe %></span>
<%= yield %>
<hr />
<span class="footer"><%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %></span>
<div class="container">
<div class="mail">
<div class="mail_head">
<p>亲爱的Trustie用户您好</p>
</div><!--mail_head end-->
<%= yield %>
<hr />
<div class="mail_foot"><%= link_to("退订该邮件?", @user_url) %> </div><!--mail_foot end-->
</div>
</div>
</body>
</html>

View File

@ -1,15 +1,42 @@
<h1><%= link_to(h("#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}"), issue_url) %></h1>
<!-- <h1><%#= link_to(h("#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}"), issue_url) %></h1> -->
<p>
<span class="c_blue">
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
</span>在
<span class="c_blue"><%= link_to(h("#{@issue.project.name}"),@project_url) %></span>中有了一个与您相关的最新活动,请您关注!</p>
<div class="mail_box">
<ul>
<li><%=l(:field_author)%>: <%=h issue.author %></li>
<li><%=l(:field_status)%>: <%=h issue.status %></li>
<li><%=l(:field_priority)%>: <%=h issue.priority %></li>
<li><%=l(:field_assigned_to)%>: <%=h issue.assigned_to %></li>
<li><%=l(:field_category)%>: <%=h issue.category %></li>
<li><%=l(:field_fixed_version)%>: <%=h issue.fixed_version %></li>
<% issue.custom_field_values.each do |c| %>
<li><%=h c.custom_field.name %>: <%=h show_value(c) %></li>
<% end %>
</ul>
<li style="list-style-type:none"><span style="float: left"><strong>标题:</strong></span><span style="float: left; width: 500px"><%= link_to(issue.subject, issue_url) %></span></li>
<li style="list-style-type:none"><span style="float: left"> <strong>来源:</strong></span><span style="float: left; width: 500px"><%= issue.project.name %><b>|&nbsp;</b>项目<%= issue.tracker.name%></span></li>
<li style="list-style-type:none"><span style="float: left"> <strong >内容:</strong></span><span style="float: left; width: 500px">
<%= issue.description %></span>
</li>
<li style="list-style-type:none">
<%= textilizable(issue, :description, :only_path => false) %>
<% unless @issue.attachments.nil? %>
<span style="float: left"> <strong>附件:</strong>
</span><span style="float: left; width: 500px">
<% @issue.attachments.each do |attach| %>
<p><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %></p>
<% end %></span>
<% end %>
</li>
</ul>
<div class="cl"></div>
<label class="mail_reply"><%= link_to( "我要回复", issue_url, :class => "mail_reply") %></label>
<div class="cl"></div>
</div>
<!-- <li><%#=l(:field_author)%>: <%#=h issue.author %></li>
<li><%#=l(:field_status)%>: <%#=h issue.status %></li>
<li><%#=l(:field_priority)%>: <%#=h issue.priority %></li>
<li><%#=l(:field_assigned_to)%>: <%#=h issue.assigned_to %></li>
<li><%#=l(:field_category)%>: <%#=h issue.category %></li>
<li><%#=l(:field_fixed_version)%>: <%#=h issue.fixed_version %></li>
-->
<%# issue.custom_field_values.each do |c| %>
<!-- <li><%#=h c.custom_field.name %>: <%#=h show_value(c) %></li>
<%#end %>
-->

View File

@ -1,13 +1,19 @@
<%= "#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}" %>
<%= issue_url %>
* <%=l(:field_author)%>: <%= issue.author %>
* <%=l(:field_status)%>: <%= issue.status %>
* <%=l(:field_priority)%>: <%= issue.priority %>
* <%=l(:field_assigned_to)%>: <%= issue.assigned_to %>
* <%=l(:field_category)%>: <%= issue.category %>
* <%=l(:field_fixed_version)%>: <%= issue.fixed_version %>
<% issue.custom_field_values.each do |c| %>* <%= c.custom_field.name %>: <%= show_value(c) %>
<% end -%>
----------------------------------------
<%= issue.description %>
<%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %>
<%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注!
标题:<%= link_to(issue.subject, issue_url) %>
来源:<%= issue.project.name %>|&nbsp;项目缺陷<
内容:
<%= issue.description %>
<% unless @issue.attachments.nil? %>
附件:
<% @issue.attachments.each do |attach| %>
<%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %>
<% end %>
<% end %>
<%= link_to( "我要回复", issue_url) %>

View File

@ -1,15 +1,8 @@
<div class="mail_content">
<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => h(@issue.author)) %>
<ul>
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
<% unless @issue.attachments.nil? %>
<% @issue.attachments.each do |attach| %>
<li> <%= l(:label_attachment) %><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %></li>
<% end %>
<% end %>
</ul>
<hr />
</div>
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>

View File

@ -1,11 +1,2 @@
<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => @issue.author) %>
<% @issue.attachments.each do |attach| %>
<%= l(:label_attachment) %>
<%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %> <%= l(:label_added) %>
<% end %>
----------------------------------------
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>

View File

@ -2,10 +2,12 @@
<ul>
<% details_to_strings(@journal.details, false, :only_path => false, :token => @token.value).each do |string| %>
<li><%= string %></li>
<% if (!string.include? l(:label_attachment)) && (!string.include? "attachments") %>
<li><%= string %></li>
<% end %>
<% end %>
</ul>
<%= textilizable(@journal, :notes, :only_path => false) %>
<span style="float: left"><strong><%= l(:field_content)%></strong></span><span style="float: left; width: 540px"><%= @journal.notes %></span>
<hr />
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>

View File

@ -1,11 +1,13 @@
<%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => @journal.user) %>
<% details_to_strings(@journal.details, true, :token => @token.value).each do |string| -%>
<%= string %>
<% if (!string.include? l(:label_attachment)) && (!string.include? "attachments") %>
<li><%= string %></li>
<% end %>
<% end -%>
<% if @journal.notes? -%>
<%= @journal.notes %>
<%= l(:field_content)%><%= @journal.notes %>
<% end -%>
----------------------------------------

View File

@ -0,0 +1,28 @@
<div class="ur_table_result">
<table border="0" cellspacing="0" cellpadding="0" >
<tbody>
<tr class="table_bluebg">
<td class="td327"><%= l(:label_poll_options) %> </td>
<td class="td42"><%= l(:label_poll_subtotal) %> </td>
<td class="td287"><%= l(:label_poll_proportion) %> </td>
</tr>
<% poll_question.poll_answers.each do |poll_answer| %>
<tr>
<td class="td327"><%= poll_answer.answer_text %> </td>
<td class="td42"><%= poll_answer.poll_votes.count %> </td>
<td class="td287">
<div class="Bar">
<span style="width:<%= statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)) %>%;" id="choice_percentage_<%= poll_answer.id %>"></span>
</div>
<%= statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)) %>%</td>
</tr>
<% end %>
<tr class="table_bluebg">
<td class="td327"><%= l(:label_poll_valid_commit) %> </td>
<td class="td42"><%= total_answer(poll_question.id) %></td>
<td class="td287">&nbsp; </td>
</tr>
</tbody>
</table>
</div>

View File

@ -0,0 +1,12 @@
<div id="popbox" style="text-align: center;margin-top: 25px">
<% if status == 0 %>
<h3 style="font-weight: normal;color: green">提交成功!</h3>
<%= link_to "确定", poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course'),:class => 'commit'%>
<% elsif status == 1 %>
<h3 style="font-weight: normal;color: red">您还有尚未作答的必答题目请完成后再提交!</h3>
<%= link_to "确定", "javascript:void(0)",:onclick => 'hidden_atert_form();',:class => 'commit'%>
<% else %>
<h3 style="font-weight: normal;color: red">发生未知错误,请检查您的网络。</h3>
<%= link_to "确定", "javascript:void(0)",:onclick => 'hidden_atert_form();',:class => 'commit'%>
<% end %>
</div>

View File

@ -0,0 +1,48 @@
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
<!--编辑单选start-->
<script type="text/javascript">
function resetQuestion<%=poll_question.id%>()
{
$("#poll_questions_title_<%=poll_question.id%>").val("<%= poll_question.question_title%>")
$("#is_necessary_<%=poll_question.id%>").replaceWith("<input type='checkbox' name='is_necessary' id='is_necessary_<%=poll_question.id%>' value='true' <%= poll_question.is_necessary == 1 ? 'checked' : ''%>/>");
$("#poll_answers_<%=poll_question.id%>").html("<% poll_question.poll_answers.reorder('answer_position').each do |poll_answer| %>" +
"<li class='ur_item'>" +
"<label>选项<span class='ur_index'></span></label>" +
"<input type='text' maxlength='200' name='question_answer[<%= poll_answer.id %>]' placeholder='新建选项' value='<%= poll_answer.answer_text%>'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
"</li>" +
"<div class='cl'></div>" +
"<% end%>");
}
</script>
<div class="ur_editor radio">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title_<%=poll_question.id%>" placeholder="请输入单选题标题" value="<%= poll_question.question_title%>"/>
<input type="checkbox" name="is_necessary" id="is_necessary_<%=poll_question.id%>" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
<label>必答</label>
</div>
<div class="ur_editor_content">
<ul id="poll_answers_<%=poll_question.id%>">
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<li class='ur_item'>
<label>选项<span class='ur_index'></span></label>
<input type='text' maxlength="200" name='question_answer[<%= poll_answer.id %>]' placeholder='新建选项' value="<%= poll_answer.answer_text%>"/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li>
<div class='cl'></div>
<% end%>
</ul>
</div>
<div class="ur_editor_footer">
<a class="btn btn_dark btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="resetQuestion<%=poll_question.id%>();pollQuestionCancel(<%= poll_question.id%>);">取消</a>
</div>
<div class="cl"></div>
</div>
<!--编辑单选 end-->
<% end%>

View File

@ -0,0 +1,44 @@
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%><!--编辑多选start-->
<script type="text/javascript">
function resetQuestion<%=poll_question.id%>()
{
$("#poll_questions_title_<%=poll_question.id%>").val("<%= poll_question.question_title%>")
$("#is_necessary_<%=poll_question.id%>").replaceWith("<input type='checkbox' name='is_necessary' id='is_necessary_<%=poll_question.id%>' value='true' <%= poll_question.is_necessary == 1 ? 'checked' : ''%>/>");
$("#poll_answers_<%=poll_question.id%>").html("<% poll_question.poll_answers.reorder('answer_position').each do |poll_answer| %>" +
"<li class='ur_item'>" +
"<label>选项<span class='ur_index'></span></label>" +
"<input type='text' maxlength='200' name='question_answer[<%= poll_answer.id %>]' placeholder='新建选项' value='<%= poll_answer.answer_text%>'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
"</li>" +
"<div class='cl'></div>" +
"<% end%>");
}
</script>
<div class="ur_editor checkbox">
<div class="ur_editor_title">
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title_<%=poll_question.id%>" placeholder="请输入单选题标题" value="<%= poll_question.question_title%>"/>
<input type="checkbox" name="is_necessary" id="is_necessary_<%=poll_question.id%>" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
<label>必答</label>
</div>
<div class="ur_editor_content">
<ul id="poll_answers_<%=poll_question.id%>">
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<li class='ur_item'>
<label>选项<span class='ur_index'></span></label>
<input maxlength="200" type='text' name='question_answer[<%= poll_answer.id %>]' placeholder='新建选项' value="<%= poll_answer.answer_text%>"/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li>
<div class='cl'></div>
<% end%>
</ul>
</div>
<div class="ur_editor_footer">
<a class="btn btn_dark btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="resetQuestion<%=poll_question.id%>();pollQuestionCancel(<%= poll_question.id%>);">取消</a>
</div>
<div class="cl"></div>
</div><!--编辑多选 end-->
<% end%>

View File

@ -0,0 +1,15 @@
<%= form_for @poll,:remote => true do |f|%>
<div class="ur_editor ur_title_editor"> <!--编辑头部start-->
<div class="ur_title_editor_title">
<input type="text" maxlength="100" name="polls_name" id="polls_title" value="<%= @poll.polls_name %>" class="input_title" placeholder="问卷标题"/>
</div>
<div class="ur_title_editor_prefix">
<textarea name="polls_description" maxlength="300" id="polls_description" class="textarea_editor"><%= @poll.polls_description%></textarea>
</div>
<div class="ur_editor_footer">
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn_cancel" data-button="cancel" onclick="pollsCancel();">取消</a>
</div>
<div class="cl"></div>
</div><!--编辑头部 end-->
<% end%>

View File

@ -0,0 +1,28 @@
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
<script type="text/javascript">
function resetQuestion<%=poll_question.id%>()
{
$("#poll_questions_title_<%=poll_question.id%>").val("<%= poll_question.question_title%>")
$("#is_necessary_<%=poll_question.id%>").replaceWith("<input type='checkbox' name='is_necessary' id='is_necessary_<%=poll_question.id%>' value='true' <%= poll_question.is_necessary == 1 ? 'checked' : ''%>/>");
}
</script>
<div class="ur_editor textarea"> <!--编辑多行文字start-->
<div class="ur_editor_title">
<label for="ur_question_title">问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title_<%=poll_question.id%>" placeholder="请输入多行主观标题" value="<%= poll_question.question_title%>"/>
<input type="checkbox" id="is_necessary_<%=poll_question.id%>" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
<label for="ur_question_require">必答</label>
</div>
<div class="ur_editor_toolbar">
<!--<label>尺寸:</label>-->
<!--<label>宽 <input name="cols" type="number" min="1" value="60"> 字</label>,-->
<!--<label>高 <input name="rows" type="number" min="1" value="5"> 行</label>-->
</div>
<div class="ur_editor_footer">
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn_cancel" data-button="cancel" onclick="resetQuestion<%=poll_question.id%>();pollQuestionCancel(<%= poll_question.id%>);">取消</a>
</div>
<div class="cl"></div>
</div><!--编辑多行文字end-->
<% end%>

View File

@ -0,0 +1,24 @@
<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
<script type="text/javascript">
function resetQuestion<%=poll_question.id%>()
{
$("#poll_questions_title_<%=poll_question.id%>").val("<%= poll_question.question_title%>")
$("#is_necessary_<%=poll_question.id%>").replaceWith("<input type='checkbox' name='is_necessary' id='is_necessary_<%=poll_question.id%>' value='true' <%= poll_question.is_necessary == 1 ? 'checked' : ''%>/>");
}
</script>
<div class="ur_editor text "> <!--编辑单行文字start-->
<div class="ur_editor_title">
<label for="ur_question_title">问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="<%= poll_question.question_type%>"/>
<input maxlength="250" id="poll_questions_title_<%=poll_question.id%>" class="ur_question_title" contenteditable="true" type="text"
name="poll_questions_title" placeholder="请输入单行主观标题" value="<%= poll_question.question_title%>"/>
<input type="checkbox" id="is_necessary_<%=poll_question.id%>" name="is_necessary" value="true" <%= poll_question.is_necessary == 1 ? "checked" : ""%>/>
<label for="ur_question_require">必答</label>
</div>
<div class="ur_editor_footer">
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn_cancel" data-button="cancel" onclick="resetQuestion<%=poll_question.id%>();pollQuestionCancel(<%= poll_question.id%>);">取消</a>
</div>
<div class="cl"></div>
</div><!--编辑单行文字end-->
<% end%>

View File

@ -0,0 +1,43 @@
<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
<!--新建单选start-->
<div class="ur_editor radio">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="1"/>
<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入单选题标题"/>
<input type="checkbox" name="is_necessary" value="true" checked/>
<label>必答</label>
</div>
<div class="ur_editor_content">
<ul>
<li class='ur_item'>
<label>选项<span class='ur_index'></span></label>
<input maxlength="200" type='text' name='question_answer[0]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li>
<div class='cl'></div>
<li class='ur_item'>
<label>选项<span class='ur_index'></span></label>
<input maxlength="200" type='text' name='question_answer[1]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li>
<div class='cl'></div>
<li class='ur_item'>
<label>选项<span class='ur_index'></span></label>
<input maxlength="200" type='text' name='question_answer[2]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li>
<div class='cl'></div>
</ul>
</div>
<div class="ur_editor_footer">
<a class="btn btn_dark btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">取消</a>
</div>
<div class="cl"></div>
</div>
<!--编辑单选 end-->
<% end%>

View File

@ -0,0 +1,41 @@
<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%><!--新建多选start-->
<div class="ur_editor checkbox">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="2"/>
<input maxlength="250" class="ur_question_title" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入多选题题标题"/>
<input type="checkbox" name="is_necessary" value="true" checked/>
<label>必答</label>
</div>
<div class="ur_editor_content">
<ul>
<li class='ur_item'>
<label>选项<span class='ur_index'></span></label>
<input maxlength="200" type='text' name='question_answer[0]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li>
<div class='cl'></div>
<li class='ur_item'>
<label>选项<span class='ur_index'></span></label>
<input maxlength="200" type='text' name='question_answer[1]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li>
<div class='cl'></div>
<li class='ur_item'>
<label>选项<span class='ur_index'></span></label>
<input maxlength="200" type='text' name='question_answer[2]' placeholder='新建选项'/>
<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>
<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>
</li>
<div class='cl'></div>
</ul>
</div>
<div class="ur_editor_footer">
<a class="btn btn_dark btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">取消</a>
</div>
<div class="cl"></div>
</div>
<% end%><!--编辑多选 end-->

View File

@ -0,0 +1,21 @@
<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
<div class="ur_editor textarea"> <!--编辑多行文字start-->
<div class="ur_editor_title">
<label for="ur_question_title">问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="4"/>
<input maxlength="250" id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入多行主观标题"/>
<input type="checkbox" name="is_necessary" value="true" checked/>
<label>必答</label>
</div>
<div class="ur_editor_toolbar">
<!--<label>尺寸:</label>-->
<!--<label>宽 <input name="cols" type="number" min="1" value="60"> 字</label>,-->
<!--<label>高 <input name="rows" type="number" min="1" value="5"> 行</label>-->
</div>
<div class="ur_editor_footer">
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">取消</a>
</div>
<div class="cl"></div>
</div><!--编辑多行文字end-->
<% end%>

View File

@ -0,0 +1,16 @@
<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
<div class="ur_editor text "> <!--编辑单行文字start-->
<div class="ur_editor_title">
<label for="ur_question_title">问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="3"/>
<input maxlength="250" id="poll_questions_title" class="ur_question_title" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行主观标题"/>
<input type="checkbox" name="is_necessary" value="true" checked/>
<label for="ur_question_require">必答</label>
</div>
<div class="ur_editor_footer">
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">确定</a>
<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">取消</a>
</div>
<div class="cl"></div>
</div><!--编辑单行文字end-->
<% end%>

View File

@ -0,0 +1,26 @@
<% 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>
<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>
</div>
<% end %>

View File

@ -0,0 +1,128 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>问卷调查_问卷编辑</title>
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<%#= javascript_include_tag "polls" %>
<script type="text/javascript">
function add_MC(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>");
$("#poll_questions_title").focus();
}
function add_MCQ(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ') %>");
$("#poll_questions_title").focus();
}
function add_single(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single') %>");
$("#poll_questions_title").focus();
}
function add_mulit(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
$("#poll_questions_title").focus();
}
//问卷头
function pollsCancel(){$("#polls_head_edit").hide();$("#polls_head_show").show();}
function pollsEdit(){$("#polls_head_edit").show();$("#polls_head_show").hide();}
//
function pollQuestionCancel(question_id){
$("#show_poll_questions_"+question_id).show();
$("#edit_poll_questions_"+question_id).hide();
}
function pollQuestionEdit(question_id){
$("#show_poll_questions_"+question_id).hide();
$("#edit_poll_questions_"+question_id).show();
$("#poll_questions_title_"+question_id).focus();
}
//单选题
function add_single_answer(doc)
{
doc.parent().after("<li class='ur_item'><label>选项<span class='ur_index'></span></label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='新建选项'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
"</li><div class='cl'></div>");
}
function remove_single_answer(doc)
{
if(doc.parent().siblings("li").length == 0)
{
alert("选择题至少有一个选项");
}
else
{
doc.parent().remove();
}
}
function poll_submit()
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { poll: @poll}) %>');
showModal('ajax-modal', '310px');
$('#ajax-modal').css('height','110px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='#' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("popbox_polls");
}
</script>
</head>
<body>
<div class=" polls_content polls_edit" id="polls">
<!-- 头部 -->
<div id="polls_head_show" style="display: none;">
<%= render :partial => 'show_head', :locals => {:poll => @poll}%>
</div>
<div id="polls_head_edit">
<%= render :partial => 'edit_head', :locals => {:poll => @poll}%>
</div>
<!-- 问题 -->
<div id="poll_content">
<%= render :partial => 'poll_content', :locals => {:poll => @poll}%>
</div>
<div class="tabs_1">
<ul class="tabs_list">
<li class="tab_item02 " >
<a title="<%= l(:label_MC) %>" class="tab_icon icon_radio" onclick="add_MC();">
<%= l(:label_MC) %>
</a>
</li>
<li class="tab_item02 " >
<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>
</li>
</ul>
<div class="cl"></div>
</div><!--选项 end-->
<!-- 新增问题 -->
<div id="new_poll_question">
</div>
<div class="ur_buttons">
<a class="ur_button_submit" onclick="poll_submit();">
<%= l(:label_memo_create)%>
</a>
</div>
<div class="cl"></div>
</div><!--编辑end-->
</body>
</html>

View File

@ -0,0 +1,12 @@
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<label>
<input class="ur_radio" type="radio" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
</td>
</tr>
<% end %>
</tbody>

View File

@ -0,0 +1,43 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function clickPublishPoll()
{
hideModal("#popbox02");
$.ajax({
type: "GET",
url: "<%= publish_poll_poll_path(poll.id)%>",
data: 'text',
success: function (data) {
}
});
}
function clickCanel(){hideModal("#popbox02");}
</script>
</head>
<body>
<div id="popbox02">
<div class="upload_con">
<div class="upload_box">
<p class="polls_box_p">问卷发布后将不能对问卷进行修改,
<br />
是否确定发布该问卷?
</p>
<div class="polls_btn_box">
<%= link_to "确 定",publish_poll_poll_path(poll.id), :class => "upload_btn", :onclick => "clickCanel();" %>
<a class="upload_btn upload_btn_grey" onclick="clickCanel();">
取&nbsp;&nbsp;消
</a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,18 @@
<div class="ur_table_result">
<table border="0" cellspacing="0" cellpadding="0" >
<tbody>
<tr class="table_bluebg">
<td class="td327" ><%= l(:label_answer) %> </td>
</tr>
<% poll_question.poll_votes.each do |poll_vote| %>
<tr>
<td class="td111"><%= poll_vote.vote_text.html_safe %> </td>
</tr>
<% end %>
<tr class="table_bluebg">
<td class="td327"><%= l(:label_poll_answer_valid_result) %> <%= l(:label_answer_total) %><%= poll_question.poll_votes.count %></td>
</tr>
</tbody>
</table>
</div>

View File

@ -0,0 +1,32 @@
<div class="ur_question_item radio ur_editor02">
<div class="ur_title">
<span class="title_index">
第<%= poll_question.question_number%>题:
</span>
<%= poll_question.question_title %>
<span class="title_index">[单选题]</span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required" 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>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" >
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<label>
<input class="ur_radio" type="radio" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div><!--单选题显示 end-->

View File

@ -0,0 +1,32 @@
<div class="ur_question_item checkbox ur_editor02">
<div class="ur_title">
<span class="title_index">
第<%= poll_question.question_number%>题:
</span>
<%= poll_question.question_title %>
<span class="title_index">[多选题]</span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required" 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>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<label>
<input class="ur_radio" type="checkbox" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div><!--多选题显示 end-->

View File

@ -0,0 +1,10 @@
<div class="ur_page_head ur_editor02"><!--头部显示 start-->
<a href="#" class="ur_icon_edit" title="编辑" onclick="pollsEdit();"></a>
<h1 class="ur_page_title" id="polls_name_h">
<%= poll.polls_name%>
</h1>
<p class="ur_prefix_content" id="polls_description_p">
<%= @poll.polls_description%>
</p>
<div class="cl"></div>
</div><!--头部显示 end-->

View File

@ -0,0 +1,21 @@
<div class="ur_question_item textarea ur_editor02">
<div class="ur_preview">
<div class="ur_title">
<span class="title_index">
第<%= poll_question.question_number%>题:
</span>
<%= poll_question.question_title %>
<span class="title_index">[多行主观]</span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required" 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>
<div class="cl"></div>
<div class="ur_inputs">
<textarea class="ur_textbox" rows="5" cols="60"></textarea>
</div>
</div>
</div><!--多行展示 end-->

View File

@ -0,0 +1,19 @@
<div class="ur_question_item text ur_editor02 ">
<div class="ur_title">
<span class="title_index">
第<%= poll_question.question_number%>题:
</span>
<%= poll_question.question_title %>
<span class="title_index">[单行主观]</span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required" 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>
<div class="cl"></div>
<div class="ur_inputs">
<input class="ur_text ur_textbox" type="text" size="" maxlength=""value="">
</div>
</div><!--单行文字展示 end-->

View File

View File

@ -0,0 +1,3 @@
<% if @pv_saved %>
$('#poll_vote_poll_answer_id_<%= @pv.poll_answer_id %>').checked = true;
<% end %>

View File

@ -0,0 +1,9 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status}) %>');
showModal('ajax-modal', '400px');
$('#ajax-modal').css('height','100px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='#' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");

View File

@ -0,0 +1,26 @@
$("#new_poll_question").html("");
$("#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>");

View File

@ -0,0 +1 @@
$("#poll_content").html("<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll}) %>");

View File

@ -0,0 +1,4 @@
<% if @poll%>
$("#polls_<%= @poll.id%>").remove();
<%else%>
<% end %>

View File

@ -0,0 +1,2 @@
<%= render :partial => 'poll_form'%>

View File

@ -0,0 +1,63 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<div class="polls_content" id="polls" style="width:677px;">
<div class="polls_head">
<h2>所有问卷
<span><%= @obj_count%></span>
</h2>
<% if @is_teacher%>
<%= link_to l(:label_new_poll), new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => "newbtn" %>
<% end%>
</div>
<div class="cl"></div>
<div class="polls_list">
<% @polls.each do |poll|%>
<ul id="polls_<%= poll.id %>">
<li title="<%= poll.polls_name %>">
<% if @is_teacher %>
<% if has_commit_poll?(poll.id ,User.current) %>
<sapn class="polls_title fl"> <%= poll.polls_name %></sapn>
<% else %>
<%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %>
<% end %>
<% else %>
<% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %>
<sapn class="polls_title fl" >
<%= poll.polls_name %>
</sapn>
<% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %>
<%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %>
<% end %>
<% end %>
</li>
<li>
<%if @is_teacher && poll.polls_status == 2%>
<%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
<% end%>
</li>
<li>
<% if @is_teacher %>
<!--新建状态的问卷可删除-->
<%= link_to(l(:button_delete), poll,
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
<% end%>
</li>
<li>
<% if @is_teacher && poll.polls_status == 1%>
<!--新建状态的问卷可编辑-->
<%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
<% end%>
</li>
<li class="polls_date fr">
<%= format_time poll.created_at%>
</li>
</ul>
<div class="cl"></div>
<% end%>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
</div><!--列表end-->
</div><!--问卷内容end-->

View File

@ -0,0 +1 @@
<%= render :partial => 'poll_form'%>

View File

@ -0,0 +1,256 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%= l(:label_poll_title) %></title>
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<style type="text/css">
.alert_box{width:480px;height:180px;position:fixed;z-index:100;left:55%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.commit{
height: 28px;
display: block;
width: 80px;
color: #fff !important;
background: #15bccf;
text-align: center;
padding-top: 4px;
margin-left: 130px;
margin-top: 4px;
margin-right: 10px;
}
</style>
<script type="text/javascript">
function hidden_atert_form(cur_page,cur_type)
{
hideModal($("#popbox"));
}
</script>
</head>
<body>
<div class="polls_content polls_box" id="polls">
<div class="ur_page_head" >
<h1 class="ur_page_title">
<%= @poll.polls_name%>
</h1>
<p class="ur_prefix_content">
<%= @poll.polls_description %>
</p>
</div>
<div class="ur_card">
<ol class="ur_questions">
<% @poll_questions.each do |pq| %>
<% if pq.question_type == 1 %>
<!-- 单选题 -->
<li class="ur_question_item radio">
<div class="ur_title">
<span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
<%= pq.question_title %>
<span class="title_index">[单选题]</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">
<form>
<table class="ur_table" >
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label >
<script>
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);
obj.checked = true;
var span = $('#percent');
span.html(dataObj.percent);
}
});
}
</script>
<%= radio_button "poll_vote","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 %>
<%= pa.answer_text %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</form>
</div>
</li>
<% elsif pq.question_type == 2 %>
<!-- 多选题 -->
<li class="ur_question_item checkbox">
<div class="ur_title">
<span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
<%= pq.question_title %>
<span class="title_index">[多选题]</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">
<form>
<table class="ur_table" >
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label >
<script>
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 == "true")
{
obj.checked = true;
}
else
{
obj.checked = false;
}
var span = $('#percent');
span.html(dataObj.percent);
}
});
}
</script>
<input class="ur_checkbox" type="checkbox" onclick="click_<%= pa.id %>(this);return false;" <%= answer_be_selected?(pa,User.current) ? "checked":"" %> <%= @can_edit_poll?"":"disabled=disabled" %> >
<%= pa.answer_text %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</form>
</div>
</li>
<% elsif pq.question_type == 3 %>
<!-- 单行文字-->
<li class="ur_question_item text">
<div class="ur_title">
<span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
<%= pq.question_title %>
<span class="title_index">[单行主观]</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">
<script>
function onblur_<%= pq.id %>(obj)
{
$(window).unbind('beforeunload');
$.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);
var span = $('#percent');
span.html(dataObj.percent);
// obj.value = data;
}
});
}
</script>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 100%" value="<%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %>>
</div>
</li><!--单行输入 end-->
<% elsif pq.question_type == 4 %>
<!-- 多行文字-->
<li class="ur_question_item textarea">
<div class="ur_preview">
<div class="ur_title">
<span class="title_index"><%= l(:label_question_number,:question_number => pq.question_number) %></span>
<%= pq.question_title %>
<span class="title_index">[多行主观]</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">
<script>
function onblur_<%= pq.id %>(obj)
{
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %> ,
vote_text: obj.innerHTML
},
success: function (data) {
var dataObj = eval(data);
if(dataObj.text != 'failure')
{
var span = $('#percent');
span.html(dataObj.percent);
}
else
{
alert("error");
}
}
});
}
</script>
<div contenteditable='<%= @can_edit_poll %>' class="ur_textbox" style="min-height: 150px;width: 100%;<%= @can_edit_poll?"":"background-color:#DCDCDC;" %>" onblur="onblur_<%= pq.id %>(this);"><%= get_anwser_vote_text(pq.id,User.current.id).html_safe %></div>
</div>
</div>
</li><!--多行输入 end-->
<% else %>
<!-- 未知题型 -->
<% end %>
<% end %>
</ol>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
<div class="ur_buttons" style="width: 100px;">
<% if @poll.polls_status == 2 %>
<%= link_to l(:button_submit),commit_poll_poll_path(@poll), :method => :post,:class => "ur_button",: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>
</div><!--问卷内容end-->
</body>
</html>

View File

@ -0,0 +1,37 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%= l(:label_poll_result) %></title>
<%= stylesheet_link_tag 'polls', :media => 'all' %>
</head>
<body>
<div class="polls_content polls_box" id="polls">
<div class="ur_page_head" >
<h1 class="ur_page_title"><%= @poll.polls_name %> <%= l(:label_poll) %></h1>
</div>
<div class="">
<% @poll_questions.each do |poll_question| %>
<ol>
<li class="ur_question_item">
<div class="ur_title_result">
<span class="title_index">第<%= poll_question.question_number %>题:</span><%= poll_question.question_title %> <span class="title_index">[<%= options_show(poll_question.question_type) %>]</span>
</div>
<% if poll_question.question_type == 1 || poll_question.question_type == 2 %>
<%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
<% else %>
<%= render :partial =>'quiz_answers', :locals =>{ :poll_question => poll_question } %>
<% end %>
</li>
</ol>
<% end %>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
<div class="ur_buttons"></div>
<div class="cl"></div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,6 @@
$("#polls_title").val("<%= @poll.polls_name%>");
$("#polls_description").val("<%= @poll.polls_description %>");
$("#polls_name_h").html("<%= @poll.polls_name %>");
$("#polls_description_p").html("<%= @poll.polls_description %>");
$("#polls_head_edit").hide();
$("#polls_head_show").show();

View File

@ -0,0 +1,22 @@
$("#poll_questions_<%= @poll_question.id%>").html("<div id='show_poll_questions_<%= @poll_question.id %>'>" +
"<% if @poll_question.question_type == 1%>" +
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>" +
"<% elsif @poll_question.question_type == 2%>" +
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_question}) %>" +
"<% elsif @poll_question.question_type == 3%>" +
"<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_question}) %>" +
"<% elsif @poll_question.question_type == 4%>" +
"<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_question}) %>" +
"<% end%>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_question.id %>' style='display: none;'>" +
"<% if @poll_question.question_type == 1%>" +
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_question}) %>" +
"<% elsif @poll_question.question_type == 2%>" +
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:poll_question => @poll_question}) %>" +
"<% elsif @poll_question.question_type == 3%>" +
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:poll_question => @poll_question}) %>" +
"<% elsif @poll_question.question_type == 4%>" +
"<%= escape_javascript(render :partial => 'edit_mulit', :locals => {:poll_question => @poll_question}) %>" +
"<% end%>" +
"</div>");

View File

@ -1817,8 +1817,10 @@ en:
label_record: 湘ICP备09019772
label_check_comment: Check comment
label_notification: Notification
label_must_answer: Will answer
label_poll_title: The questionnaire survey _ questionnaire page
label_question_number: 'question %{question_number}:'
label_complete_question: The answer has been completed
#end
# ajax异步验证

View File

@ -964,6 +964,8 @@ zh:
label_default: 默认
label_search_titles_only: 仅在标题中搜索
label_user_mail_option_all: "收取我的项目的所有通知"
label_must_answer: "必答"
label_poll_title: 问卷调查_问卷页面
#huang
label_file_new: 下载
label_user_edit: "修改资料"
@ -1419,6 +1421,8 @@ zh:
other: 参与了 %{count} 个项目:
#end
label_total_commit: 共%{total_commit}次提交
label_question_number: 第%{question_number}题:
label_complete_question: 答题已完成
#modify by men
label_x_total_commit:
zero: 共 %{count} 次提交
@ -2241,4 +2245,24 @@ zh:
label_quote_resource_failed: ",此资源引用失败! "
label_file_lost: 以下无法成功下载,请联系相关人员重新上传:
label_file_exist: 该作品中有重复命名文件,请通过文件名学号和姓名信息进入该作业详细界面手动下载
label_poll_new: 未命名问卷
label_poll: 问卷调查
label_new_poll: 新建问卷
label_statistical_results: 统计结果
label_MC: 单选题
label_MCQ: 多选题
label_single: 单行主观
label_mulit: 多行主观
label_enter_single_title: 请输入单选题标题
label_new_answer: 新建选项
label_poll_title: 问卷标题
label_poll_description: 问卷描述
label_poll_options: 选项
label_poll_subtotal: 小计
label_poll_proportion: 比例
label_poll_valid_commit: 本题有效填写人次
label_poll_result: 问卷调查_问卷统计
label_answer: 答案:
label_poll_answer_valid_result: 以上为有效问答题答案!
label_answer_total: 总计:

View File

@ -58,6 +58,20 @@ RedmineApp::Application.routes.draw do
end
end
resources :poll do
member do
get 'statistics_result'
post 'commit_answer'
post 'create_poll_question'
post 'commit_poll'
get 'publish_poll'
end
collection do
delete 'delete_poll_question'
post 'update_poll_question'
end
end
resources :contest_notification
resources :open_source_projects do

View File

@ -0,0 +1,9 @@
class AddDescriptionToPolls < ActiveRecord::Migration
def up
add_column :polls, :polls_description, :text
end
def down
remove_column :polls,:polls_description
end
end

View File

@ -0,0 +1,9 @@
class AddQuestionNumberToPollQuestions < ActiveRecord::Migration
def self.up
add_column :poll_questions, :question_number, :integer
end
def self.down
remove_column :poll_questions, :question_number
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 => 20150112024820) do
ActiveRecord::Schema.define(:version => 20150114022710) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -803,8 +803,9 @@ ActiveRecord::Schema.define(:version => 20150112024820) do
t.integer "question_type"
t.integer "is_necessary"
t.integer "poll_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "question_number"
end
create_table "poll_users", :force => true do |t|

View File

@ -0,0 +1,65 @@
function add_MC(){
var now = new Date().getTime();
$("#poll_content").append("<div id='new_poll_question_" + now + "'>"+
"<form accept-charset='UTF-8' action='/poll/2/create_poll_question' class='new_poll_question' data-remote='true' id='new_poll_question' method='post'>"+
"<div>" +
"<div class='ur_editor radio'>" +
"<div class='ur_editor_title'>" +
"<label>问题:&nbsp;&nbsp;</label>" +
"<input type='hidden' name='question_type' value='1'/>" +
"<input class='ur_question_title' type='text' name='poll_questions_title' placeholder='请输入单选题标题'/>" +
"<input type='checkbox' name='is_necessary' value='true' checked/>" +
"<label>必答</label>" +
"</div>" +
"<div class='ur_editor_content'>" +
"<ul>" +
"<li class='ur_item'>" +
"<label>选项<span class='ur_index'></span></label>" +
"<input type='text' name='question_answer[0]' placeholder='新建选项'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
"</li>" +
"<div class='cl'></div>" +
"<li class='ur_item'>" +
"<label>选项<span class='ur_index'></span></label>" +
"<input type='text' name='question_answer[1]' placeholder='新建选项'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
"</li>" +
"<div class='cl'></div>" +
"<li class='ur_item'>" +
"<label>选项<span class='ur_index'></span></label>" +
"<input type='text' name='question_answer[2]' placeholder='新建选项'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a>" +
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
"</li>" +
"<div class='cl'></div>" +
"</ul>" +
"</div>" +
"<div class='ur_editor_footer'>" +
"<a class='btn btn_dark btn_submit' data-button='ok' onclick='$(this).parent().parent().parent().parent().submit();'>确定</a>" +
"<a class='btn btn_light btn_cancel' data-button='cancel' onclick='$("+ '"#new_poll_question_' + now + '"' +").remove();'>取消</a>" +
"</div>" +
"<div class='cl'></div>" +
"</div>" +
"</div>" +
"</form>" +
"</div>");
}
function add_MCQ(){$("#poll_content").append("<%= escape_javascript(render :partial => 'new_MCQ') %>");}
function add_single(){$("#poll_content").append("<%= escape_javascript(render :partial => 'new_single') %>");}
function add_mulit(){$("#poll_content").append("<%= escape_javascript(render :partial => 'new_mulit') %>");}
//问卷头
function pollsCancel(){$("#polls_head_edit").hide();$("#polls_head_show").show();}
function pollsEdit(){$("#polls_head_edit").show();$("#polls_head_show").hide();}
//单选题
function add_single_answer(doc)
{
doc.parent().after("<li class='ur_item'><label>选项<span class='ur_index'></span></label><input type='text' name='question_answer["+new Date().getTime()+"]' placeholder='新建选项'/>" +
"<a class='icon_add' title='向下插入选项' onclick='add_single_answer($(this));'></a><a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
"</li><div class='cl'></div>");
}
function remove_single_answer(doc)
{
if(doc.parent().siblings("li").length == 0){doc.parent().parent().parent().parent().parent().parent().remove();}else{doc.parent().remove();}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,136 @@
/* CSS Document */
#polls{ font-size:12px; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
#polls div,img,tr,td{ border:0;}
#polls table,tr,td{border:0; cellspacing:0; cellpadding:0;}
#polls ul,li{ list-style-type:none}
#polls .cl{ clear:both; overflow:hidden; }
#polls a{ text-decoration:none; }
#polls a:hover{ text-decoration:underline; }
#polls .ml10{ margin-left:10px;}
#polls .ml20{ margin-left:20px;}
#polls .mr10{ margin-right:10px;}
#polls .fl{ float: left;}
#polls .fr{ float:right;}
/*问卷按钮*/
.polls_btn{ height:33px;border-top:1px solid #15bed1; border-bottom:1px solid #15bed1;border-right:1px solid #cee6e6; width:225px; padding:7px 0 0 15px; }
.polls_btn a{font-size:14px; color:#444444;font-weight:bold;}
.polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;}
/*问卷列表*/
.polls_content{ width:615px;}
.polls_head{ width:677px; height:48px; background:#eaeaea;}
.polls_head h2{ float:left; font-size:14px; color:#585858; margin:11px 0 0 10px;}
.polls_head span{ font-weight:normal; color:#15bccf;}
a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd9; color:#fff; font-size:14px; margin:10px; text-align:center;}
a:hover.newbtn{ background:#55a1b9; text-decoration:none;}
.polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;}
a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 350px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
.polls_title{ font-weight:bold; color:#3e6d8e;}
a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;}
a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
.polls_date{ color:#666666;}
.polls_de{ color:#6883b6;}
/****翻页***/
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist li{float: left;}
ul.wlist li a{ border:1px solid #15bccf; padding:4px; margin-left:3px;}
ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}
/*问卷页面*/
.polls_box{ border:1px solid #dcdcdc; padding:15px 30px;}
.ur_page_title{ font-size:16px; text-align:center; color:#353535; word-break:break-all; word-wrap:break-word;}
.ur_prefix_content{ color:#656565; text-indent:30px; margin-top:10px; }
.ur_card{border-top:1px solid #dcdcdc;margin-top:20px; color:#3a3a3a;}
.ur_title{ padding:20px 0px ; float:left; width:604px; word-break: break-all; word-wrap: break-word;}
.ur_required{ font-weight: bold; color:red;}
.ur_inputs{ color:#666;}
.ur_table{border-top:1px solid #dcdcdc;}
.ur_inputs tr td{ height:40px;border-bottom:1px solid #dcdcdc; width:617px;word-break: break-all; word-wrap: break-word;}
.ur_inputs label{ padding-left:10px;word-break: break-all; word-wrap: break-word;}
.ur_inputs input{ margin-right:5px;}
.ur_text{ height:30px;}
.ur_textbox{ border:1px solid #dcdcdc !important; color:#676765;}
.ur_buttons{ width:250px; margin:20px auto 10px;}
a.ur_button{ display:block; width:106px; height:37px; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:3px; float:left; margin-right:15px;}
a:hover.ur_button{ background:#0fa9bb; text-decoration:none;}
.ur_progress_text{ text-align:center; font-size:14px;}
/*问卷结果*/
.title_index{ color:#62bcd7; }
.ur_title_result{ padding-top:20px; word-break:break-all; word-wrap:break-word;}
.ur_table_result{ color:#5d5d5d;border-right:1px solid #cbcbcb;border-bottom:1px solid #cbcbcb;}
.ur_table_result tr td{ border-left:1px solid #cbcbcb;border-top:1px solid #cbcbcb; height:20px;}
.table_bluebg{ background:#d7e5ee; color:#2f3a40; height:24px;}
.td327{ width:601px; padding-left:5px; word-break:break-all; word-wrap:break-word; }
.td42{ width:42px; text-align:center;}
.td287{ width:259px;padding-left:5px; text-align:center; }
.td111{ width:601px;padding-left:5px; word-break:break-all; word-wrap:break-word; }
.Bar{ position: relative; width: 120px; border: 1px solid #cbcbcb; float:left; height:10px; margin-top:5px; margin-right:3px; }
.Bar span{ display: block; position: relative;background:#64badb;/* 进度条背景颜色 */ color: #333333;height: 10px; /* 高度 */ line-height: 20px; }
.ur_progress_text{ color:#3a3a3a;}
/*问卷编辑*/
.polls_edit{ color:#767676;}
a:hover{ text-decoration:none; cursor:pointer;}
.tabs_1{ width:665px; height: auto; border:1px solid #cbcbcb; padding:10px 0 0 10px; margin-bottom:10px;}
.tab_item { float:left; height:30px; background:#eeeeee; margin-right:4px; padding:0 8px; margin-bottom:10px;}
.icon_delete{ font-size:16px;}
a:hover.icon_delete{ font-weight: bold;}
.current{ color:#4f4f4d; background:#c4c4c4;}
.tab_add{float:left; width:22px; height:22px; border:1px solid #cbcbcb; margin-top:6px; }
.icon_page_add{ background:url(images/icons.png) 4px -314px no-repeat; width:22px; height:27px; display:block;}
a:hover.icon_page_add{ background:url(images/icons.png) -16px -314px no-repeat;}
.tab_item02{ float:left; width:141px; height:30px;background:#eeeeee; margin-right:10px; padding:0 10px; margin-bottom:10px; padding:10px 0 0 15px;}
.tab_item02:hover{ background:#c9c9c9;}
.tab_icon{padding-left:25px;}
a:hover.tab_item02{ background:#fff;}
.icon_radio{background:url(images/icons.png) 0px 0px no-repeat;color: gray; padding-bottom: 5px;}
.icon_checkbox{background:url(images/icons.png) 0px -40px no-repeat;color: gray; padding-bottom: 5px;}
.icon_text{background:url(images/icons.png) 0px -80px no-repeat;color: gray; padding-bottom: 5px;}
.icon_textarea{background:url(images/icons.png) 0px -120px no-repeat; color: gray;padding-bottom: 5px;}
.ur_editor {width:655px; border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px;}
.ur_title_editor_title{ margin-bottom:10px;}
.input_title{ width:630px; height:40px; padding:0 10px; text-align:center; font-size:16px; font-weight:bold;border: 1px solid #DCDCDC !important;}
.textarea_editor{ width:632px; height:120px; padding:10px; margin-bottom:10px;border: 1px solid #DCDCDC !important;}
.btn_submit{ width:56px; height:24px; padding-top:4px;background:#15bccf; color:#fff; text-align:center; display:block; float:left; margin-right:10px;}
a:hover.btn_submit{background:#0fa9bb;}
.btn_cancel{width:54px; height:22px; padding-top:4px;background:#fff; color:#999; border:1px solid #999; text-align:center; display:block; float:left; }
a:hover.btn_cancel{ color:#666;}
.ur_question_title{ width:534px; height:30px; border:1px solid #cbcbcb; padding:0 5px !important; margin-right:10px;border: 1px solid #DCDCDC !important;}
.ur_editor_title{ margin-bottom:10px;}
.ur_editor_content{ }
.ur_item{ margin-bottom:5px; height:32px; }
.ur_item input{ width:324px; height:30px;border:1px solid #cbcbcb; padding:0 5px; float:left; margin-right:10px; }
.ur_item label{ float:left;}
.icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
.icon_remove{background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;}
a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;}
.ur_editor_toolbar{ margin-bottom:10px;}
.ur_editor_toolbar input{ width:40px; height:20px;}
.ur_editor02{width:655px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px;}
a.ur_button_submit{ display:block; width:106px; height:37px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:3px; margin-bottom:10px; }
a:hover.ur_button_submit{ background:#0fa9bb; text-decoration:none;}
a.ur_icon_de{ background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px;}
a:hover.ur_icon_de{ background:url(images/icons.png) -20px -338px no-repeat;}
.ur_icon_edit{ background:url(images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;}
a:hover.ur_icon_edit{ background:url(images/icons.png) -21px -272px no-repeat;}
/***弹框***/
.popbox_polls{width:300px;height:100px;position:fixed;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-310px;background:url(/images/bid/close.png) no-repeat;cursor:pointer;}
.upload_box{ width:270px; margin:15px auto;}
.polls_box_p{ font-size:14px; text-align:center;}
a.upload_btn{ display:block; float:left; margin:15px 0 5px; width:60px; padding: 7px 0; text-align: center; color:#fff; font-size:14px; background:#15bccf; margin-right:10px;}
a:hover.upload_btn{ background:#06a9bc;}
a.upload_btn_grey{background:#a3a3a3;}
a:hover.upload_btn_grey{background:#8a8a8a;}
.upload_con p{ color:#808181;}
.upload_con a:hover{ text-decoration:none;}
.polls_btn_box{ width:145px; margin:0 auto; padding-left:10px;}
.polls_btn_box02{ width:80px; margin:0 auto; padding-left:10px;}

View File

@ -852,7 +852,7 @@ p.breadcrumb
input[type="text"],input[type="password"],textarea,select
{
padding:2px;
border:1px solid #039ea0
border:1px solid #039ea0
}
input[type="text"],input[type="password"]