обновлен модуль оформления

This commit is contained in:
developer 2026-03-26 14:51:09 +08:00
parent 1babe189ec
commit 3094b90e16
5 changed files with 53 additions and 13 deletions

View File

@ -69,6 +69,25 @@
name="menu_btn_hover_text_color" value="{{ ($parameters['menu_btn_hover_text_color'] ?? '') }}"> name="menu_btn_hover_text_color" value="{{ ($parameters['menu_btn_hover_text_color'] ?? '') }}">
</div> </div>
</div> </div>
<h5 class="mt-3">Заголовки и надписи</h5>
<div class="d-flex flex-column gap-3">
<div class="col d-flex flex-row justify-content-start align-items-center gap-2 bg-light rounded p-2">
<label for="title" class="form-label m-0 w-25">Название</label>
<input type="text" class="form-control" id="title" name="title" value="{{ ($parameters['title'] ?? '') }}">
</div>
<div class="col d-flex flex-row justify-content-start align-items-center gap-2 bg-light rounded p-2">
<label for="phone" class="form-label m-0 w-25">Телефон</label>
<input type="text" class="form-control" id="phone" name="phone" value="{{ ($parameters['phone'] ?? '') }}">
</div>
<div class="col d-flex flex-row justify-content-start align-items-center gap-2 bg-light rounded p-2">
<label for="phone_description" class="form-label m-0 w-25">Подпись телефона</label>
<input type="text" class="form-control" id="phone_description" name="phone_description" value="{{ ($parameters['phone_description'] ?? '') }}">
</div>
<div class="col d-flex flex-row justify-content-start align-items-center gap-2 bg-light rounded p-2">
<label for="copyright" class="form-label m-0 w-25">Copyright</label>
<input type="text" class="form-control" id="copyright" name="copyright" value="{{ ($parameters['copyright'] ?? '') }}">
</div>
</div>
<input type="submit" class="btn btn-primary mt-3" value="Сохранить" /> <input type="submit" class="btn btn-primary mt-3" value="Сохранить" />
</form> </form>
@endsection @endsection

View File

@ -15,6 +15,10 @@ class Design extends Model
]; ];
public const parameters = [ public const parameters = [
'title',
'copyright',
'phone',
'phone_description',
'logo', 'logo',
'page_color', 'page_color',
'text_color', 'text_color',
@ -33,7 +37,7 @@ public static function getParameters() {
} }
foreach (self::parameters as $parameter) { foreach (self::parameters as $parameter) {
if (!array_key_exists($parameter, $parameters)) { if (!array_key_exists($parameter, $parameters)) {
$parameters[$parameter] = null; //$parameters[$parameter] = null;
} }
} }
return $parameters; return $parameters;

View File

@ -7,6 +7,7 @@
use Livewire\Livewire; use Livewire\Livewire;
use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Gate;
use Modules\Main\Models\Design;
class ModuleServiceProvider extends ServiceProvider class ModuleServiceProvider extends ServiceProvider
{ {
@ -27,6 +28,11 @@ public function boot()
$this->registerComponent(); $this->registerComponent();
$this->registerLivewire(); $this->registerLivewire();
$this->registerHelpers(); $this->registerHelpers();
define('DESIGN_PARAMETERS', Design::getParameters());
if (array_key_exists('title', DESIGN_PARAMETERS)) {
\Config::set('app.name', DESIGN_PARAMETERS['title']);
}
} }
protected function registerViews() protected function registerViews()
@ -83,8 +89,7 @@ protected function registerPolicies()
protected function registerHelpers() protected function registerHelpers()
{ {
$files = glob(__DIR__ . '/../Helpers/' . "*.php"); $files = glob(__DIR__ . '/../Helpers/' . "*.php");
foreach ($files as $key => $file) foreach ($files as $key => $file) {
{
require_once $file; require_once $file;
} }
} }

View File

@ -1,6 +1,11 @@
<?php <?php
use Modules\Main\Models\Design; use Modules\Main\Models\Design;
define('DESIGN_PARAMETERS', Design::getParameters()); /*define('DESIGN_PARAMETERS', Design::getParameters());
if (array_key_exists('title', DESIGN_PARAMETERS)) {
Config::set('app.name', DESIGN_PARAMETERS['title']);
}*/
?> ?>
<style> <style>
@if(array_key_exists('page_color', DESIGN_PARAMETERS)) @if(array_key_exists('page_color', DESIGN_PARAMETERS))

View File

@ -68,9 +68,14 @@
</h3> </h3>
<div class="justify-content-center float-md-end"> <div class="justify-content-center float-md-end">
<div> <div>
@if(array_key_exists('phone', DESIGN_PARAMETERS))
<span class="fw-bold py-1 px-0 fs-3 text-secondary" aria-current="page" <span class="fw-bold py-1 px-0 fs-3 text-secondary" aria-current="page"
href="#">8-800-222-06-10</span> href="#">{{ DESIGN_PARAMETERS['phone'] }}</span>
<div>Звонок по РФ бесплатный</div> @if(array_key_exists('phone_description', DESIGN_PARAMETERS))
<div>{{ DESIGN_PARAMETERS['phone_description'] }}</div>
@endif
@endif
</div> </div>
</div> </div>
</header> </header>
@ -82,7 +87,9 @@
</main> </main>
<footer class="mt-auto"> <footer class="mt-auto">
<div class="container"> <div class="container">
<span class="text-body-secondary">&copy; Группа компаний «АЛЬФА»</span> @if(array_key_exists('copyright', DESIGN_PARAMETERS))
<span class="text-body-secondary">&copy; {{ DESIGN_PARAMETERS['copyright'] }}</span>
@endif
</div> </div>
</footer> </footer>
</div> </div>