show.blade.php 4.3 KB

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