socialforge/app/views/poll/show.html.erb

152 lines
5.9 KiB
Plaintext
Raw Normal View History

<!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' %>
2015-01-15 09:41:19 +08:00
<%= javascript_heads %>
</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">
2015-01-14 11:50:59 +08:00
<% @poll_questions.each do |pq| %>
<% if pq.question_type == 1 %>
<!-- 单选题 -->
<li class="ur_question_item radio">
<div class="ur_title">
<span class="title_index">第<%= pq.question_number %>题:</span>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="必答">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
2015-01-15 09:41:19 +08:00
<%= form_tag(commit_answer_poll_path(@poll),:remote => true,:id => 'form_'+ pq.id.to_s) do %>
2015-01-14 11:50:59 +08:00
<table class="ur_table" >
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label >
2015-01-15 09:41:19 +08:00
<script>
function clickOK()
{
$.ajax({
type: "GET",
url: "<%= bid.comment_status == 0 ? start_anonymous_comment_bid_path(bid) : stop_anonymous_comment_bid_path(bid)%>",
data: 'text',
success: function (data) {
}
});
}
</script>
<%= radio_button "poll_vote","poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"this.form.submit();return false" %>
<%= hidden_field_tag "poll_question_id",pq.id %>
<%= pa.answer_text %>
2015-01-14 11:50:59 +08:00
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
2015-01-15 09:41:19 +08:00
<% end %>
2015-01-14 11:50:59 +08:00
</div>
</li>
<% elsif pq.question_type == 2 %>
<!-- 多选题 -->
<li class="ur_question_item checkbox">
<div class="ur_title">
<span class="title_index">第<%= pq.question_number %>题:</span>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="必答">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" >
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label >
<input class="ur_checkbox" type="checkbox" value="新建选项" >
<%= pa.answer_text %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</li>
<% elsif pq.question_type == 3 %>
<!-- 单行文字-->
<li class="ur_question_item text">
<div class="ur_title">
<span class="title_index">第<%= pq.question_number %>题:</span>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="必答">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<input class="ur_text ur_textbox" type="text" size="" maxlength=""value="">
</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">第<%= pq.question_number %>题:</span>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="必答">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<textarea class="ur_textbox" rows="5" cols="60"></textarea>
</div>
</div>
</li><!--多行输入 end-->
<% else %>
<!-- 未知题型 -->
<% end %>
<% end %>
</ol>
2015-01-14 11:50:59 +08:00
<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;">
<a href="#" class="ur_button" >提交</a>
</div>
<div class="cl"></div>
<div class="ur_progress_text">答题已完成 <strong class="ur_progress_number">0%</strong> </div>
</div>
</div><!--问卷内容end-->
</body>
</html>