Merge pull request #1235 from batuhawk/master

File upload and review updated
This commit is contained in:
Batuhan Baş 2020-02-07 13:04:48 +03:00 committed by GitHub
commit 18b1e6e703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 106 additions and 155 deletions

View File

@ -2,38 +2,39 @@
$column_name = !empty($column_name) ? $column_name : 'attachment';
$options = !empty($options) ? $options : false;
@endphp
<div class="card mb-0">
<div class="card-body">
<div class="row align-items-center">
<div class="col-auto">
@if ($file->aggregate_type != 'image')
<i class="fas fa-file-image"></i>
@else
<a href="#" class="avatar">
<img src="{{ url('uploads/' . $file->id) }}" alt="{{ $file->basename }}">
</a>
@endif
</div>
<ul class="mailbox-attachments clearfix margin-top">
<li>
@if ($file->aggregate_type != 'image')
<span class="mailbox-attachment-icon">
<i class="fa fa-file-{{ $file->aggregate_type }}-o"></i>
</span>
@else
<span class="mailbox-attachment-icon has-img">
<img src="{{ url('uploads/' . $file->id) }}" alt="{{ $file->basename }}">
</span>
@endif
<div class="col ml--2 long-texts">
<h4 class="mb-0">
<span><i class="fas fa-paperclip"></i></span>
<span>{{ $file->basename }}</span>
</h4>
<div class="mailbox-attachment-info">
<a href="javascript:void();" class="mailbox-attachment-name">
<p class="mailbox-attachment-file-name">
<i class="fa fa-paperclip"></i> {{ $file->basename }}
</p>
</a>
<small>{{ $file->readableSize() }}</small>
</div>
<span class="mailbox-attachment-size">
{{ $file->readableSize() }}
@permission('delete-common-uploads')
<div class="col-auto">
@permission('delete-common-uploads')
{!! Form::open([
'id' => $column_name. '-' . $file->id,
'method' => 'DELETE',
'url' => [url('uploads/' . $file->id)],
'class' => 'd-inline'
]) !!}
<a href="javascript:void();" id="remove-{{ $column_name }}" class="btn btn-danger btn-xs pull-right mailbox-attachment-remove">
<i class="fa fa fa-times"></i>
<a href="javascript:void();" id="remove-{{ $column_name }}" type="button" class="btn btn-danger text-white header-button-top">
<i class="fas fa-times"></i>
</a>
@if ($options)
@ -42,12 +43,12 @@
<input type="hidden" name="value" value="{{ $file->id }}" />
@endif
{!! Form::close() !!}
@endpermission
@endpermission
<a href="{{ url('uploads/' . $file->id . '/download') }}" class="btn btn-info btn-xs pull-right mailbox-attachment-download">
<i class="fa fa-cloud-download"></i>
<a href="{{ url('uploads/' . $file->id . '/download') }}" type="button" class="btn btn-info text-white header-button-top">
<i class="fas fa-file-download"></i>
</a>
</span>
</div>
</div>
</li>
</ul>
</div>
</div>

View File

@ -1,54 +0,0 @@
@php
$column_name = !empty($column_name) ? $column_name : 'attachment';
$options = !empty($options) ? $options : false;
@endphp
<ul class="mailbox-attachments clearfix margin-top">
@foreach ($files as $file)
<li>
@if ($file->aggregate_type != 'image')
<span class="mailbox-attachment-icon">
<i class="fa fa-file-{{ $file->aggregate_type }}-o"></i>
</span>
@else
<span class="mailbox-attachment-icon has-img">
<img src="{{ url('uploads/' . $file->id) }}" alt="{{ $file->basename }}">
</span>
@endif
<div class="mailbox-attachment-info">
<a href="javascript:void();" class="mailbox-attachment-name">
<p class="mailbox-attachment-file-name">
<i class="fa fa-paperclip"></i> {{ $file->basename }}
</p>
</a>
<span class="mailbox-attachment-size">
{{ $file->readableSize() }}
@permission('delete-common-uploads')
{!! Form::open([
'id' => 'attachment-' . $file->id,
'method' => 'DELETE',
'url' => [url('uploads/' . $file->id)],
'class' => 'd-inline'
]) !!}
<a href="javascript:void();" id="remove-attachment" class="btn btn-danger btn-xs pull-right mailbox-attachment-remove">
<i class="fa fa fa-times"></i>
</a>
@if ($options)
<input type="hidden" name="page" value="{{ $options['page'] }}" />
<input type="hidden" name="key" value="{{ $options['key'] }}" />
<input type="hidden" name="value" value="{{ $file->id }}" />
@endif
{!! Form::close() !!}
@endpermission
<a href="{{ url('uploads/' . $file->id . '/download') }}" class="btn btn-info btn-xs pull-right mailbox-attachment-download">
<i class="fa fa-cloud-download"></i>
</a>
</span>
</div>
</li>
@endforeach
</ul>

