Skip to content

Commit

Permalink
Secondary color for Back button
Browse files Browse the repository at this point in the history
  • Loading branch information
formsdev committed Aug 11, 2023
1 parent 7e75343 commit 755689f
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/Http/Requests/UserFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function rules()
'logo_picture' => 'url|nullable',
'dark_mode' => ['required',Rule::in(Form::DARK_MODE_VALUES)],
'color' => 'required|string',
'secondary_color' => 'required|string',
'hide_title' => 'required|boolean',
'uppercase_labels' => 'required|boolean',
'no_branding' => 'required|boolean',
Expand Down
1 change: 1 addition & 0 deletions app/Http/Resources/FormResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ private function getPasswordProtectedForm()
'dark_mode' => $this->dark_mode,
'transparent_background' => $this->transparent_background,
'color' => $this->color,
'secondary_color' => $this->secondary_color,
'is_password_protected' => true,
'has_password' => $this->has_password,
'width' => 'centered',
Expand Down
1 change: 1 addition & 0 deletions app/Models/Forms/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Form extends Model
'logo_picture',
'dark_mode',
'color',
'secondary_color',
'uppercase_labels',
'no_branding',
'hide_title',
Expand Down
1 change: 1 addition & 0 deletions database/factories/FormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function definition()
'width' => $this->faker->randomElement(Form::WIDTHS),
'dark_mode' => $this->faker->randomElement(Form::DARK_MODE_VALUES),
'color' => '#3B82F6',
'secondary_color' => '#CBD5E1',
'hide_title' => false,
'no_branding' => false,
'uppercase_labels' => true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('forms', function (Blueprint $table) {
$table->string('secondary_color')->default('#CBD5E1');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('forms', function (Blueprint $table) {
$table->dropColumn('secondary_color');
});
}
};
2 changes: 1 addition & 1 deletion resources/js/components/open/forms/OpenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<!-- Submit, Next and previous buttons -->
<div class="flex flex-wrap justify-center w-full">
<open-form-button v-if="currentFieldGroupIndex>0 && previousFieldsPageBreak && !loading" native-type="button"
:color="form.color" :theme="theme" class="mt-2 px-8 mx-1" @click="previousPage"
:color="form.secondary_color" :theme="theme" class="mt-2 px-8 mx-1" @click="previousPage"
>
{{ previousFieldsPageBreak.previous_btn_text }}
</open-form-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@
:form="form" label="Dark Mode"
/>
<color-input name="color" class="mt-4"
:form="form"
label="Color (for buttons & inputs border)"
:form="form"
label="Color"
help="Buttons & inputs border"
/>
<color-input name="secondary_color" class="mt-4"
:form="form"
label="Secondary Color"
help="Back buttons"
/>
<toggle-switch-input name="hide_title" :form="form" class="mt-4"
label="Hide Title"
Expand Down
1 change: 1 addition & 0 deletions resources/js/mixins/form_editor/initForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
width: 'centered',
dark_mode: 'auto',
color: '#3B82F6',
secondary_color: '#CBD5E1',
hide_title: false,
no_branding: false,
uppercase_labels: true,
Expand Down

0 comments on commit 755689f

Please sign in to comment.