time.blade.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. @extends('admin/public/layout')
  2. @section('title')时间设置@endsection
  3. @section('content')
  4. <section class="content-header">
  5. <h1>
  6. 时间设置
  7. <small>默认时区及时间格式设置</small>
  8. </h1>
  9. </section>
  10. <section class="content">
  11. <div class="row">
  12. <div class="col-xs-12">
  13. <div class="box box-primary">
  14. <form role="form" name="addForm" method="POST" action="{{ route('admin.setting.time') }}">
  15. <input type="hidden" name="_token" value="{{ csrf_token() }}">
  16. <div class="box-body">
  17. <div class="form-group">
  18. <label for="time_offset">默认时区</label>
  19. <select name="time_offset" class="form-control">
  20. @foreach($timeOffsets as $timeOffset=>$title )
  21. <option value="{{ $timeOffset }}" @if(Setting()->get('time_offset') == $timeOffset )) selected @endif>{{ $title }}</option>
  22. @endforeach
  23. </select>
  24. </div>
  25. <div class="form-group @if ($errors->has('time_diff')) has-error @endif">
  26. <label for="time_diff">本地时间与服务器的时间差</label>
  27. <span class="text-muted">(时间差(分钟),例如本地 8:00 服务器 8:10,则填写-10)</span>
  28. <input type="text" name="time_diff" class="form-control " placeholder="" value="{{ old('time_diff',Setting()->get('time_diff')) }}">
  29. @if ($errors->has('time_diff')) <p class="help-block">{{ $errors->first('time_diff') }}</p> @endif
  30. </div>
  31. <div class="form-group">
  32. <label for="date_format">日期格式</label>
  33. <select name="date_format" class="form-control">
  34. <option value="Y-n-j" @if(Setting()->get('date_format') == 'Y-n-j') selected @endif >{{ date("Y-n-j") }}(Y-n-j)</option>
  35. <option value="Y/m/d" @if(Setting()->get('date_format') == 'Y/m/d') selected @endif >{{ date("Y/m/d") }}(Y/m/d)</option>
  36. <option value="m/d/Y" @if(Setting()->get('date_format') == 'm/d/Y') selected @endif >{{ date("m/d/Y") }}(m/d/Y)</option>
  37. <option value="d/m/Y" @if(Setting()->get('date_format') == 'd/m/Y') selected @endif >{{ date("d/m/Y") }}(d/m/Y)</option>
  38. <option value="Y.m.d" @if(Setting()->get('date_format') == 'Y.m.d') selected @endif >{{ date("Y.m.d") }}(Y.m.d)</option>
  39. <option value="m.d.Y" @if(Setting()->get('date_format') == 'm.d.Y') selected @endif >{{ date("m.d.Y") }}(m.d.Y)</option>
  40. <option value="Y-m-d" @if(Setting()->get('date_format') == 'Y-m-d') selected @endif >{{ date("Y-m-d") }}(Y-m-d)</option>
  41. <option value="m-d-Y" @if(Setting()->get('date_format') == 'm-d-Y') selected @endif >{{ date("m-d-Y") }}(m-d-Y)</option>
  42. <option value="d-m-Y" @if(Setting()->get('date_format') == 'd-m-Y') selected @endif >{{ date("d-m-Y") }}(m-d-Y)</option>
  43. </select>
  44. </div>
  45. <div class="form-group">
  46. <label for="time_format">时间格式</label>
  47. <select name="time_format" class="form-control">
  48. <option value="H:i" @if(Setting()->get('time_format') == 'H:i') selected @endif >{{ date("H:i") }}(H:i)</option>
  49. <option value="H:i:s" @if(Setting()->get('time_format') == 'H:i:s') selected @endif >{{ date("H:i:s") }}(H:i:s)</option>
  50. <option value="g:i a" @if(Setting()->get('time_format') == 'g:i a') selected @endif >{{ date("g:i a") }}(g:i a)</option>
  51. <option value="g:i A" @if(Setting()->get('time_format') == 'g:i A') selected @endif >{{ date("g:i A") }}(g:i A)</option>
  52. </select>
  53. </div>
  54. <div class="form-group @if ($errors->has('time_friendly')) has-error @endif">
  55. <label for="time_friendly">人性化时间格式</label>
  56. <span class="text-muted">(开启之后,系统中的时间将显示以“n分钟前”、“昨天”、“n天前”等形式显示)</span>
  57. <div class="radio">
  58. <label><input type="radio" name="time_friendly" value="1" @if(Setting()->get('time_friendly')==1) checked @endif>是</label>&nbsp;&nbsp;&nbsp;&nbsp;
  59. <label><input type="radio" name="time_friendly" value="0" @if(Setting()->get('time_friendly')==0) checked @endif>否</label>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="box-footer">
  64. <button type="submit" class="btn btn-primary">保存</button>
  65. <button type="reset" class="btn btn-success">重置</button>
  66. </div>
  67. </form>
  68. </div>
  69. </div>
  70. </div>
  71. </section>
  72. @endsection
  73. @section('script')
  74. <script type="text/javascript">
  75. set_active_menu('global',"{{ route('admin.setting.time') }}");
  76. </script>
  77. @endsection