View File

@ -72,17 +72,17 @@
</div>
@if ($payment->attachment)
<div class="card-footer pb-0">
<div class="card-footer">
<div class="row float-right">
<div class="col-md-12">
@if (1)
<div class="card w-50">
<div class="card mb-0">
<div class="card-body text-center">
<i class="far fa-file-pdf font-size-50"></i>
</div>
<div class="card-footer">
<div class="row align-items-center">
<div class="col-xs-6 col-md-6">
<div class="col-xs-6 col-sm-6">
<a class="btn btn-icon btn-white" type="button">
<span class="btn-inner--icon">
<i class="fas fa-paperclip"></i>
@ -91,8 +91,8 @@
</a>
</div>
<div class="col-xs-6 col-md-6">
<a class="btn btn-icon btn-white float-right" type="button">
<div class="col-xs-6 col-sm-6">
<a class="btn btn-icon btn-info float-right" type="button">
<span class="btn-inner--icon">
<i class="fas fa-file-download"></i>
{{ basename($payment->attachment) }}
@ -103,7 +103,7 @@
</div>
</div>
@else
<div class="card w-50">
<div class="card mb-0">
<div class="card-body text-center">
@if($payment->attachment)
<img src="public/img/invoice_templates/classic.png" alt="Attachment">
@ -123,7 +123,7 @@
</div>
<div class="col-xs-6 col-md-6">
<a class="btn btn-icon btn-white float-right" type="button">
<a class="btn btn-icon btn-info float-right" type="button">
<span class="btn-inner--icon">
<i class="fas fa-file-download"></i>
{{ basename($payment->attachment) }}

View File

