Skip to content

Commit

Permalink
User default avatar after signup
Browse files Browse the repository at this point in the history
  • Loading branch information
summerblue committed Nov 1, 2017
1 parent 81a600e commit e80be90
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
12 changes: 5 additions & 7 deletions app/Observers/UserObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@

class UserObserver
{
public function creating(User $user)
public function saving(User $user)
{
//
}

public function updating(User $user)
{
//
// 这样写扩展性更高,只有空的时候才指定默认头像
if (empty($user->avatar)) {
$user->avatar = 'https://fsdhubcdn.phphub.org/uploads/images/201710/30/1/TrJS40Ey5k.png';
}
}
}
35 changes: 29 additions & 6 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -8464,36 +8464,42 @@ body {
/* Topic Index Page */

.topics-index-page .topic-list .nav > li > a,
.categories-show-page .topic-list .nav > li > a {
.categories-show-page .topic-list .nav > li > a,
.root-page .topic-list .nav > li > a {
position: relative;
display: block;
padding: 5px 14px;
font-size: 0.9em;
}

.topics-index-page .topic-list a,
.categories-show-page .topic-list a {
.categories-show-page .topic-list a,
.root-page .topic-list a {
color: #444444;
}

.topics-index-page .topic-list .meta,
.categories-show-page .topic-list .meta {
.categories-show-page .topic-list .meta,
.root-page .topic-list .meta {
font-size: 0.9em;
color: #b3b3b3;
}

.topics-index-page .topic-list .meta a,
.categories-show-page .topic-list .meta a {
.categories-show-page .topic-list .meta a,
.root-page .topic-list .meta a {
color: #b3b3b3;
}

.topics-index-page .topic-list .badge,
.categories-show-page .topic-list .badge {
.categories-show-page .topic-list .badge,
.root-page .topic-list .badge {
background-color: #d8d8d8;
}

.topics-index-page .topic-list hr,
.categories-show-page .topic-list hr {
.categories-show-page .topic-list hr,
.root-page .topic-list hr {
margin-top: 12px;
margin-bottom: 12px;
border: 0;
Expand Down Expand Up @@ -8995,3 +9001,20 @@ body {
background-color: #d15b47 !important;
}

/* Sidebar */

.sidebar .panel-body {
padding: 12px;
}

.sidebar hr {
margin-top: 8px;
margin-bottom: 10px;
}

.sidebar .active-users a.media {
color: #797878;
line-height: 26px;
font-size: 0.9em;
}

0 comments on commit e80be90

Please sign in to comment.