Add groups list to the poster expansion when you click an avatar while

in a topic.
This commit is contained in:
Robin Ward 2014-02-10 12:30:36 -05:00
parent 25070dcde7
commit b61b33c0fa
9 changed files with 66 additions and 19 deletions

View File

@ -0,0 +1,12 @@
/**
Displays a list of groups that a user belongs to.
@class Discourse.GroupsListComponent
@extends Ember.Component
@namespace Discourse
@module Discourse
**/
Discourse.GroupsListComponent = Em.Component.extend({
classNames: ['groups']
});

View File

@ -0,0 +1,18 @@
/**
This mixin will cause a view to scroll the viewport to the top once it has been inserted
@class Discourse.ScrollTop
@extends Ember.Mixin
@namespace Discourse
@module Discourse
**/
Discourse.ScrollTop = Em.Mixin.create({
_scrollTop: function() {
Em.run.schedule('afterRender', function() {
$(document).scrollTop(0);
});
}.on('didInsertElement'),
});

View File

@ -0,0 +1,6 @@
{{#if groups}}
{{i18n groups.title count=groups.length}}:
{{#each groups}}
{{#link-to 'group' this class="group-link"}}{{name}}{{/link-to}}
{{/each}}
{{/if}}

View File

@ -10,6 +10,8 @@
<h3>{{i18n last_post}} {{unboundDate path="user.last_posted_at" leaveAgo="true"}}</h3>
<h3>{{i18n joined}} {{unboundDate path="user.created_at" leaveAgo="true"}}</h3>
{{groups-list groups=user.custom_groups}}
<div class='bottom'>
{{#if user.bio_cooked}}<div class='bio'>{{{user.bio_cooked}}}</div>{{/if}}

View File

@ -43,14 +43,7 @@
<div class='bio'>{{{bio_cooked}}}</div>
{{#if custom_groups}}
<div class='groups'>
{{i18n groups.title count=custom_groups.length}}:
{{#each custom_groups}}
{{#link-to 'group' this class="group-link"}}{{name}}{{/link-to}}
{{/each}}
</div>
{{/if}}
{{groups-list groups=custom_groups}}
{{#if isSuspended}}
<div class='suspended'>

View File

@ -7,15 +7,9 @@
@namespace Discourse
@module Discourse
**/
Discourse.DiscoveryTopicsView = Discourse.View.extend(Discourse.LoadMore, {
Discourse.DiscoveryTopicsView = Discourse.View.extend(Discourse.ScrollTop, Discourse.LoadMore, {
eyelineSelector: '.topic-list-item',
_scrollTop: function() {
Em.run.schedule('afterRender', function() {
$(document).scrollTop(0);
});
}.on('didInsertElement'),
actions: {
loadMore: function() {
var self = this;

View File

@ -1,4 +1,13 @@
Discourse.GroupIndexView = Discourse.View.extend(Discourse.LoadMore, {
/**
Displays all posts within a group
@class Discourse.GroupIndexView
@extends Ember.Mixin
@namespace Discourse
@module Discourse
**/
Discourse.GroupIndexView = Discourse.View.extend(Discourse.ScrollTop, Discourse.LoadMore, {
eyelineSelector: '.user-stream .item'
});

View File

@ -40,6 +40,16 @@
margin-top: 0px;
color: $primary_medium;
}
.groups {
font-size: 13px;
font-weight: normal;
margin-top: 0px;
color: $primary_medium;
.group-link {
color: $primary;
}
}
.bottom {
clear: both;

View File

@ -2,6 +2,12 @@
@import "common/foundation/variables";
@import "common/foundation/mixins";
.groups {
.group-link {
color: $tertiary_lightest;
}
}
.user-preferences {
input.category-group {
width: 500px;
@ -210,9 +216,6 @@
h1, h2 {margin-top: 10px;}
.group-link {
color: $tertiary_lightest;
}
.bio {
color: $primary_lighter;