Header tweaks

This commit is contained in:
Vincent Fiduccia 2017-08-18 19:09:13 -07:00
parent bdb275aedd
commit 96f2cc2c13
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582
6 changed files with 66 additions and 53 deletions

View File

@ -1,5 +1,5 @@
<section class="clearfix pt-20"> <section class="clearfix pt-20">
<h4 class="pull-left">{{t 'generic.cluster'}}: {{model.displayName}}</h4> <h4 class="pull-left m-0 pr-10 pt-5">{{t 'generic.cluster'}}: {{model.displayName}}</h4>
{{#unless (eq model.state 'active')}} {{#unless (eq model.state 'active')}}
{{badge-state model=model}} {{badge-state model=model}}
{{/unless}} {{/unless}}
@ -19,7 +19,7 @@
</section> </section>
<hr/> <hr/>
{{#if (not-eq model.state 'inactive')}} {{#if (eq model.state 'active')}}
<div class="row"> <div class="row">
<div class="col span-3"> <div class="col span-3">
<div class="banner bg-info"> <div class="banner bg-info">
@ -60,8 +60,7 @@
</div> </div>
{{/if}} {{/if}}
<div class="p-20"> {{#sortable-table
{{#sortable-table
tableClassNames="bordered" tableClassNames="bordered"
bulkActions=true bulkActions=true
rightActions=true rightActions=true
@ -75,7 +74,7 @@
fullRows=true fullRows=true
stickyHeader=false stickyHeader=false
as |sortable kind p dt| as |sortable kind p dt|
}} }}
{{#if (eq kind "row")}} {{#if (eq kind "row")}}
{{project-row model=p dt=dt}} {{project-row model=p dt=dt}}
{{else if (eq kind "nomatch")}} {{else if (eq kind "nomatch")}}
@ -85,5 +84,4 @@
{{else if (eq kind "right-actions")}} {{else if (eq kind "right-actions")}}
{{#link-to "authenticated.clusters.new-project" (query-params clusterId=model.id) class="btn btn-sm bg-primary"}}{{t 'clustersPage.newProject'}}{{/link-to}} {{#link-to "authenticated.clusters.new-project" (query-params clusterId=model.id) class="btn btn-sm bg-primary"}}{{t 'clustersPage.newProject'}}{{/link-to}}
{{/if}} {{/if}}
{{/sortable-table}} {{/sortable-table}}
</div>

View File

@ -24,14 +24,19 @@ export default Ember.Component.extend({
let clusterId = cluster.get('id'); let clusterId = cluster.get('id');
let entry = out.findBy('clusterId', clusterId); let entry = out.findBy('clusterId', clusterId);
if ( !entry ) { if ( !entry ) {
entry = {clusterId: clusterId, cluster: cluster, projects: []}; entry = {clusterId: clusterId, cluster: cluster, projects: [], show: false};
out.push(entry); out.push(entry);
} }
if ( project.get('clusterOwner') ) {
entry.system = project;
} else {
entry.projects.push(project); entry.projects.push(project);
entry.show = true;
}
}); });
return out; return out.filterBy('show',true);;
}.property('projectChoices.@each.clusterId'), }.property('projectChoices.@each.clusterId'),
projectIsMissing: function() { projectIsMissing: function() {

View File

@ -1,8 +1,6 @@
{{~#if project~}} {{~#if project~}}
<li class="dropdown pull-right"> <li class="dropdown pull-right">
{{#if (gt byCluster.length 1)}} {{#if (gt byCluster.length 1)}}
<ul class="list-unstyled pr-40" style="padding: 4px;"> <ul class="list-unstyled pr-40" style="padding: 4px;">
<li> <li>
<a href="#" role="button" class="text-white dropdown-toggle clip" aria-haspopup="true" aria-expanded="false" aria-label="{{t 'nav.cluster.label'}}"> <a href="#" role="button" class="text-white dropdown-toggle clip" aria-haspopup="true" aria-expanded="false" aria-label="{{t 'nav.cluster.label'}}">
@ -13,16 +11,15 @@
</li> </li>
<li class="pl-15 text-small text-muted"> <li class="pl-15 text-small text-muted">
<a href="#" role="button" class="color-white dropdown-toggle clip" aria-haspopup="true" aria-expanded="false" aria-label="{{t 'nav.environment.label'}}"> <a href="#" role="button" class="text-white dropdown-toggle clip" aria-haspopup="true" aria-expanded="false" aria-label="{{t 'nav.environment.label'}}">
<i class="{{project.icon}} project-icon icon-fw"></i> <i class="{{project.icon}} project-icon icon-fw"></i>
{{project.displayName}} {{project.displayName}}
<span class="sr-only">{{t 'nav.srToggleDropdown'}}</span> <span class="sr-only">{{t 'nav.srToggleDropdown'}}</span>
</a> </a>
</li> </li>
<i class="icon icon-chevron-down project-chevron ml-10" style="position: absolute; right: 20px; top: 20px;"></i> <i class="icon icon-chevron-down project-chevron ml-10 text-white" style="position: absolute; right: 20px; top: 20px;"></i>
</ul> </ul>
{{else}} {{else}}
<span class="environment-dropdown"> <span class="environment-dropdown">
<i class="{{project.icon}} project-icon icon-fw"></i> <i class="{{project.icon}} project-icon icon-fw"></i>
@ -36,14 +33,25 @@
<ul class="dropdown-menu project-menu" role="menu" data-dropdown-id="enviroment"> <ul class="dropdown-menu project-menu" role="menu" data-dropdown-id="enviroment">
{{#if (gt byCluster.length 1)}} {{#if (gt byCluster.length 1)}}
{{else if projectChoices.length}} {{#each byCluster as |entry|}}
<li role="presentation" class="dropdown-header"> <li class="{{if entry.system.active 'active selected'}}">
{{#if accessEnabled}} <a href="#" {{action "switchProject" entry.system.id}} class="clip">
{{t 'nav.environment.your'}} <i class="icon icon-cluster"></i>
{{else}} &nbsp;
{{t 'nav.environment.all'}} {{entry.cluster.displayName}}
{{/if}} </a>
</li> </li>
{{#each entry.projects as |p|}}
<li class="{{if p.active 'active selected'}}">
<a href="#" {{action "switchProject" p.id}} class="clip pl-40">
<i class="icon {{p.icon}}"></i>
&nbsp;
{{p.displayName}}
</a>
</li>
{{/each}}
{{/each}}
{{else if projectChoices.length}}
{{#each projectChoices as |p|}} {{#each projectChoices as |p|}}
<li class="{{if p.active 'active selected'}}"> <li class="{{if p.active 'active selected'}}">
<a href="#" {{action "switchProject" p.id}} class="clip"> <a href="#" {{action "switchProject" p.id}} class="clip">

View File

@ -94,7 +94,7 @@
<ul class="nav-user dropdown"> <ul class="nav-user dropdown">
<li> <li>
<a class="btn dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" aria-label={{t 'nav.user.label' username=session.user}}> <a class="btn dropdown-toggle" style="height: 51px; padding-top: 8px;" role="button" aria-haspopup="true" aria-expanded="false" aria-label={{t 'nav.user.label' username=session.user}}>
{{#if accessEnabled}} {{#if accessEnabled}}
{{identity-avatar link=false identity=access.identity}} {{identity-avatar link=false identity=access.identity}}
{{else}} {{else}}

View File

@ -33,7 +33,9 @@ export default Ember.Service.extend({
opt.filter = {all: 'true'}; opt.filter = {all: 'true'};
} }
return this.get('userStore').find('project', null, opt); return this.get('userStore').find('project', null, opt).then(() => {
return this.get('userStore').all('project');
});
}, },
refreshAll: function() { refreshAll: function() {

View File

@ -136,8 +136,8 @@ $user-btn : darken($header, 10%) !default;
.bg-error.badge-xs { .bg-error.badge-xs {
position: absolute; position: absolute;
right: 2px; right: 4px;
top: 10px; top: 15px;
text-align: center; text-align: center;
width: 19px; width: 19px;
border-radius: 90%; border-radius: 90%;