show.blade.php 4.1 KB

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