Merge remote-tracking branch 'origin/szzh' into guange_dev

This commit is contained in:
guange 2015-06-17 17:01:40 +08:00
commit 71ae441bfc
6 changed files with 27 additions and 0 deletions

View File

@ -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

View File

@ -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(/&nbsp;/," ") 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(/&nbsp;/," ")}.join(";")
end
end
count_row += 1
end
book.write xls_report
xls_report.string
end

View File

@ -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, {

View File

@ -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'],

View File

@ -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'],

View File

@ -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'],