Merge branch 'issue-68' into 'develop'
fix published news - issue #68 See merge request ldc-web/projets/tregalette!18
This commit is contained in:
commit
879330c659
3 changed files with 15 additions and 10 deletions
|
|
@ -17,12 +17,17 @@ class NewsController extends Controller
|
|||
*/
|
||||
public function index(): \Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var \App\Models\StaticPage $staticPageModel */
|
||||
$staticPageModel = StaticPage::query()
|
||||
->where('type', StaticPageType::news)
|
||||
->firstOrFail();
|
||||
$rangeModelList = Range::query()->limit(3)->inRandomOrder()->get();
|
||||
|
||||
$newsModelList = News::query()->get();
|
||||
/** @var \App\Models\Range $rangeModelList */
|
||||
$rangeModelList = Range::query()->limit(3)->inRandomOrder()->get();
|
||||
|
||||
/** @var \App\Models\News $newsModelList */
|
||||
$newsModelList = News::query()->where('published', true)->orderby('publish_at', 'ASC')->get();
|
||||
|
||||
return view('fo.pages.news.index', compact(
|
||||
'staticPageModel',
|
||||
'newsModelList',
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<tbody>
|
||||
@foreach ($newsModels as $newsModel)
|
||||
<tr class="border-bottom list-item">
|
||||
<td class="text-center align-middle">{{ $newsModel->text }}</td>
|
||||
<td class="text-center align-middle">{!! clean(Str::limit($newsModel->text, 50)) !!}</td>
|
||||
<td class="text-center align-middle">
|
||||
<img src="{{ asset($newsModel->picture) }}" title="{{ $newsModel->picture_title }}" alt="{{ $newsModel->picture_alt }}"
|
||||
height="50px">
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use Illuminate\Support\Facades\Route;
|
|||
Route::prefix('bo')
|
||||
->name('bo.')
|
||||
->group(function () {
|
||||
// * Authenticable routes
|
||||
// * AUTHENTICABLE ROUTES
|
||||
Route::namespace('\App\Http\Controllers\Bo')
|
||||
->group(function () {
|
||||
Auth::routes(
|
||||
|
|
@ -37,7 +37,7 @@ Route::prefix('bo')
|
|||
Route::middleware(['admin-secure', 'auth:backend'])->group(function () {
|
||||
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
||||
|
||||
// * USERS.
|
||||
// * USERS
|
||||
Route::resource('users', UserController::class)->except('show');
|
||||
Route::patch('/users/{user}/change-published', [
|
||||
UserController::class, 'changePublished'
|
||||
|
|
@ -46,7 +46,7 @@ Route::prefix('bo')
|
|||
UserController::class, 'duplicate'
|
||||
])->name('users.duplicate');
|
||||
|
||||
// * StaticPages
|
||||
// * STATIC PAGES
|
||||
Route::resource('pages', StaticPageController::class)
|
||||
->names([
|
||||
'index' => 'static_pages.index',
|
||||
|
|
@ -57,7 +57,7 @@ Route::prefix('bo')
|
|||
->withoutMiddleware('htmlsanitize')
|
||||
->middleware(['htmlsanitize:content']);
|
||||
|
||||
// * PICTOS.
|
||||
// * PICTOS
|
||||
Route::resource('pictos', PictoController::class)->except('show');
|
||||
Route::patch('/pictos/{picto}/change-published', [
|
||||
PictoController::class, 'changePublished'
|
||||
|
|
@ -83,7 +83,7 @@ Route::prefix('bo')
|
|||
ProductController::class, 'duplicate'
|
||||
])->name('products.duplicate');
|
||||
|
||||
// * LOCAL_COMMITMENTS
|
||||
// * LOCAL COMMITMENTS
|
||||
Route::resource('localcommitments', LocalCommitmentController::class)->except('show')
|
||||
->parameters(['localcommitments' => 'local_commitment'])
|
||||
->withoutMiddleware('htmlsanitize')
|
||||
|
|
@ -145,10 +145,10 @@ Route::prefix('bo')
|
|||
->only(['edit', 'update']);
|
||||
|
||||
Route::middleware('can:isConceptor')->group(function () {
|
||||
// * ACTIVITY LOGS.
|
||||
// * ACTIVITY LOGS
|
||||
Route::resource('activity_logs', ActivityLogController::class)->only(['index', 'show']);
|
||||
});
|
||||
});
|
||||
// * Others routes
|
||||
// * OTHERS ROUTES
|
||||
Route::post('theme/set', [Controller::class, 'setTheme'])->name('theme.set');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue