_form.blade.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {{ csrf_field() }}
  2. <div class="box box-primary">
  3. <div class="box-header with-border">
  4. <h3 class="box-title"></h3>
  5. </div>
  6. <div class="box-body">
  7. <div class="row">
  8. <div class="col-md-6">
  9. <div class="form-group">
  10. <label for="name">Nome:</label>
  11. <input type="text" name="name" class="form-control title" value="{{ old('name') }}">
  12. </div>
  13. </div>
  14. <div class="col-md-6">
  15. <div class="form-group">
  16. <label for="slug">Slug:</label>
  17. <input type="text" name="slug" class="form-control slug" value="{{ old('slug') }}">
  18. </div>
  19. </div>
  20. </div>
  21. <input name="layout" type="hidden" value="{{isset($section) ? $section->layout : ''}}" id="layout">
  22. @if(false)
  23. <div class="row">
  24. <div class="col-md-6">
  25. <div class="form-group">
  26. <label for="layout">Layout:</label>
  27. <br>
  28. @for($x=1;$x<=6;$x++)
  29. <div style="padding:10px;float:left;{{(isset($section) && $section->layout == 'layout_' . $x) ? 'background-color:red;' : ''}} " class="selImg" data-id="layout_{{$x}}">
  30. <img src="/images/layout_{{$x}}.png" style="width:150px;">
  31. </div>
  32. @endfor
  33. <input name="layout" type="hidden" value="{{isset($section) ? $section->layout : ''}}" id="layout">
  34. </div>
  35. </div>
  36. <div class="col-md-6">
  37. <div class="form-group">
  38. <label for="type">Tipologia:</label>
  39. {{-- TODO: Convert Form::select for type manually --}}
  40. <select name="type" class="form-control">
  41. {{-- Add options manually --}}
  42. </select>
  43. </div>
  44. </div>
  45. </div>
  46. @endif
  47. <input name="position" type="hidden" value="{{isset($section) ? $section->position : '0'}}">
  48. <div class="row">
  49. <div class="col-md-6">
  50. <div class="form-group">
  51. <label for="type">Tipologia:</label>
  52. {{-- TODO: Convert Form::select for type manually --}}
  53. <select name="type" class="form-control">
  54. {{-- Add options manually --}}
  55. </select>
  56. </div>
  57. </div>
  58. <div class="col-md-3">
  59. <div class="form-group">
  60. <label for="show_social">Mostra box Facebook:</label><br>
  61. <input type="checkbox" name="show_social" value="on" {{ old('show_social') ? 'checked' : '' }}>
  62. </div>
  63. </div>
  64. <div class="col-md-3">
  65. <div class="form-group">
  66. <label for="show_social_twitter">Mostra box Twitter:</label><br>
  67. <input type="checkbox" name="show_social_twitter" value="on" {{ old('show_social_twitter') ? 'checked' : '' }}>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="box-footer">
  73. @if(Auth::user()->only_read == false)
  74. <button type="submit" class="btn btn-success">{{ $submit_text }}</button>
  75. @endif
  76. {!! link_to_route('sections.index', 'Annulla', null, array('class' => 'btn btn-info')) !!}
  77. </div>
  78. </div>
  79. @section('extra_js')
  80. <script>
  81. $(function () {
  82. $(".title").keyup(function(){
  83. var Text = $(this).val();
  84. Text = Text.toLowerCase();
  85. Text = Text.replace(/[^a-zA-Z0-9]+/g,'-');
  86. $(".slug").val(Text);
  87. });
  88. $(".selImg").click(function(){
  89. $(".selImg").css("background-color", "white");
  90. $(this).css("background-color", "red");
  91. var id = $(this).attr("data-id");
  92. $("#layout").val(id);
  93. });
  94. });
  95. </script>
  96. @stop