|
|
@@ -13,21 +13,26 @@
|
|
|
<div class="form-group">
|
|
|
<label for="title">Titolo:</label>
|
|
|
<span id="chars">{{ isset($news) ? 100 - strlen($news->title) : 100 }} caratteri rimanenti</span>
|
|
|
- <input type="text" name="title" id="title" class="form-control title" maxlength="100" value="{{ old('title', $news->title ?? '') }}">
|
|
|
+ <input type="text" name="title" id="title" class="form-control title" maxlength="100"
|
|
|
+ value="{{ old('title', $news->title ?? '') }}">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-4">
|
|
|
<div class="form-group">
|
|
|
<label for="title_region_1">Titolo regione 1:</label>
|
|
|
- <span id="chars_region_1">{{ isset($news) ? 100 - strlen($news->title_region_1) : 100 }} caratteri rimanenti</span>
|
|
|
- <input type="text" name="title_region_1" id="title_region_1" class="form-control title_region_1" maxlength="100" value="{{ old('title_region_1', $news->title_region_1 ?? '') }}">
|
|
|
+ <span id="chars_region_1">{{ isset($news) ? 100 - strlen($news->title_region_1) : 100 }} caratteri
|
|
|
+ rimanenti</span>
|
|
|
+ <input type="text" name="title_region_1" id="title_region_1" class="form-control title_region_1"
|
|
|
+ maxlength="100" value="{{ old('title_region_1', $news->title_region_1 ?? '') }}">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-4">
|
|
|
<div class="form-group">
|
|
|
<label for="title_region_2">Titolo regione 2:</label>
|
|
|
- <span id="chars_region_2">{{ isset($news) ? 100 - strlen($news->title_region_2) : 100 }} caratteri rimanenti</span>
|
|
|
- <input type="text" name="title_region_2" id="title_region_2" class="form-control title_region_2" maxlength="100" value="{{ old('title_region_2', $news->title_region_2 ?? '') }}">
|
|
|
+ <span id="chars_region_2">{{ isset($news) ? 100 - strlen($news->title_region_2) : 100 }} caratteri
|
|
|
+ rimanenti</span>
|
|
|
+ <input type="text" name="title_region_2" id="title_region_2" class="form-control title_region_2"
|
|
|
+ maxlength="100" value="{{ old('title_region_2', $news->title_region_2 ?? '') }}">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -94,7 +99,8 @@
|
|
|
<div class="row">
|
|
|
@if(isset($news))
|
|
|
@if(($news->section_id > 0 && $news->section_position != '') || (!$news->online && $news->section_id > 0))
|
|
|
- <div class="col-md-4" id="layout_section" style="display:{{ (isset($news) && $news->section_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
+ <div class="col-md-4" id="layout_section"
|
|
|
+ style="display:{{ (isset($news) && $news->section_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
</div>
|
|
|
@else
|
|
|
<div class="col-md-4">
|
|
|
@@ -102,12 +108,14 @@
|
|
|
</div>
|
|
|
@endif
|
|
|
@else
|
|
|
- <div class="col-md-4" id="layout_section" style="display:{{ (isset($news) && $news->section_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
+ <div class="col-md-4" id="layout_section"
|
|
|
+ style="display:{{ (isset($news) && $news->section_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
</div>
|
|
|
@endif
|
|
|
@if(isset($news))
|
|
|
@if(($news->region_1_id > 0 && $news->region_1_position != '') || (!$news->online && $news->region_1_id > 0))
|
|
|
- <div class="col-md-4" id="layout_region_1" style="display:{{ (isset($news) && $news->region_1_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
+ <div class="col-md-4" id="layout_region_1"
|
|
|
+ style="display:{{ (isset($news) && $news->region_1_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
</div>
|
|
|
@else
|
|
|
<div class="col-md-4">
|
|
|
@@ -115,12 +123,14 @@
|
|
|
</div>
|
|
|
@endif
|
|
|
@else
|
|
|
- <div class="col-md-4" id="layout_region_1" style="display:{{ (isset($news) && $news->region_1_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
+ <div class="col-md-4" id="layout_region_1"
|
|
|
+ style="display:{{ (isset($news) && $news->region_1_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
</div>
|
|
|
@endif
|
|
|
@if(isset($news))
|
|
|
@if(($news->region_2_id > 0 && $news->region_2_position != '') || (!$news->online && $news->region_2_id > 0))
|
|
|
- <div class="col-md-4" id="layout_region_2" style="display:{{ (isset($news) && $news->region_2_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
+ <div class="col-md-4" id="layout_region_2"
|
|
|
+ style="display:{{ (isset($news) && $news->region_2_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
</div>
|
|
|
@else
|
|
|
<div class="col-md-4">
|
|
|
@@ -128,7 +138,8 @@
|
|
|
</div>
|
|
|
@endif
|
|
|
@else
|
|
|
- <div class="col-md-4" id="layout_region_2" style="display:{{ (isset($news) && $news->region_2_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
+ <div class="col-md-4" id="layout_region_2"
|
|
|
+ style="display:{{ (isset($news) && $news->region_2_position != '') || !isset($news) ? 'block' : 'none' }}">
|
|
|
</div>
|
|
|
@endif
|
|
|
</div>
|
|
|
@@ -139,7 +150,8 @@
|
|
|
<select name="event_id" id="event_id" class="form-control">
|
|
|
<option value=""></option>
|
|
|
@foreach($events as $key => $value)
|
|
|
- <option value="{{ $key }}" {{ old('event_id', $news->event_id ?? '') == $key ? 'selected' : '' }}>{{ $value }}</option>
|
|
|
+ <option value="{{ $key }}" {{ old('event_id', $news->event_id ?? '') == $key ? 'selected' : '' }}>
|
|
|
+ {{ $value }}</option>
|
|
|
@endforeach
|
|
|
</select>
|
|
|
</div>
|
|
|
@@ -150,7 +162,8 @@
|
|
|
<select name="page_id" id="page_id" class="form-control">
|
|
|
<option value=""></option>
|
|
|
@foreach($pages as $key => $value)
|
|
|
- <option value="{{ $key }}" {{ old('page_id', $news->page_id ?? '') == $key ? 'selected' : '' }}>{{ $value }}</option>
|
|
|
+ <option value="{{ $key }}" {{ old('page_id', $news->page_id ?? '') == $key ? 'selected' : '' }}>
|
|
|
+ {{ $value }}</option>
|
|
|
@endforeach
|
|
|
</select>
|
|
|
</div>
|
|
|
@@ -160,13 +173,15 @@
|
|
|
<div class="col-md-6">
|
|
|
<div class="form-group">
|
|
|
<label for="text_short">Testo breve:</label>
|
|
|
- <input type="text" name="text_short" id="text_short" class="form-control" maxlength="100" value="{{ old('text_short', $news->text_short ?? '') }}">
|
|
|
+ <input type="text" name="text_short" id="text_short" class="form-control" maxlength="100"
|
|
|
+ value="{{ old('text_short', $news->text_short ?? '') }}">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-6">
|
|
|
<div class="form-group">
|
|
|
<label for="date">Data:</label>
|
|
|
- <input type="text" name="date" id="date" class="form-control" value="{{ old('date', isset($news) ? $news->date : date('d/m/Y H:i')) }}">
|
|
|
+ <input type="text" name="date" id="date" class="form-control"
|
|
|
+ value="{{ old('date', isset($news) ? $news->date : date('d/m/Y H:i')) }}">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -174,7 +189,8 @@
|
|
|
<div class="col-md-12">
|
|
|
<div class="form-group">
|
|
|
<label for="text">Testo:</label>
|
|
|
- <textarea name="text" id="text" rows="30" cols="100" class="form-control js-editor">{{ old('text', $news->text ?? '') }}</textarea>
|
|
|
+ <textarea name="text" id="text" rows="30" cols="100"
|
|
|
+ class="form-control js-editor">{{ old('text', $news->text ?? '') }}</textarea>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -274,7 +290,8 @@
|
|
|
<div class="row">
|
|
|
<div class="col-md-12">
|
|
|
<div class="form-group">
|
|
|
- <label for="no_social">Selezionando questo flag la news NON viene pubblicata su Facebook/Twitter ma solamente sul sito:</label><br>
|
|
|
+ <label for="no_social">Selezionando questo flag la news NON viene pubblicata su Facebook/Twitter ma
|
|
|
+ solamente sul sito:</label><br>
|
|
|
<input type="checkbox" name="no_social" id="no_social" value="on" {{ old('no_social', $news->no_social ?? '') == 'on' ? 'checked' : '' }}>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -282,7 +299,8 @@
|
|
|
</div>
|
|
|
<div class="box-footer">
|
|
|
@if(isset($news) && $news->user_id > 0 && $news->user_id != Auth::user()->id)
|
|
|
- <span style="color:red; font-weight:bold">ATTENZIONE : l'utente {{ $news->user->name }} sta modificando questa news</span><br><br>
|
|
|
+ <span style="color:red; font-weight:bold">ATTENZIONE : l'utente {{ $news->user->name }} sta modificando questa
|
|
|
+ news</span><br><br>
|
|
|
@endif
|
|
|
<button type="submit" class="btn btn-success saved" name="save" value="1">{{ $submit_text }}</button>
|
|
|
<button type="submit" class="btn btn-success saved" name="save_exit" value="1">Salva ed esci</button>
|
|
|
@@ -298,3 +316,46 @@
|
|
|
<a href="{{ route('news.index') }}" class="btn btn-info">Annulla</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+@section('extra_js')
|
|
|
+ <script>
|
|
|
+ $(document).ready(function () {
|
|
|
+ $('.js-editor').summernote({
|
|
|
+ height: 400,
|
|
|
+ lang: 'it-IT',
|
|
|
+ toolbar: [
|
|
|
+ ['style', ['style']],
|
|
|
+ ['font', ['bold', 'italic', 'underline', 'clear']],
|
|
|
+ ['fontname', ['fontname']],
|
|
|
+ ['fontsize', ['fontsize']],
|
|
|
+ ['color', ['color']],
|
|
|
+ ['para', ['ul', 'ol', 'paragraph']],
|
|
|
+ ['height', ['height']],
|
|
|
+ ['table', ['table']],
|
|
|
+ ['insert', ['link', 'picture', 'video']],
|
|
|
+ ['view', ['fullscreen', 'codeview', 'help']]
|
|
|
+ ],
|
|
|
+ callbacks: {
|
|
|
+ onImageUpload: function (files) {
|
|
|
+ console.log('Image upload:', files);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#title').on('input', function () {
|
|
|
+ var remaining = 100 - $(this).val().length;
|
|
|
+ $('#chars').text(remaining + ' caratteri rimanenti');
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#title_region_1').on('input', function () {
|
|
|
+ var remaining = 100 - $(this).val().length;
|
|
|
+ $('#chars_region_1').text(remaining + ' caratteri rimanenti');
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#title_region_2').on('input', function () {
|
|
|
+ var remaining = 100 - $(this).val().length;
|
|
|
+ $('#chars_region_2').text(remaining + ' caratteri rimanenti');
|
|
|
+ });
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+@endsection
|