Skip to content

Commit

Permalink
Merge pull request #963 from FrozenNode/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
David Mathews committed Dec 26, 2015
2 parents 98193e4 + 01ce3da commit 5a1d47d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 16 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog

### 5.0.10
- Bugfix: L5.2 changed the way url() works so added url('/') instead
- Added: Support for middleware additions to the Admin routes via the administrator config
- Testfix: Fixed failing tests

### 5.0.9
- Bugfx: Fix for datetimepicker partially being covered by top menu

Expand Down
6 changes: 3 additions & 3 deletions docs/field-type-relationship.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The `belongsTo` filter lets you filter a result set for items that are related t
'actors' => array(
'type' => 'relationship',
'title' => 'Actors',
'name_field' => 'full_name', //using the getFullNameAttribute accessor
'name_field' => 'full_name', //using the getNameAttribute accessor
'options_sort_field' => "CONCAT(first_name, ' ' , last_name)",
)

Expand All @@ -73,7 +73,7 @@ If you want to let your admin users reorder the selected values, you can create
'actors' => array(
'type' => 'relationship',
'title' => 'Actors',
'name_field' => 'full_name', //using the getFullNameAttribute accessor
'name_field' => 'full_name', //using the getNameAttribute accessor
'sort_field' => 'ordering', //this will look for a numerical column at films_actors.ordering
)

Expand Down Expand Up @@ -248,4 +248,4 @@ Now when we create the `BoxOffice` [model config](/docs/model-configuration), we
),
)

So now when you select a particular film, it will limit the available theaters by those that have played that film. When you select a particular theater, it will only give the the ability to choose a film that's been in that theater.
So now when you select a particular film, it will limit the available theaters by those that have played that film. When you select a particular theater, it will only give the the ability to choose a film that's been in that theater.
9 changes: 7 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Administrator is an administrative interface builder for [Laravel](http://larave

- **Author:** Jan Hartigan
- **Website:** [http://frozennode.com](http://administrator.frozennode.com/)
- **Version:** 5.0.9
- **Version:** 5.0.10

[![Build Status](https://travis-ci.org/FrozenNode/Laravel-Administrator.png?branch=master)](https://travis-ci.org/FrozenNode/Laravel-Administrator)

Expand Down Expand Up @@ -63,8 +63,13 @@ Administrator is released under the MIT License. See the LICENSE file for detail

## Recent Changelog

### 5.0.10
- Bugfix: L5.2 changed the way url() works so added url('/') instead
- Added: Support for middleware additions to the Admin routes via the administrator config
- Testfix: Fixed failing tests

### 5.0.9
- Bugfx: Fix for datetimepicker partially being covered by top menu
- Bugfix: Fix for datetimepicker partially being covered by top menu

### 5.0.8
- Bugfix: Rename Bool class to Boolean to fix PHP 7
Expand Down
7 changes: 7 additions & 0 deletions src/config/administrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
*/
'domain' => '',

/**
* Middleware for admin routing.
*
* @type array
*/
'middleware' => array(),

/**
* Page title
*
Expand Down
4 changes: 2 additions & 2 deletions src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Routes
*/
Route::group(array('domain' => config('administrator.domain'), 'prefix' => config('administrator.uri'), 'middleware' => 'Frozennode\Administrator\Http\Middleware\ValidateAdmin'), function()
Route::group(array('domain' => config('administrator.domain'), 'prefix' => config('administrator.uri'), 'middleware' => [implode(',',config('administrator.middleware')), 'Frozennode\Administrator\Http\Middleware\ValidateAdmin']), function()
{
//Admin Dashboard
Route::get('/', array(
Expand Down Expand Up @@ -139,4 +139,4 @@
'uses' => 'Frozennode\Administrator\AdminController@customModelItemAction'
));
});
});
});
4 changes: 2 additions & 2 deletions src/views/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>

<script type="text/javascript">
var site_url = "<?php echo url() ?>",
var site_url = "<?php echo url('/') ?>",
base_url = "<?php echo $baseUrl ?>/",
asset_url = "<?php echo $assetUrl ?>",
file_url = "<?php echo route('admin_display_file', array($config->getOption('name'))) ?>",
Expand Down Expand Up @@ -79,4 +79,4 @@

<script id="filtersTemplate" type="text/html">
<?php echo view("administrator::templates.filters")?>
</script>
</script>
14 changes: 7 additions & 7 deletions tests/Config/Model/ModelConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ public function testSetModelRelationshipMultipleValuesNoAutocomplete()
{
$model = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel1 = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel1->shouldReceive('getKeyName')->once()->andReturn('id');
$relatedModel1->shouldReceive('getKeyName')->andReturn('id');
$relatedModel1->id = 1;
$relatedModel1->name = 'model_1';
$relatedModel2 = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel2->shouldReceive('getKeyName')->once()->andReturn('id');
$relatedModel2->shouldReceive('getKeyName')->andReturn('id');
$relatedModel2->id = 2;
$relatedModel2->name = 'model_2';
$field = m::mock('Frozennode\Administrator\Fields\Field');
Expand All @@ -109,11 +109,11 @@ public function testSetModelRelationshipMultipleValuesAutocomplete()
{
$model = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel1 = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel1->shouldReceive('getKeyName')->once()->andReturn('id');
$relatedModel1->shouldReceive('getKeyName')->andReturn('id');
$relatedModel1->id = 1;
$relatedModel1->name = 'model_1';
$relatedModel2 = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel2->shouldReceive('getKeyName')->once()->andReturn('id');
$relatedModel2->shouldReceive('getKeyName')->andReturn('id');
$relatedModel2->id = 2;
$relatedModel2->name = 'model_2';
$field = m::mock('Frozennode\Administrator\Fields\Field');
Expand All @@ -130,7 +130,7 @@ public function testSetModelRelationshipSingleValueNoAutocomplete()
{
$model = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel1 = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel1->shouldReceive('getKeyName')->once()->andReturn('id');
$relatedModel1->shouldReceive('getKeyName')->andReturn('id');
$relatedModel1->id = 1;
$relatedModel1->name = 'model_1';
$field = m::mock('Frozennode\Administrator\Fields\Field');
Expand All @@ -146,7 +146,7 @@ public function testSetModelRelationshipSingleValueAutocomplete()
{
$model = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel1 = m::mock('Illuminate\Database\Eloquent\Model')->makePartial();
$relatedModel1->shouldReceive('getKeyName')->once()->andReturn('id');
$relatedModel1->shouldReceive('getKeyName')->andReturn('id');
$relatedModel1->id = 1;
$relatedModel1->name = 'model_1';
$field = m::mock('Frozennode\Administrator\Fields\Field');
Expand Down Expand Up @@ -400,4 +400,4 @@ public function testRunQueryFilterWithFilter()
$this->config->runQueryFilter($query);
}

}
}

0 comments on commit 5a1d47d

Please sign in to comment.