Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
	
		
	
				
					
				
			Conflicts: Gemfileemail_verify
						commit
						0147b30133
					
				| @ -1,125 +0,0 @@ | ||||
| source 'https://rubygems.org' | ||||
| 
 | ||||
| unless RUBY_PLATFORM =~ /w32/ | ||||
|   # unix-like only | ||||
|   gem 'iconv' | ||||
|   gem 'rubyzip' | ||||
|   gem 'zip-zip' | ||||
| end | ||||
| 
 | ||||
| gem 'seems_rateable', path: 'lib/seems_rateable' | ||||
| gem "rails", "3.2.13" | ||||
| gem "jquery-rails", "~> 2.0.2" | ||||
| gem "i18n", "~> 0.6.0" | ||||
| gem "coderay", "~> 1.0.6" | ||||
| gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] | ||||
| gem "builder", "3.0.0" | ||||
| gem 'acts-as-taggable-on', '2.4.1' | ||||
| 
 | ||||
| group :development do | ||||
|   gem 'better_errors', path: 'lib/better_errors' | ||||
|   gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler' | ||||
|   if ENV['PRY'] | ||||
|     gem 'pry' | ||||
|     gem 'pry-nav' | ||||
|   end | ||||
| end | ||||
| 
 | ||||
| # group :test do | ||||
| #  # shoulda的版本做了改动 | ||||
| #  #gem "shoulda", "~> 3.3.2" | ||||
| #  gem "shoulda", "> 3.3.2" | ||||
| #  gem "mocha", "~> 0.13.3" | ||||
| #  gem 'capybara', '~> 2.0.0' | ||||
| #  gem 'nokogiri', '< 1.6.0' | ||||
| # end | ||||
| 
 | ||||
| 
 | ||||
| # Gems used only for assets and not required | ||||
| # in production environments by default. | ||||
| group :assets do | ||||
|   gem 'sass-rails',   '~> 3.2.3' | ||||
|   gem 'coffee-rails', '~> 3.2.1' | ||||
| 
 | ||||
|   # See https://github.com/sstephenson/execjs#readme for more supported runtimes | ||||
|    gem 'therubyracer', :platforms => :ruby | ||||
| 
 | ||||
|   gem 'uglifier', '>= 1.0.3' | ||||
| end | ||||
| 
 | ||||
| # Optional gem for LDAP authentication | ||||
| group :ldap do | ||||
|   gem "net-ldap", "~> 0.3.1" | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| # platforms :mri, :mingw do | ||||
| #  group :rmagick do | ||||
| #    # RMagick 2 supports ruby 1.9 | ||||
| #    # RMagick 1 would be fine for ruby 1.8 but Bundler does not support | ||||
| #    # different requirements for the same gem on different platforms | ||||
| #    gem "rmagick", ">= 2.0.0" | ||||
| #  end | ||||
| # end | ||||
| 
 | ||||
| # Optional gem for OpenID authentication | ||||
| group :openid do | ||||
|   gem "ruby-openid", "~> 2.1.4", :require => "openid" | ||||
|   gem "rack-openid" | ||||
| end | ||||
| 
 | ||||
| # Optional gem for exporting the gantt to a PNG file, not supported with jruby | ||||
| platforms :jruby do | ||||
|   # jruby-openssl is bundled with JRuby 1.7.0 | ||||
|   gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0' | ||||
|   gem "activerecord-jdbc-adapter", "1.2.5" | ||||
| end | ||||
| 
 | ||||
