show.blade.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. @extends('layouts.app')
  2. @section('title', $book->title ? $book->title : '实战教程')
  3. @section('content')
  4. <div class="ui centered grid container books-page stackable rm-link-color">
  5. <div class="fourteen wide column">
  6. <div class="ui segment">
  7. <div class="content extra-padding">
  8. <br><div class="book header">
  9. <div class="ui items">
  10. <div class="item">
  11. <div class="image">
  12. <img class="ui image image-shadow lazy" data-original="{{ assert_images($book->image['path']) }}">
  13. </div>
  14. <div class="content">
  15. <div class="header" style="width:100%">
  16. {{ $book->title }}
  17. </div>
  18. <div class="description">
  19. <div class="meta" style="line-height:24px">
  20. <a href="javascript:;">
  21. <i class="icon clock"></i> 更新于 <span title="{{ $book->updated_at }}">{{$book->updated_at}}</span>
  22. </a>
  23. </div>
  24. {{$book->excerpt}}
  25. </div>
  26. <div class="extra">
  27. <a class="ui button primary go-start-read" href="javascript:;"><i class="icon game"></i>开始阅读</a>
  28. @auth
  29. @if(Auth()->user()->hasRole('Founder'))
  30. <a class="ui button black" href="{{ route('course.sections.index', $book->id) }}">
  31. 管理章节
  32. </a>
  33. <a class="ui button black" href="{{ route('course.articles.create', $book->id) }}">
  34. 新建教程文章
  35. </a>
  36. @endif
  37. @endauth
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="ui attached tabular menu" id="topics">
  44. <a class="item active" href="javascript:;">
  45. <i class="grey content icon"></i>
  46. 文章列表
  47. </a>
  48. </div>
  49. <br>
  50. <ol class=" sorted_table tree " data-chapterid="0" data-filetype="chapter">
  51. @foreach($sections as $section)
  52. <li class="item" data-itemid="461" data-filetype="chapter" data-chapterid="461">
  53. <i class="blue folder icon"></i>
  54. {{ $section->title }}
  55. <ol data-chapterid="461" class="chapter-container">
  56. @foreach($section->articles as $article)
  57. <li class="item" data-itemid="2517" data-filetype="file" data-chapterid="461">
  58. <i class="grey file text outline icon"></i>
  59. <a href="{{ route('course.articles.show', [$book->id, $article->id]) }}" class="">
  60. {{ $article->title }}
  61. @if($article->policy == '0')
  62. <span class="ui left green basic label">免费</span>
  63. @elseif($article->policy == '2')
  64. <span class="ui left green basic label">限免</span>
  65. @endif
  66. </a>
  67. </li>
  68. @endforeach
  69. </ol>
  70. </li>
  71. @endforeach
  72. </ol>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. @endsection
  78. @section('script')
  79. {{-- 开始阅读 --}}
  80. <script type="text/javascript">
  81. $('.go-start-read').attr('href', $('ol.sorted_table a').eq(0).attr('href'))
  82. </script>
  83. @endsection