Skip to content

A free open source IT asset/license management system

Added colorpickers for link colors

snipe2d001c4fa1b5
diff --git a/resources/views/blade/input/colorpicker.blade.php b/resources/views/blade/input/colorpicker.blade.php
index 10f2865a35..b53dfb99a5 100644
--- a/resources/views/blade/input/colorpicker.blade.php
+++ b/resources/views/blade/input/colorpicker.blade.php
@@ -2,12 +2,13 @@
'item' => null,
'name' => 'color',
'id' => 'color',
+ 'div_id' => null
])
<!-- Colorpicker -->
-<div id="color" class="input-group colorpicker-component row col-md-5">
+<div {{ $attributes->merge(['class' => 'color input-group colorpicker-component row col-md-5']) }} id="{{ $div_id }}">
<input class="form-control" placeholder="#FF0000" aria-label="{{ $name }}" name="{{ $name }}" type="text" id="{{ $id }}" value="{{ old($name, ($item->{$name} ?? '')) }}">
- <span class="input-group-addon"><i></i></span>
+ <span class="input-group-addon"><i> </i></span>
</div>
<!-- /.input group -->
diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php
index 4ee2cff96c..0d29cae74f 100644
--- a/resources/views/layouts/default.blade.php
+++ b/resources/views/layouts/default.blade.php
@@ -61,7 +61,7 @@
--color-bg: #ecf0f5;
--color-fg: #000000;
--header-color: #000000;
- --link-color: hsl(from var(--main-theme-color) h s calc(l - 10));
+ --link-color: {{ $snipeSettings->link_light_color ?? '#5fa4cc' }};
--link-hover: hsl(from var(--link-color) h s calc(l - 10));
--nav-primary-font-color: #ffffff;
--tab-bottom-border: 1px solid var(--box-header-top-border-color);
@@ -93,7 +93,7 @@
--color-bg: #222222;
--color-fg: #ffffff;
--header-color: #ffffff;
- --link-color: hsl(from var(--main-theme-color) h s calc(l + 20));
+ --link-color: {{ $snipeSettings->link_dark_color ?? '#5fa4cc' }};
--link-hover: hsl(from var(--link-color) h s calc(l + 15));
--nav-primary-font-color: #ffffff;
--tab-bottom-border: 1px solid var(--box-header-top-border-color);
@@ -123,7 +123,7 @@
a:hover,
a:focus
{
- color: hsl(from var(--link-hover) h s calc(l + 25)) !important;
+ color: var(--link-hover) !important;
}
@@ -135,7 +135,7 @@
.btn-theme:hover {
background-color: var(--btn-theme-hover);
- color: contrast-color(var(--btn-theme-hover)) !important;
+ color: contrast-color(var(--main-theme-color)) !important;
border: 1px solid hsl(from var(--btn-theme-base) h s calc(l - 15)) !important;
}
@@ -461,9 +461,6 @@
.btn-tableButton.active.focus,
.btn-tableButton.active:focus,
.btn-tableButton.active:hover,
- .btn-tableButton:active.focus,
- .btn-tableButton:active:focus,
- .btn-tableButton:active:hover,
.dropdown-menu > .active > a:focus,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:link,
@@ -1717,7 +1714,7 @@
<script nonce="{{ csrf_token() }}">
//color picker with addon
- $("#color").colorpicker();
+ $(".color").colorpicker();
/**
diff --git a/resources/views/settings/branding.blade.php b/resources/views/settings/branding.blade.php
index 1c7e9c677c..f2f2dd47b6 100644
--- a/resources/views/settings/branding.blade.php
+++ b/resources/views/settings/branding.blade.php
@@ -76,16 +76,33 @@
<div class="form-group {{ $errors->has('header_color') ? 'error' : '' }}">
<label for="header_color" class="col-md-3 control-label">{{ trans('admin/settings/general.header_color') }}</label>
<div class="col-md-9">
- <div id="header-color" class="input-group colorpicker-component row col-md-5">
- <input type="text" class="form-control" placeholder="#FF0000" aria-label="header_color" name="header_color" id="header_color" value="{{ old('header_color', ($setting->header_color ?? '#3c8dbc')) }}" />
- <span class="input-group-addon"><i></i></span>
- </div>
+ <x-input.colorpicker :item="$setting" div_id="header-color" id="header_color" :value="old('link_light_color', ($setting->header_color ?? '#3c8dbc'))" name="header_color" />
<p class="help-block">{{ trans('admin/settings/general.header_color_help') }}</p>
{!! $errors->first('header_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
+ <!-- Light Link color -->
+ <div class="form-group {{ $errors->has('link_light_color') ? 'error' : '' }}">
+ <label for="link_light_color" class="col-md-3 control-label">{{ trans('admin/settings/general.link_light_color') }}</label>
+ <div class="col-md-9">
+ <x-input.colorpicker :item="$setting" id="link_light_color" :value="old('link_light_color', ($setting->link_light_color ?? '#296282'))" name="link_light_color" />
+ {!! $errors->first('link_light_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
+ <p class="help-block">{{ trans('admin/settings/general.link_light_color_help') }}</p>
+ </div>
+ </div>
+
+ <!-- Dark Link color -->
+ <div class="form-group {{ $errors->has('link_dark_color') ? 'error' : '' }}">
+ <label for="link_dark_color" class="col-md-3 control-label">{{ trans('admin/settings/general.link_dark_color') }}</label>
+ <div class="col-md-9">
+ <x-input.colorpicker :item="$setting" id="link_dark_color" :value="old('link_dark_color', ($setting->link_dark_color ?? '#5fa4cc'))" name="link_dark_color" />
+ {!! $errors->first('link_dark_color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
+ <p class="help-block">{{ trans('admin/settings/general.link_dark_color_help') }}</p>
+ </div>
+ </div>
+
<fieldset name="logo-preferences">
<x-form-legend>
{{ trans('admin/settings/general.legends.logos') }}