Eliminate style attributes

This commit is contained in:
Les De Ridder 2018-10-19 20:45:48 +02:00
parent 8d01a2689d
commit b1c06ae55b
4 changed files with 18 additions and 9 deletions

View File

@ -19,9 +19,6 @@ class PollController extends Controller
return view('create_poll'); return view('create_poll');
} }
//TODO: Close polls
//TODO: Implement poll editing
public function create(Request $request) public function create(Request $request)
{ {
if($request->has('options')) { if($request->has('options')) {
@ -268,7 +265,7 @@ class PollController extends Controller
$extraCodes = $request->session()->pull('extraCodes', null); $extraCodes = $request->session()->pull('extraCodes', null);
if($poll->admin_password == null || $request->query('password') != $poll->admin_password) { if($poll->admin_password == null || $request->query('password') != $poll->admin_password) {
return redirect()->action('PollController@view', ['poll' => $poll]); return redirect()->action('PollController@viewResults', ['poll' => $poll]);
} }
return view('edit_poll')->with('poll', $poll)->with('changed', $changed)->with('extraCodes', $extraCodes); return view('edit_poll')->with('poll', $poll)->with('changed', $changed)->with('extraCodes', $extraCodes);

View File

@ -100,7 +100,7 @@
<input type="hidden" name="automatically_close_poll" value="1"> <input type="hidden" name="automatically_close_poll" value="1">
<input type="hidden" name="automatically_close_poll_datetime" value="now"> <input type="hidden" name="automatically_close_poll_datetime" value="now">
<input type="submit" class="btn" style="width:100%" value="Close poll now"> <input type="submit" class="btn huge-button" value="Close poll now">
</div> </div>
</form> </form>
</section> </section>

View File

@ -17,12 +17,24 @@
.some-more-bottom-margin { margin-bottom: 2.0rem; } .some-more-bottom-margin { margin-bottom: 2.0rem; }
.inline-block { display: inline-block; } .inline-block { display: inline-block; }
.text-browser { display: none; } .text-browser { display: none; }
.huge-button { width: 100%; }
.float-right { float: right; }
.primary-box { .primary-box {
padding: 1rem 1rem 1rem 1rem!important; padding: 1rem 1rem 1rem 1rem!important;
border: 2px solid #e83fb8; border: 2px solid #e83fb8;
} }
.vote-bar {
background-color: #e83fb8;
height: 2rem;
}
img.centered-image {
display: block;
margin: 0 auto;
}
.copyarea { .copyarea {
user-select: all; user-select: all;
width: calc(100% - 0.4rem); width: calc(100% - 0.4rem);

View File

@ -38,10 +38,10 @@
<div> <div>
<span>{{ $option->text }}</span> <span>{{ $option->text }}</span>
<span class="text-browser">:</span> <span class="text-browser">:</span>
<span style="float:right">{{ $votes }} votes</span> <span class="float-right">{{ $votes }} votes</span>
</div> </div>
<div> <div>
<div style="background-color:#e83fb8;height:2rem;width:{{ $total == 0 ? 0 : ($votes / $total * 100) }}%;" "{{ $total == 0 ? 0 : ($votes / $total * 100)}}% of votes"> <div class="vote-bar" style="width:{{ $total == 0 ? 0 : ($votes / $total * 100) }}%;">
<div class="text-browser"> <div class="text-browser">
<span>{{ $total == 0 ? 0 : round($votes / $total * 100, 2) }}% of votes</span> <span>{{ $total == 0 ? 0 : round($votes / $total * 100, 2) }}% of votes</span>
<br><br> <br><br>
@ -60,14 +60,14 @@
@if ($total != 0) @if ($total != 0)
<div class="primary-box"> <div class="primary-box">
<img src="{{ $cache['pie_chart']}}" style="display:block;margin: 0 auto"> <img src="{{ $cache['pie_chart']}}" class="centered-image">
<br> <br>
<div class="text-browser"><br></div> <div class="text-browser"><br></div>
@foreach ($nonZeroOptions as $option) @foreach ($nonZeroOptions as $option)
<img src="{{ $cache['colour_squares'][$option->id] }}" style="display:inline-block"> <img src="{{ $cache['colour_squares'][$option->id] }}" class="inline-block">
<span>{{ $option->text }}</span> <span>{{ $option->text }}</span>
<br> <br>