Merge pull request #2932 from awesomerobot/master

new usercard style
This commit is contained in:
Sam 2014-10-30 11:01:05 +11:00
commit cd0ff7b0f2
7 changed files with 98 additions and 57 deletions

View file

@ -83,7 +83,6 @@
</div>
</div>
{{#if currentUser.admin}}
<div class='display-row'>
<div class='field'>{{i18n admin.groups.title}}</div>

View file

@ -1,37 +1,22 @@
{{#if username}}
<div class="card-content">
{{#link-to 'user' user}}{{bound-avatar avatar "huge"}}{{/link-to}}
<div class="names">
<span>
<h1 {{bind-attr class="staff new_user"}}>
{{#link-to 'user' user}}{{username}}{{/link-to}}
</h1>
{{#if showName}}
<h2>{{#link-to 'user' user}}{{name}}{{/link-to}}</h2>
{{/if}}
</span>
</div>
{{#if showBadges}}
<div class="badge-section">
{{#each user.featured_user_badges}}
{{user-badge badge=badge}}
{{/each}}
{{#if showMoreBadges}}
{{#link-to 'user.badges' user class="btn more-user-badges"}}
{{i18n badges.more_badges count=moreBadgesCount}}
{{/link-to}}
{{/if}}
</div>
{{/if}}
{{#if user}}
<div class="metadata">
{{#if user.location}}<h3>{{fa-icon "map-marker"}} {{user.location}}</h3>{{/if}}
<h3>{{i18n last_post}} {{format-date path="user.last_posted_at" leaveAgo="true"}}</h3>
<h3>{{i18n joined}} {{format-date path="user.created_at" leaveAgo="true"}}</h3>
{{groups-list groups=user.custom_groups}}
</div>
<div class='bottom'>
{{#if isSuspended}}
<div class='suspended'>
{{fa-icon "ban"}}
@ -42,25 +27,41 @@
{{#if user.bio_cooked}}<div class='bio'>{{{user.bio_cooked}}}</div>{{/if}}
{{/if}}
{{#if showBadges}}
<div class="badge-section">
{{#each user.featured_user_badges}}
{{user-badge badge=badge}}
{{/each}}
{{#if showMoreBadges}}
{{#link-to 'user.badges' user class="btn more-user-badges"}}
{{i18n badges.more_badges count=moreBadgesCount}}
{{/link-to}}
{{/if}}
</div>
{{/if}}
<ul class="usercard-controls">
{{#if user.can_send_private_message_to_user}}
<button class='btn btn-primary' {{action "composePrivateMessage" user}}>{{fa-icon "envelope"}}{{i18n user.private_message}}</button>
<li><a class='btn btn-primary' {{action "composePrivateMessage" user}}>{{fa-icon "envelope"}}{{i18n user.private_message}}</a></li>
{{/if}}
{{#link-to 'user' user class="btn"}}{{fa-icon "user"}}{{i18n user.profile}}{{/link-to}}
<li>{{#link-to 'user' user class="btn"}}{{fa-icon "user"}}{{i18n user.profile}}{{/link-to}}</li>
{{#if showFilter}}
<button class='btn' {{action "togglePosts" user}}>{{fa-icon "filter"}}{{i18n topic.filter_to username="username" post_count="participant.post_count"}}</button>
<li><a class='btn' {{action "togglePosts" user}}>{{fa-icon "filter"}}{{i18n topic.filter_to username="username" post_count="participant.post_count"}}</a></li>
{{/if}}
{{#if hasUserFilters}}
<button class='btn' {{action "cancelFilter"}}>{{fa-icon "times"}}{{i18n topic.filters.cancel}}</button>
<li><a class='btn' {{action "cancelFilter"}}>{{fa-icon "times"}}{{i18n topic.filters.cancel}}</a></li>
{{/if}}
</ul>
{{#if user.card_badge}}
{{#link-to 'badges.show' user.card_badge class="card-badge"}}
{{icon-or-image user.card_badge.image}}
{{/link-to}}
{{/if}}
</div>
{{else}}
<p class='loading'>{{i18n loading}}</p>

View file

@ -39,7 +39,6 @@
<div class='details'>
<div class='primary'>
{{bound-avatar model "huge"}}
<section class='controls'>
@ -217,6 +216,5 @@
</section>
</div>
{{/unless}}

View file

@ -17,9 +17,9 @@ export default Discourse.View.extend(CleansUp, {
if (!$this) { return; }
if (Ember.empty(url)) {
$this.css('background-image', '');
$this.css('background-image', '').addClass('no-bg');
} else {
$this.css('background-image', "url(" + url + ")");
$this.css('background-image', "url(" + url + ")").removeClass('no-bg');
}
}.observes('controller.user.card_background'),

View file

@ -37,7 +37,6 @@
}
// Base list
// --------------------------------------------------

View file

@ -2,18 +2,33 @@
#user-card {
position: absolute;
width: 460px;
width: 500px;
left: 20px;
z-index: 990;
box-shadow: 0 2px 6px rgba(0,0,0, .6);
margin-top: -2px;
background-color: $secondary;
padding: 12px 12px 5px 12px;
border: 1px solid scale-color-diff();
background-color: $primary;
color: $secondary;
background-size: cover;
background-position: center center;
.card-content {
padding: 12px;
background: rgba($primary, .85);
margin-top: 100px;
&:after {
content: '';
display: block;
clear: both;
}
}
&.no-bg {
.card-content {
margin-top: 0;
}
}
.avatar-placeholder {
width: 120px;
height: 120px;
@ -27,12 +42,12 @@
font-size: 25px;
line-height: 1.25;
display: block;
max-width: 280px;
max-width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
a {
color: $primary;
color: $secondary;
}
}
@ -41,13 +56,12 @@
line-height: 1.25;
font-weight: normal;
display: block;
max-width: 280px;
max-width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
a {
color: $primary;
color: $secondary;
}
}
@ -58,6 +72,9 @@
color: scale-color($primary, $lightness: 50%);
overflow: hidden;
text-overflow: ellipsis;
a {
color: $secondary;
}
}
.groups {
font-size: 13px;
@ -84,9 +101,15 @@
}
.bio {
max-height: 100px;
max-height: 55px;
overflow: auto;
margin-bottom: 10px;
float: left;
margin: 10px 0;
width: 70%;
a {
color: $secondary;
text-decoration: underline;
}
img {
max-width: 100%;
}
@ -95,6 +118,7 @@
img.avatar {
float: left;
padding-right: 10px;
margin-top: -60px;
}
p {
@ -108,6 +132,16 @@
.btn {
margin: 0 0 7px 0;
box-sizing: border-box;
}
.usercard-controls {
list-style-type: none;
margin: 0;
position: absolute;
right: 12px;
a {width: 100%; min-width: 150px;}
}
.new-user a {
@ -115,17 +149,32 @@
}
&.show-badges {
width: 560px;
width: 580px;
.names {
width: 250px;
float: left;
height: 60px;
position: relative;
width: 45%;
span {
position: absolute;
bottom: 0;
display: block;
}
}
.badge-section {
margin-top: 10px;
float: left;
width: 270px;
width: 390px;
.user-badge {
background: transparent;
color: $secondary;
}
h3 {
color: $primary;

View file

@ -6,11 +6,6 @@
}
}
.has-background .details {
}
.profile-image {
height: 250px;
width: 100%;