questions_and_answers_update.blade.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
  5. <link rel="stylesheet"
  6. href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css">
  7. @endsection
  8. @section('content')
  9. <body class="gray-bg">
  10. <div class="wrapper wrapper-content animated fadeInRight">
  11. <div class="row">
  12. <div class="col-sm-12">
  13. <div class="ibox float-e-margins">
  14. <div class="ibox-content">
  15. <form method="get" class="form-horizontal" id="form">
  16. <div class="form-group">
  17. <label class="col-sm-2 control-label" for="nickname"><span
  18. class="red">* </span>问题:</label>
  19. <div class="col-sm-6">
  20. <input type="text" class="form-control" id="title" name="title" autocomplete="off"
  21. value="{{$info->title??''}}">
  22. </div>
  23. </div>
  24. {{-- <div class="form-group">
  25. <label class="col-sm-2 control-label" for="username_new"><span class="red">* </span>
  26. 内容:</label>
  27. <div class="col-sm-6">
  28. <input type="text" class="form-control" id="content" name="content"
  29. value="{{$info->content??''}}" autocomplete="off">
  30. </div>
  31. </div>--}}
  32. <div class="form-group">
  33. <label class="col-sm-2 control-label" for="translate_content">回答:</label>
  34. <div class="col-sm-8">
  35. <script id="translate_content" name="content"
  36. type="text/plain">{!! $info->content??''!!}</script>
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <div class="col-sm-4 col-sm-offset-2">
  41. <button class="btn btn-primary" type="button" data-id="{{$info->id??0}}"
  42. id="save">
  43. 保存
  44. </button>
  45. <button class="btn btn-white" type="button" id="cancel">取消</button>
  46. </div>
  47. </div>
  48. </form>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </body>
  55. @endsection
  56. @section('footer')
  57. @include('vendor.ueditor.assets')
  58. <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
  59. <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js"></script>
  60. <script>
  61. var ue = UE.getEditor('content');
  62. ue.ready(function () {
  63. ue.setHeight(300);
  64. });
  65. var ueTranslate = UE.getEditor('translate_content');
  66. ueTranslate.ready(function () {
  67. ueTranslate.setHeight(300);
  68. });
  69. $(document).on('click', '#cancel', function () {
  70. tips.closeParentLayer();
  71. });
  72. $(document).on('click', '#save', function () {
  73. var data = tips.getFormValues('#form');
  74. var id = $(this).data('id');
  75. var url = '/admin/classroom/questions-and-answers-update/' + id;
  76. var type = 'get';
  77. var ajaxConfig = {
  78. url: url,
  79. type: type,
  80. data: data,
  81. success: function (result) {
  82. layer.msg(result.message, {icon: 6, time: 1500}, function () {
  83. tips.closeParentLayer();
  84. window.parent.tips.tableRefresh('#table');
  85. });
  86. }
  87. };
  88. tips.ajax(ajaxConfig);
  89. });
  90. </script>
  91. @endsection