FEATURE: create module for contact form.

Currently contact form can be created, edit is not done yet. And also email sending neither work, now.
This commit is contained in:
Michal Kváček
2016-04-01 17:04:10 +02:00
parent 509ef1752e
commit f90f43fcd6
27 changed files with 569 additions and 0 deletions
@@ -0,0 +1,7 @@
<?php
return [
'contactForm' => 'Contact form',
'new' => 'New',
'overview' => 'All contact forms',
'sentMessages' => 'Messages'
];
@@ -0,0 +1,12 @@
<?php
return [
'content' => 'Contact form content',
'address' => 'Address',
'emailList' => 'Send emails to these addresses',
'gpsLat' => 'GPS latitude',
'gpsLng' => 'GPS longitude',
'compName' => 'Name displayed above address',
'phone' => 'Contact phone',
'contactEmail' => 'E-mail, where messages from this form will be delivered',
'contactInformation' => 'Contact information'
];
@@ -0,0 +1,5 @@
<?php
return [
'recaptchaSiteKey' => 'reCAPTCHA site key',
'recaptchaSecret' => 'reCAPTCHA application secret key',
];
@@ -0,0 +1,5 @@
<?php
return [
'name' => 'Contact form',
'description' => 'Simple contact form'
];
@@ -0,0 +1,113 @@
<div class="row">
<div class="columns large-6">
<label>
@lang('admin/contents.field_title')
<input type="text" name="title" placeholder="@lang('admin/contents.field_title')"
value="{{old('title', $page->title)}}" />
</label>
</div>
<div class="columns large-6">
<label>
@lang('admin/contents.field_url')
<input type="text" name="url" placeholder="@lang('admin/contents.field_url')"
value="{{old('url', $page->url)}}" />
@if (isset($errors) && $errors->has('url'))
<div class="callout alert">
{{ $errors->first('url') }}
</div>
@endif
</label>
</div>
</div>
<div class="row">
<div class="columns large-6">
<label>
<select name="status">
@foreach($contentStatuses as $status => $translation)
<option value="{{$status}}" @if(old('status', $page->status) == $status) selected @endif>
{{$translation}}
</option>
@endforeach
</select>
</label>
@if (isset($errors) && $errors->has('status'))
<div class="callout alert">
{{ $errors->first('status') }}
</div>
@endif
</div>
<div class="column large-6">
<label>
<select name="parentPage">
<option value="">@lang('admin/contents.noParentPage')</option>
@foreach($rootPages as $rootPage)
<option value="{{$rootPage->id}}"
@if(old('parent_page', $page->parent_id) == $rootPage->id) selected @endif>
{{$rootPage->title}}
</option>
@endforeach
</select>
</label>
@if (isset($errors) && $errors->has('parentPage'))
<div class="callout alert">
{{ $errors->first('parentPage') }}
</div>
@endif
</div>
</div>
<h2>@lang('contactform::admin/content.contactInformation')</h2>
<div class="row">
<div class="column large-6">
<label>
@lang('contactform::admin/content.phone')
<input type="tel" name="phone" value="{{$page->module_settings->phone or ""}}" />
</label>
</div>
<div class="column large-6">
<label>
@lang('contactform::admin/content.contactEmail')
<input type="email" name="email" value="{{$page->module_settings->email or \Auth::user()->email}}" />
</label>
</div>
</div>
<div class="row">
<div class="column large-6">
<label>
@lang('contactform::admin/content.compName')
<input type="text" name="companyName" value="{{$page->module_settings->companyName or ""}}" />
</label>
<label>
@lang('contactform::admin/content.address')
<textarea rows="3" name="address">{{$page->module_settings->address or ""}}</textarea>
</label>
</div>
<div class="column large-6">
<label>
@lang('contactform::admin/content.gpsLat')
<input type="text" value="{{$page->module_settings->gpsLat or ""}}" name="gpsLat" />
</label>
<label>
@lang('contactform::admin/content.gpsLng')
<input type="text" value="{{$page->module_settings->gpsLng or ""}}" name="gpsLng" />
</label>
</div>
</div>
@@ -0,0 +1,10 @@
<div class="row">
<div class="columns large-12">
<label>
<textarea name="pageContent" id="pageContent" class="wysiwyg-editor">
{{old('pageContent', $page->content)}}
</textarea>
</label>
</div>
</div>
@@ -0,0 +1,13 @@
<label>
@lang('contactform::admin/settings.recaptchaSiteKey')
<input type="text" name="recaptchaSiteKey" value="{{old('recaptchaSiteKey', isset($settings->recaptchaSiteKey) ? $settings->recaptchaSiteKey : null)}}" />
</label>
<label>
@lang('contactform::admin/settings.recaptchaSecret')
<input type="text" name="recaptchaSecret" value="{{old('recaptchaSecret', isset($settings->recaptchaSecret) ? $settings->recaptchaSecret : null)}}" />
</label>
<em><a href="https://www.google.com/recaptcha/admin#list" target="_blank">reCAPTCHA</a></em>