Code cleanup.

This commit is contained in:
James Cole
2015-07-26 15:51:07 +02:00
parent 0e2419d61a
commit 17a8c4918c
30 changed files with 176 additions and 172 deletions

View File

@@ -6,7 +6,6 @@ use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
use Preferences;
use Session;
use View;
/**

View File

@@ -1,5 +1,6 @@
<?php namespace FireflyIII\Http\Controllers;
use Artisan;
use Auth;
use Carbon\Carbon;
use Config;
@@ -11,7 +12,7 @@ use Preferences;
use Route;
use Session;
use Steam;
use Artisan;
/**
* Class HomeController
*

View File

@@ -193,7 +193,6 @@ Route::group(
Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']);
/**
* Attachment Controller
*/

View File

@@ -12,6 +12,21 @@ use FireflyIII\Models\Attachment;
class AttachmentRepository implements AttachmentRepositoryInterface
{
/**
* @param Attachment $attachment
*
* @return bool
*/
public function destroy(Attachment $attachment)
{
/** @var \FireflyIII\Helpers\Attachments\AttachmentHelperInterface $helper */
$helper = app('FireflyIII\Helpers\Attachments\AttachmentHelperInterface');
$file = $helper->getAttachmentLocation($attachment);
unlink($file);
$attachment->delete();
}
/**
* @param Attachment $attachment
* @param array $data
@@ -29,19 +44,4 @@ class AttachmentRepository implements AttachmentRepositoryInterface
return $attachment;
}
/**
* @param Attachment $attachment
*
* @return bool
*/
public function destroy(Attachment $attachment)
{
/** @var \FireflyIII\Helpers\Attachments\AttachmentHelperInterface $helper */
$helper = app('FireflyIII\Helpers\Attachments\AttachmentHelperInterface');
$file = $helper->getAttachmentLocation($attachment);
unlink($file);
$attachment->delete();
}
}

View File

@@ -12,6 +12,13 @@ use FireflyIII\Models\Attachment;
interface AttachmentRepositoryInterface
{
/**
* @param Attachment $attachment
*
* @return bool
*/
public function destroy(Attachment $attachment);
/**
* @param Attachment $attachment
* @param array $attachmentData
@@ -19,12 +26,5 @@ interface AttachmentRepositoryInterface
* @return Attachment
*/
public function update(Attachment $attachment, array $attachmentData);
/**
* @param Attachment $attachment
*
* @return bool
*/
public function destroy(Attachment $attachment);
}

View File

@@ -8,6 +8,16 @@ use Illuminate\Database\Schema\Blueprint;
*/
class ChangesForV349 extends Migration
{
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
/**
* Run the migrations.
*
@@ -22,14 +32,4 @@ class ChangesForV349 extends Migration
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@@ -8,6 +8,17 @@ use Illuminate\Database\Schema\Blueprint;
*/
class ChangesForV3410 extends Migration
{
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('attachments');
}
/**
* Run the migrations.
*
@@ -42,16 +53,4 @@ class ChangesForV3410 extends Migration
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('attachments');
}
}

View File

@@ -30,9 +30,11 @@
{{ Lang.choice('form.also_delete_piggyBanks', account.piggyBanks|length, {count: account.piggyBanks|length}) }}
{% endif %}
</p>
<p class="text-success">
{{ 'save_transactions_by_moving'|_ }}
</p>
<p>
{{ Form.select('move_account_before_delete', accountList, null, {class: 'form-control'}) }}
</p>

View File

@@ -55,6 +55,5 @@
</div>
</form>
{% endblock %}

View File

@@ -54,6 +54,7 @@
}
}
</script>
</body>

View File

@@ -1,12 +1,14 @@
<div class="popover" role="tooltip">
<div class="arrow"></div>
<h3 class="popover-title"></h3>
<div class="popover-content"></div>
<div class="popover-navigation">
<div class="btn-group">
<button class="btn btn-sm btn-default" data-role="prev">&laquo; {{ 'prev'|_ }}</button>
<button class="btn btn-sm btn-default" data-role="next">{{ 'prev'|_ }} &raquo;</button>
<button class="btn btn-sm btn-default" data-role="pause-resume" data-pause-text="{{ 'pause'|_ }}" data-resume-text="Resume"> {{ 'pause'|_ }}</button>
<button class="btn btn-sm btn-default" data-role="pause-resume" data-pause-text="{{ 'pause'|_ }}"
data-resume-text="Resume"> {{ 'pause'|_ }}</button>
</div>
<button class="btn btn-sm btn-default" data-role="end">{{ 'end-tour'|_ }}</button>
</div>

View File

@@ -53,7 +53,8 @@
<td>
<a href="{{ route('transactions.show',journal.id) }}" title="{{ journal.description }}">{{ journal.description }}</a>
{% if journal.attachments|length > 0 %}
<i class="fa fa-paperclip pull-right" title="{{ Lang.choice('firefly.nr_of_attachments', journal.attachments|length, {count: journal.attachments|length}) }}"></i>
<i class="fa fa-paperclip pull-right"
title="{{ Lang.choice('firefly.nr_of_attachments', journal.attachments|length, {count: journal.attachments|length}) }}"></i>
{% endif %}
</td>

View File

@@ -16,6 +16,7 @@
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.tag_areYouSure', {'tag': tag.tag}) }}
</p>