Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e143017
Tinkering with CSS/JS dark more
snipe Nov 26, 2025
34612ac
Experiment: light/dark simplifcation
snipe Nov 26, 2025
a974c6d
Moved icon-med
snipe Nov 26, 2025
9f6f0f0
Few more tweaks
snipe Nov 26, 2025
d203cec
Removed indicidual skins
snipe Nov 26, 2025
30a4308
More variablization
snipe Nov 26, 2025
5beb068
More updates for dark and light switches
snipe Nov 26, 2025
a17f167
Fix button overrides
snipe Nov 26, 2025
d4ee91f
Removed a few classes
snipe Nov 27, 2025
efea043
Added dark/light text
snipe Nov 27, 2025
af1e496
Added correct box class
snipe Nov 27, 2025
490c50a
Added fa-fw to action buttons
snipe Nov 27, 2025
139d1cd
Added a few more classes
snipe Nov 27, 2025
c547249
Show header color preview
snipe Nov 27, 2025
9a1e9f9
Better preview for header color, updated text
snipe Nov 27, 2025
4dff662
Added contrast-color to dynamically pick white/black for topnav
snipe Nov 27, 2025
a321ad9
Handle select2 stuff
snipe Nov 28, 2025
8ddac4d
More select2 styling :(
snipe Nov 28, 2025
6d958b6
Added fa-fw to arrow class
snipe Nov 28, 2025
5cc261d
Smaller LDAP screen
snipe Nov 28, 2025
20a75bb
More styles
snipe Nov 28, 2025
4e4b8dd
And more updates
snipe Nov 28, 2025
772c297
Use css variable
snipe Nov 28, 2025
dac684c
Update demo settings
snipe Nov 28, 2025
cbd6b57
Removed skin from user profile update
snipe Nov 28, 2025
2d001c4
Added colorpickers for link colors
snipe Nov 28, 2025
8df643a
Removed user skin option
snipe Nov 28, 2025
3bf84d9
Update language
snipe Nov 28, 2025
d97f690
Save settings controller
snipe Nov 28, 2025
28d5d24
Migration to handle skins
snipe Nov 28, 2025
56d97a1
Updated map
snipe Nov 28, 2025
97ffe33
Check that a setting record exists
snipe Nov 28, 2025
255a2ec
Sigh
snipe Nov 28, 2025
fadfe0a
Removed old skin references
snipe Nov 28, 2025
db1b35c
Fixed style
snipe Nov 28, 2025
7820636
Nicer defaults
snipe Nov 29, 2025
2e269d2
Removed old skin less files
snipe Nov 29, 2025
6a99132
More tweaks
snipe Dec 2, 2025
c9a03cf
Final color tweaks
snipe Dec 2, 2025
1409d01
Tweaked color
snipe Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/Console/Commands/ResetDemoSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ public function handle()
$settings->logo = 'snipe-logo.png';
$settings->alert_email = '[email protected]';
$settings->login_note = 'Use `admin` / `password` to login to the demo.';
$settings->header_color = null;
$settings->header_color = '#3c8dbc';
$settings->link_dark_color = '#084d73';
$settings->link_light_color = '#86cbf2;';
$settings->label2_2d_type = 'QRCODE';
$settings->default_currency = 'USD';
$settings->brand = 2;
$settings->ldap_enabled = 0;
$settings->full_multiple_companies_support = 0;
$settings->label2_1d_type = 'C128';
$settings->skin = '';
$settings->email_domain = 'snipeitapp.com';
$settings->email_format = 'filastname';
$settings->username_format = 'filastname';
Expand All @@ -80,6 +81,8 @@ public function handle()

if ($user = User::where('username', '=', 'admin')->first()) {
$user->locale = 'en-US';
$user->enable_confetti = 1;
$user->enable_sounds = 1;
$user->save();
}

Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ public function postIndex(ImageUploadRequest $request) : RedirectResponse
$user->last_name = $request->input('last_name');
$user->website = $request->input('website');
$user->gravatar = $request->input('gravatar');
$user->skin = $request->input('skin');
$user->phone = $request->input('phone');
$user->enable_sounds = $request->input('enable_sounds', false);
$user->enable_confetti = $request->input('enable_confetti', false);
$user->link_light_color = $request->input('link_light_color', '#296282');
$user->link_dark_color = $request->input('link_dark_color', '#296282');
$user->nav_link_color = $request->input('nav_link_color', '#FFFFFF');

if (! config('app.lock_passwords')) {
$user->locale = $request->input('locale');
Expand Down
5 changes: 3 additions & 2 deletions app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,12 @@ public function postBranding(ImageUploadRequest $request) : RedirectResponse

$setting->brand = $request->input('brand', '1');
$setting->header_color = $request->input('header_color');
$setting->link_light_color = $request->input('link_light_color', '#296282');
$setting->link_dark_color = $request->input('link_dark_color', '#296282');
$setting->nav_link_color = $request->input('nav_link_color', '#FFFFFF');
$setting->support_footer = $request->input('support_footer');
$setting->version_footer = $request->input('version_footer');
$setting->footer_text = $request->input('footer_text');
$setting->skin = $request->input('skin');
$setting->allow_user_skin = $request->input('allow_user_skin', '0');
$setting->show_url_in_emails = $request->input('show_url_in_emails', '0');
$setting->logo_print_assets = $request->input('logo_print_assets', '0');
$setting->load_remote = $request->input('load_remote', 0);
Expand Down
1 change: 1 addition & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\CheckForTwoFactor::class,
\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
\App\Http\Middleware\AssetCountForSidebar::class,
\App\Http\Middleware\CheckColorSettings::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
Expand Down
68 changes: 68 additions & 0 deletions app/Http/Middleware/CheckColorSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

namespace App\Http\Middleware;

use App\Models\Setting;
use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Support\Facades\Auth;

class CheckColorSettings
{
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;

/**
* Create a new filter instance.
*
* @param Guard $auth
* @return void
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}

/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($settings = Setting::getSettings()) {
$nav_color = $settings->nav_link_color;
$link_dark_color = $settings->link_dark_color;
$link_light_color = $settings->link_light_color;
}


// Override system settings
if ($request->user()) {

if ($request->user()->nav_color) {
$nav_color = $request->user()->nav_color;
}
if ($request->user()->link_dark_color) {
$link_dark_color = $request->user()->link_dark_color;
}
if ($request->user()->nav_color) {
$link_light_color = $request->user()->link_light_color;
}
}


view()->share('nav_link_color', $nav_color);
view()->share('link_dark_color', $link_dark_color);
view()->share('link_light_color', $link_light_color);

return $next($request);

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?php

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

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$setting = DB::table('settings')->select(['skin', 'header_color'])->first();

Schema::table('settings', function (Blueprint $table) {
$table->string('link_dark_color')->after('header_color')->nullable()->default(null);
$table->string('link_light_color')->after('header_color')->nullable()->default(null);
$table->string('nav_link_color')->after('header_color')->nullable()->default(null);
});

Schema::table('users', function (Blueprint $table) {
$table->string('link_dark_color')->after('skin')->nullable()->default(null);
$table->string('link_light_color')->after('skin')->nullable()->default(null);
$table->string('nav_link_color')->after('skin')->nullable()->default(null);
});


// Set Snipe-IT defaults
$link_dark_color = '#89c9ed';
$link_light_color = '#296282';
$nav_color = '#ffffff';
$header_color = '#3c8dbc';

if ($setting) {

switch ($setting->skin) {
case ('green' || 'green-dark'):
$header_color = '#00a65a';
$link_dark_color = '#00a65a';
$link_light_color = '#00a65a';
$nav_color = '#ffffff';

case ('red' || 'red-dark'):
$header_color = '#dd4b39';
$link_dark_color = '#dd4b39';
$link_light_color = '#dd4b39';
$nav_color = '#ffffff';

case ('orange' || 'orange-dark'):
$header_color = '#FF851B';
$link_dark_color = '#FF851B';
$link_light_color = '#FF851B';
$nav_color = '#ffffff';

case ('black' || 'black-dark'):
$header_color = '#000000';
$link_dark_color = '#111';
$link_light_color = '#111';
$nav_color = '#ffffff';

case ('purple' || 'purple-dark'):
$header_color = '#605ca8';
$link_dark_color = '#605ca8';
$link_light_color = '#605ca8';
$nav_color = '#ffffff';

case ('yellow' || 'yellow-dark') :
$header_color = '#f39c12';
$link_dark_color = '#f39c12';
$link_light_color = '#f39c12';
$nav_color = '#ffffff';

case 'contrast':
$header_color = '#001F3F';
$link_dark_color = '#86cbf2';
$link_light_color = '#084d73';
$nav_color = '#ffffff';
break;
}

// Override the header color if the settings have one
if ($setting->header_color) {
$header_color = $setting->header_color;
\Log::debug('A header color was found, so lets use that instead: '.$setting->header_color);
}


DB::table('settings')->update([
'link_light_color' => $link_light_color,
'link_dark_color' => $link_dark_color,
'nav_link_color' => $nav_color,
'header_color' => $header_color]);

DB::table('users')->whereNull('skin')->update([
'link_light_color' => $link_light_color,
'link_dark_color' => $link_dark_color,
'nav_link_color' => $nav_color]);
}

}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('settings', function ($table) {
$table->dropColumn('link_dark_color');
$table->dropColumn('link_light_color');
$table->dropColumn('nav_link_color');
});

Schema::table('users', function ($table) {
$table->dropColumn('link_dark_color');
$table->dropColumn('link_light_color');
$table->dropColumn('nav_link_color');
});
}
};
617 changes: 0 additions & 617 deletions public/css/build/all.css

This file was deleted.

43 changes: 11 additions & 32 deletions public/css/build/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/css/build/app.css.map

Large diffs are not rendered by default.

Loading
Loading