mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 11:52:44 +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-body span14'>
|
||||||
<div class='topic-meta-data'>
|
<div class='topic-meta-data'>
|
||||||
<div class="names">
|
<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}}
|
{{#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}}
|
||||||
|
|
||||||
{{#if user_title}}
|
{{#if user_title}}
|
||||||
{{#if primary_group_name}}
|
{{#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}}
|
{{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}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</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;
|
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 {
|
.info-line {
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
color: $primary;
|
color: $primary;
|
||||||
|
@ -993,17 +980,6 @@ a.attachment:before {
|
||||||
content: "\f0e0";
|
content: "\f0e0";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.names {
|
|
||||||
float: left;
|
|
||||||
.username {
|
|
||||||
a {
|
|
||||||
font-size: 13px;
|
|
||||||
color: scale-color($primary, $lightness: 20%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.topic-meta-data {
|
.topic-meta-data {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ class PostSerializer < BasicPostSerializer
|
||||||
:raw,
|
:raw,
|
||||||
:actions_summary,
|
:actions_summary,
|
||||||
:moderator?,
|
:moderator?,
|
||||||
|
:admin?,
|
||||||
:staff?,
|
:staff?,
|
||||||
:user_id,
|
:user_id,
|
||||||
:draft_sequence,
|
:draft_sequence,
|
||||||
|
@ -50,11 +51,15 @@ class PostSerializer < BasicPostSerializer
|
||||||
|
|
||||||
|
|
||||||
def moderator?
|
def moderator?
|
||||||
object.user.try(:moderator?) || false
|
!!(object.user && object.user.moderator?)
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin?
|
||||||
|
!!(object.user && object.user.admin?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def staff?
|
def staff?
|
||||||
object.user.try(:staff?) || false
|
!!(object.user && object.user.staff?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def yours
|
def yours
|
||||||
|
|
Loading…
Reference in New Issue
Block a user