@ -450,83 +450,87 @@
@stack('card_footer_start')
<div class="card-footer">
<div class="float-right">
@stack('button_edit_start')
@if(!$invoice->reconciled)
<a href="{{ route('invoices.edit', $invoice->id) }}" class="btn btn-info header-button-top">
<i class="fas fa-edit"></i>&nbsp; {{ trans('general.edit') }}
</a>
<div class="row align-items-center">
<div class="col-xs-12 col-sm-6">
@if($invoice->attachment)
@php $file = $invoice->attachment; @endphp
@include('partials.media.file')
@endif
@stack('button_edit_end')
</div>
@stack('button_print_start')
<a href="{{ route('invoices.print', $invoice->id) }}" target="_blank" class="btn btn-success header-button-top">
<i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }}
</a>
@stack('button_print_end')
<div class="col-xs-12 col-sm-6 text-right">
@stack('button_edit_start')
@if(!$invoice->reconciled)
<a href="{{ route('invoices.edit', $invoice->id) }}" class="btn btn-info header-button-top">
<i class="fas fa-edit"></i>&nbsp; {{ trans('general.edit') }}
</a>
@endif
@stack('button_edit_end')
@stack('button_share_start')
<a href="{{ $signed_url }}" target="_blank" class="btn btn-white header-button-top">
<i class="fa fa-share"></i>&nbsp; {{ trans('general.share') }}
</a>
@stack('button_share_end')
@stack('button_print_start')
<a href="{{ route('invoices.print', $invoice->id) }}" target="_blank" class="btn btn-success header-button-top">
<i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }}
</a>
@stack('button_print_end')
@stack('button_group_start')
<div class="dropup">
<button type="button" class="btn btn-primary header-button-top" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-chevron-up"></i>&nbsp; {{ trans('general.more_actions') }}</button>
<div class="dropdown-menu" role="menu">
@stack('button_pay_start')
@if($invoice->status != 'paid')
@stack('button_share_start')
<a href="{{ $signed_url }}" target="_blank" class="btn btn-white header-button-top">
<i class="fa fa-share"></i>&nbsp; {{ trans('general.share') }}
</a>
@stack('button_share_end')
@stack('button_group_start')
<div class="dropup">
<button type="button" class="btn btn-primary header-button-top" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-chevron-up"></i>&nbsp; {{ trans('general.more_actions') }}</button>
<div class="dropdown-menu" role="menu">
@stack('button_pay_start')
@if($invoice->status != 'paid')
@permission('update-sales-invoices')
<a class="dropdown-item" href="{{ route('invoices.paid', $invoice->id) }}">{{ trans('invoices.mark_paid') }}</a>
@endpermission
@if(empty($invoice->paid) || ($invoice->paid != $invoice->amount))
<button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('invoices.add_payment') }}</button>
@endif
<div class="dropdown-divider"></div>
@endif
@stack('button_pay_end')
@stack('button_sent_start')
@permission('update-sales-invoices')
<a class="dropdown-item" href="{{ route('invoices.paid', $invoice->id) }}">{{ trans('invoices.mark_paid') }}</a>
@if($invoice->status == 'draft')
<a class="dropdown-item" href="{{ route('invoices.sent', $invoice->id) }}">{{ trans('invoices.mark_sent') }}</a>
@else
<button type="button" class="dropdown-item" disabled="disabled"><span class="text-disabled">{{ trans('invoices.mark_sent') }}</span></button>
@endif
@endpermission
@stack('button_sent_end')
@if(empty($invoice->paid) || ($invoice->paid != $invoice->amount))
<button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('invoices.add_payment') }}</button>
@endif
<div class="dropdown-divider"></div>
@endif
@stack('button_pay_end')
@stack('button_sent_start')
@permission('update-sales-invoices')
@if($invoice->status == 'draft')
<a class="dropdown-item" href="{{ route('invoices.sent', $invoice->id) }}">{{ trans('invoices.mark_sent') }}</a>
@stack('button_email_start')
@if($invoice->contact_email)
<a class="dropdown-item" href="{{ route('invoices.email', $invoice->id) }}">{{ trans('invoices.send_mail') }}</a>
@else
<button type="button" class="dropdown-item" disabled="disabled"><span class="text-disabled">{{ trans('invoices.mark_sent') }}</span></button>
<button type="button" class="dropdown-item" disabled="disabled" data-toggle="tooltip" data-placement="right" title="{{ trans('invoices.messages.email_required') }}">
<span class="text-disabled">{{ trans('invoices.send_mail') }}</span>
</button>
@endif
@endpermission
@stack('button_sent_end')
@stack('button_email_end')
@stack('button_email_start')
@if($invoice->contact_email)
<a class="dropdown-item" href="{{ route('invoices.email', $invoice->id) }}">{{ trans('invoices.send_mail') }}</a>
@else
<button type="button" class="dropdown-item" disabled="disabled" data-toggle="tooltip" data-placement="right" title="{{ trans('invoices.messages.email_required') }}">
<span class="text-disabled">{{ trans('invoices.send_mail') }}</span>
</button>
@endif
@stack('button_email_end')
@stack('button_pdf_start')
<a class="dropdown-item" href="{{ route('invoices.pdf', $invoice->id) }}">{{ trans('invoices.download_pdf') }}</a>
@stack('button_pdf_end')
@stack('button_pdf_start')
<a class="dropdown-item" href="{{ route('invoices.pdf', $invoice->id) }}">{{ trans('invoices.download_pdf') }}</a>
@stack('button_pdf_end')
@stack('button_delete_start')
@permission('delete-sales-invoices')
@if(!$invoice->reconciled)
{!! Form::deleteLink($invoice, 'sales/invoices') !!}
@endif
@endpermission
@stack('button_delete_end')
@stack('button_delete_start')
@permission('delete-sales-invoices')
@if(!$invoice->reconciled)
{!! Form::deleteLink($invoice, 'sales/invoices') !!}
@endif
@endpermission
@stack('button_delete_end')
</div>
</div>
</div>
@stack('button_group_end')
@if($invoice->attachment)
@php $file = $invoice->attachment; @endphp
@include('partials.media.file')
@endif
@stack('button_group_end')
</div>
</div>
</div>
@stack('card_footer_end')