Removed unused skin files, added skin setting option

This commit is contained in:
snipe 2018-03-02 17:50:40 -08:00
parent ef91cc992e
commit f171357e36
28 changed files with 87 additions and 19 deletions

View file

@ -386,6 +386,7 @@ class SettingsController extends Controller
$setting->header_color = $request->input('header_color'); $setting->header_color = $request->input('header_color');
$setting->support_footer = $request->input('support_footer'); $setting->support_footer = $request->input('support_footer');
$setting->footer_text = $request->input('footer_text'); $setting->footer_text = $request->input('footer_text');
$setting->skin = $request->input('skin');
$setting->show_url_in_emails = $request->input('show_url_in_emails', '0'); $setting->show_url_in_emails = $request->input('show_url_in_emails', '0');

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddThemeToSettings extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->char('skin')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn('skin');
});
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -177,6 +177,7 @@
'settings' => 'Settings', 'settings' => 'Settings',
'sign_in' => 'Sign in', 'sign_in' => 'Sign in',
'signature' => 'Signature', 'signature' => 'Signature',
'skin' => 'Skin',
'some_features_disabled' => 'DEMO MODE: Some features are disabled for this installation.', 'some_features_disabled' => 'DEMO MODE: Some features are disabled for this installation.',
'site_name' => 'Site Name', 'site_name' => 'Site Name',
'state' => 'State', 'state' => 'State',

View file

@ -511,3 +511,22 @@ Form::macro('customfield_elements', function ($name = "customfield_elements", $s
return $select; return $select;
}); });
Form::macro('skin', function ($name = "skin", $selected = null, $class = null) {
$formats = array(
'' => 'Default Blue',
'skin-green-dark.css' => 'Green Dark',
);
$select = '<select name="'.$name.'" class="'.$class.'" style="width: 250px">';
foreach ($formats as $format => $label) {
$select .= '<option value="'.$format.'"'.($selected == $format ? ' selected="selected"' : '').'>'.$label.'</option> '."\n";
}
$select .= '</select>';
return $select;
});

View file

@ -31,30 +31,33 @@
</script> </script>
@if (($snipeSettings) && ($snipeSettings->skin!=''))
<link rel="stylesheet" href="{{ url('css/skins/'.$snipeSettings->skin) }}">
@endif
<style nonce="{{ csrf_token() }}"> <style nonce="{{ csrf_token() }}">
@if ($snipeSettings) @if (($snipeSettings) && ($snipeSettings->header_color!=''))
@if ($snipeSettings->header_color) .main-header .navbar, .main-header .logo {
.main-header .navbar, .main-header .logo { background-color: {{ $snipeSettings->header_color }};
background-color: {{ $snipeSettings->header_color }}; background: -webkit-linear-gradient(top, {{ $snipeSettings->header_color }} 0%,{{ $snipeSettings->header_color }} 100%);
background: -webkit-linear-gradient(top, {{ $snipeSettings->header_color }} 0%,{{ $snipeSettings->header_color }} 100%); background: linear-gradient(to bottom, {{ $snipeSettings->header_color }} 0%,{{ $snipeSettings->header_color }} 100%);
background: linear-gradient(to bottom, {{ $snipeSettings->header_color }} 0%,{{ $snipeSettings->header_color }} 100%); border-color: {{ $snipeSettings->header_color }};
border-color: {{ $snipeSettings->header_color }}; }
} .skin-blue .sidebar-menu > li:hover > a, .skin-blue .sidebar-menu > li.active > a {
.skin-blue .sidebar-menu > li:hover > a, .skin-blue .sidebar-menu > li.active > a { border-left-color: {{ $snipeSettings->header_color }};
border-left-color: {{ $snipeSettings->header_color }}; }
}
.btn-primary { .btn-primary {
background-color: {{ $snipeSettings->header_color }}; background-color: {{ $snipeSettings->header_color }};
border-color: {{ $snipeSettings->header_color }}; border-color: {{ $snipeSettings->header_color }};
} }
@endif
@endif @if (($snipeSettings) && ($snipeSettings->custom_css!=''))
@if ($snipeSettings->custom_css)
{!! $snipeSettings->show_custom_css() !!} {!! $snipeSettings->show_custom_css() !!}
@endif @endif
@endif
@media (max-width: 400px) { @media (max-width: 400px) {
.navbar-left { .navbar-left {
margin: 2px; margin: 2px;

View file

@ -120,6 +120,18 @@
</div> </div>
</div> </div>
<!-- Email format -->
<div class="form-group {{ $errors->has('skin') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('skin', trans('general.skin')) }}
</div>
<div class="col-md-9">
{!! Form::skin('skin', Input::old('skin', $setting->skin), 'select2') !!}
{!! $errors->first('skin', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
<!-- Custom css --> <!-- Custom css -->
<div class="form-group {{ $errors->has('custom_css') ? 'error' : '' }}"> <div class="form-group {{ $errors->has('custom_css') ? 'error' : '' }}">
<div class="col-md-3"> <div class="col-md-3">