WIP: Road to 1.0.0 #1

Draft
miguel456 wants to merge 123 commits from develop into master
8 changed files with 20 additions and 3 deletions
Showing only changes of commit 6940b1816e - Show all commits

View File

@ -71,7 +71,7 @@ class ContextAwareValidator
$validator = []; $validator = [];
if ($includeFormName) { if ($includeFormName) {
$validator['formName'] = 'required|string|max:100'; $validator['formName'] = 'required|string';
} }
foreach ($fields as $fieldName => $field) { foreach ($fields as $fieldName => $field) {

View File

@ -36,6 +36,8 @@ use Illuminate\Support\Facades\Log;
class ApplicationController extends Controller class ApplicationController extends Controller
{ {
private function canVote($votes): bool private function canVote($votes): bool
{ {
$allvotes = collect([]); $allvotes = collect([]);

View File

@ -82,6 +82,7 @@ class FormController extends Controller
public function destroy(Request $request, Form $form) public function destroy(Request $request, Form $form)
{ {
$this->authorize('delete', $form); $this->authorize('delete', $form);
$deletable = true; $deletable = true;
if (! is_null($form) && ! is_null($form->vacancies) && $form->vacancies->count() !== 0 || ! is_null($form->responses)) { if (! is_null($form) && ! is_null($form->vacancies) && $form->vacancies->count() !== 0 || ! is_null($form->responses)) {
@ -97,6 +98,7 @@ class FormController extends Controller
} }
return redirect()->back(); return redirect()->back();
} }
public function preview(Request $request, Form $form) public function preview(Request $request, Form $form)

4
public/js/unsaved.js vendored Normal file
View File

@ -0,0 +1,4 @@
// Load this on all pages requiring exit confirmation.
$(window).bind('beforeunload', function(){
return "Are you sure you want to exit this page? You might have unsaved work.";
});

View File

@ -10,6 +10,12 @@
@section('js') @section('js')
<script>
jQuery(window).bind('beforeunload', function(){
return 'Are you sure you want to leave the form builder? You might have unsaved work.';
});
</script>
@if (session()->has('success')) @if (session()->has('success'))
<script> <script>

View File

@ -69,6 +69,8 @@
<p>{{__('messages.application_r.welcome.line2', ['agerqr' => '18 ' . __('messages.application_r.welcome.yrs_old')])}}.</p> <p>{{__('messages.application_r.welcome.line2', ['agerqr' => '18 ' . __('messages.application_r.welcome.yrs_old')])}}.</p>
<p class="text-bold">{{__('messages.application_r.welcome.line3')}}.</p> <p class="text-bold">{{__('messages.application_r.welcome.line3')}}.</p>
<p><i class="fab fa-markdown"></i> All fields support <a target="_blank" href="https://www.markdownguide.org/cheat-sheet/">Markdown</a></p>
</div> </div>
</div> </div>

View File

@ -103,7 +103,8 @@
<div class="mt-4 mb-3"> <div class="mt-4 mb-3">
<h5>{{$content['title']}}</h5> <h5>{{$content['title']}}</h5>
<p>{{$content['response']}}</p>
<p>{!! GrahamCampbell\Markdown\Facades\Markdown::convertToHtml($content['response']) !!}</p>
</div> </div>