Skip to content

Commit

Permalink
Added option to select brand type text or logo or text + logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan committed Oct 12, 2015
1 parent 485b34b commit a6586b5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/controllers/admin/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public function postEdit()
// 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',
Expand Down Expand Up @@ -115,6 +116,7 @@ public function postEdit()

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'));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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');
});
}

}
7 changes: 6 additions & 1 deletion app/views/backend/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion app/views/backend/settings/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit a6586b5

Please sign in to comment.