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/reminders/add.blade.php
Normal file
46
resources/views/people/reminders/add.blade.php
Normal file
@@ -0,0 +1,46 @@
|
||||
@extends('layouts.skeleton')
|
||||
|
||||
@section('content')
|
||||
<div class="people-show">
|
||||
|
||||
{{-- 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 reminders 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.reminders.form', [
|
||||
'method' => 'POST',
|
||||
'action' => route('people.reminders.store', $contact),
|
||||
'update_or_add' =>'add'
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
46
resources/views/people/reminders/edit.blade.php
Normal file
46
resources/views/people/reminders/edit.blade.php
Normal file
@@ -0,0 +1,46 @@
|
||||
@extends('layouts.skeleton')
|
||||
|
||||
@section('content')
|
||||
<div class="people-show">
|
||||
|
||||
{{-- 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 reminders 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.reminders.form', [
|
||||
'method' => 'PUT',
|
||||
'action' => route('people.reminders.update', [$contact, $reminder]),
|
||||
'update_or_add' =>'edit'
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
89
resources/views/people/reminders/form.blade.php
Normal file
89
resources/views/people/reminders/form.blade.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<form method="POST" action="{{ $action }}">
|
||||
@method($method)
|
||||
@csrf
|
||||
|
||||
<h2>{{ trans('people.reminders_add_title', ['name' => $contact->first_name]) }}</h2>
|
||||
|
||||
@include('partials.errors')
|
||||
|
||||
<p>{{ trans('people.reminders_add_description') }}</p>
|
||||
|
||||
{{-- Nature of reminder --}}
|
||||
<fieldset class="form-group nature">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="title" value="{{ old('title') ?? $reminder->title }}" required>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
{{-- Date --}}
|
||||
<div class="form-group">
|
||||
<label for="initial_date">{{ trans('people.reminders_add_next_time') }}</label>
|
||||
|
||||
<input type="date" id="initial_date" name="initial_date" class="form-control"
|
||||
@if (is_null($reminder->initial_date))
|
||||
value="{{ old('initial_date') ?? now(\App\Helpers\DateHelper::getTimezone())->toDateString() }}"
|
||||
@else
|
||||
value="{{ old('initial_date') ?? $reminder->initial_date->toDateString() }}"
|
||||
@endif
|
||||
min="{{ now(\App\Helpers\DateHelper::getTimezone())->toDateString() }}"
|
||||
max="{{ now(\App\Helpers\DateHelper::getTimezone())->addYears(10)->toDateString() }}"
|
||||
>
|
||||
|
||||
<fieldset class="form-group frequency{{ $errors->has('frequency_type') ? ' has-error' : '' }}">
|
||||
|
||||
{{-- One time reminder --}}
|
||||
<div class="form-check">
|
||||
<label class="form-check-label" for="frequency_type_once">
|
||||
<input type="radio" id="frequency_type_once" class="form-check-input" name="frequency_type"
|
||||
:value="'one_time'"
|
||||
{{ $reminder->frequency_type === 'one_time' ? 'checked' : '' }}
|
||||
>
|
||||
{{ trans('people.reminders_add_once') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{{-- Recurring reminder --}}
|
||||
<div class="form-check">
|
||||
<label class="form-check-label" for="frequency_type_recurrent">
|
||||
<input type="radio" id="frequency_type_recurrent" class="form-check-input" name="frequency_type"
|
||||
:value="'recurrent'"
|
||||
{{ $reminder->frequency_type !== null && $reminder->frequency_type !== 'one_time' ? 'checked' : '' }}
|
||||
>
|
||||
|
||||
{{ trans('people.reminders_add_recurrent') }}
|
||||
|
||||
<input type="number" class="form-control frequency-type" name="frequency_number"
|
||||
value="{{ $reminder->frequency_number ?? 1 }}"
|
||||
min="1"
|
||||
max="115"
|
||||
:disabled="reminders_frequency == 'one_time'">
|
||||
|
||||
<select name="frequency_number_select" :disabled="reminders_frequency == 'one_time'">
|
||||
<option value="week"{{ $reminder->frequency_type === 'week' ? 'selected' : '' }}>{{ trans('people.reminders_type_week') }}</option>
|
||||
<option value="month"{{ $reminder->frequency_type === 'month' ? 'selected' : '' }}>{{ trans('people.reminders_type_month') }}</option>
|
||||
<option value="year"{{ $reminder->frequency_type === 'year' ? 'selected' : '' }}>{{ trans('people.reminders_type_year') }}</option>
|
||||
</select>
|
||||
|
||||
{{ trans('people.reminders_add_starting_from') }}
|
||||
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">{{ trans('people.reminders_add_optional_comment') }}</label>
|
||||
<textarea class="form-control" id="description" name="description" rows="3">{{ old('description') ?? $reminder->description }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group actions">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
@if($update_or_add == 'add')
|
||||
{{ trans('people.reminders_add_cta') }}
|
||||
@elseif ($update_or_add == 'edit')
|
||||
{{ trans('people.reminders_edit_update_cta') }}
|
||||
@endif
|
||||
</button>
|
||||
<a href="{{ route('people.show', $contact) }}" class="btn btn-secondary">{{ trans('app.cancel') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
79
resources/views/people/reminders/index.blade.php
Normal file
79
resources/views/people/reminders/index.blade.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<div class="col-12 section-title">
|
||||
<img src="img/people/reminders.svg" class="icon-section icon-reminders">
|
||||
<h3>
|
||||
{{ trans('people.section_personal_reminders') }}
|
||||
|
||||
<span class="{{ htmldir() == 'ltr' ? 'fr' : 'fl' }}">
|
||||
<a href="{{ route('people.reminders.create', $contact) }}" class="btn">{{ trans('people.reminders_cta') }}</a>
|
||||
</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($reminders->count() === 0)
|
||||
|
||||
<div class="col-12">
|
||||
<div class="section-blank">
|
||||
<h3>{{ trans('people.reminders_blank_title', ['name' => $contact->first_name]) }}</h3>
|
||||
<a href="{{ route('people.reminders.create', $contact) }}">{{ trans('people.reminders_blank_add_activity') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
|
||||
<div class="col-12 reminders-list">
|
||||
|
||||
@if (! $accountHasLimitations)
|
||||
<p>{{ trans('people.reminders_description') }}</p>
|
||||
@else
|
||||
<p>{{ trans('people.reminders_free_plan_warning') }}</p>
|
||||
@endif
|
||||
|
||||
<ul class="table">
|
||||
@foreach($reminders as $reminder)
|
||||
<li class="table-row">
|
||||
|
||||
<div class="table-cell date">
|
||||
{{ $reminder->next_expected_date_human_readable }}
|
||||
</div>
|
||||
|
||||
<div class="table-cell frequency-type">
|
||||
@if ($reminder->frequency_type != 'one_time')
|
||||
{{ trans_choice('people.reminder_frequency_'.$reminder->frequency_type, $reminder->frequency_number, ['number' => $reminder->frequency_number]) }}
|
||||
@else
|
||||
{{ trans('people.reminders_one_time') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="table-cell title">
|
||||
{{ $reminder->title }}
|
||||
</div>
|
||||
|
||||
<div class="table-cell comment">
|
||||
@if (!is_null($reminder->description))
|
||||
{{ $reminder->description }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="table-cell list-actions">
|
||||
{{-- Only display this if the reminder can be deleted - ie if it's not a reminder added automatically for birthdates --}}
|
||||
@if ($reminder->delible || ! $reminder->isBirthdayReminder())
|
||||
<a href="{{ route('people.reminders.edit', [$contact, $reminder]) }}" class="edit">
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
|
||||
</a>
|
||||
@endif
|
||||
<form method="POST" action="{{ route('people.reminders.destroy', [$contact, $reminder]) }}" class="di">
|
||||
@method('DELETE')
|
||||
@csrf
|
||||
<confirm message="{{ trans('people.reminders_delete_confirmation') }}">
|
||||
<i class="fa fa-trash-o" aria-hidden="true"></i>
|
||||
</confirm>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
Reference in New Issue
Block a user