| # Include database gems for the adapters found in the database | ||||
| # configuration file | ||||
| require 'erb' | ||||
| require 'yaml' | ||||
| database_file = File.join(File.dirname(__FILE__), "config/database.yml") | ||||
| if File.exist?(database_file) | ||||
|   database_config = YAML::load(ERB.new(IO.read(database_file)).result) | ||||
|   adapters = database_config.values.map {|c| c['adapter']}.compact.uniq | ||||
|   if adapters.any? | ||||
|     adapters.each do |adapter| | ||||
|       case adapter | ||||
|       when 'mysql2' | ||||
|         gem "mysql2", "= 0.3.11", :platforms => [:mri, :mingw] | ||||
|         gem "activerecord-jdbcmysql-adapter", :platforms => :jruby | ||||
|       when 'mysql' | ||||
|         gem "mysql", "~> 2.8.1", :platforms => [:mri, :mingw] | ||||
|         gem "activerecord-jdbcmysql-adapter", :platforms => :jruby | ||||
|       when /postgresql/ | ||||
|         gem "pg", ">= 0.11.0", :platforms => [:mri, :mingw] | ||||
|         gem "activerecord-jdbcpostgresql-adapter", :platforms => :jruby | ||||
|       when /sqlite3/ | ||||
|         gem "sqlite3", :platforms => [:mri, :mingw] | ||||
|         gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby | ||||
|       when /sqlserver/ | ||||
|         gem "tiny_tds", "~> 0.5.1", :platforms => [:mri, :mingw] | ||||
|         gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw] | ||||
|       else | ||||
|         warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems") | ||||
|       end | ||||
|     end | ||||
|   else | ||||
|     warn("No adapter found in config/database.yml, please configure it first") | ||||
|   end | ||||
| else | ||||
|   warn("Please configure your config/database.yml first") | ||||
| end | ||||
| 
 | ||||
| local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local") | ||||
| if File.exists?(local_gemfile) | ||||
|   puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v` | ||||
|   instance_eval File.read(local_gemfile) | ||||
| end | ||||
| 
 | ||||
| # Load plugins' Gemfiles | ||||
| Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file| | ||||
|   puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v` | ||||
|   instance_eval File.read(file) | ||||
| end | ||||
| @ -1,2 +0,0 @@ | ||||
| class PollAnswerController < ApplicationController | ||||
| end | ||||
| @ -1,2 +0,0 @@ | ||||
| class PollQuestionController < ApplicationController | ||||
| end | ||||
| @ -1,2 +0,0 @@ | ||||
| class PollUserController < ApplicationController | ||||
| end | ||||
| @ -1,2 +0,0 @@ | ||||
| class PollVoteController < ApplicationController | ||||
| end | ||||
| @ -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 | ||||
| @ -0,0 +1,8 @@ | ||||
| class ForumObserver < ActiveRecord::Observer | ||||
|   def after_create(forum) | ||||
|     Thread.start do | ||||
|       Mailer.forum_add(forum).deliver if Setting.notified_events.include?('forum_add') | ||||
|     end | ||||
| 
 | ||||
|   end | ||||
| end | ||||
| @ -1,7 +1,9 @@ | ||||
| # Added by young | ||||
| class JournalsForMessageObserver < ActiveRecord::Observer | ||||
| 	def after_create(journals_for_message) | ||||
|     thread1 = Thread.start do | ||||
| 			Mailer.journals_for_message_add(User.current, journals_for_message).deliver | ||||
|     end | ||||
| 	end | ||||
| end | ||||
| 
 | ||||
|  | ||||
| @ -0,0 +1,8 @@ | ||||
| class MemoObserver < ActiveRecord::Observer | ||||
|   def after_create(memo) | ||||
| 
 | ||||
|     thread1=Thread.new do | ||||
|       Mailer.forum_message_added(memo).deliver if Setting.notified_events.include?('forum_message_added') | ||||
|     end | ||||
|   end | ||||
| end | ||||
| @ -1,33 +1,52 @@ | ||||
| <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;} | ||||
| .mail{ width:600px; margin:20px; height:auto; color:#4b4b4b; font-size:14px; } | ||||
| ol,ul,li{ list-style-type:none} | ||||
| .cl{ clear:both; overflow:hidden; margin-top: 30px;} | ||||
| .mail_box,ul,li{ list-style-type:none} | ||||
| .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;} | ||||
| .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;} | ||||
| 
 | ||||
