Add checkbox to set note as private. When note is private then no one can see them from non local network.

This commit is contained in:
kplaczek
2018-09-19 20:04:35 +02:00
parent 31e65c4730
commit fcfc0bd58a
4 changed files with 31 additions and 19 deletions

View File

@@ -33,6 +33,11 @@
@if(isset($id))
<button class="ui delete button js-delete red" type="submit" name="delete">Usuń</button>
@endif
<div class="ui @if(isset($private) && $private == 1) checked @endif checkbox">
<input name="private" id="private" @if(isset($private) && $private == 1) checked="checked" @endif value="1" type="checkbox">
<label for="private">Prywatna notatka</label>
</div>
</form>

View File

@@ -50,22 +50,26 @@
<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>
@if($note->private != 1 || $_SERVER['REMOTE_ADDR'] == '192.168.0.1')
<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>
<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>
@endif
@endforeach
</div>
<h1 class="ui header">Szablony notatek</h1>