File tree Expand file tree Collapse file tree 4 files changed +43
-7
lines changed
Expand file tree Collapse file tree 4 files changed +43
-7
lines changed Original file line number Diff line number Diff line change @@ -189,17 +189,21 @@ public function getRemove($id)
189189 *
190190 * @return \Illuminate\Http\Response
191191 */
192- public function getUpcoming ()
192+ public function getUpcoming ($ mode = null )
193193 {
194194 $ perPage = Auth::user ()->options ['notes_per_page ' ];
195195
196- $ notes = Note::logged ()
196+ $ query = Note::logged ()
197197 ->where ('status ' , 0 )
198- ->whereNotNull ('expires_at ' )
199- ->orderBy ('expires_at ' , 'asc ' )
200- ->simplePaginate ($ perPage );
198+ ->whereNotNull ('expires_at ' );
201199
202- return View::make ('index ' , [
200+ if ($ mode == 'no-expired ' ) {
201+ $ query ->whereRaw ('expires_at > NOW() ' );
202+ }
203+
204+ $ notes = $ query ->orderBy ('expires_at ' , 'asc ' )->simplePaginate ($ perPage );
205+
206+ return View::make ('note.upcoming ' , [
203207 'notes ' => $ notes ,
204208 'title ' => trans ('note.upcoming.title ' ),
205209 ]);
Original file line number Diff line number Diff line change 4444
4545Route::get ('stats ' , ['as ' => 'stats ' , 'uses ' => 'StatisticsController@getIndex ' ]);
4646
47- Route::get ('upcoming ' , ['as ' => 'upcoming ' , 'uses ' => 'NoteController@getUpcoming ' ]);
47+ Route::get ('upcoming/{mode?} ' , ['as ' => 'upcoming ' , 'uses ' => 'NoteController@getUpcoming ' ]);
Original file line number Diff line number Diff line change 4444 ],
4545 'removed ' => 'Notatka została usunięta. ' ,
4646 'upcoming ' => [
47+ 'no-expired ' => 'Bez przekroczonych ' ,
4748 'title ' => 'Nadchodzące notatki ' ,
4849 ],
4950];
Original file line number Diff line number Diff line change 1+ @extends (' app' )
2+
3+ @section (' content' )
4+ <h2 >
5+ @lang (' note.upcoming.title' )
6+ <a href =" {!! route (' upcoming' , [' mode' => ' no-expired' ]) ! !}" class =" btn btn-default btn-sm" >
7+ @lang (' note.upcoming.no-expired' )
8+ </a >
9+ </h2 >
10+
11+ <div class =" jscroll-container" >
12+ @each (' note.single' , $notes , ' note' )
13+
14+ {!! $notes -> render () ! !}
15+ </div >
16+ @stop
17+
18+ @section (' footer' )
19+ <script >
20+ $ (' .pager' ).hide ();
21+ $ (' .jscroll-container' ).jscroll ({
22+ loadingHtml: ' <i class="fa fa-spinner fa-spin"></i>' ,
23+ padding: 10 ,
24+ nextSelector: ' .pager a[rel="next"]' ,
25+ contentSelector: ' .jscroll-container' ,
26+ callback : function () {
27+ $ (' .pager' ).hide ();
28+ }
29+ });
30+ </script >
31+ @stop
You can’t perform that action at this time.
0 commit comments