Remove fallback support for dropzone

This commit is contained in:
Hillel Coren 2016-05-30 11:51:41 +03:00
parent 162c6d2ce6
commit 2f3c309d41
8 changed files with 87 additions and 150 deletions

View File

@ -158,26 +158,7 @@ class ExpenseRepository extends BaseRepository
} }
} }
} }
if(!empty($input['documents']) && Auth::user()->can('create', ENTITY_DOCUMENT)){
// Fallback upload
$doc_errors = array();
foreach($input['documents'] as $upload){
$result = $this->documentRepo->upload($upload);
if(is_string($result)){
$doc_errors[] = $result;
}
else{
$result->expense_id = $expense->id;
$result->save();
$document_ids[] = $result->public_id;
}
}
if(!empty($doc_errors)){
Session::flash('error', implode('<br>',array_map('htmlentities',$doc_errors)));
}
}
// prevent loading all of the documents if we don't have to // prevent loading all of the documents if we don't have to
if ( ! $expense->wasRecentlyCreated) { if ( ! $expense->wasRecentlyCreated) {
foreach ($expense->documents as $document){ foreach ($expense->documents as $document){

View File

@ -494,25 +494,6 @@ class InvoiceRepository extends BaseRepository
} }
} }
if(!empty($data['documents']) && Auth::user()->can('create', ENTITY_DOCUMENT)){
// Fallback upload
$doc_errors = array();
foreach($data['documents'] as $upload){
$result = $this->documentRepo->upload($upload);
if(is_string($result)){
$doc_errors[] = $result;
}
else{
$result->invoice_id = $invoice->id;
$result->save();
$document_ids[] = $result->public_id;
}
}
if(!empty($doc_errors)){
Session::flash('error', implode('<br>',array_map('htmlentities',$doc_errors)));
}
}
foreach ($invoice->documents as $document){ foreach ($invoice->documents as $document){
if(!in_array($document->public_id, $document_ids)){ if(!in_array($document->public_id, $document_ids)){
// Removed // Removed

File diff suppressed because one or more lines are too long

85
public/css/built.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

81
public/css/style.css vendored
View File

@ -101,7 +101,7 @@ border-bottom: 1px solid #dfe0e1;
table.dataTable.no-footer { table.dataTable.no-footer {
border-bottom: none; border-bottom: none;
} }
.table-striped>tbody>tr:nth-child(odd)>tr, .table-striped>tbody>tr:nth-child(odd)>tr,
.table-striped>tbody>tr:nth-child(odd)>th { .table-striped>tbody>tr:nth-child(odd)>th {
background-color: #FDFDFD; background-color: #FDFDFD;
} }
@ -192,7 +192,7 @@ opacity: 1;
filter: alpha(opacity=100); filter: alpha(opacity=100);
} }
/*buttons*/ /*buttons*/
.btn { font-weight: bold; .btn { font-weight: bold;
border-radius: 3px; border-radius: 3px;
padding: 9px 12px; padding: 9px 12px;
} }
@ -258,8 +258,8 @@ border-color: #0b4d78;
} }
.form-actions .btn, .form-actions .btn,
.form-actions div.btn-group { .form-actions div.btn-group {
margin-left: 10px; margin-left: 10px;
} }
.form-actions .btn.btn-success:first-child { .form-actions .btn.btn-success:first-child {
@ -377,7 +377,7 @@ border: none;
border-radius: 0; border-radius: 0;
color: #fff; color: #fff;
background-color: #9b9b9b; background-color: #9b9b9b;
} }
.nav-tabs.nav-justified>li:first-child>a { .nav-tabs.nav-justified>li:first-child>a {
border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px;
@ -406,7 +406,7 @@ font-weight: bold;
ul.dropdown-menu, ul.dropdown-menu,
.twitter-typeahead .tt-menu { .twitter-typeahead .tt-menu {
x-moz-box-shadow: 0 0 10px 2px rgba(0,0,0,.05); x-moz-box-shadow: 0 0 10px 2px rgba(0,0,0,.05);
x-webkit-box-shadow: 0 0 10px 2px rgba(0,0,0,.05); x-webkit-box-shadow: 0 0 10px 2px rgba(0,0,0,.05);
box-shadow: 0 0 10px 2px rgba(0,0,0,.05); box-shadow: 0 0 10px 2px rgba(0,0,0,.05);
} }
@ -466,7 +466,7 @@ background-clip: padding-box;
/*********************************************** /***********************************************
Dashboard Dashboard
************************************************/ ************************************************/
.in-bold { .in-bold {
@ -628,14 +628,14 @@ div.discount-group span {
.navbar-default .navbar-nav > li > a:focus { .navbar-default .navbar-nav > li > a:focus {
color: #ffffff; color: #ffffff;
} }
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus { .navbar-default .navbar-nav > .active > a:focus {
color: #ffffff; color: #ffffff;
background-color: #3276b1; background-color: #3276b1;
} }
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus { .navbar-default .navbar-nav > .open > a:focus {
color: #ffffff; color: #ffffff;
background-color: #3276b1; background-color: #3276b1;
@ -649,8 +649,8 @@ div.discount-group span {
border-top-color: #ffffff; border-top-color: #ffffff;
border-bottom-color: #ffffff; border-bottom-color: #ffffff;
} }
.navbar-default .navbar-nav > .open > a .caret, .navbar-default .navbar-nav > .open > a .caret,
.navbar-default .navbar-nav > .open > a:hover .caret, .navbar-default .navbar-nav > .open > a:hover .caret,
.navbar-default .navbar-nav > .open > a:focus .caret { .navbar-default .navbar-nav > .open > a:focus .caret {
border-top-color: #ffffff; border-top-color: #ffffff;
border-bottom-color: #ffffff; border-bottom-color: #ffffff;
@ -689,7 +689,7 @@ div.fb_iframe_widget {
display: inline; display: inline;
} }
div.fb_iframe_widget > span { div.fb_iframe_widget > span {
vertical-align: top !important; vertical-align: top !important;
} }
.pro-label { .pro-label {
font-size:9px; font-size:9px;
@ -728,12 +728,12 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
.plans-table .glyphicon-remove {background-color: #da4830;} .plans-table .glyphicon-remove {background-color: #da4830;}
.plans-table .glyphicon-ok {background-color: #35c156;} .plans-table .glyphicon-ok {background-color: #35c156;}
.plans-table .glyphicon-star {border-radius: 0; background-color: #2e2b2b; .plans-table .glyphicon-star {border-radius: 0; background-color: #2e2b2b;
display: block; display: block;
width: 60px; width: 60px;
height: 30px; height: 30px;
position: absolute; position: absolute;
top: -5px; top: -5px;
right: -20px; right: -20px;
-webkit-transform: rotate(45deg); -webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg); -moz-transform: rotate(45deg);
-o-transform: rotate(45deg); -o-transform: rotate(45deg);
@ -763,11 +763,11 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
.ellipsis { .ellipsis {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.entityArchived { .entityArchived {
color: #888 !important; color: #888 !important;
} }
.entityDeleted { .entityDeleted {
@ -775,12 +775,12 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
} }
/* Custom, iPhone Retina */ /* Custom, iPhone Retina */
@media only screen and (min-width : 320px) { @media only screen and (min-width : 320px) {
} }
/* Extra Small Devices, Phones */ /* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) { @media only screen and (min-width : 480px) {
} }
@ -828,7 +828,7 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
@media (max-width: 992px) { @media (max-width: 992px) {
.hide-phone { .hide-phone {
display: none !important; display: none !important;
} }
} }
@media (max-width: 767px) { @media (max-width: 767px) {
@ -846,8 +846,8 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
.plans-table .free .cell { padding-right: 0; } .plans-table .free .cell { padding-right: 0; }
.plans-table .free .cell:first-child {margin-right: 0;} .plans-table .free .cell:first-child {margin-right: 0;}
.plans-table .cell div:first-child {margin-bottom: 5px;} .plans-table .cell div:first-child {margin-bottom: 5px;}
.plans-table .cell .cta {margin-bottom: 0 !important;} .plans-table .cell .cta {margin-bottom: 0 !important;}
.plans-table .pro {margin-top: 40px;} .plans-table .pro {margin-top: 40px;}
} }
label[for=recommendedGateway_id2].radio{ label[for=recommendedGateway_id2].radio{
@ -976,14 +976,14 @@ button .glyphicon {
.pro-plan-modal a.button { .pro-plan-modal a.button {
font-family: 'roboto_slabregular', Georgia, Times, serif; font-family: 'roboto_slabregular', Georgia, Times, serif;
background: #f38c4f; background: #f38c4f;
background: -moz-linear-gradient(top, #f38c4f 0%, #db7134 100%); background: -moz-linear-gradient(top, #f38c4f 0%, #db7134 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f38c4f), color-stop(100%,#db7134)); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f38c4f), color-stop(100%,#db7134));
background: -webkit-linear-gradient(top, #f38c4f 0%,#db7134 100%); background: -webkit-linear-gradient(top, #f38c4f 0%,#db7134 100%);
background: -o-linear-gradient(top, #f38c4f 0%,#db7134 100%); background: -o-linear-gradient(top, #f38c4f 0%,#db7134 100%);
background: -ms-linear-gradient(top, #f38c4f 0%,#db7134 100%); background: -ms-linear-gradient(top, #f38c4f 0%,#db7134 100%);
background: linear-gradient(to bottom, #f38c4f 0%,#db7134 100%); background: linear-gradient(to bottom, #f38c4f 0%,#db7134 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f38c4f', endColorstr='#db7134',GradientType=0 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f38c4f', endColorstr='#db7134',GradientType=0 );
text-shadow: 1px 1px 1px rgba(0, 0, 0, .25); text-shadow: 1px 1px 1px rgba(0, 0, 0, .25);
width: 68%; width: 68%;
margin-top: 20px; margin-top: 20px;
@ -1046,7 +1046,7 @@ ul.user-accounts a:hover div.remove {
.invoice-contact .tooltip-inner { .invoice-contact .tooltip-inner {
text-align:left; text-align:left;
width: 350px; width: 350px;
} }
.smaller { .smaller {
@ -1103,10 +1103,3 @@ div.panel-body div.panel-body {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.dropzone .fallback-doc{
display:none;
}
.dropzone.dz-browser-not-supported .fallback-doc{
display:block;
}

View File

@ -114,15 +114,8 @@
<div class="col-md-12 col-sm-8"> <div class="col-md-12 col-sm-8">
<div role="tabpanel" class="tab-pane" id="attached-documents" style="position:relative;z-index:9"> <div role="tabpanel" class="tab-pane" id="attached-documents" style="position:relative;z-index:9">
<div id="document-upload" class="dropzone"> <div id="document-upload" class="dropzone">
<div class="fallback">
<input name="documents[]" type="file" multiple />
</div>
<div data-bind="foreach: documents"> <div data-bind="foreach: documents">
<div class="fallback-doc"> <input type="hidden" name="document_ids[]" data-bind="value: public_id"/>
<a href="#" class="fallback-doc-remove" data-bind="click: $parent.removeDocument"><i class="fa fa-close"></i></a>
<span data-bind="text:name"></span>
<input type="hidden" name="document_ids[]" data-bind="value: public_id"/>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -364,15 +364,8 @@
<div role="tabpanel" class="tab-pane" id="attached-documents" style="position:relative;z-index:9"> <div role="tabpanel" class="tab-pane" id="attached-documents" style="position:relative;z-index:9">
<div id="document-upload"> <div id="document-upload">
<div class="dropzone"> <div class="dropzone">
<div class="fallback">
<input name="documents[]" type="file" multiple />
</div>
<div data-bind="foreach: documents"> <div data-bind="foreach: documents">
<div class="fallback-doc"> <input type="hidden" name="document_ids[]" data-bind="value: public_id"/>
<a href="#" class="fallback-doc-remove" data-bind="click: $parent.removeDocument"><i class="fa fa-close"></i></a>
<span data-bind="text:name"></span>
<input type="hidden" name="document_ids[]" data-bind="value: public_id"/>
</div>
</div> </div>
</div> </div>
@if ($invoice->hasExpenseDocuments()) @if ($invoice->hasExpenseDocuments())