Add poll view stub
This commit is contained in:
parent
5d5ee08b48
commit
f627e545b8
|
@ -17,17 +17,17 @@
|
|||
<br>
|
||||
|
||||
@for ($i = 0; $i < 5; $i++)
|
||||
<section class="grid grid--large">
|
||||
<div class="textfield">
|
||||
<input type="text" class="option" name="options[]" placeholder="Enter a poll option" @if($i == 0 ) required @endif>
|
||||
</div>
|
||||
<div class="textfield">
|
||||
<input type="text" class="option" name="options[]" placeholder="Enter a poll option" @if($i == 0 ) required @endif>
|
||||
</div>
|
||||
<div class="textfield">
|
||||
<input type="text" class="option" name="options[]" placeholder="Enter a poll option">
|
||||
</div>
|
||||
</section>
|
||||
<section class="grid grid--large">
|
||||
<div class="textfield">
|
||||
<input type="text" class="option" name="options[]" placeholder="Enter a poll option" @if($i == 0 ) required @endif>
|
||||
</div>
|
||||
<div class="textfield">
|
||||
<input type="text" class="option" name="options[]" placeholder="Enter a poll option" @if($i == 0 ) required @endif>
|
||||
</div>
|
||||
<div class="textfield">
|
||||
<input type="text" class="option" name="options[]" placeholder="Enter a poll option">
|
||||
</div>
|
||||
</section>
|
||||
@endfor
|
||||
|
||||
<section class="grid grid--large">
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('title', $poll->question)
|
||||
|
||||
@php
|
||||
$type = $poll->allow_multiple_answers ? "checkbox" : "radio";
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
<form>
|
||||
<section class="grid grid--large">
|
||||
<div>
|
||||
@foreach ($poll->options as $option)
|
||||
<label class="{{$type}} no-bottom-margin">
|
||||
<input type="{{$type}}" name="option" value="{{$option->id}}">
|
||||
<span class="{{$type}}__label">{{$option->text}}</span>
|
||||
</label>
|
||||
|
||||
<br>
|
||||
@endforeach
|
||||
</div>
|
||||
<div>
|
||||
<!-- TODO: Pie chart (http://lavacharts.com/#example-pie) -->
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="some-top-margin">
|
||||
<input type="submit" class="btn" value="Submit vote">
|
||||
</section>
|
||||
</form>
|
||||
@endsection
|
Loading…
Reference in New Issue