show.blade.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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>
  37. function fetch(id) {
  38. const articleElement = document.getElementById(`article_B${id}`);
  39. if (!articleElement.innerHTML) {
  40. ajaxGet(jsRoute('{{ route('admin.article.show', 'PLACEHOLDER') }}', id), {}, {
  41. loadingSelector: "#loading_article",
  42. success: function(ret) {
  43. articleElement.innerHTML = ret.content;
  44. }
  45. });
  46. }
  47. return false;
  48. }
  49. // 更换订阅地址
  50. function exchangeSubscribe() {
  51. showConfirm({
  52. title: '{{ trans('common.warning') }}',
  53. html: `{!! trans('user.subscribe.exchange_warning') !!}`,
  54. icon: "warning",
  55. onConfirm: function() {
  56. ajaxPost('{{ route('changeSub') }}');
  57. }
  58. });
  59. }
  60. $(document).on('click', '.mt-clipboard', function(e) {
  61. e.preventDefault();
  62. copyToClipboard($(this).text());
  63. });
  64. </script>
  65. @endsection