Merge branch 'issue-26' of krzysiej/paper-pi into master
This commit was merged in pull request #39.
This commit is contained in:
@@ -136,6 +136,33 @@ class Main extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* get:/filte/{$filter?}
|
||||
* @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
|
||||
|
||||
10
public/css/app.css
vendored
10
public/css/app.css
vendored
@@ -20,6 +20,14 @@ textarea.content {
|
||||
|
||||
}
|
||||
|
||||
.note-title {
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
h1.header span.icon.display-inline-block {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
form {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@@ -32,9 +40,11 @@ form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.flex.space-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.flex.header {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
@@ -47,22 +47,24 @@
|
||||
|
||||
</div>
|
||||
<div class="ui container">
|
||||
<h1 class="ui header">Lista notatek</h1>
|
||||
<h1 class="ui header"> @if(isset($filter)) <a href="/">Lista notatek</a> z ikonką <span
|
||||
class="icon {{ $filter }} display-inline-block"></span>@else Lista notatek @endif</h1>
|
||||
<div class="ui middle aligned divided list">
|
||||
@foreach($notes as $note)
|
||||
<div class="item">
|
||||
<div class="left floated content">
|
||||
<a href="/filter/{{ $note->icon }}" class="left floated"><span
|
||||
class="icon @if($note->icon){{ $note->icon }} @else empty @endif "
|
||||
title="{{ $note->icon }}"></span></a><a class="note-title"
|
||||
href="/edit/{{ $note->id }}/{{ $note->topic_slug?$note->topic_slug:str_limit($note->text, 30, '...') }}">{{ $note->topic?$note->topic:str_limit($note->text, 30, '...') }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="right floated content">
|
||||
<form method="post" action="/print/{{ $note->id }}">
|
||||
{{ csrf_field() }}
|
||||
<button type="primary" class="ui tiny button primary">Drukuj</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="content">
|
||||
<a href="/edit/{{ $note->id }}/{{ $note->topic_slug?$note->topic_slug:str_limit($note->text, 30, '...') }}"><span
|
||||
class="icon @if($note->icon){{ $note->icon }} @else empty @endif "
|
||||
title="{{ $note->icon }}"></span>{{ $note->topic?$note->topic:str_limit($note->text, 30, '...') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
Route::get('/', 'Main@listView')->name('list');
|
||||
Route::get('/filter/{icon?}', 'Main@filterView');
|
||||
Route::get('/settings', 'Settings@mainView')->name('settingsList');
|
||||
Route::post('/settings', 'Settings@save');
|
||||
//Route::post('/', 'Main@listView');
|
||||
|
||||
Reference in New Issue
Block a user