-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(contact): Edit contact inside Prospect/Customer view #117 WITHOU…
…T AJAX
- Loading branch information
1 parent
423c222
commit 4670556
Showing
5 changed files
with
89 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,86 @@ | ||
@php | ||
$lead_id = (empty($lead_id) && !empty($contact->lead_id)) ? $contact->lead_id : null; | ||
$customer_id = (empty($customer_id) && !empty($contact->customer_id)) ? $contact->customer_id : null; | ||
@endphp | ||
<form method="post" action="{{ url('/contact/save') }}"> | ||
@csrf | ||
<input type="hidden" name="id" value="{{ !empty($contact) ? $contact->id : '' }}"> | ||
<input type="hidden" name="lead_id" value="{{ !empty($lead_id) ? $lead_id : '' }}"> | ||
<input type="hidden" name="customer_id" value="{{ !empty($customer_id) ? $customer_id : '' }}"> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_first_name">{{ __('First name') }}</label> | ||
<input type="text" name="contact_first_name" id="contact_first_name" | ||
value="{{ !empty($contact) ? $contact->first_name : '' }}" required class="form-control"> | ||
</div> | ||
<div class="col"> | ||
<label for="contact_last_name">{{ __('Last name') }}</label> | ||
<input type="text" name="contact_last_name" id="contact_last_name" | ||
value="{{ !empty($contact) ? $contact->last_name : '' }}" class="form-control"> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_phone">{{ __('Phone') }}</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="las la-phone"></i></span> | ||
<input type="tel" name="contact_phone" id="contact_phone" | ||
value="{{ !empty($contact) ? $contact->phone : '' }}" maxlength="15" class="form-control"> | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
@include('layouts.partials._header', ['title' => __('Contact')]) | ||
|
||
<div class="card"> | ||
<div class="card-body"> | ||
<form method="post" action="{{ url('/contact/save') }}"> | ||
@csrf | ||
<input type="hidden" name="id" value="{{ !empty($contact) ? $contact->id : '' }}"> | ||
<input type="hidden" name="lead_id" value="{{ !empty($contact) ? $contact->lead_id : '' }}"> | ||
<input type="hidden" name="customer_id" value="{{ !empty($contact) ? $contact->customer_id : '' }}"> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_first_name">{{ __('First name') }}</label> | ||
<input type="text" name="contact_first_name" id="contact_first_name" value="{{ !empty($contact) ? $contact->first_name : '' }}" required class="form-control"> | ||
</div> | ||
<div class="col"> | ||
<label for="contact_last_name">{{ __('Last name') }}</label> | ||
<input type="text" name="contact_last_name" id="contact_last_name" value="{{ !empty($contact) ? $contact->last_name : '' }}" class="form-control"> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
<label for="contact_mobile">{{ __('Mobile') }}</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="las la-mobile"></i></span> | ||
<input type="tel" name="contact_mobile" id="contact_mobile" | ||
value="{{ !empty($contact) ? $contact->mobile : '' }}" maxlength="15" class="form-control"> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_phone">{{ __('Phone') }}</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="las la-phone"></i></span> | ||
<input type="tel" name="contact_phone" id="contact_phone" value="{{ !empty($contact) ? $contact->phone : '' }}" maxlength="15" class="form-control"> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
<label for="contact_mobile">{{ __('Mobile') }}</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="las la-mobile"></i></span> | ||
<input type="tel" name="contact_mobile" id="contact_mobile" value="{{ !empty($contact) ? $contact->mobile : '' }}" maxlength="15" class="form-control"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_email">E-mail</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="las la-envelope"></i></span> | ||
<input type="email" name="contact_email" id="contact_email" | ||
value="{{ !empty($contact) ? $contact->email : '' }}" maxlength="254" class="form-control"> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_email">E-mail</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="las la-envelope"></i></span> | ||
<input type="email" name="contact_email" id="contact_email" value="{{ !empty($contact) ? $contact->email : '' }}" maxlength="254" class="form-control"> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
<label for="contact_linkedin">Linkedin</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="lab la-linkedin-in"></i></span> | ||
<input type="url" name="contact_linkedin" id="contact_linkedin" placeholder="https://linkedin.com/in/" value="{{ !empty($contact) ? $contact->linkedin : '' }}" class="form-control"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col"> | ||
<label for="contact_linkedin">Linkedin</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="lab la-linkedin-in"></i></span> | ||
<input type="url" name="contact_linkedin" id="contact_linkedin" placeholder="https://linkedin.com/in/" | ||
value="{{ !empty($contact) ? $contact->linkedin : '' }}" class="form-control"> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_job_title">{{ __('Job title') }}</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="las la-briefcase"></i></span> | ||
<input type="text" name="contact_job_title" id="contact_job_title" value="{{ !empty($contact) ? $contact->job_title : '' }}" maxlength="80" class="form-control"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_job_title">{{ __('Job title') }}</label> | ||
<div class="input-group"> | ||
<span class="input-group-text"><i class="las la-briefcase"></i></span> | ||
<input type="text" name="contact_job_title" id="contact_job_title" | ||
value="{{ !empty($contact) ? $contact->job_title : '' }}" maxlength="80" class="form-control"> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_notes">{{ __('Notes') }}</label> | ||
@php | ||
$notes = !empty($contact) ? $contact->notes : ''; | ||
@endphp | ||
<textarea name="contact_notes" id="contact_notes" class="form-control">{{ $notes }}</textarea> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="contact_notes">{{ __('Notes') }}</label> | ||
@php | ||
$notes = !empty($contact) ? $contact->notes : ''; | ||
@endphp | ||
<textarea name="contact_notes" id="contact_notes" class="form-control">{{ $notes }}</textarea> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col mt-2"> | ||
<button type="submit" class="btn btn-secondary">{{ __('Save') }}</button> | ||
</div> | ||
<div class="row"> | ||
<div class="col mt-2"> | ||
<button type="submit" class="btn btn-secondary">{{ __('Save') }}</button> | ||
@php | ||
$url = $contact->lead_id ? 'lead/show/' . $contact->lead_id : 'customer/show/' . $contact->customer_id; | ||
@endphp | ||
<a href="{{ url($url) }}" class="btn btn-secondary">{{ __('Cancel') }}</a> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters