mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Working on client portal
This commit is contained in:
parent
433a2a01d7
commit
3f1fcdda76
@ -40,6 +40,7 @@ class StartupCheck
|
||||
if (Input::has('clear_cache')) {
|
||||
Session::flash('message', 'Cache cleared');
|
||||
}
|
||||
|
||||
foreach ($cached_tables as $name => $class) {
|
||||
if (Input::has('clear_cache') || ! Cache::has($name)) {
|
||||
// check that the table exists in case the migration is pending
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace App\Http\ViewComposers;
|
||||
|
||||
use App\Utils\TranslationHelper;
|
||||
use Illuminate\View\View;
|
||||
|
||||
/**
|
||||
@ -28,7 +29,9 @@ class PortalComposer
|
||||
*/
|
||||
public function compose(View $view) :void
|
||||
{
|
||||
$view->with('portal', $this->portalData());
|
||||
|
||||
$view->with($this->portalData());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -36,15 +39,17 @@ class PortalComposer
|
||||
*/
|
||||
private function portalData() :array
|
||||
{
|
||||
|
||||
if(!auth()->user())
|
||||
return [];
|
||||
|
||||
$data['sidebar'] = $this->sidebarMenu();
|
||||
$data['header'] = [];
|
||||
$data['footer'] = [];
|
||||
|
||||
$data['countries'] = TranslationHelper::getCountries();
|
||||
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
private function sidebarMenu() :array
|
||||
@ -56,6 +61,7 @@ class PortalComposer
|
||||
$data[] = [ 'title' => ctrans('texts.invoices'), 'url' => 'client.invoices.index', 'icon' => 'fa fa-file-pdf-o fa-fw fa-2x'];
|
||||
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -31,6 +31,7 @@ class TranslationComposer
|
||||
*/
|
||||
public function compose(View $view) :void
|
||||
{
|
||||
|
||||
$view->with('industries', TranslationHelper::getIndustries());
|
||||
|
||||
$view->with('countries', TranslationHelper::getCountries());
|
||||
|
@ -22,6 +22,7 @@ class ComposerServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
|
||||
view()->composer('portal.*', 'App\Http\ViewComposers\PortalComposer');
|
||||
|
||||
//view()->composer('*', 'App\Http\ViewComposers\HeaderComposer');
|
||||
|
@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Laravel\Telescope\Telescope;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Laravel\Telescope\IncomingEntry;
|
||||
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
||||
|
||||
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
// Telescope::night();
|
||||
|
||||
$this->hideSensitiveRequestDetails();
|
||||
|
||||
Telescope::filter(function (IncomingEntry $entry) {
|
||||
if ($this->app->isLocal()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $entry->isReportableException() ||
|
||||
$entry->isFailedJob() ||
|
||||
$entry->isScheduledTask() ||
|
||||
$entry->hasMonitoredTag();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent sensitive request details from being logged by Telescope.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function hideSensitiveRequestDetails()
|
||||
{
|
||||
if ($this->app->isLocal()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Telescope::hideRequestParameters(['_token']);
|
||||
|
||||
Telescope::hideRequestHeaders([
|
||||
'cookie',
|
||||
'x-csrf-token',
|
||||
'x-xsrf-token',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Telescope gate.
|
||||
*
|
||||
* This gate determines who can access Telescope in non-local environments.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function gate()
|
||||
{
|
||||
Gate::define('viewTelescope', function ($user) {
|
||||
return in_array($user->email, [
|
||||
//
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
@ -50,7 +50,6 @@
|
||||
"filp/whoops": "^2.0",
|
||||
"fzaninotto/faker": "^1.4",
|
||||
"laravel/dusk": "^5.0",
|
||||
"laravel/telescope": "^2.0",
|
||||
"mockery/mockery": "^1.0",
|
||||
"nunomaduro/collision": "^2.0",
|
||||
"phpunit/phpunit": "^7.0"
|
||||
|
@ -175,7 +175,6 @@ return [
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\TelescopeServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\ComposerServiceProvider::class,
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
"dependencies": {
|
||||
"@coreui/coreui": "^2.1.12",
|
||||
"@coreui/icons": "^0.3.0",
|
||||
"@danielfarrell/bootstrap-combobox": "^1.1.8",
|
||||
"bootstrap": "^4.3.1",
|
||||
"bootstrap-sweetalert": "^1.0.1",
|
||||
"cross-env": "^5.2.0",
|
||||
|
@ -9,6 +9,8 @@
|
||||
"/vendors/js/perfect-scrollbar.min.js": "/vendors/js/perfect-scrollbar.min.js?id=4a10bcfa0a9c9fa9d503",
|
||||
"/vendors/css/select2.min.css": "/vendors/css/select2.min.css?id=8e44c39add2364bdb469",
|
||||
"/vendors/js/select2.min.js": "/vendors/js/select2.min.js?id=0a96cf2d3a193019a91b",
|
||||
"/vendors/css/bootstrap-combobox.css": "/vendors/css/bootstrap-combobox.css?id=f6a6add416aca5e75f21",
|
||||
"/vendors/js/bootstrap-combobox.js": "/vendors/js/bootstrap-combobox.js?id=36f9331a05f0b943b74c",
|
||||
"/vendors/css/dropzone.min.css": "/vendors/css/dropzone.min.css?id=2f735dbf472afcd77604",
|
||||
"/vendors/css/dropzone-basic.min.css": "/vendors/css/dropzone-basic.min.css?id=960bcd6d5cb8351ac0d0",
|
||||
"/vendors/js/dropzone.min.js": "/vendors/js/dropzone.min.js?id=33148c7d5e055ea74714",
|
||||
|
@ -1,12 +1,22 @@
|
||||
@extends('portal.default.layouts.master')
|
||||
|
||||
@section('header')
|
||||
@parent
|
||||
<link href="/vendors/css/bootstrap-combobox.css" rel="stylesheet">
|
||||
@stop
|
||||
@section('body')
|
||||
<main class="main">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row" style="padding-top: 30px;">
|
||||
|
||||
<div class="col-sm-6" style="padding-bottom: 10px;">
|
||||
<div class="col-sm-3" style="padding-bottom: 10px;">
|
||||
|
||||
{!! Former::framework('TwitterBootstrap4'); !!}
|
||||
|
||||
{!! Former::horizontal_open()
|
||||
->id('update_contact')
|
||||
->route('client.profile.update', auth()->user()->hashed_id)
|
||||
->method('PUT'); !!}
|
||||
|
||||
<div class="card">
|
||||
|
||||
@ -17,7 +27,7 @@
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
@include('generic.dropzone')
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@ -25,23 +35,77 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6" style="padding-bottom: 10px;">
|
||||
<div class="col-sm-9" style="padding-bottom: 10px;">
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header">
|
||||
|
||||
<strong> {{ ctrans('texts.profile') }}</strong>
|
||||
<strong> {{ ctrans('texts.client_information') }}</strong>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
{!! Former::text('name')->placeholder( ctrans('texts.first_name'))->label('') !!}
|
||||
{!! Former::text('phone')->placeholder( ctrans('texts.phone'))->label('') !!}
|
||||
{!! Former::text('website')->placeholder( ctrans('texts.website'))->label('') !!}
|
||||
|
||||
{!! Former::text('address1')->placeholder( ctrans('texts.address1'))->label('') !!}
|
||||
{!! Former::text('address2')->placeholder( ctrans('texts.address2'))->label('') !!}
|
||||
{!! Former::text('city')->placeholder( ctrans('texts.city'))->label('') !!}
|
||||
{!! Former::text('state')->placeholder( ctrans('texts.state'))->label('') !!}
|
||||
{!! Former::text('postal_code')->placeholder( ctrans('texts.postal_code'))->label('') !!}
|
||||
|
||||
{!! Former::select('country_id')
|
||||
->addOption('','')
|
||||
->autocomplete('off')
|
||||
->label('')
|
||||
->fromQuery($countries, 'name', 'id') !!}
|
||||
|
||||
{!! Former::text('shipping_address1')->placeholder( ctrans('texts.shipping_address1'))->label('') !!}
|
||||
{!! Former::text('shipping_address2')->placeholder( ctrans('texts.shipping_address2'))->label('') !!}
|
||||
{!! Former::text('shipping_city')->placeholder( ctrans('texts.shipping_city'))->label('') !!}
|
||||
{!! Former::text('shipping_state')->placeholder( ctrans('texts.shipping_state'))->label('') !!}
|
||||
{!! Former::text('shipping_postal_code')->placeholder( ctrans('texts.shipping_postal_code'))->label('') !!}
|
||||
|
||||
{!! Former::select('shipping_country_id')
|
||||
->addOption('','')
|
||||
->autocomplete('off')
|
||||
->label('')
|
||||
->fromQuery($countries, 'name', 'id') !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header">
|
||||
|
||||
<strong> {{ ctrans('texts.user_details') }}</strong>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
{!! Former::text('first_name')->placeholder( ctrans('texts.first_name'))->label('') !!}
|
||||
|
||||
{!! Former::text('last_name')->placeholder( ctrans('texts.last_name'))->label('') !!}
|
||||
|
||||
{!! Former::text('email')->placeholder( ctrans('texts.email'))->label('') !!}
|
||||
|
||||
{!! Former::text('phone')->placeholder( ctrans('texts.phone'))->label('') !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{!! Former::close() !!}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -50,13 +114,23 @@
|
||||
</main>
|
||||
</body>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script src="/vendors/js/bootstrap-combobox.js"></script>
|
||||
@endpush
|
||||
|
||||
@section('footer')
|
||||
|
||||
<script>
|
||||
|
||||
$(function() {
|
||||
$('#country_id, #shipping_country_id').combobox();
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
@ -2,7 +2,7 @@
|
||||
<div class="sidebar">
|
||||
<nav class="sidebar-nav">
|
||||
<ul class="nav">
|
||||
@foreach($portal['sidebar'] as $row)
|
||||
@foreach($sidebar as $row)
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="{{ route($row['url']) }}">
|
||||
<span><i class="{{$row['icon']}}"></i></span> <span> {{ $row['title'] }} </span>
|
||||
|
3
webpack.mix.js
vendored
3
webpack.mix.js
vendored
@ -25,6 +25,9 @@ mix.copyDirectory('node_modules/perfect-scrollbar/dist/perfect-scrollbar.min.js'
|
||||
mix.copyDirectory('node_modules/select2/dist/css/select2.min.css', 'public/vendors/css/select2.min.css');
|
||||
mix.copyDirectory('node_modules/select2/dist/js/select2.full.min.js', 'public/vendors/js/select2.min.js');
|
||||
|
||||
mix.copyDirectory('node_modules/@danielfarrell/bootstrap-combobox/css/bootstrap-combobox.css', 'public/vendors/css/bootstrap-combobox.css');
|
||||
mix.copyDirectory('node_modules/@danielfarrell/bootstrap-combobox/js/bootstrap-combobox.js', 'public/vendors/js/bootstrap-combobox.js');
|
||||
|
||||
mix.copyDirectory('node_modules/dropzone/dist/min/dropzone.min.css', 'public/vendors/css/dropzone.min.css');
|
||||
mix.copyDirectory('node_modules/dropzone/dist/min/basic.min.css', 'public/vendors/css/dropzone-basic.min.css');
|
||||
mix.copyDirectory('node_modules/dropzone/dist/min/dropzone.min.js', 'public/vendors/js/dropzone.min.js');
|
||||
|
Loading…
x
Reference in New Issue
Block a user