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

34 lines
1.9 KiB
Plaintext
Raw Normal View History

2016-10-27 15:38:10 +08:00
<p class="mt10 mb10">
<span class="questionLabel" id="poll_question_number_<%=poll_question.id %>"><%= poll_question.question_number%></span>
<%if poll_question.is_necessary == 1%>
<span class="c_red questionLabel ml5" title="必答">*</span>
<%end%>
</p>
2016-11-07 16:03:04 +08:00
<div id="toolbar" class="undis">
2016-10-27 18:25:47 +08:00
<% poll = poll_question.poll %>
<% count = poll.poll_questions.count %>
<% unless poll_question.question_number == 1 %>
<%= link_to('', {:controller => 'poll', :action => 'update_question_num', :id => poll.id, :ques_id => poll_question.id, :opr => 'up'},:remote => true, :method => 'post', :class => "poll-up mb8", :title => '上移') %>
<% end %>
<% if poll_question.question_number < count %>
<%= link_to('', {:controller => 'poll', :action => 'update_question_num', :id => poll.id, :ques_id => poll_question.id, :opr => 'down'},:remote => true, :method => 'post', :class => "poll-down mb8", :title => '下移') %>
<% end %>
2016-10-28 15:42:45 +08:00
<div class="poll-add mb8 pr">
<ul class="poll-add-menu fontGrey3">
2016-10-27 15:38:10 +08:00
<li><a href="javascript:void(0);" onclick=" dismiss('<%=type %>',<%=poll_question.id%>);insert_MC('<%=type %>',<%=poll_question.id%>);">单选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('<%=type %>',<%=poll_question.id%>);insert_MCQ('<%=type %>',<%=poll_question.id%>);">多选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('<%=type %>',<%=poll_question.id%>);insert_SINGLE('<%=type %>',<%=poll_question.id%>);">主观题</a></li>
2016-10-28 15:42:45 +08:00
</ul>
</div>
2016-10-27 15:38:10 +08:00
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
2016-11-07 16:03:04 +08:00
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "poll-delete", :title => "删除") %>
</div>
<script>
$('.poll-container').mouseover(function(){
$(this).find("#toolbar, .poll-edit").show();
})
$('.poll-container').mouseout(function(){
$(this).find("#toolbar, .poll-edit").hide();
})
</script>