| a{ text-decoration:none; } | ||||
| a:hover{ text-decoration:underline; } | ||||
| 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;} | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| </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> | ||||
| 
 | ||||
| <body style="font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal; margin:0; padding:0; border:0;"> | ||||
|  <div class="container" style="margin:0; padding:0; border:0;"> | ||||
| 	<div class="mail" style="width:600px; margin:20px; height:auto; color:#4b4b4b; font-size:14px; margin:0; padding:0; border:0;"> | ||||
|     	<div class="mail_head" style="margin:0; padding:0; border:0;"> | ||||
|         	<p><%= l(:mail_issue_greetings)%></p> | ||||
|         </div><!--mail_head end--> | ||||
|         <%= yield %> | ||||
|         <hr /> | ||||
|       <span class="footer" style="margin:0; padding:0;"><%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %></span><!--mail_foot end--> | ||||
|     </div> | ||||
|  </div> | ||||
| </body> | ||||
| </html> | ||||
|  | ||||
| @ -1,15 +1,50 @@ | ||||
| <h1><%= link_to(h("#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}"), issue_url) %></h1> | ||||
| 
 | ||||
| <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 %> | ||||
| <!-- <h1><%#= link_to(h("#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}"), issue_url) %></h1> --> | ||||
| <p> | ||||
|       <span class="c_blue" style="color:#1b55a7;"> | ||||
|         <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> | ||||
|      </span><%= l(:mail_issue_title_userin)%> | ||||
|   <span class="c_blue" style="color:#1b55a7;"><%= link_to(h("#{@issue.project.name}"), @project_url, :style=>'color:#1b55a7; font-weight:bold;') %></span><%= l(:mail_issue_title_active)%></p> | ||||
| <div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;"> | ||||
| <ul style="list-style-type:none; margin:0; padding:0;"> | ||||
| 	<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_subject)%></strong></span><span style="float: left; width: 526px"><%= link_to(issue.subject, issue_url, :style=>'color:#1b55a7; font-weight:bold;') %></span></li> | ||||
| 	<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_sent_from)%></strong></span><span style="float: left; width: 526px"><%= issue.project.name %><b>| </b><%= l(:mail_issue_from_project)%></span></li> | ||||
| 	<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span> | ||||
| 		<span style="float: left; width: 526px"> | ||||
|         	<% if @journal.nil? %> | ||||
|                  <%= issue.description %> | ||||
|             <% else %> | ||||
|             	<%= @journal.notes %> | ||||
|            <% end%> | ||||
|         </span> | ||||
|     </li> | ||||
|     <li style="list-style-type:none; margin:0; padding:0;"> | ||||
| 
 | ||||
|       <% unless @issue.attachments.nil? %> | ||||
|         <span style="float: left"> <strong><%= l(:mail_issue_attachments)%></strong></span> | ||||
|         <span style="float: left; width: 526px; margin:0; padding:0;"> | ||||
|           <% @issue.attachments.each do |attach| %> | ||||
|           <p style="float: left; width: 526px; margin:0; padding:0;"><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false, :style=>'color:#1b55a7; font-weight:bold;')%></p> | ||||
|         <% end %></span> | ||||
|       <% end %> | ||||
| 
 | ||||
| 
 | ||||
|     </li> | ||||
| </ul> | ||||
|   <div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div> | ||||
|   <label  class="mail_reply"> | ||||
|   	<%= link_to( l(:mail_issue_reply), issue_url,  :class => "mail_reply", :style =>'display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px; line-height: 30px;') %> | ||||
|   	</label> | ||||
|   <div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div> | ||||
| </div> | ||||
| <!-- <li><%#=l(:field_author)%>: <%#=h issue.author %></li> | ||||
| 
 | ||||
