Added option to select brand type text or logo or text + logo

This commit is contained in:
Stefan
2015-10-12 20:34:12 +02:00
parent 485b34b66e
commit a6586b5919
4 changed files with 44 additions and 3 deletions
+3 -1
View File
@@ -68,7 +68,8 @@ class SettingsController extends AdminController
// Declare the rules for the form validation
$rules = array(
"per_page" => 'required|min:1|numeric',
"brand" => 'required|min:1|numeric',
"per_page" => 'required|min:1|numeric',
"qr_text" => 'min:1|max:31',
"logo" => 'mimes:jpeg,bmp,png,gif',
"custom_css" => 'alpha_space',
@@ -115,6 +116,7 @@ class SettingsController extends AdminController
if (Config::get('app.lock_passwords')==false) {
$setting->site_name = e(Input::get('site_name'));
$setting->brand = e(Input::get('brand'));
$setting->custom_css = e(Input::get('custom_css'));
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddBrandToSettings extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function(Blueprint $table)
{
$table->tinyInteger('brand')->default(1);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function(Blueprint $table)
{
$table->dropColumn('brand');
});
}
}
+6 -1
View File
@@ -113,7 +113,12 @@
</button>
@if (Setting::getSettings()->logo)
@if (Setting::getSettings()->brand === 3)
<a class="navbar-brand" href="{{ Config::get('app.url') }}" style="padding: 5px;">
<img src="{{ Config::get('app.url') }}/uploads/{{{ Setting::getSettings()->logo }}}">
{{{ Setting::getSettings()->site_name }}}
</a>
@elseif (Setting::getSettings()->brand === 2)
<a class="navbar-brand" href="{{ Config::get('app.url') }}" style="padding: 5px;">
<img src="{{ Config::get('app.url') }}/uploads/{{{ Setting::getSettings()->logo }}}">
</a>
+1 -1
View File
@@ -102,7 +102,7 @@
{{ Form::label('header_color', Lang::get('admin/settings/general.header_color')) }}
</div>
<div class="col-md-9">
{{ Form::text('header_color', Input::old('header_color', $setting->header_color), array('class' => 'form-control', 'style' => 'width: 100px;')) }}
{{ Form::text('header_color', Input::old('header_color', $setting->header_color), array('class' => 'form-control', 'style' => 'width: 100px;','placeholder' => '#FF0000')) }}
{{ $errors->first('header_color', '<br><span class="alert-msg">:message</span>') }}
</div>
</div>