mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 04:42:55 +08:00
Adjust username styling
This commit is contained in:
parent
8de172c0da
commit
c683fab2a1
|
@ -36,17 +36,18 @@
|
|||
<div class='topic-body span14'>
|
||||
<div class='topic-meta-data'>
|
||||
<div class="names">
|
||||
<h3 {{bind-attr class="staff new_user :username"}}><a href='{{unbound usernameUrl}}' {{action showPosterExpansion this}}>{{{breakUp username name}}}</a></h3>
|
||||
<span {{bind-attr class="staff new_user :username"}}><a href='{{unbound usernameUrl}}' {{action showPosterExpansion this}}>{{unbound username}}</a>{{#if admin}}<i class='fa fa-trophy'></i>{{else}}{{#if moderator}}<i class='fa fa-magic'></i>{{/if}}{{/if}}
|
||||
</span>
|
||||
|
||||
{{#if showName}}
|
||||
<h3 class="full-name"><a href='{{unbound usernameUrl}}' {{action showPosterExpansion this}}>{{breakUp name}}</a></h3>
|
||||
<span class="full-name"><a href='{{unbound usernameUrl}}' {{action showPosterExpansion this}}>{{unbound name}}</a></span>
|
||||
{{/if}}
|
||||
|
||||
{{#if user_title}}
|
||||
{{#if primary_group_name}}
|
||||
<div class="user-title"><a href='/groups/{{unbound primary_group_name}}' class='user-group'>{{unbound user_title}}</a></div>
|
||||
<span class="user-title"><a href='/groups/{{unbound primary_group_name}}' class='user-group'>{{unbound user_title}}</a></span>
|
||||
{{else}}
|
||||
<div class="user-title" {{action showPosterExpansion this}}>{{unbound user_title}}</div>
|
||||
<span class="user-title" {{action showPosterExpansion this}}>{{unbound user_title}}</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
21
app/assets/stylesheets/common/base/topic-post.scss
Normal file
21
app/assets/stylesheets/common/base/topic-post.scss
Normal file
|
@ -0,0 +1,21 @@
|
|||
.names {
|
||||
float: left;
|
||||
.username {
|
||||
font-weight: bold;
|
||||
}
|
||||
span {
|
||||
font-size: 13px;
|
||||
padding-right: 4px;
|
||||
a {
|
||||
color: scale-color($primary, $lightness: 30%);
|
||||
}
|
||||
}
|
||||
.fa {
|
||||
font-size: 11px;
|
||||
margin-left: 3px;
|
||||
color: scale-color($primary, $lightness: 40%);
|
||||
}
|
||||
.new_user a, .user-title, .user-title a {
|
||||
color: scale-color($primary, $lightness: 50%);
|
||||
}
|
||||
}
|
|
@ -632,19 +632,6 @@ iframe {
|
|||
font-size: 36px;
|
||||
}
|
||||
|
||||
.staff a {
|
||||
margin: -2px 0 0 0;
|
||||
background-color: scale-color($highlight, $lightness: 60%);
|
||||
}
|
||||
|
||||
.user-title {
|
||||
margin-top: 5px;
|
||||
color: $primary;
|
||||
overflow: hidden;
|
||||
font-size: 80%;
|
||||
line-height: 13px;
|
||||
}
|
||||
|
||||
.info-line {
|
||||
margin: 10px 0;
|
||||
color: $primary;
|
||||
|
@ -993,17 +980,6 @@ a.attachment:before {
|
|||
content: "\f0e0";
|
||||
}
|
||||
|
||||
|
||||
.names {
|
||||
float: left;
|
||||
.username {
|
||||
a {
|
||||
font-size: 13px;
|
||||
color: scale-color($primary, $lightness: 20%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.topic-meta-data {
|
||||
margin-bottom: 10px;
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ class PostSerializer < BasicPostSerializer
|
|||
:raw,
|
||||
:actions_summary,
|
||||
:moderator?,
|
||||
:admin?,
|
||||
:staff?,
|
||||
:user_id,
|
||||
:draft_sequence,
|
||||
|
@ -50,11 +51,15 @@ class PostSerializer < BasicPostSerializer
|
|||
|
||||
|
||||
def moderator?
|
||||
object.user.try(:moderator?) || false
|
||||
!!(object.user && object.user.moderator?)
|
||||
end
|
||||
|
||||
def admin?
|
||||
!!(object.user && object.user.admin?)
|
||||
end
|
||||
|
||||
def staff?
|
||||
object.user.try(:staff?) || false
|
||||
!!(object.user && object.user.staff?)
|
||||
end
|
||||
|
||||
def yours
|
||||
|
|
Loading…
Reference in New Issue
Block a user