diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 2a772a949..4ecff7a40 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -23,6 +23,7 @@ class AttachmentsController < ApplicationController before_filter :delete_authorize, :only => [:destroy] before_filter :authorize_global, :only => [:upload] before_filter :authorize_attachment_download1, :only => [:download] + before_filter :has_login #before_filter :login_without_softapplication, only: [:download] accept_api_auth :show, :download, :upload require 'iconv' @@ -511,4 +512,8 @@ private format.js end end + + def has_login + render_403 unless User.current.logged? + end end diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index a222314ab..d8a9d88c3 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -483,6 +483,24 @@ class PollController < ApplicationController count_row += 1 end end + + sheet1.row(count_row).default_format = blue + sheet1[count_row ,0] = l(:label_bidding_user_studentname) + poll_questions.each_with_index do |poll_question, i| + sheet1[count_row ,i + 1] = poll_question.question_title + end + count_row += 1 + @poll.users.each do |user| + sheet1[count_row ,0] = user.show_name + poll_questions.each_with_index do |poll_question, i| + if poll_question.question_type == 1 || poll_question.question_type == 2 + sheet1[count_row ,i + 1] = user.poll_votes.where(:poll_question_id => poll_question.id).map{|poll_vote| poll_vote.poll_answer.answer_text.gsub(/<\/?.*?>/,"").gsub(/ /," ") if poll_vote.poll_answer}.join(";") + else + sheet1[count_row ,i + 1] = user.poll_votes.where(:poll_question_id => poll_question.id).map{|poll_vote| poll_vote.vote_text.gsub(/<\/?.*?>/,"").gsub(/ /," ")}.join(";") + end + end + count_row += 1 + end book.write xls_report xls_report.string end diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index b49b4a960..5520f526d 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -123,6 +123,7 @@ function nh_check_field(params){ function nh_init_board(params){ //发帖/编辑/回复按钮的click params.showbtn.click(function(){ + params.textarea.removeAttr('placeholder'); if(params.textarea.data('init') == undefined){ //初始化编辑器 var editor = params.kindutil.create(params.textarea, { diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 03adc2fd7..cedc05f4b 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -56,6 +56,7 @@ $(function(){ function init_editor(params){ + params.textarea.removeAttr('placeholder'); var editor = params.kindutil.create(params.textarea, { resizeType : 1,minWidth:"1px",width:"100%",height:"150px", items:['emoticons'], diff --git a/app/views/projects/_project_jours.html.erb b/app/views/projects/_project_jours.html.erb index 93974579f..baee72475 100644 --- a/app/views/projects/_project_jours.html.erb +++ b/app/views/projects/_project_jours.html.erb @@ -45,6 +45,7 @@ $(function(){ function init_editor(params){ + params.textarea.removeAttr('placeholder'); var editor = params.kindutil.create(params.textarea, { resizeType : 1,minWidth:"1px",width:"100%",height:"150px", items:['emoticons'], diff --git a/app/views/users/_user_jours.html.erb b/app/views/users/_user_jours.html.erb index aeb3a71ea..9d7a601d5 100644 --- a/app/views/users/_user_jours.html.erb +++ b/app/views/users/_user_jours.html.erb @@ -69,6 +69,7 @@ $(function(){ function init_editor(params){ + params.textarea.removeAttr('placeholder'); var editor = params.kindutil.create(params.textarea, { resizeType : 1,minWidth:"1px",width:"100%",height:"150px", items:['emoticons'],