Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag update #6

Merged
merged 16 commits into from
May 30, 2018
Prev Previous commit
Next Next commit
style conflict
  • Loading branch information
ro4 committed May 30, 2018
commit 7691326efbe0ab6dadd3cbfbde47df086e882652
15 changes: 11 additions & 4 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,23 @@ function userHasNotifications()

/**
* 用户通知消息数
*
* @param int $limit 显示限制数量,如果提供了,则返回string类型的数量展示,最大值为$limit,超过数量显示为"$limit+"
*
* @return int
* @return int|string
*/
function userNotificationCount()
function userNotificationCount($limit = 0)
{
if (Auth::guest()) {
return 0;
}

return count(Auth::user()->unreadNotifications);
$unreadCount = count(Auth::user()->unreadNotifications);
if ($limit > 0) {
return $unreadCount > $limit ? "{$limit}+" : $unreadCount;
}

return $unreadCount;
}

/**
Expand Down Expand Up @@ -393,4 +400,4 @@ function comment_filter(string $comment): string

return $matches[0];
}, $comment);
}
}
9 changes: 9 additions & 0 deletions public/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ form {
.container-small {
max-width: 960px;
}
.container-medium {
max-width: 1140px;
}
}

.container-narrow > hr {
Expand Down Expand Up @@ -562,8 +565,14 @@ a:hover {
font-weight: bold;
}

/* 消息数量提示气泡 */
.wz-message-tip {
font-weight: bold;
border: 1px solid #f00;
padding: 2px 5px;
border-radius: 56px;
color: #fff;
background: #f00;
}

@-webkit-keyframes twinkling {
Expand Down
4 changes: 2 additions & 2 deletions resources/views/layouts/navbar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a class="p-2 text-dark dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ Auth::user()->name ?? Auth::user()->email }}
@if(userHasNotifications())
<sup class="text-danger wz-message-tip" title="您有未读消息">{{ userNotificationCount() }}</sup>
<sup class="wz-message-tip" title="您有未读消息">{{ userNotificationCount(99) }}</sup>
@endif
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
Expand Down Expand Up @@ -45,4 +45,4 @@
</div>
</nav>
@endif
</div>
</div>
2 changes: 1 addition & 1 deletion resources/views/layouts/project-setting.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@extends('layouts.default')

@section('title', $project->name)
@section('container-style', 'container container-small')
@section('container-style', 'container container-medium')
@section('content')

<div class="row marketing wz-main-container-full">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/single.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@extends('layouts.default')
@section('container-style', 'container container-small')
@section('container-style', 'container container-medium')
@section('content')
<div class="row marketing wz-main-container-full">
<div class="col">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/user.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@extends('layouts.default')

@section('container-style', 'container container-small')
@section('container-style', 'container container-medium')
@section('content')
<div class="row marketing wz-main-container-full">
<div class="col-3">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/project/project.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@
});
</script>
@endif
@endpush
@endpush
2 changes: 1 addition & 1 deletion resources/views/search.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@

});
</script>
@endpush
@endpush
4 changes: 3 additions & 1 deletion resources/views/share-show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<textarea id="append-test" style="display:none;">{{ $pageItem->content }}</textarea>
@endif
</div>

<div class="text-center wz-panel-limit mt-3">~ END ~</div>
@endsection

@includeIf("components.{$type}-show")
@includeIf("components.{$type}-show")