| <%= textilizable(issue, :description, :only_path => false) %> | ||||
| <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 %> | ||||
| --> | ||||
|  | ||||
| @ -1,13 +1,23 @@ | ||||
| <%= "#{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) %> | ||||
|      <%= l(:mail_issue_title_userin)%> | ||||
|  <%= link_to(h("#{@issue.project.name}"),@project_url) %><%= l(:mail_issue_title_active)%> | ||||
| <%= l(:mail_issue_subject)%><%= link_to(issue.subject, issue_url) %> | ||||
| <%= l(:mail_issue_sent_from)%>| <%= l(:mail_issue_from_project)%> | ||||
| <%= l(:mail_issue_content)%> | ||||
| 	<% if @journal.nil? %> | ||||
|      <%= issue.description %> | ||||
|     <% else %> | ||||
|     	<%= @journal.notes %> | ||||
|     <% end%> | ||||
|         <% unless @issue.attachments.nil? %> | ||||
| <%= l(:mail_issue_attachments)%> | ||||
| 
 | ||||
| 
 | ||||
|             <% @issue.attachments.each do |attach| %> | ||||
|                 <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %> | ||||
|             <% end %> | ||||
|         <% end %> | ||||
| 
 | ||||
| 
 | ||||
|  <%= link_to( l(:mail_issue_reply), issue_url) %> | ||||
|  | ||||
| @ -0,0 +1,4 @@ | ||||
| <h1><%= link_to(h(@forum.name), @forum_url) %></h1> | ||||
| <em><%=h @forum.creator.name %></em> | ||||
| 
 | ||||
| <%= @forum.description.html_safe %> | ||||
| @ -0,0 +1,4 @@ | ||||
| <%= @forum_url %> | ||||
| <%= @author.name %> | ||||
| 
 | ||||
| <%= @forum.description %> | ||||
| @ -0,0 +1,4 @@ | ||||
| <h1><%= link_to(h(@memo.subject), @memo_url) %></h1> | ||||
| <em><%=h @memo.author.name %></em> | ||||
| 
 | ||||
| <%= @memo.content.html_safe %> | ||||
| @ -0,0 +1,5 @@ | ||||
| <%= @memo_url %> | ||||
| <%= @author.name %> | ||||
| 
 | ||||
| <%= @memo.subject %> | ||||
| <%= @memo.content %> | ||||
| @ -1,3 +1,9 @@ | ||||
| <%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => h(@issue.author)) %> | ||||
| <hr /> | ||||
| <%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %> | ||||
| <div class="mail_content" style="margin-top:30px; margin:0; padding:0; border:0;"> | ||||
| 
 | ||||
| 
 | ||||
|          <%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %> | ||||
| 
 | ||||
| 
 | ||||
| </div> | ||||
| <div class="mail_foot" style="margin:0; padding:0; border:0;"><%= link_to( l(:mail_issue_footer), @user_url , :style=>'font-size:12px; font-weight:normal; color:#1b55a7;')  %> </div> | ||||
| 
 | ||||
|  | ||||
| @ -1,4 +1,3 @@ | ||||
| <%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => @issue.author) %> | ||||
| 
 | ||||
| ---------------------------------------- | ||||
| <%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> | ||||
| <%= link_to( l(:mail_issue_footer), @user_url)  %> | ||||
| @ -1,11 +1,11 @@ | ||||
| <%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => h(@journal.user)) %> | ||||
| <div> | ||||
|   <%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => h(@journal.user)) %> | ||||
| 
 | ||||
| <ul> | ||||
| <% details_to_strings(@journal.details, false, :only_path => false).each do |string| %> | ||||
|   <li><%= string %></li> | ||||
| <% end %> | ||||
| </ul> | ||||
|    | ||||
| </div> | ||||
| <div class="cl" style="margin-top: 15px; clear:both; overflow:hidden;"></div> | ||||
| <hr/> | ||||
| 
 | ||||
