Merge branch 'qianmengnet-master'

This commit is contained in:
Dan Brown 2019-01-05 15:01:38 +00:00
commit d682a0157f
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
3 changed files with 39 additions and 15 deletions

View File

@ -56,6 +56,9 @@
<a href="{{ baseUrl('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a> <a href="{{ baseUrl('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
@endif @endif
@if(!signedInUser()) @if(!signedInUser())
@if(setting('registration-enabled', false))
<a href="{{ baseUrl("/register") }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
@endif
<a href="{{ baseUrl('/login') }}">@icon('login') {{ trans('auth.log_in') }}</a> <a href="{{ baseUrl('/login') }}">@icon('login') {{ trans('auth.log_in') }}</a>
@endif @endif
</div> </div>

View File

@ -37,22 +37,27 @@
</div> </div>
<div class="col-md-5 text-bigger" id="content-counts"> <div class="col-md-5 text-bigger" id="content-counts">
<div class="text-muted">{{ trans('entities.profile_created_content') }}</div> <div class="text-muted">{{ trans('entities.profile_created_content') }}</div>
<div class="text-book"> <a href="#recent-books">
@icon('book') {{ trans_choice('entities.x_books', $assetCounts['books']) }} <div class="text-book">
</div> @icon('book') {{ trans_choice('entities.x_books', $assetCounts['books']) }}
<div class="text-chapter"> </div>
@icon('chapter') {{ trans_choice('entities.x_chapters', $assetCounts['chapters']) }} </a>
</div> <a href="#recent-chapters">
<div class="text-page"> <div class="text-chapter">
@icon('page') {{ trans_choice('entities.x_pages', $assetCounts['pages']) }} @icon('chapter') {{ trans_choice('entities.x_chapters', $assetCounts['chapters']) }}
</div> </div>
</a>
<a href="#recent-pages">
<div class="text-page">
@icon('page') {{ trans_choice('entities.x_pages', $assetCounts['pages']) }}
</div>
</a>
</div> </div>
</div> </div>
<hr class="even"> <hr class="even">
<h3 id="recent-pages">{{ trans('entities.recently_created_pages') }}</h3>
<h3>{{ trans('entities.recently_created_pages') }}</h3>
@if (count($recentlyCreated['pages']) > 0) @if (count($recentlyCreated['pages']) > 0)
@include('partials/entity-list', ['entities' => $recentlyCreated['pages']]) @include('partials/entity-list', ['entities' => $recentlyCreated['pages']])
@else @else
@ -60,8 +65,7 @@
@endif @endif
<hr class="even"> <hr class="even">
<h3 id="recent-chapters">{{ trans('entities.recently_created_chapters') }}</h3>
<h3>{{ trans('entities.recently_created_chapters') }}</h3>
@if (count($recentlyCreated['chapters']) > 0) @if (count($recentlyCreated['chapters']) > 0)
@include('partials/entity-list', ['entities' => $recentlyCreated['chapters']]) @include('partials/entity-list', ['entities' => $recentlyCreated['chapters']])
@else @else
@ -69,8 +73,7 @@
@endif @endif
<hr class="even"> <hr class="even">
<h3 id="recent-books">{{ trans('entities.recently_created_books') }}</h3>
<h3>{{ trans('entities.recently_created_books') }}</h3>
@if (count($recentlyCreated['books']) > 0) @if (count($recentlyCreated['books']) > 0)
@include('partials/entity-list', ['entities' => $recentlyCreated['books']]) @include('partials/entity-list', ['entities' => $recentlyCreated['books']])
@else @else

View File

@ -14,6 +14,24 @@ class PublicActionTest extends BrowserKitTest
$this->visit($page->getUrl())->seePageIs('/login'); $this->visit($page->getUrl())->seePageIs('/login');
} }
public function test_login_link_visible()
{
$this->setSettings(['app-public' => 'true']);
$this->visit('/')->see(url('/login'));
}
public function test_register_link_visible_when_enabled()
{
$this->setSettings(['app-public' => 'true']);
$this->visit('/')->see(url('/login'));
$this->visit('/')->dontSee(url('/register'));
$this->setSettings(['app-public' => 'true', 'registration-enabled' => 'true']);
$this->visit('/')->see(url('/login'));
$this->visit('/')->see(url('/register'));
}
public function test_books_viewable() public function test_books_viewable()
{ {
$this->setSettings(['app-public' => 'true']); $this->setSettings(['app-public' => 'true']);