Add poll view stub

This commit is contained in:
Les De Ridder 2018-10-16 04:28:44 +02:00
parent 5d5ee08b48
commit f627e545b8
2 changed files with 42 additions and 11 deletions

View File

@ -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">

View File

@ -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