From 49b0fac0f52a6278779ed035a4b03f2aa172ee24 Mon Sep 17 00:00:00 2001 From: Dave Earley Date: Thu, 5 May 2016 21:33:26 +0100 Subject: [PATCH] Removed the instructions field for event questions --- .../Controllers/EventSurveyController.php | 2 -- ...ove_instructions_field_questions_table.php | 31 +++++++++++++++++++ .../Modals/CreateQuestion.blade.php | 10 ------ .../ManageEvent/Modals/EditQuestion.blade.php | 12 +------ .../views/ManageOrganiser/Dashboard.blade.php | 2 +- 5 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 database/migrations/2016_05_05_201200_remove_instructions_field_questions_table.php diff --git a/app/Http/Controllers/EventSurveyController.php b/app/Http/Controllers/EventSurveyController.php index 1717cd8a..9872ef03 100644 --- a/app/Http/Controllers/EventSurveyController.php +++ b/app/Http/Controllers/EventSurveyController.php @@ -71,7 +71,6 @@ class EventSurveyController extends MyBaseController // Create question. $question = Question::createNew(false, false, true); $question->title = $request->get('title'); - $question->instructions = $request->get('instructions'); $question->is_required = ($request->get('is_required') == 'yes') ; $question->question_type_id = $request->get('question_type_id'); $question->save(); @@ -146,7 +145,6 @@ class EventSurveyController extends MyBaseController // Create question. $question = Question::scope()->findOrFail($question_id); $question->title = $request->get('title'); - $question->instructions = $request->get('instructions'); $question->is_required = $request->get('is_required'); $question->question_type_id = $request->get('question_type_id'); $question->save(); diff --git a/database/migrations/2016_05_05_201200_remove_instructions_field_questions_table.php b/database/migrations/2016_05_05_201200_remove_instructions_field_questions_table.php new file mode 100644 index 00000000..a077f5fe --- /dev/null +++ b/database/migrations/2016_05_05_201200_remove_instructions_field_questions_table.php @@ -0,0 +1,31 @@ +dropColumn('instructions'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('questions', function (Blueprint $table) { + $table->string('instructions'); + }); + } +} diff --git a/resources/views/ManageEvent/Modals/CreateQuestion.blade.php b/resources/views/ManageEvent/Modals/CreateQuestion.blade.php index 64d37cf1..4b1ef7a0 100644 --- a/resources/views/ManageEvent/Modals/CreateQuestion.blade.php +++ b/resources/views/ManageEvent/Modals/CreateQuestion.blade.php @@ -41,16 +41,6 @@ @endforeach -
- - {!! Form::text('instructions', null, [ - 'id' => 'question-instructions', - 'class' => 'form-control', - 'placeholder' => 'e.g. Please enter your post code in the format XXX XX?' - ]) !!} -
has_options) ? ' class="hide"' : '' !!}> diff --git a/resources/views/ManageEvent/Modals/EditQuestion.blade.php b/resources/views/ManageEvent/Modals/EditQuestion.blade.php index 2cea0790..d0c3cadf 100644 --- a/resources/views/ManageEvent/Modals/EditQuestion.blade.php +++ b/resources/views/ManageEvent/Modals/EditQuestion.blade.php @@ -40,18 +40,8 @@ @endforeach -
- - {!! Form::text('instructions', $question->instructions, [ - 'id' => 'question-instructions', - 'class' => 'form-control', - ]) !!} -
- Question Options - +
@foreach ($question->options as $question_option) diff --git a/resources/views/ManageOrganiser/Dashboard.blade.php b/resources/views/ManageOrganiser/Dashboard.blade.php index 7bf10205..b6ce828b 100644 --- a/resources/views/ManageOrganiser/Dashboard.blade.php +++ b/resources/views/ManageOrganiser/Dashboard.blade.php @@ -107,7 +107,7 @@

Recent Orders

@if($organiser->orders->count())
    - @foreach($organiser->orders()->orderBy('created_at', 'desc')->take(30)->get() as $order) + @foreach($organiser->orders()->orderBy('created_at', 'desc')->take(10)->get() as $order)