notice.blade.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <body class="gray-bg">
  7. <div class="wrapper wrapper-content animated fadeInRight">
  8. <div class="row">
  9. <div class="col-sm-12">
  10. <div class="ibox float-e-margins">
  11. <div class="ibox-content">
  12. <form method="get" class="form-horizontal" id="form">
  13. <div class="form-group">
  14. <label class="col-sm-2 control-label" for="content">注意事项:</label>
  15. <div class="col-sm-8">
  16. <!-- 编辑器容器 -->
  17. <script id="content" name="content"
  18. type="text/plain">{!! $data->content??'' !!}</script>
  19. </div>
  20. </div>
  21. <div class="hr-line-dashed"></div>
  22. <div class="form-group">
  23. <div class="col-sm-4 col-sm-offset-2">
  24. <button class="btn btn-primary" type="button"
  25. onclick="units.save({{$data->id??0}})">
  26. 保存
  27. </button>
  28. </div>
  29. </div>
  30. </form>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </body>
  37. @endsection
  38. @section('footer')
  39. @include('vendor.ueditor.assets')
  40. <script src="{{asset('js/plugins/chosen/chosen.jquery.js')}}"></script>
  41. <script>
  42. var ue = UE.getEditor('content');
  43. ue.ready(function () {
  44. ue.setHeight(300);
  45. });
  46. var units = {
  47. save: function (id) {
  48. var data = tips.getFormValues('#form');
  49. var ajaxConfig = {
  50. url: '/admin/articles/notice',
  51. type: 'put',
  52. data: data,
  53. success: function (result) {
  54. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  55. });
  56. }
  57. };
  58. tips.ajax(ajaxConfig);
  59. }
  60. };
  61. </script>
  62. @endsection