| <%= textilizable(@journal, :notes, :only_path => false) %> | ||||
| <hr /> | ||||
| <%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %> | ||||
| <div class="mail_foot"><%= link_to( l(:mail_issue_footer), @user_url, :style=>'font-size:12px; font-weight:normal; color:#1b55a7;')  %> </div> | ||||
| 
 | ||||
|  | ||||
| @ -1,12 +1,8 @@ | ||||
| <%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => @journal.user) %> | ||||
| 
 | ||||
| <% details_to_strings(@journal.details, true).each do |string| -%> | ||||
| <%= string %> | ||||
| <% end -%> | ||||
| 
 | ||||
| <% if @journal.notes? -%> | ||||
| <%= @journal.notes %> | ||||
| 
 | ||||
| <% end -%> | ||||
| ---------------------------------------- | ||||
| -------------------------------------------------------------------------------- | ||||
| <%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> | ||||
| 
 | ||||
| <%= link_to( l(:mail_issue_footer), @user_url)  %> | ||||
| @ -1,4 +1,10 @@ | ||||
| <h1><%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %></h1> | ||||
| <h1> | ||||
|   <% if @message.project %> | ||||
|       <%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %> | ||||
|   <% elsif @message.course %> | ||||
|       <%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url) %> | ||||
|   <% end %> | ||||
| </h1> | ||||
| <em><%=h @message.author %></em> | ||||
| 
 | ||||
| <%= textilizable(@message, :content, :only_path => false) %> | ||||
|  | ||||
| @ -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">  </td> | ||||
|         </tr> | ||||
|      </tbody> | ||||
|    </table> | ||||
| </div> | ||||
| 
 | ||||
| @ -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> | ||||
| @ -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%> | ||||
| @ -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">问题:  </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%> | ||||
| @ -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">问题:  </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%> | ||||
| @ -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">问题:  </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%> | ||||
| @ -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">问题:  </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%> | ||||
| @ -0,0 +1,68 @@ | ||||
| <% has_commit = has_commit_poll?(poll.id ,User.current)%> | ||||
| <% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%> | ||||
| <li title="<%= poll.polls_name %>"> | ||||
|   <% if @is_teacher %> | ||||
|       <% if has_commit %> | ||||
|           <sapn class="polls_title fl"> | ||||
|             <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %> | ||||
|           </sapn> | ||||
|       <% else %> | ||||
|           <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl" %> | ||||
|       <% end %> | ||||
|   <% else %> | ||||
|       <% if has_commit && poll.polls_status == 2 %> | ||||
|           <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 500px;width: auto;" %> | ||||
|       <% elsif !has_commit && poll.polls_status == 2 %> | ||||
|           <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %> | ||||
|       <% end %> | ||||
|   <% end %> | ||||
| </li> | ||||
| <% if !@is_teacher && has_commit && poll.polls_status == 2%> | ||||
|     <li class="pollsbtn_tip fl ml5">已答</li> | ||||
| <% end %> | ||||
| 
 | ||||
| <%if @is_teacher%> | ||||
|     <% if poll.polls_status == 1 %> | ||||
|         <li class="pollsbtn fl ml10 pollsbtn_grey">统计结果</li> | ||||
|     <% elsif poll.polls_status == 2%> | ||||
|         <li> | ||||
|           <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> | ||||
|         </li> | ||||
|     <% end%> | ||||
| <% end%> | ||||
| 
 | ||||
