From 41bc4f68753f99878c496f46868dcbb8e5cbdc11 Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Fri, 12 Oct 2018 18:54:48 +0200 Subject: [PATCH] Tentatively finish poll creation view --- .../2018_10_03_224516_create_polls_table.php | 4 +- resources/views/create_poll.blade.php | 53 ++++++++++- resources/views/layouts/app.blade.php | 87 +++++++++++++++++-- 3 files changed, 134 insertions(+), 10 deletions(-) diff --git a/database/migrations/2018_10_03_224516_create_polls_table.php b/database/migrations/2018_10_03_224516_create_polls_table.php index 38f4a1d..52e1e3c 100644 --- a/database/migrations/2018_10_03_224516_create_polls_table.php +++ b/database/migrations/2018_10_03_224516_create_polls_table.php @@ -16,8 +16,8 @@ class CreatePollsTable extends Migration Schema::create('polls', function (Blueprint $table) { $table->char('id', 6); $table->string('question'); - $table->enum('type', ['cookies', 'codes']); - $table->boolean('multiple_answers_allowed'); + $table->enum('duplicate_vote_checking', ['none', 'cookies', 'codes']); + $table->boolean('allow_multiple_answers'); $table->timestamp('created_at'); $table->timestamp('closes_at')->nullable(); $table->string('admin_password')->nullable(); diff --git a/resources/views/create_poll.blade.php b/resources/views/create_poll.blade.php index 7b76cb8..0313d76 100644 --- a/resources/views/create_poll.blade.php +++ b/resources/views/create_poll.blade.php @@ -6,12 +6,14 @@
@csrf -
+
-
+
+
+ @for ($i = 0; $i < 5; $i++)
@@ -25,7 +27,52 @@
@endfor -
+ +
+
+ +
+ +
+ +
+
+
+ Duplicate vote checking: +
+ +
+ +
+ +
+ +
+
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index d11a8da..55fc398 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -10,18 +10,95 @@ + .no-bottom-margin { margin-bottom: 0!important; } + .some-bottom-margin { margin-bottom: 0.5rem!important; } + .some-bottom-padding { padding-bottom: 3rem!important; } + .some-top-margin { margin-top: 2.0rem; } + .inline-block { display: inline-block; } + + .ta-center { + margin-top: 1rem; + } + + .post-input-label { + display: inline-block; + font-size: 1.2rem; + } + + .number { + display: inline-block; + margin-bottom: 2.4rem; + padding: 0 1rem 0 2rem; + position: relative; + } + + .number > input[type="number"] { + display: inline-block; + border: 1px solid #7d7d7e; + margin-top: 0.5rem; + margin-left: 1rem; + } + + .number > input[type="number"]:focus { + border-color: #e83fb8; + box-shadow: 0 1px 2px 0 #dededf inset; + outline: 0; + } + + input[type="datetime-local"] { + margin-top: 0.2rem; + margin-bottom: 0.2rem; + font-size: 1.3rem; + padding: 0.2rem 0.5rem 0 0.5rem!important; + display: inline-block; + border: 1px solid #7d7d7e; + } + + input[type="datetime-local"]:focus { + border-color: #e83fb8; + box-shadow: 0 1px 2px 0 #dededf inset; + outline: 0; + } + + /* TODO: Fix footer: should stick to bottom (with some padding/margin at the bottom) and centered */ + + body { + min-height: initial; + } + + footer, footer > * { + display: flex; + justify-content: center; + padding-bottom: 0; + } + + input.inline-text[type="text"] { + margin-top: 0.2rem; + margin-bottom: 0.2rem; + padding: 0.2rem 0.5rem 0 0.5rem!important; + font-size: 1.3rem; + display: inline-block; + border: 1px solid #7d7d7e; + } + + input.inline-text[type="text"]:focus { + border-color: #e83fb8; + box-shadow: 0 1px 2px 0 #dededf inset; + outline: 0; + } + -
-

@yield('title') - {{ config('app.name') }}

+
+

@yield('title')

-
+
@yield('content') -
+