All code for reminders based on piggy banks. I hope.

This commit is contained in:
James Cole
2014-08-23 22:32:12 +02:00
parent d56c00915c
commit 6e17c805c2
28 changed files with 652 additions and 44 deletions

View File

@@ -10,13 +10,6 @@
<?php echo stylesheet_link_tag(); ?>
@yield('styles')
<!-- Bootstrap -->
<!--
<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/site.css" rel="stylesheet">
-->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
@@ -32,6 +25,17 @@
@include('partials.flashes')
@yield('content')
</div>
<div class="modal fade" id="reminderModal" tabindex="-1" role="dialog"
aria-labelledby="reminderModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<?php echo javascript_include_tag(); ?>
@yield('scripts')
</body>

View File

@@ -54,9 +54,13 @@ $r = Route::current()->getName();
</ul>
</li>
</ul>
<!--
<p style="cursor:pointer;" class="navbar-text"><span class="label label-danger">1 reminder</span> </p>
-->
@if(Session::get('reminderCount') == 1)
<p style="cursor:pointer;" id="reminderModalTrigger" class="navbar-text"><span class="label label-danger">1 reminder</span> </p>
@endif
@if(Session::get('reminderCount') > 1)
<p style="cursor:pointer;" id="reminderModalTrigger" class="navbar-text"><span class="label label-danger">{{Session::get('reminderCount')}}
reminders</span> </p>
@endif
@if(\Auth::user() && \Auth::check())
<ul class="nav navbar-nav navbar-right">

View File

@@ -68,8 +68,6 @@
@if($piggyBank->currentRelevantRep()->currentamount > 0)
<a data-toggle="modal" href="{{route('piggybanks.amount.remove',$piggyBank->id)}}" data-target="#modal" class="btn btn-default"><span class="glyphicon glyphicon-minus-sign"></span> Remove money</a>
@endif
<a href="{{route('piggybanks.edit',$piggyBank->id)}}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="{{route('piggybanks.delete',$piggyBank->id)}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
</div>
</td>
<td style="width:40%;">
@@ -80,7 +78,12 @@
@endif
</td>
<td></td>
<td>
<div class="btn-group btn-group-xs">
<a href="{{route('piggybanks.edit',$piggyBank->id)}}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="{{route('piggybanks.delete',$piggyBank->id)}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
</div>
</td>
</tr>
</table>
@endif
@@ -125,8 +128,7 @@
@if($repeated->currentRelevantRep()->currentamount > 0)
<a data-toggle="modal" href="{{route('piggybanks.amount.remove',$repeated->id)}}" data-target="#modal" class="btn btn-default"><span class="glyphicon glyphicon-minus-sign"></span> Remove money</a>
@endif
<a href="{{route('piggybanks.edit',$repeated->id)}}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="{{route('piggybanks.delete',$repeated->id)}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
</div>
</td>
<td style="width:40%;">
@@ -137,7 +139,12 @@
@endif
</td>
<td></td>
<td>
<div class="btn-group btn-group-xs">
<a href="{{route('piggybanks.edit',$repeated->id)}}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="{{route('piggybanks.delete',$repeated->id)}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
</div>
</td>
</tr>
</table>
@endif

View File

@@ -0,0 +1,24 @@
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal"><span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span></button>
<h4 class="modal-title">Reminders</h4>
</div>
<div class="modal-body">
<table class="table">
@foreach($reminders as $reminder)
<tr class="reminder-row-{{$reminder->id}}">
<td>{{$reminder->render()}}</td>
<td style="width:50%;">
<a href="#" data-id="{{$reminder->id}}" class="dismiss-24 btn btn-danger btn-sm">Postpone (24hrs)</a>
<a href="#" data-id="{{$reminder->id}}" class="dismiss-forever btn btn-danger btn-sm">Dismiss (forever)</a>
<a href="#" data-id="{{$reminder->id}}" class="do-it btn btn-success btn-sm">I want to do this</a>
</td>
</tr>
@endforeach
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>

View File

@@ -28,6 +28,7 @@
</div>
{{Form::open(['class' => 'form-horizontal','url' => route('transactions.store',$what)])}}
{{Form::hidden('reminder',Input::get('reminder_id'))}}
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-12">
@@ -37,7 +38,7 @@
<div class="form-group">
<label for="description" class="col-sm-4 control-label">Description</label>
<div class="col-sm-8">
<input type="text" name="description" value="{{{Input::old('description')}}}" autocomplete="off" class="form-control" placeholder="Description" />
<input type="text" name="description" value="{{{Input::old('description') ?: Input::get('description')}}}" autocomplete="off" class="form-control" placeholder="Description" />
@if($errors->has('description'))
<p class="text-danger">{{$errors->first('description')}}</p>
@endif
@@ -56,7 +57,7 @@
@endif
</label>
<div class="col-sm-8">
{{Form::select('account_id',$accounts,Input::old('account_id') ?: Input::get('account'),['class' => 'form-control'])}}
{{Form::select('account_id',$accounts,Input::old('account_id') ?: Input::get('account_id'),['class' => 'form-control'])}}
@if($errors->has('account_id'))
<p class="text-danger">{{$errors->first('account_id')}}</p>
@endif
@@ -91,7 +92,7 @@
<div class="form-group">
<label for="account_from_id" class="col-sm-4 control-label">Account from</label>
<div class="col-sm-8">
{{Form::select('account_from_id',$accounts,Input::old('account_from_id'),['class' => 'form-control'])}}
{{Form::select('account_from_id',$accounts,Input::old('account_from_id') ?: Input::get('account_from_id'),['class' => 'form-control'])}}
@if($errors->has('account_from_id'))
<p class="text-danger">{{$errors->first('account_from_id')}}</p>
@endif
@@ -101,7 +102,7 @@
<div class="form-group">
<label for="account_to_id" class="col-sm-4 control-label">Account to</label>
<div class="col-sm-8">
{{Form::select('account_to_id',$accounts,Input::old('account_to_id'),['class' => 'form-control'])}}
{{Form::select('account_to_id',$accounts,Input::old('account_to_id') ?: Input::get('account_to_id'),['class' => 'form-control'])}}
@if($errors->has('account_to_id'))
<p class="text-danger">{{$errors->first('account_to_id')}}</p>
@endif
@@ -123,7 +124,7 @@
@endif
</label>
<div class="col-sm-8">
<input type="number" name="amount" min="0.01" value="{{Input::old('amount')}}" step="any" class="form-control" />
<input type="number" name="amount" min="0.01" value="{{Input::old('amount') ?: Input::get('amount')}}" step="any" class="form-control" />
@if($errors->has('amount'))
<p class="text-danger">{{$errors->first('amount')}}</p>
@endif
@@ -185,7 +186,7 @@
<select name="piggybank_id" class="form-control">
<option value="0" label="(no piggy bank)">(no piggy bank)</option>
@foreach($piggies as $piggy)
@if($piggy->id == Input::old('piggybank_id'))
@if($piggy->id == Input::old('piggybank_id') || $piggy->id == Input::get('piggybank_id'))
<option value="{{$piggy->id}}" label="{{{$piggy->name}}}" selected="selected ">{{{$piggy->name}}}</option>
@else
<option value="{{$piggy->id}}" label="{{{$piggy->name}}}">{{{$piggy->name}}}</option>