Commit 050946c3c3588d4c20b7d4d617614611dcbdff8a

Authored by Hayk Nazaryan
1 parent 6408200e47
Exists in master

news - details/list modifications

Showing 3 changed files with 9 additions and 27 deletions Side-by-side Diff

app/Http/Controllers/MainController.php
... ... @@ -399,13 +399,16 @@ class MainController extends Controller
399 399 $sort = $request->get('sort');
400 400 switch ($sort) {
401 401 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break;
402   - case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break;
403   - case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
404   - case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
405   - case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
406   - default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
  402 + case 'name_down': $Query = $Query->orderByDesc('title')->orderByDesc('id'); break;
  403 + case 'created_at_up': $Query = $Query->orderBy('created_at')->orderBy('id'); break;
  404 + case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderByDesc('id'); break;
  405 + default: $Query = $Query->orderByDesc('created_at')->orderByDesc('id'); break;
407 406 }
  407 + } else {
  408 + $Query = $Query->orderByDesc('created_at')->orderByDesc('id');
408 409 }
  410 + } else {
  411 + $Query = $Query->orderByDesc('created_at')->orderByDesc('id');
409 412 }
410 413 $Query_count = $Query->count();
411 414 $Query = $Query->paginate(6);
resources/views/detail_new.blade.php
... ... @@ -61,9 +61,8 @@
61 61 @else
62 62 <img src="{{ asset(Storage::url($Query[0]->image)) }}" alt="{{ $title }}" class="thing__pic thing__pic_two">
63 63 @endif
64   - <time class="thing__date">{{ date('d.m.Y H:i:s', strtotime($Query[0]->created_at)) }}</time>
  64 + <time class="thing__date">{{ date('d.m.Y', strtotime($Query[0]->created_at)) }}</time>
65 65 <h1 class="thing__title">{{ $title }}</h1>
66   - <p class="thing__text">{!! mb_strimwidth($Query[0]->text, 0, 100, "...") !!}</p>
67 66 </div>
68 67 </div>
69 68 </section>
resources/views/news-list.blade.php
... ... @@ -100,15 +100,6 @@
100 100 </ul>
101 101 <h1 class="thing__title">Новости</h1>
102 102 <p class="thing__text">Информационные блоки и новости о компании и событиях в мире</p>
103   - <div class="search thing__search">
104   - <input type="search" id="search" name="search" class="input" placeholder="Введите наименование статьи" value="@if (!empty($_GET['search'])) {{ $_GET['search'] }} @endif">
105   - <button type="submit" class="button">Найти</button>
106   - <span>
107   - <svg>
108   - <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
109   - </svg>
110   - </span>
111   - </div>
112 103 </form>
113 104 </div>
114 105 </section>
... ... @@ -117,17 +108,6 @@
117 108 <div class="main__employers">
118 109 <div class="filters">
119 110 <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
120   - <div class="filters__body">
121   - <div class="select filters__select">
122   - <select class="js-select2" id="sort_ajax" name="sort_ajax">
123   - <option value="default">Сортировка (по умолчанию)</option>
124   - <option value="name_up">По имени (возрастание)</option>
125   - <option value="name_down">По имени (убывание)</option>
126   - <option value="created_at_up">По дате (возрастание)</option>
127   - <option value="created_at_down">По дате (убывание)</option>
128   - </select>
129   - </div>
130   - </div>
131 111 </div>
132 112 <div id="Main_Ajax" name="Main_Ajax">
133 113