Clicking on icon next to note title will filter list to notes that has been assigned with clicked icon.
This commit is contained in:
@@ -136,6 +136,33 @@ class Main extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* get:/
|
||||
* @param Request $request
|
||||
* @param null $filter
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function filterView(Request $request, $filter = 'empty')
|
||||
{
|
||||
$notes = DB::select('SELECT *, CASE WHEN icon IS NULL
|
||||
THEN \'empty\'
|
||||
ELSE icon
|
||||
END AS new_icon FROM note WHERE type = "note" AND new_icon = :icon ORDER BY updated_at DESC', ['icon' => $filter]);
|
||||
$templates = DB::select('SELECT *, CASE WHEN icon IS NULL
|
||||
THEN \'empty\'
|
||||
ELSE icon
|
||||
END AS new_icon FROM note WHERE type = "template" AND new_icon = :icon ORDER BY updated_at DESC', ['icon' => $filter]);
|
||||
return view('list', [
|
||||
'filter' => $filter,
|
||||
'notes' => $notes,
|
||||
'templates' => $templates,
|
||||
'title' => $request->old('title'),
|
||||
'text' => $request->old('text'),
|
||||
'icon_selected' => $request->old('icon'),
|
||||
'icons' => $this->paper->getIcons()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* post::/print/{id}
|
||||
* @param Request $request
|
||||
|
||||
Reference in New Issue
Block a user