refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
46
resources/views/people/debt/add.blade.php
Normal file
46
resources/views/people/debt/add.blade.php
Normal file
@@ -0,0 +1,46 @@
|
||||
@extends('layouts.skeleton')
|
||||
|
||||
@section('content')
|
||||
<div class="people-show debt">
|
||||
|
||||
{{-- Breadcrumb --}}
|
||||
<div class="breadcrumb">
|
||||
<div class="{{ Auth::user()->getFluidLayout() }}">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<ul class="horizontal">
|
||||
<li>
|
||||
<a href="{{ route('dashboard.index') }}">{{ trans('app.breadcrumb_dashboard') }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('people.index') }}">{{ trans('app.breadcrumb_list_contacts') }}</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ $contact->name }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Page header -->
|
||||
@include('people._header')
|
||||
|
||||
<!-- Page content -->
|
||||
<div class="main-content central-form">
|
||||
<div class="{{ Auth::user()->getFluidLayout() }}">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-6 offset-sm-3 offset-sm-3-right">
|
||||
@include('people.debt.form', [
|
||||
'method' => 'POST',
|
||||
'action' => route('people.debts.store', $contact),
|
||||
'update_or_add' =>'add'
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
46
resources/views/people/debt/edit.blade.php
Normal file
46
resources/views/people/debt/edit.blade.php
Normal file
@@ -0,0 +1,46 @@
|
||||
@extends('layouts.skeleton')
|
||||
|
||||
@section('content')
|
||||
<div class="people-show debt">
|
||||
|
||||
{{-- Breadcrumb --}}
|
||||
<div class="breadcrumb">
|
||||
<div class="{{ Auth::user()->getFluidLayout() }}">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<ul class="horizontal">
|
||||
<li>
|
||||
<a href="{{ route('dashboard.index') }}">{{ trans('app.breadcrumb_dashboard') }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('people.index') }}">{{ trans('app.breadcrumb_list_contacts') }}</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ $contact->name }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Page header -->
|
||||
@include('people._header')
|
||||
|
||||
<!-- Page content -->
|
||||
<div class="main-content central-form">
|
||||
<div class="{{ Auth::user()->getFluidLayout() }}">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-6 offset-sm-3 offset-sm-3-right">
|
||||
@include('people.debt.form', [
|
||||
'method' => 'PUT',
|
||||
'action' => route('people.debts.update', [$contact, $debt]),
|
||||
'update_or_add' =>'edit'
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
44
resources/views/people/debt/form.blade.php
Normal file
44
resources/views/people/debt/form.blade.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<form method="POST" action="{{ $action }}">
|
||||
@method($method)
|
||||
@csrf
|
||||
|
||||
@include('partials.errors')
|
||||
|
||||
<h2>{{ trans('people.debt_add_title') }}</h2>
|
||||
|
||||
{{-- Debt direction --}}
|
||||
<fieldset class="form-group">
|
||||
<label class="form-check-inline" for="youowe">
|
||||
<input type="radio" class="form-check-input" name="in_debt" id="youowe" value="yes" @if(old('in_debt') !== 'no' || $debt->in_debt !== 'no') checked @endif>
|
||||
{{ trans('people.debt_add_you_owe', ['name' => $contact->first_name]) }}
|
||||
</label>
|
||||
|
||||
<label class="form-check-inline" for="theyowe">
|
||||
<input type="radio" class="form-check-input" name="in_debt" id="theyowe" value="no" @if(old('in_debt') === 'no' || $debt->in_debt === 'no') checked @endif>
|
||||
{{ trans('people.debt_add_they_owe', ['name' => $contact->first_name]) }}
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
{{-- Amount --}}
|
||||
<div class="form-group">
|
||||
<label for="amount">{{ trans('people.debt_add_amount') }} ({{ Auth::user()->currency->symbol }})</label>
|
||||
<input type="number" step=".01" class="form-control" name="amount" id="amount" maxlength="254" value="{{ old('amount') ?? $debt->amount }}" autofocus required>
|
||||
</div>
|
||||
|
||||
{{-- Reason --}}
|
||||
<div class="form-group">
|
||||
<label for="reason">{{ trans('people.debt_add_reason') }}</label>
|
||||
<textarea class="form-control" name="reason" id="reason" maxlength="2500">{{ old('reason') ?? $debt->reason }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group actions">
|
||||
<button type="submit" cy-name="save-debt-button" class="btn btn-primary">
|
||||
@if($update_or_add == 'add')
|
||||
{{ trans('people.debt_add_add_cta') }}
|
||||
@elseif ($update_or_add == 'edit')
|
||||
{{ trans('people.debt_edit_update_cta') }}
|
||||
@endif
|
||||
</button>
|
||||
<a href="{{ route('people.show', $contact) }}" class="btn btn-secondary">{{ trans('app.cancel') }}</a>
|
||||
</div> <!-- .form-group -->
|
||||
</form>
|
||||
86
resources/views/people/debt/index.blade.php
Normal file
86
resources/views/people/debt/index.blade.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<div class="col-12 section-title">
|
||||
<img src="img/people/debt/bill.svg" class="icon-section icon-money">
|
||||
<h3>
|
||||
{{ trans('people.debt_title') }}
|
||||
|
||||
<span class="{{ htmldir() == 'ltr' ? 'fr' : 'fl' }}">
|
||||
<a href="{{ route('people.debts.create', $contact) }}" class="btn">{{ trans('people.debt_add_cta') }}</a>
|
||||
</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@if (!$contact->hasDebt())
|
||||
|
||||
<div class="col-12" cy-name="debt-blank-state">
|
||||
<div class="section-blank">
|
||||
<h3>{{ trans('people.debts_blank_title', ['name' => $contact->first_name]) }}</h3>
|
||||
<a href="{{ route('people.debts.create', $contact) }}" cy-name="add-debt-button">{{ trans('people.debt_add_cta') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
|
||||
<div class="col-12 debts-list">
|
||||
|
||||
<ul class="table" cy-name="debts-body" cy-items="{{ $contact->debts->implode('id', ',') }}">
|
||||
@foreach($contact->debts as $debt)
|
||||
<li class="table-row" cy-name="debt-item-{{ $debt->id }}">
|
||||
<div class="table-cell date">
|
||||
{{ \App\Helpers\DateHelper::getShortDate($debt->created_at) }}
|
||||
</div>
|
||||
<div class="table-cell debt-nature">
|
||||
@if ($debt->in_debt == 'yes')
|
||||
{{ trans('people.debt_you_owe', [
|
||||
'amount' => $debt->displayValue
|
||||
]) }}
|
||||
@else
|
||||
{{ trans('people.debt_they_owe', [
|
||||
'name' => $contact->first_name,
|
||||
'amount' => $debt->displayValue
|
||||
]) }}
|
||||
@endif
|
||||
</div>
|
||||
<div class="table-cell reason">
|
||||
@if (! is_null($debt->reason))
|
||||
{{ $debt->reason }}
|
||||
@endif
|
||||
</div>
|
||||
<div class="table-cell list-actions">
|
||||
<a href="{{ route('people.debts.edit', [$contact, $debt]) }}" cy-name="edit-debt-button-{{ $debt->id }}">
|
||||
<i class="fa fa-pencil" aria-hidden="true"></i>
|
||||
</a>
|
||||
<form method="POST" action="{{ route('people.debts.destroy', [$contact, $debt]) }}">
|
||||
@method('DELETE')
|
||||
@csrf
|
||||
<confirm message="{{ trans('people.debt_delete_confirmation') }}" cy-name="delete-debt-button-{{ $debt->id }}" :name="'delete-debt'">
|
||||
<i class="fa fa-trash-o" aria-hidden="true"></i>
|
||||
</confirm>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@endforeach
|
||||
<li class="table-row">
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell">
|
||||
<strong>
|
||||
@if ($contact->isOwedMoney())
|
||||
{{ trans('people.debt_they_owe', [
|
||||
'name' => $contact->first_name,
|
||||
'amount' => App\Helpers\MoneyHelper::format($contact->totalOutstandingDebtAmount(), Auth::user()->currency)
|
||||
]) }}
|
||||
@else
|
||||
{{ trans('people.debt_you_owe', [
|
||||
'amount' => App\Helpers\MoneyHelper::format(-$contact->totalOutstandingDebtAmount(), Auth::user()->currency)
|
||||
]) }}
|
||||
@endif
|
||||
</strong>
|
||||
</div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
@endif
|
||||
Reference in New Issue
Block a user