show.blade.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/fonts/font-awesome/css/all.min.css" rel="stylesheet">
  4. <link href="/assets/global/fonts/material-design/material-design.min.css" rel="stylesheet">
  5. <style>
  6. ol > li {
  7. margin-bottom: 8px;
  8. }
  9. </style>
  10. @endsection
  11. @section('content')
  12. <div class="page-content container-fluid">
  13. <div class="row">
  14. <div class="col-md-10 offset-md-1">
  15. <div class="panel">
  16. <div class="panel-heading">
  17. <h3 class="panel-title">{{$article->title}} {!! $article->category ?'<sub class="ml-20">'.$article->category.'</sub>':'' !!}</h3>
  18. <div class="panel-actions"><code>{{$article->created_at}}</code></div>
  19. </div>
  20. <div class="panel-body pt-0 pb-60">
  21. <div style="padding: 10px;">{!! $article->content !!}</div>
  22. <div class="panel-footer text-right">
  23. <a href="{{route('admin.article.index')}}" class="btn btn-primary">返 回</a>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. @endsection
  31. @section('javascript')
  32. <script src="/assets/custom/clipboardjs/clipboard.min.js"></script>
  33. <script>
  34. const clipboard = new ClipboardJS('.mt-clipboard');
  35. function fetch(id) {
  36. if (!document.getElementById('article_B' + id).innerHTML) {
  37. $.ajax({
  38. method: 'GET',
  39. url: '{{route('article', '')}}/' + id,
  40. beforeSend: function() {
  41. $('#loading_article').show();
  42. },
  43. success: function(ret) {
  44. document.getElementById('article_B' + id).innerHTML = ret.content;
  45. },
  46. complete: function() {
  47. $('#loading_article').hide();
  48. },
  49. });
  50. }
  51. return false;
  52. }
  53. // 更换订阅地址
  54. function exchangeSubscribe() {
  55. swal.fire({
  56. title: '{{trans('common.warning')}}',
  57. text: '{{trans('user.subscribe.exchange_warning')}}',
  58. icon: 'warning',
  59. showCancelButton: true,
  60. cancelButtonText: '{{trans('common.close')}}',
  61. confirmButtonText: '{{trans('common.confirm')}}',
  62. }).then((result) => {
  63. if (result.value) {
  64. $.post('{{route('changeSub')}}', {_token: '{{csrf_token()}}'}, function(ret) {
  65. if (ret.status === 'success') {
  66. swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
  67. } else {
  68. swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
  69. }
  70. });
  71. }
  72. });
  73. }
  74. clipboard.on('success', function() {
  75. swal.fire({
  76. title: '{{trans('common.copy.success')}}',
  77. icon: 'success',
  78. timer: 1300,
  79. showConfirmButton: false,
  80. });
  81. });
  82. clipboard.on('error', function() {
  83. swal.fire({
  84. title: '{{trans('common.copy.failed')}}',
  85. icon: 'error',
  86. timer: 1500,
  87. showConfirmButton: false,
  88. });
  89. });
  90. </script>
  91. @endsection