create.blade.php 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. @extends('admin/public/layout')
  2. @section('title')
  3. 添加分类
  4. @endsection
  5. @section('content')
  6. <section class="content-header">
  7. <h1>
  8. 分类管理
  9. <small>添加分类</small>
  10. </h1>
  11. </section>
  12. <section class="content">
  13. <div class="row">
  14. <div class="col-xs-12">
  15. <div class="box box-default">
  16. <form role="form" name="addForm" method="POST" action="{{ route('admin.category.store') }}">
  17. <input type="hidden" name="_token" value="{{ csrf_token() }}">
  18. <input type="hidden" name="parent_id" value="{{ $parentCategory['id'] }}" />
  19. <div class="box-body">
  20. <div class="form-group @if($errors->has('name')) has-error @endif">
  21. <label>上级分类</label>
  22. <input type="text" name="name" class="form-control" disabled value="{{ $parentCategory['name'] }}">
  23. @if($errors->has('name')) <p class="help-block">{{ $errors->first('name') }}</p> @endif
  24. </div>
  25. <div class="form-group @if($errors->has('name')) has-error @endif">
  26. <label>分类名称</label>
  27. <input type="text" name="name" class="form-control " placeholder="分类名称" value="{{ old('name','') }}">
  28. @if($errors->has('name')) <p class="help-block">{{ $errors->first('name') }}</p> @endif
  29. </div>
  30. <div class="form-group @if($errors->has('slug')) has-error @endif">
  31. <label>分类标识</label>
  32. <span class="text-muted">(英文字母)</span>
  33. <input type="text" name="slug" class="form-control " placeholder="分类标识" value="{{ old('slug','') }}">
  34. @if($errors->has('slug')) <p class="help-block">{{ $errors->first('slug') }}</p> @endif
  35. </div>
  36. <div class="form-group">
  37. <label>栏目</label>
  38. <span class="text-muted">(允许显示的栏目)</span>
  39. <div class="checkbox">
  40. @foreach( config('tipask.category_types') as $key => $name )
  41. <input type="checkbox" name="types[]" value="{{ $key }}"> {{ $name }} &nbsp;&nbsp;
  42. @endforeach
  43. </div>
  44. </div>
  45. <div class="form-group @if($errors->has('sort')) has-error @endif">
  46. <label>排序</label>
  47. <span class="text-muted">(仅对当前层级分类有效)</span>
  48. <input type="text" name="sort" class="form-control " placeholder="排序" value="{{ old('sort',0) }}">
  49. @if($errors->has('sort')) <p class="help-block">{{ $errors->first('sort') }}</p> @endif
  50. </div>
  51. <div class="form-group">
  52. <label>状态</label>
  53. <span class="text-muted">(禁用后前台不会显示)</span>
  54. <div class="radio">
  55. <label>
  56. <input type="radio" name="status" value="1" checked /> 启用
  57. </label>&nbsp;&nbsp;
  58. <label>
  59. <input type="radio" name="status" value="0" /> 禁用
  60. </label>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="box-footer">
  65. <button type="submit" class="btn btn-primary">保存</button>
  66. </div>
  67. </form>
  68. </div>
  69. </div>
  70. </div>
  71. </section>
  72. @endsection
  73. @section('script')
  74. <script type="text/javascript">
  75. $(function(){
  76. set_active_menu('manage_content',"{{ route('admin.category.index') }}");
  77. });
  78. </script>
  79. @endsection