| <li> | ||||
|   <%if @is_teacher %> | ||||
|     <% if poll.polls_status == 1 %> | ||||
|       <a href="#" class="pollsbtn btn_pu fl ml5" onclick="poll_submit(<%= poll.id%>);">发布问卷</a> | ||||
|     <% elsif poll.polls_status == 2%> | ||||
|       <a href="#" class="pollsbtn btn_de fl ml5" onclick="republish_poll(<%= poll.id%>);">取消发布</a> | ||||
|     <% end%> | ||||
|   <% 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%> | ||||
|       <% if poll.polls_status == 1 %> | ||||
|           <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> | ||||
|       <% elsif poll.polls_status == 2%> | ||||
|         <li class="polls_de_grey fr ml20">编辑</li> | ||||
|       <% end%> | ||||
|   <% end%> | ||||
| </li> | ||||
| <!--<li>--> | ||||
|   <!--<% if @is_teacher && poll.polls_status == 2%>--> | ||||
|     <!--<a class="polls_de fr ml20" onclick="republish_poll(<%= poll.id%>);">--> | ||||
|       <!--取消发布--> | ||||
|     <!--</a>--> | ||||
|   <!--<% end %>--> | ||||
| <!--</li>--> | ||||
| <li class="polls_date fr mr10"> | ||||
|   <%= format_time poll.created_at%> | ||||
| </li> | ||||
| @ -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 %> | ||||
| @ -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> | ||||
| @ -0,0 +1,32 @@ | ||||
| <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 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 "确    定",republish_poll_poll_path(poll.id), :class => "upload_btn", :onclick => "clickCanel();" %> | ||||
|         <a class="upload_btn upload_btn_grey" onclick="clickCanel();"> | ||||
|           取  消 | ||||
|         </a> | ||||
|       </div> | ||||
|       <div class="cl"></div> | ||||
|     </div> | ||||
| 
 | ||||
|   </div> | ||||
| 
 | ||||
| </div> | ||||
| </body> | ||||
| </html> | ||||
| 
 | ||||
| @ -0,0 +1,29 @@ | ||||
| <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 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,:is_remote => is_remote), :class => "upload_btn", :onclick => "clickCanel();" %> | ||||
|         <a class="upload_btn upload_btn_grey" onclick="clickCanel();"> | ||||
|           取  消 | ||||
|         </a> | ||||
|       </div> | ||||
|       <div class="cl"></div> | ||||
|     </div> | ||||
|   </div> | ||||
| </div> | ||||
| </body> | ||||
| </html> | ||||
| 
 | ||||
| @ -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> | ||||
| 
 | ||||
| @ -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--> | ||||
| @ -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--> | ||||
| @ -0,0 +1,26 @@ | ||||
| <li  class="ur_question_item checkbox"> | ||||
|   <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> | ||||
|   <div class="cl"></div> | ||||
|   <div class="ur_inputs"> | ||||
|     <table class="ur_table"> | ||||
|       <tbody> | ||||
|       <% poll_question.poll_votes.where("user_id = #{User.current.id}").each do |answer|%> | ||||
|           <tr> | ||||
|             <td> | ||||
|               <%= answer.poll_answer.answer_text  %> | ||||
|             </td> | ||||
|           </tr> | ||||
|       <% end%> | ||||
|       </tbody> | ||||
|     </table> | ||||
|   </div> | ||||
| </li><!--多选题 end--> | ||||
| @ -0,0 +1,27 @@ | ||||
| <li class="ur_question_item radio"> | ||||
|   <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> | ||||
|   <div class="cl"></div> | ||||
|   <div class="ur_inputs"> | ||||
|     <table class="ur_table" > | ||||
|       <tbody> | ||||
|       <% poll_question.poll_votes.where("user_id = #{User.current.id}").each do |answer|%> | ||||
|           <tr> | ||||
|             <td> | ||||
|               <%= answer.poll_answer.answer_text  %> | ||||
|             </td> | ||||
|           </tr> | ||||
|       <% end%> | ||||
| 
 | ||||
