mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-27 17:31:09 -06:00
View single reminder.
This commit is contained in:
parent
93996ada96
commit
081ff3ff55
@ -5,7 +5,6 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Reminders\ReminderHelperInterface;
|
||||
use FireflyIII\Http\Requests;
|
||||
use FireflyIII\Models\Reminder;
|
||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||
use Redirect;
|
||||
use URL;
|
||||
|
||||
@ -18,6 +17,19 @@ class ReminderController extends Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param Reminder $reminder
|
||||
*/
|
||||
public function dismiss(Reminder $reminder)
|
||||
{
|
||||
$reminder->notnow = true;
|
||||
$reminder->save();
|
||||
|
||||
return Redirect::to(URL::previous());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -26,11 +38,13 @@ class ReminderController extends Controller
|
||||
|
||||
$reminders = Auth::user()->reminders()->get();
|
||||
|
||||
$reminders->each(function(Reminder $reminder) use ($helper) {
|
||||
$reminder->description = $helper->getReminderText($reminder);
|
||||
});
|
||||
$reminders->each(
|
||||
function (Reminder $reminder) use ($helper) {
|
||||
$reminder->description = $helper->getReminderText($reminder);
|
||||
}
|
||||
);
|
||||
|
||||
$today = new Carbon;
|
||||
$today = new Carbon;
|
||||
// active reminders:
|
||||
$active = $reminders->filter(
|
||||
function (Reminder $reminder) use ($today) {
|
||||
@ -78,18 +92,18 @@ class ReminderController extends Controller
|
||||
*/
|
||||
public function show(Reminder $reminder)
|
||||
{
|
||||
$title = 'Reminder';
|
||||
$mainTitleIcon = 'fa-clock-o';
|
||||
if ($reminder->notnow === true) {
|
||||
$subTitle = 'Dismissed reminder';
|
||||
} else {
|
||||
$subTitle = 'Reminder';
|
||||
}
|
||||
$subTitle .= ' for piggy bank "' . $reminder->remindersable->name . '"';
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Reminder $reminder
|
||||
*/
|
||||
public function dismiss(Reminder $reminder)
|
||||
{
|
||||
$reminder->notnow = true;
|
||||
$reminder->save();
|
||||
return Redirect::to(URL::previous());
|
||||
return view('reminders.show', compact('reminder', 'title', 'subTitle', 'mainTitleIcon'));
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Models\Reminder;
|
||||
use FireflyIII\Models\LimitRepetition;
|
||||
use FireflyIII\Models\PiggyBank;
|
||||
|
||||
@ -239,8 +240,17 @@ Breadcrumbs::register(
|
||||
|
||||
// reminders
|
||||
Breadcrumbs::register(
|
||||
'reminders.show', function (Generator $breadcrumbs, Reminder $reminder) {
|
||||
'reminders.index', function (Generator $breadcrumbs) {
|
||||
$breadcrumbs->parent('home');
|
||||
$breadcrumbs->push('Reminders', route('reminders.index'));
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
// reminders
|
||||
Breadcrumbs::register(
|
||||
'reminders.show', function (Generator $breadcrumbs, Reminder $reminder) {
|
||||
$breadcrumbs->parent('reminders.index');
|
||||
$breadcrumbs->push('Reminder #' . $reminder->id, route('reminders.show', $reminder->id));
|
||||
|
||||
}
|
||||
|
@ -4,12 +4,14 @@
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<a href="{{route('reminders.show',$reminder->id)}}">
|
||||
@if($reminder->notnow === true)
|
||||
Dismissed reminder
|
||||
@else
|
||||
Reminder
|
||||
@endif
|
||||
for piggy bank "{{$reminder->remindersable->name}}"
|
||||
</a>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
|
38
resources/views/reminders/show.blade.php
Normal file
38
resources/views/reminders/show.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $reminder) !!}
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<a href="{{route('reminders.show',$reminder->id)}}">
|
||||
@if($reminder->notnow === true)
|
||||
Dismissed reminder
|
||||
@else
|
||||
Reminder
|
||||
@endif
|
||||
for piggy bank "{{$reminder->remindersable->name}}"
|
||||
</a>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
Active between {{$reminder->startdate->format('jS F Y')}}
|
||||
and {{$reminder->enddate->format('jS F Y')}}.
|
||||
</p>
|
||||
|
||||
@if(isset($reminder->description))
|
||||
<p>{!! $reminder->description !!}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<div class="btn-group">
|
||||
@if($reminder->active === true)
|
||||
<a class="btn btn-warning" href="{{route('reminders.dismiss',$reminder->id)}}">Dismiss</a>
|
||||
<a class="btn btn-success" href="#">Act</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
Loading…
Reference in New Issue
Block a user