UX: Improving styling so names/usernames fit better (#86)
This commit is contained in:
parent
190681cdd1
commit
26682ccec4
|
@ -1 +1 @@
|
||||||
{{group-assignments-menu-item group = group}}
|
{{group-assignments-menu-item group=group}}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
export default {
|
||||||
|
shouldRender(args, component) {
|
||||||
|
return (
|
||||||
|
component.currentUser &&
|
||||||
|
component.currentUser.can_assign &&
|
||||||
|
args.group.assignment_count > 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
|
@ -1,13 +1,3 @@
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
canAssign: false,
|
tagName: ""
|
||||||
|
|
||||||
init() {
|
|
||||||
this._super(...arguments);
|
|
||||||
this.set(
|
|
||||||
"displayAssignTab",
|
|
||||||
this.currentUser &&
|
|
||||||
this.currentUser.can_assign &&
|
|
||||||
this.group.assignment_count > 0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{{#if show-avatar}}
|
{{#if show-avatar}}
|
||||||
{{#link-to "group.assignments.show" filter.username_lower}}
|
{{#link-to "group.assignments.show" filter.username_lower}}
|
||||||
{{avatar filter avatarTemplatePath="avatar_template" usernamePath="username" imageSize="small"}} {{displayName}} ({{filter.assignments_count}})
|
{{avatar filter avatarTemplatePath="avatar_template" usernamePath="username" imageSize="small"}}
|
||||||
|
<span class="assign-count">({{filter.assignments_count}})</span>
|
||||||
|
<span class="assign-name">{{displayName}}</span>
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#link-to "group.assignments.show" filter}}
|
{{#link-to "group.assignments.show" filter}}
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
{{#if displayAssignTab}}
|
{{#link-to "group.assignments"}}
|
||||||
<ul class ='nav-pills'>
|
{{d-icon "user-plus" class="glyph"}}{{i18n 'discourse_assign.group_assignments'}} ({{group.assignment_count}})
|
||||||
<li>
|
{{/link-to}}
|
||||||
{{#link-to "group.assignments"}}
|
|
||||||
{{d-icon "user-plus" class="glyph"}}{{i18n 'discourse_assign.group_assignments'}} ({{group.assignment_count}})
|
|
||||||
{{/link-to}}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
{{/if}}
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<section class="user-secondary-navigation">
|
<section class="user-secondary-navigation group-assignments">
|
||||||
{{#mobile-nav class="activity-nav" desktopClass="action-list activity-list nav-stacked" currentPath=router._router.currentPath}}
|
{{#mobile-nav class="activity-nav" desktopClass="action-list activity-list nav-stacked" currentPath=router._router.currentPath}}
|
||||||
{{#load-more selector=".activity-nav li" action=(action "loadMore")}}
|
{{#load-more selector=".activity-nav li" action=(action "loadMore")}}
|
||||||
{{group-assignments-filter show-avatar=false filter="everyone" routeType=route_type assignment_count=group.assignment_count}}
|
{{group-assignments-filter show-avatar=false filter="everyone" routeType=route_type assignment_count=group.assignment_count}}
|
||||||
|
@ -11,4 +11,4 @@
|
||||||
</section>
|
</section>
|
||||||
<section class="user-content">
|
<section class="user-content">
|
||||||
{{outlet}}
|
{{outlet}}
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -90,3 +90,30 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Group assigns sidebar nav
|
||||||
|
|
||||||
|
.group-assignments {
|
||||||
|
// a little extra space for long names
|
||||||
|
min-width: 180px;
|
||||||
|
li a {
|
||||||
|
display: grid;
|
||||||
|
grid-template-areas:
|
||||||
|
"avatar count"
|
||||||
|
"name name";
|
||||||
|
grid-template-columns: auto 1fr;
|
||||||
|
align-items: center;
|
||||||
|
img {
|
||||||
|
margin-right: 0.25em;
|
||||||
|
grid-area: avatar;
|
||||||
|
}
|
||||||
|
.assign-name {
|
||||||
|
grid-area: name;
|
||||||
|
margin-top: 0.25em;
|
||||||
|
@include ellipsis;
|
||||||
|
}
|
||||||
|
.assign-count {
|
||||||
|
grid-area: count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -24,3 +24,23 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.group-assignments .mobile-nav .drop li a {
|
||||||
|
display: grid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-assignments .mobile-nav a.expander > span {
|
||||||
|
display: flex;
|
||||||
|
@include ellipsis;
|
||||||
|
.assign-count {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.assign-name {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue