_form.blade.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. {!! Form::label('name', 'Nome:') !!}
  11. {!! Form::text('name', null, array('class' => 'form-control title')) !!}
  12. </div>
  13. </div>
  14. <div class="col-md-6">
  15. <div class="form-group">
  16. {!! Form::label('slug', 'Slug:') !!}
  17. {!! Form::text('slug', null, array('class' => 'form-control 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. {!! Form::label('layout', 'Layout:') !!}
  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. {!! Form::label('type', 'Tipologia:') !!}
  39. {!! Form::select('type', ['section' => 'Nazionale', 'region' => 'Regionale'] , null, array('class' => 'form-control')) !!}
  40. </div>
  41. </div>
  42. </div>
  43. @endif
  44. <input name="position" type="hidden" value="{{isset($section) ? $section->position : '0'}}">
  45. <div class="row">
  46. <div class="col-md-6">
  47. <div class="form-group">
  48. {!! Form::label('type', 'Tipologia:') !!}
  49. {!! Form::select('type', ['section' => 'Nazionale', 'region' => 'Regionale'] , null, array('class' => 'form-control')) !!}
  50. </div>
  51. </div>
  52. <div class="col-md-3">
  53. <div class="form-group">
  54. {!! Form::label('show_social', 'Mostra box Facebook:') !!}<br>
  55. {!! Form::checkbox('show_social', 'on', null) !!}
  56. </div>
  57. </div>
  58. <div class="col-md-3">
  59. <div class="form-group">
  60. {!! Form::label('show_social_twitter', 'Mostra box Twitter:') !!}<br>
  61. {!! Form::checkbox('show_social_twitter', 'on', null) !!}
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="box-footer">
  67. @if(Auth::user()->only_read == false)
  68. {!! Form::submit($submit_text, ['class'=>'btn btn-success']) !!}
  69. @endif
  70. {!! link_to_route('sections.index', 'Annulla', null, array('class' => 'btn btn-info')) !!}
  71. </div>
  72. </div>
  73. @section('extra_js')
  74. <script>
  75. $(function () {
  76. $(".title").keyup(function(){
  77. var Text = $(this).val();
  78. Text = Text.toLowerCase();
  79. Text = Text.replace(/[^a-zA-Z0-9]+/g,'-');
  80. $(".slug").val(Text);
  81. });
  82. $(".selImg").click(function(){
  83. $(".selImg").css("background-color", "white");
  84. $(this).css("background-color", "red");
  85. var id = $(this).attr("data-id");
  86. $("#layout").val(id);
  87. });
  88. });
  89. </script>
  90. @stop