|       </tbody> | ||||
|     </table> | ||||
|   </div> | ||||
| </li><!--单选题 end--> | ||||
| @ -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.empty? ? l(:label_poll_new) : poll.polls_name%> | ||||
|   </h1> | ||||
|   <p class="ur_prefix_content" id="polls_description_p"> | ||||
|     <%= @poll.polls_description%> | ||||
|   </p> | ||||
|   <div class="cl"></div> | ||||
| </div><!--头部显示 end--> | ||||
| @ -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--> | ||||
| @ -0,0 +1,20 @@ | ||||
| <li class="ur_question_item textarea"> | ||||
|   <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> | ||||
|     <div class="cl"></div> | ||||
|     <div class="ur_inputs"> | ||||
|       <p> | ||||
|         <%= get_anwser_vote_text(poll_question.id,User.current.id).html_safe%> | ||||
|       </p> | ||||
|     </div> | ||||
|   </div> | ||||
| </li><!--多行输入 end--> | ||||
| @ -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--> | ||||
| @ -0,0 +1,18 @@ | ||||
| <li  class="ur_question_item text"> | ||||
|   <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> | ||||
|   <div class="cl"></div> | ||||
|   <div class="ur_inputs"> | ||||
|     <p> | ||||
|       <%= get_anwser_vote_text poll_question.id,User.current.id%> | ||||
|     </p> | ||||
|   </div> | ||||
| </li><!--当行输入 end--> | ||||
| @ -0,0 +1,3 @@ | ||||
| <% if @pv_saved %> | ||||
| $('#poll_vote_poll_answer_id_<%= @pv.poll_answer_id %>').checked = true; | ||||
| <% end %> | ||||
| @ -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"); | ||||
| @ -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>"); | ||||
| 
 | ||||
| @ -0,0 +1 @@ | ||||
| $("#poll_content").html("<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll}) %>"); | ||||
| @ -0,0 +1,4 @@ | ||||
| <% if @poll%> | ||||
|     $("#polls_<%= @poll.id%>").remove(); | ||||
| <%else%> | ||||
| <% end %> | ||||
| @ -0,0 +1,2 @@ | ||||
| <%= render :partial => 'poll_form'%> | ||||
| 
 | ||||
| @ -0,0 +1 @@ | ||||
| <%= render :partial => 'poll_form'%> | ||||
| @ -0,0 +1,36 @@ | ||||
| <%= stylesheet_link_tag  'polls', :media => 'all' %> | ||||
| <div class="polls_content polls_box"> | ||||
|   <div class="ur_page_head" > | ||||
|     <h1 class="ur_page_title"> | ||||
|       <%= @poll.polls_name.empty? ? l(:label_poll_new) : @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 |poll_question|%> | ||||
|           <% if poll_question.question_type == 1%> | ||||
|               <%= render :partial => 'show_MC_result', :locals => {:poll_question => poll_question} %> | ||||
|           <% elsif poll_question.question_type == 2%> | ||||
|               <%= render :partial => 'show_MCQ_result', :locals => {:poll_question => poll_question} %> | ||||
|           <% elsif poll_question.question_type == 3%> | ||||
|               <%= render :partial => 'show_single_result', :locals => {:poll_question => poll_question} %> | ||||
|           <% elsif poll_question.question_type == 4%> | ||||
|               <%= render :partial => 'show_mulit_result', :locals => {:poll_question => poll_question} %> | ||||
|           <% end%> | ||||
|       <% end%> | ||||
|     </ol> | ||||
|   </div> <!--ur_cards end--> | ||||
|   <div class="cl"></div> | ||||
| 
 | ||||
|   <!-- 分页 --> | ||||
|   <div class="polls_content" id="polls"> | ||||
|       <ul class="wlist"> | ||||
|         <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> | ||||
|       </ul> | ||||
|       <div class="cl"></div> | ||||
|   </div> | ||||
| </div><!--问卷内容end--> | ||||
| 
 | ||||
| @ -0,0 +1,2 @@ | ||||
| $("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); | ||||
| alert("发布成功"); | ||||
| @ -0,0 +1,2 @@ | ||||
| $("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); | ||||
| alert("取消成功"); | ||||
Some files were not shown because too many files have changed in this diff Show More
					Loading…
					
					
				
		Reference in new issue