1.增加点击单选、多选、单行文本、多行文本的js

2.分割问卷标题头
3.增加新增问题的路由及action
This commit is contained in:
sw 2015-01-13 20:13:50 +08:00
parent c84b8f75cc
commit 311d90d565
6 changed files with 51 additions and 19 deletions

View File

@ -81,6 +81,11 @@ class PollController < ApplicationController
end
end
#添加单选题
def add_mc
end
private
def find_poll_and_course
@poll = Poll.find params[:id]

View File

@ -2,7 +2,7 @@
<div class="ur_editor checkbox">
<div class="ur_editor_title">
<label >问题:&nbsp;&nbsp;</label>
<input class="ur_question_title" type="text" name="title" placeholder="请输入问题标题" value="选题">
<input class="ur_question_title" type="text" name="title" placeholder="请输入问题标题" value="选题">
<input type="checkbox" name="required" value="true" checked="">
<label >必答</label>
</div>

View File

@ -0,0 +1,13 @@
<div class="ur_editor ur_title_editor"> <!--编辑头部start-->
<div class="ur_title_editor_title">
<input type="text" name="title" class="input_title" value="问卷标题">
</div>
<div class="ur_title_editor_prefix">
<textarea name="prefix" class="textarea_editor">问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述</textarea>
</div>
<div class="ur_editor_footer">
<a class="btn_submit" data-button="ok">确定</a>
<a class="btn_cancel" data-button="cancel">取消</a>
</div>
<div class="cl"></div>
</div><!--编辑头部 end-->

View File

@ -4,6 +4,13 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>问卷调查_问卷编辑</title>
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<script type="text/javascript">
function add_MC(){$("#poll_content").append("<%= escape_javascript(render :partial => 'edit_MC') %>");}
function add_MCQ(){$("#poll_content").append("<%= escape_javascript(render :partial => 'edit_MCQ') %>");}
function add_single(){$("#poll_content").append("<%= escape_javascript(render :partial => 'edit_single') %>");}
function add_mulit(){$("#poll_content").append("<%= escape_javascript(render :partial => 'edit_mulit') %>");}
</script>
</head>
<body>
@ -12,37 +19,38 @@
<div class="tabs_1">
<ul class="tabs_list">
<li class="tab_item02 " >
<a title="单选题" class="tab_icon icon_radio">单选题</a>
<a title="<%= l(:label_MC) %>" class="tab_icon icon_radio" onclick="add_MC();">
<%= l(:label_MC) %>
</a>
</li>
<li class="tab_item02 " >
<a title="多选题" class=" tab_icon icon_checkbox">多选题</a>
<a title="<%= l(:label_MCQ) %>" class=" tab_icon icon_checkbox" onclick="add_MCQ();">
<%= l(:label_MCQ) %>
</a>
</li>
<li class="tab_item02 " >
<a title="单行文字" class="tab_icon icon_text">单行文字</a>
<a title="<%= l(:label_single) %>" class="tab_icon icon_text" onclick="add_single();">
<%= l(:label_single) %>
</a>
</li>
<li class="tab_item02 " >
<a title="多行文字" class="tab_icon icon_textarea">多行文字</a>
<a title="<%= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">
<%= l(:label_mulit)%>
</a>
</li>
</ul>
<div class="cl"></div>
</div><!--选项 end-->
<div class="ur_editor ur_title_editor"> <!--编辑头部start-->
<div class="ur_title_editor_title">
<input type="text" name="title" class="input_title" value="问卷标题">
</div>
<div class="ur_title_editor_prefix">
<textarea name="prefix" class="textarea_editor">问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述</textarea>
</div>
<div class="ur_editor_footer">
<a class="btn_submit" data-button="ok">确定</a>
<a class="btn_cancel" data-button="cancel">取消</a>
</div>
<div class="cl"></div>
</div><!--编辑头部 end-->
<%= render :partial => 'edit_head'%>
<div id="poll_content">
</div>
<div class="ur_buttons">
<a href="#" class="ur_button_submit" >提交</a>
<a href="#" class="ur_button_submit" >
<%= l(:label_memo_create)%>
</a>
</div>
<div class="cl"></div>

View File

@ -2245,4 +2245,9 @@ zh:
label_poll: 问卷调查
label_new_poll: 新建问卷
label_statistical_results: 统计结果
label_MC: 单选题
label_MCQ: 多选题
label_single: 单行文字
label_mulit: 多行文字

View File

@ -61,6 +61,7 @@ RedmineApp::Application.routes.draw do
resources :poll do
member do
get 'statistics_result'
get 'add_mc'
end
end