Merge remote-tracking branch 'origin/bg-title-color' into develop
This commit is contained in:
commit
cc29ff626a
7 changed files with 74 additions and 3 deletions
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
namespace App\Http\Requests\Bo\Concepts;
|
||||
|
||||
use App\Enums\Concepts\ColorsEnum;
|
||||
use App\Http\Requests\Bo\UpdateMiniCrudRequest;
|
||||
use App\Models\Concept;
|
||||
use App\Traits\Requests\HasPicture;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rules\Enum;
|
||||
|
||||
class StoreConceptRequest extends UpdateMiniCrudRequest
|
||||
{
|
||||
|
|
@ -55,6 +57,9 @@ class StoreConceptRequest extends UpdateMiniCrudRequest
|
|||
'name' => 'required|min:3|max:70',
|
||||
'slug' => 'unique_translation:concepts',
|
||||
'title' => 'required|min:3|max:70',
|
||||
'title_background_color' => [
|
||||
'required', new Enum(ColorsEnum::class)
|
||||
],
|
||||
'subtitle' => 'required|min:3|max:70',
|
||||
'description' => 'required|string|min:15',
|
||||
'data' => 'present|array',
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ class Concept extends Model
|
|||
'name',
|
||||
'slug',
|
||||
'title',
|
||||
'title_background_color',
|
||||
'subtitle',
|
||||
'description',
|
||||
'data',
|
||||
|
|
@ -64,6 +65,7 @@ class Concept extends Model
|
|||
*/
|
||||
protected $casts = [
|
||||
'data' => 'object',
|
||||
'title_background_color' => ColorsEnum::class
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use App\Enums\Concepts\ColorsEnum;
|
||||
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(): void
|
||||
{
|
||||
Schema::table('concepts', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('title_background_color')
|
||||
->default(ColorsEnum::redwine->value())
|
||||
->after('title')
|
||||
->comment('Couleur de fond du titre');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('concepts', function (Blueprint $table) {
|
||||
$table->dropColumn('title_background_color');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -98,6 +98,33 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- TITLE BACKGROUND COLOR --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ __('Title background color') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('bo.partials.inputs.tinyint-enum', [
|
||||
'id' => 'productTitleBackgroundColor',
|
||||
'label' => __('Title background color *'),
|
||||
'name' => "title_background_color",
|
||||
'model' => $conceptModel ?? null,
|
||||
'value' => old('title_background_color', $conceptModel->title_background_color ?? null),
|
||||
'required' => true,
|
||||
'associatedModels' => collect(\App\Enums\Concepts\ColorsEnum::all())
|
||||
->map(fn ($enum) => (object)[
|
||||
'label' => $enum->label(),
|
||||
'value' => $enum->value(),
|
||||
]),
|
||||
'helper' => __('Title background color *'),
|
||||
])
|
||||
@include('modules.input-error', [
|
||||
'inputName' => "title_background_color"
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- SUBTITLE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<svg class="absolute right-4 -bottom-3 sm:-bottom-4 md:-bottom-5 lg:-bottom-6 h-[40px] sm:h-[50px] md:h-[60px] text-weinrot" viewBox="0 0 313 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_219_44709)">
|
||||
@php
|
||||
$color = \App\Enums\Concepts\ColorsEnum::make($conceptModel->data['bloc_1_color']['value']);
|
||||
$color = \App\Enums\Concepts\ColorsEnum::make($conceptModel->title_background_color);
|
||||
@endphp
|
||||
<path d="M312.425 3.98605C311.085 6.46369 309.583 8.59519 308.89 10.7631C308.128 13.095 307.319 13.6416 300.85 14.7346C301.474 15.937 301.474 17.1394 302.814 18.2143C304.131 19.2527 306.811 20.1272 307.088 21.0745C306.51 21.8214 305.748 22.5501 305.355 23.2971C304.593 24.7181 304.339 26.1937 303.16 27.5783C302.837 27.9609 299.995 28.1613 297.847 28.5256C300.088 29.309 302.698 30.2017 305.956 31.3494C304.616 31.7684 302.837 32.315 300.85 32.9162C302.028 33.2259 303.415 33.572 305.078 34.0092C301.543 35.4485 297.477 36.9423 309.075 37.9625C305.702 38.3998 304.085 38.6002 302.283 38.837C304.57 39.4018 305.864 39.7297 307.157 40.0394C304.223 40.9503 302.028 42.1162 298.678 42.5717C285.464 44.3206 272.249 45.5594 256.746 44.7214C243.809 44.0291 230.109 44.5574 216.778 44.4299C209.015 44.357 201.322 44.0291 193.559 43.8287C192.52 43.7923 191.434 43.8287 190.371 43.8287C178.265 43.9562 166.136 44.0473 154.053 44.2477C149.34 44.3206 144.72 44.8125 140.007 44.8489C125.983 44.9582 111.959 44.9582 97.9358 44.9582C81.2554 44.9582 64.5981 45.0311 47.9639 44.8854C41.726 44.8307 35.5344 44.3024 29.4352 43.8469C28.049 43.7376 27.0556 43.0453 26.2008 42.5899C25.138 41.9705 24.3063 41.2964 23.0587 40.4402C20.425 41.4422 18.5305 42.1709 16.6823 42.8632C12.6624 40.5495 9.12758 38.5091 5.5235 36.4504C3.97559 35.576 4.738 34.574 1.66529 33.6813C-1.82328 32.6611 0.972194 31.4587 6.2859 30.8211C4.55317 29.6734 2.63562 28.6167 1.43426 27.5054C0.71806 26.8678 0.879782 26.1209 1.0415 25.4286C1.68839 22.6595 2.47389 19.8721 3.2594 17.103C3.32871 16.8479 3.65215 16.6293 3.76767 16.3743C4.32214 15.2812 12.593 14.3885 4.738 13.095C9.54344 11.4918 1.27253 11.2186 1.45736 10.3623C4.32214 8.57697 7.55657 7.01023 9.38172 5.29774C10.6986 4.05892 12.8703 3.74921 16.8209 3.67634C40.6864 3.25733 64.5288 2.63792 88.4174 2.38287C119.306 2.07316 150.241 1.76346 181.153 1.83633C217.564 1.92742 253.974 2.4193 290.361 2.8201C296.669 2.89297 302.929 3.29376 309.19 3.58525C310.6 3.65812 311.94 3.91318 312.425 3.96783" fill="{{ $color->color() }}" />
|
||||
</g>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ export default defineConfig({
|
|||
},
|
||||
plugins: [
|
||||
checker({
|
||||
enableBuild: true,
|
||||
vueTsc: {
|
||||
root: ".",
|
||||
tsconfigPath: "tsconfig.json",
|
||||
|
|
@ -80,7 +81,7 @@ export default defineConfig({
|
|||
"**/vendor/**/*.scss",
|
||||
"**/vendor/**/*.css",
|
||||
],
|
||||
lintOnStart: true,
|
||||
lintOnStart: false,
|
||||
emitError: true,
|
||||
emitWarning: true,
|
||||
emitErrorAsWarning: false,
|
||||
|
|
@ -90,7 +91,7 @@ export default defineConfig({
|
|||
cache: false,
|
||||
extensions: ["js", "ts"],
|
||||
include: "**/*.ts",
|
||||
lintOnStart: true,
|
||||
lintOnStart: false,
|
||||
emitWarning: true,
|
||||
emitError: true,
|
||||
failOnWarning: false,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue