平台的用户反馈增加“问题页面网址”输入入口,且必填

dev_haigong
cxt 6 years ago
parent e1fc755f49
commit 4eeb6f1fcc

@ -141,6 +141,7 @@ class AccountController < ApplicationController
@resubmit = "#{code}"
@agreement = Help.first
@cooperation = Cooperation.all
@url = params[:url]
@com_coop_img = CooImg.where(:img_type => 'com_coop').order("position asc")
@edu_coop_img = CooImg.where(:img_type => 'edu_coop').order("position asc")
@ -208,7 +209,7 @@ class AccountController < ApplicationController
end
def insert_suggest
content = "<p>[#{params[:question_kind]}]</p>" + params[:description]
content = "<p>[#{params[:question_kind]}]</p>" + "<p>问题页面网址:#{params[:url]}</p>" + params[:description]
PrivateMessage.create(:user_id => User.current.id, :target_id => 1, :sender_id => User.current.id, :receiver_id => 1, :content => content, :send_time => Time.now, :status => 1)
PrivateMessage.create(:user_id => 1, :target_id => User.current.id, :sender_id => User.current.id, :receiver_id => 1, :content => content, :send_time => Time.now, :status => 0)
redirect_to message_detail_user_path(User.current, :user_id => 1)

@ -1,6 +1,6 @@
<%= stylesheet_link_tag 'css/public','css/common'%>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<div xmlns="http://www.w3.org/1999/html">
<div class="edu-back-white ml15 pt20 pb20 clearfix pl30 pr30 mb30">
@ -15,79 +15,94 @@
<div class="color-orange mt15 mb15">
<span class="mr5">*</span>
<a href="https://trustie.educoder.net/help?index=5" class="color-orange">看看帮助中心是否有你想要的答案</a></div>
<%= form_for('new_form',:url => insert_suggest_path(), :html =>{:id => "insert_suggest"}, :method => :post) do |f| %>
<div class="mt10">
<span class="mr5 color-orange font-16">*</span><span class="font-16">问题分类</span>
<div class="font-14 mt10 mb10 ml20 color-dark-grey">
<label class="mr40">
<input type="radio" value="登录注册" class="mr5 magic-radio" name="question_kind" id ="type_1" checked>
<label for="type_1" style="display: inline-block">登录注册</label>
</label>
<label class="mr40">
<input type="radio" value="信息认证" class="mr5 magic-radio" name="question_kind" id ="type_2">
<label for="type_2" style="display: inline-block">信息认证</label>
</label>
<label class="mr40">
<input type="radio" value="实训编程" class="mr5 magic-radio" name="question_kind" id ="type_3">
<label for="type_3" style="display: inline-block">实训编程</label>
</label>
<label class="mr40">
<input type="radio" value="实训课程" class="mr5 magic-radio" name="question_kind" id ="type_4">
<label for="type_4" style="display: inline-block">实训课程</label>
</label>
<label class="mr40">
<input type="radio" value="课堂" class="mr5 magic-radio" name="question_kind" id ="type_5">
<label for="type_5" style="display: inline-block">课堂</label>
</label>
<label class="mr40">
<input type="radio" value="其他" class="mr5 magic-radio" name="question_kind" id ="type_6">
<label for="type_6" style="display: inline-block">其他</label>
</label>
</div>
</div>
<div class="clearfix mt10">
<span class="mr5 color-orange font-16">*</span><span class="font-16">问题描述</span>
<div class="font-14 mt10 ml20 clearfix">
<!--<div id="hidden_div_block_1">
<%= form_for('new_form',:url => insert_suggest_path(), :html =>{:id => "insert_suggest"}, :method => :post) do |f| %>
<div class="mt10">
<span class="mr5 color-orange font-16">*</span><span class="font-16">问题分类</span>
<div class="font-14 mt10 mb10 ml20 color-dark-grey">
<label class="mr40">
<input type="radio" value="登录注册" class="mr5 magic-radio" name="question_kind" id ="type_1" checked>
<label for="type_1" style="display: inline-block">登录注册</label>
</label>
<label class="mr40">
<input type="radio" value="信息认证" class="mr5 magic-radio" name="question_kind" id ="type_2">
<label for="type_2" style="display: inline-block">信息认证</label>
</label>
<label class="mr40">
<input type="radio" value="实训编程" class="mr5 magic-radio" name="question_kind" id ="type_3">
<label for="type_3" style="display: inline-block">实训编程</label>
</label>
<label class="mr40">
<input type="radio" value="实训课程" class="mr5 magic-radio" name="question_kind" id ="type_4">
<label for="type_4" style="display: inline-block">实训课程</label>
</label>
<label class="mr40">
<input type="radio" value="课堂" class="mr5 magic-radio" name="question_kind" id ="type_5">
<label for="type_5" style="display: inline-block">课堂</label>
</label>
<label class="mr40">
<input type="radio" value="其他" class="mr5 magic-radio" name="question_kind" id ="type_6">
<label for="type_6" style="display: inline-block">其他</label>
</label>
</div>
</div>
<div class="clearfix mt10">
<span class="mr5 color-orange font-16">*</span><span class="font-16">问题页面网址</span>
<div class="font-14 mt10 ml20 clearfix">
<input type="text" class="width100 radius4" id="url_content" name ="url" value="<%= @url %>" style="height: 40px;" placeholder="反馈平台问题,请同时填写对应的问题页面链接,以便平台能够及时跟踪解决,谢谢">
</div>
<p class="color-orange ml20 mt5 undis" id="new_memo_url_notice"><i class="fa fa-exclamation-circle mr5"></i>网址不能为空</p>
</div>
<div class="clearfix mt10">
<span class="mr5 color-orange font-16">*</span><span class="font-16">问题描述</span>
<div class="font-14 mt10 ml20 clearfix">
<!--<div id="hidden_div_block_1">
<textarea style="display: none" id="hidden_textarea_1" name ="description"></textarea>
</div>
<%#= hidden_field_tag :asset_id, params[:asset_id],:required => false,:style => 'display:none' %>-->
<textarea class="width100 radius4" id="description" name ="description" style="height: 150px;" placeholder="反馈平台问题,请同时填写对应的问题页面链接,以便平台能够及时跟踪解决,谢谢"></textarea>
</div>
<p class="color-orange ml20 mt5 undis" id="new_memo_content_notice"><i class="fa fa-exclamation-circle mr5"></i>内容不能为空</p>
<!--<div class="mt10">-->
<!--<span class="font-16 ml20">联系方式</span>-->
<!--<div class="font-14 mt10 mb10 ml20 color-dark-grey">-->
<!--<input type="phone" class="font-14 pl10" style="width:89%;height: 40px" placeholder="请留下您的联系方式" name = 'phone'/>-->
<!--</div>-->
<!--</div>-->
<a href="javascript:void(0);" class="defalutSubmitbtn fl ml20 mt10" onclick="insert_suggest()">提交</a>
<% end %>
<textarea class="width100 radius4" id="description" name ="description" style="height: 150px;" placeholder="反馈平台问题,请同时填写对应的问题页面链接,以便平台能够及时跟踪解决,谢谢"></textarea>
</div>
<p class="color-orange ml20 mt5 undis" id="new_memo_content_notice"><i class="fa fa-exclamation-circle mr5"></i>内容不能为空</p>
<!--<div class="mt10">-->
<!--<span class="font-16 ml20">联系方式</span>-->
<!--<div class="font-14 mt10 mb10 ml20 color-dark-grey">-->
<!--<input type="phone" class="font-14 pl10" style="width:89%;height: 40px" placeholder="请留下您的联系方式" name = 'phone'/>-->
<!--</div>-->
<!--</div>-->
<a href="javascript:void(0);" class="defalutSubmitbtn fl ml20 mt10" onclick="insert_suggest()">提交</a>
</div>
<% end %>
</div>
</div>
</div>
<script>
/*sd_create_editor_from_data(1,null,"100%", "Issue");*/
//var suggest_ke;
/*KindEditor.ready(function(K){
$("#hidden_div_block_1").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.placeholder = "请填写具体内容,帮助我们了解您的建议与意见";
params.textarea = $("textarea[name='description']",params.div_form);
params.height = 300;
if(params.textarea.data('init') == undefined) {
memo_content_editor = init_exercise_quetison_editor(params);
//suggest_ke = memo_content_editor;
//new_quetion_editor = params.editor;
params.textarea.data('init', 1);
//params.editor.
}
});
});*/
/*KindEditor.ready(function(K){
$("#hidden_div_block_1").each(function(){
var params = {};
params.kindutil = K;
params.div_form = $(this);
params.placeholder = "请填写具体内容,帮助我们了解您的建议与意见";
params.textarea = $("textarea[name='description']",params.div_form);
params.height = 300;
if(params.textarea.data('init') == undefined) {
memo_content_editor = init_exercise_quetison_editor(params);
//suggest_ke = memo_content_editor;
//new_quetion_editor = params.editor;
params.textarea.data('init', 1);
//params.editor.
}
});
});*/
function regexContent() {
if($("#url_content").val()==""){
$("#new_memo_url_notice").show();
return false;
}
else {
$("#new_memo_url_notice").hide();
}
// KE输入框类被添加了元素导致isEmpty方法失效
if($("#description").val()==""){
$("#new_memo_content_notice").show();

@ -27,7 +27,7 @@
<script>
$.ajax({
url:'<%= help_path() %>',
data: {index: '<%= @index %>'},
data: {index: '<%= @index %>', url: '<%= @url %>'},
type: 'post',
dataType: 'script'
})

@ -6,7 +6,7 @@
</div>
<div class="feedback" tooltips="意见反馈">
<a target="_blank" class="color_white inline" href="<%= help_path(:index => 6) %>">
<a target="_blank" class="color_white inline" href="<%= help_path(:index => 6, :url => request.url) %>">
<i class="iconfont icon-yijianfankui color-white font-22 fl"></i>
</a>
</div>

Loading…
Cancel
Save