Removed the instructions field for event questions

This commit is contained in:
Dave Earley 2016-05-05 21:33:26 +01:00
parent 79f8de9653
commit 49b0fac0f5
5 changed files with 33 additions and 24 deletions

View File

@ -71,7 +71,6 @@ class EventSurveyController extends MyBaseController
// Create question. // Create question.
$question = Question::createNew(false, false, true); $question = Question::createNew(false, false, true);
$question->title = $request->get('title'); $question->title = $request->get('title');
$question->instructions = $request->get('instructions');
$question->is_required = ($request->get('is_required') == 'yes') ; $question->is_required = ($request->get('is_required') == 'yes') ;
$question->question_type_id = $request->get('question_type_id'); $question->question_type_id = $request->get('question_type_id');
$question->save(); $question->save();
@ -146,7 +145,6 @@ class EventSurveyController extends MyBaseController
// Create question. // Create question.
$question = Question::scope()->findOrFail($question_id); $question = Question::scope()->findOrFail($question_id);
$question->title = $request->get('title'); $question->title = $request->get('title');
$question->instructions = $request->get('instructions');
$question->is_required = $request->get('is_required'); $question->is_required = $request->get('is_required');
$question->question_type_id = $request->get('question_type_id'); $question->question_type_id = $request->get('question_type_id');
$question->save(); $question->save();

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveInstructionsFieldQuestionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('questions', function (Blueprint $table) {
$table->dropColumn('instructions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('questions', function (Blueprint $table) {
$table->string('instructions');
});
}
}

View File

@ -41,16 +41,6 @@
@endforeach @endforeach
</select> </select>
</div> </div>
<div class="form-group">
<label for="question-instructions">
Instructions
</label>
{!! Form::text('instructions', null, [
'id' => 'question-instructions',
'class' => 'form-control',
'placeholder' => 'e.g. Please enter your post code in the format XXX XX?'
]) !!}
</div>
<fieldset id="question-options" {!! empty($question->has_options) ? ' class="hide"' : '' !!}> <fieldset id="question-options" {!! empty($question->has_options) ? ' class="hide"' : '' !!}>

View File

@ -40,18 +40,8 @@
@endforeach @endforeach
</select> </select>
</div> </div>
<div class="form-group">
<label for="question-instructions">
Instructions
</label>
{!! Form::text('instructions', $question->instructions, [
'id' => 'question-instructions',
'class' => 'form-control',
]) !!}
</div>
<fieldset id="question-options" class="{{ $question->has_options ? 'hide' : '' }}" > <fieldset id="question-options" class="{{ $question->has_options ? 'hide' : '' }}" >
<legend>Question Options</legend> <table >
<table class="table">
<tbody> <tbody>
@foreach ($question->options as $question_option) @foreach ($question->options as $question_option)
<tr> <tr>

View File

@ -107,7 +107,7 @@
<h4 style="margin-bottom: 25px;margin-top: 20px;">Recent Orders</h4> <h4 style="margin-bottom: 25px;margin-top: 20px;">Recent Orders</h4>
@if($organiser->orders->count()) @if($organiser->orders->count())
<ul class="list-group"> <ul class="list-group">
@foreach($organiser->orders()->orderBy('created_at', 'desc')->take(30)->get() as $order) @foreach($organiser->orders()->orderBy('created_at', 'desc')->take(10)->get() as $order)
<li class="list-group-item"> <li class="list-group-item">
<h6 class="ellipsis"> <h6 class="ellipsis">
<a href="{{ route('showEventDashboard', ['event_id' => $order->event->id]) }}"> <a href="{{ route('showEventDashboard', ['event_id' => $order->event->id]) }}">