1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Merge pull request #2361 from marshmalien/fix/panel-header-docs

Modify panel header to accept title and badge string bindings
This commit is contained in:
Marliana Lara 2018-07-03 11:16:36 -04:00 committed by GitHub
commit f3ff624873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 106 additions and 61 deletions

View File

@ -1,7 +1,5 @@
<at-panel>
<at-panel-heading>
{{ vm.panelTitle }}
</at-panel-heading>
<at-panel-heading title="{{:: vm.panelTitle }}"></at-panel-heading>
<at-tab-group>
<at-tab state="vm.tab.details">{{:: vm.strings.get('tab.DETAILS') }}</at-tab>

View File

@ -25,6 +25,7 @@ function ApplicationsStrings (BaseString) {
};
ns.list = {
PANEL_TITLE: t.s('APPLICATIONS'),
ROW_ITEM_LABEL_EXPIRED: t.s('EXPIRATION'),
ROW_ITEM_LABEL_ORGANIZATION: t.s('ORG'),
ROW_ITEM_LABEL_MODIFIED: t.s('LAST MODIFIED')

View File

@ -1,9 +1,8 @@
<at-panel>
<at-panel-heading hide-dismiss="true">
APPLICATIONS
<span class="badge List-titleBadge">
{{ vm.applicationsCount }}
</span>
<at-panel-heading
title="{{:: vm.strings.get('list.PANEL_TITLE') }}"
badge="{{ vm.applicationsCount }}"
hide-dismiss="true">
</at-panel-heading>
<at-panel-body>

View File

@ -1,5 +1,5 @@
<at-panel ng-if="!$state.current.name.includes('permissions')">
<at-panel-heading>{{ vm.panelTitle }}</at-panel-heading>
<at-panel-heading title="{{:: vm.panelTitle }}"></at-panel-heading>
<at-tab-group>
<at-tab state="vm.tab.details">{{:: vm.strings.get('tab.DETAILS') }}</at-tab>
@ -29,7 +29,7 @@
</at-panel>
<at-panel ng-if="$state.current.name.includes('permissions')" on-dismiss="credentials">
<at-panel-heading>{{:: vm.strings.get('permissions.TITLE') }}</at-panel-heading>
<at-panel-heading title="{{:: vm.strings.get('permissions.TITLE') }}"></at-panel-heading>
<at-tab-group class="at-TabGroup--padBelow">
<at-tab state="vm.tab.details">{{:: vm.strings.get('tab.DETAILS') }}</at-tab>

View File

@ -3,17 +3,10 @@
<at-panel ng-cloak id="htmlTemplate">
<div>
<div ng-hide="$state.includes('schedules')">
<at-panel-heading hide-dismiss="true">
<translate>JOBS</translate>
<at-panel-heading title="{{:: vm.strings.get('list.PANEL_TITLE') }}" hide-dismiss="true">
</at-panel-heading>
<div ui-view="jobsList"></div>
</div>
<div ng-hide="!$state.includes('schedules')">
<at-panel-heading hide-dismiss="true">
<translate>SCHEDULES</translate>
</at-panel-heading>
<div ui-view="schedulesList"></div>
</div>
</div>
</at-panel>
<div ng-include="'/static/partials/logviewer.html'"></div>

View File

@ -5,6 +5,7 @@ function JobsStrings (BaseString) {
const ns = this.jobs;
ns.list = {
PANEL_TITLE: t.s('JOBS'),
ROW_ITEM_LABEL_STARTED: t.s('Started'),
ROW_ITEM_LABEL_FINISHED: t.s('Finished'),
ROW_ITEM_LABEL_WORKFLOW_JOB: t.s('Workflow Job'),

View File

@ -58,7 +58,12 @@ export default {
},
views: {
'@': {
templateUrl: indexTemplate
templateUrl: indexTemplate,
controller: ['JobsStrings', function (strings) {
const vm = this || {};
vm.strings = strings;
}],
controllerAs: 'vm'
},
'jobsList@jobs': {
templateUrl: jobsListTemplate,

View File

@ -2,19 +2,16 @@
<div ui-view="form"></div>
<at-panel ng-cloak id="htmlTemplate">
<div ng-if="$state.is('templates')">
<at-panel-heading hide-dismiss="true">
{{:: vm.strings.get('list.PANEL_TITLE') }}
<div class="at-Panel-headingTitleBadge" ng-show="vm.count">
{{ vm.count }}
</div>
<at-panel-heading
title="{{:: vm.strings.get('list.PANEL_TITLE') }}"
hide-dismiss="true"
badge="{{ vm.count }}">
</at-panel-heading>
</div>
<div ng-if="!$state.is('templates')">
<at-panel-heading>
{{:: vm.strings.get('list.PANEL_TITLE') }}
<div class="at-Panel-headingTitleBadge" ng-show="vm.count">
{{ vm.count }}
</div>
<at-panel-heading
title="{{:: vm.strings.get('list.PANEL_TITLE') }}"
badge="{{ vm.count }}">
</at-panel-heading>
</div>
<div ui-view="templatesList"></div>

View File

@ -1,7 +1,5 @@
<at-panel>
<at-panel-heading>
{{ vm.panelTitle }}
</at-panel-heading>
<at-panel-heading title="{{:: vm.panelTitle }}"></at-panel-heading>
<at-panel-body>
<at-form state="vm.form" autocomplete="off">

View File

@ -5,12 +5,14 @@
}
.at-Panel-heading {
margin: 0;
margin-bottom: 20px;
padding: 0;
}
.at-Panel-headingRow {
margin-bottom: 20px;
display: flex;
align-items: center;
justify-content: space-between;
}
.at-Panel-dismiss {
@ -42,7 +44,13 @@
vertical-align: middle;
white-space: nowrap;
text-align: center;
margin-left: 5px;
margin-left: 10px;
margin-right: auto;
}
.at-Panel-headingCustomContent {
display: flex;
flex: 1;
}
.at-Panel-label {

View File

@ -12,7 +12,11 @@ function atPanelHeading () {
replace: true,
transclude: true,
templateUrl,
link
link,
scope: {
title: '@',
badge: '@?'
}
};
}

View File

@ -1,20 +1,27 @@
<div class="row at-Panel-headingRow">
<div class="col-xs-10"
<div class="at-Panel-heading">
<div class="at-Panel-headingRow"
ng-if="!hideDismiss">
<h3 class="at-Panel-headingTitle">
<ng-transclude></ng-transclude>
{{ title }}
</h3>
</div>
<div class="col-xs-2"
ng-if="!hideDismiss">
<span ng-if="badge" class="at-Panel-headingTitleBadge">
{{ badge }}
</span>
<div class="at-Panel-headingCustomContent" ng-transclude></div>
<div class="at-Panel-dismiss">
<i class="fa fa-times-circle fa-lg" ng-click="dismiss()"></i>
</div>
</div>
<div class="col-xs-12"
<div class="at-Panel-headingRow"
ng-if="hideDismiss">
<h3 class="at-Panel-headingTitle">
<ng-transclude></ng-transclude>
{{ title }}
</h3>
<span ng-if="badge" class="at-Panel-headingTitleBadge">
{{ badge }}
</span>
</div>
</div>

View File

@ -1,6 +1,8 @@
<at-panel>
<at-panel-heading>
{{ vm.panelTitle }}
<at-panel-heading title="{{:: vm.panelTitle }}">
<a class="Panel-docsLink" ng-href="{{ vm.docs.url }}" target="_blank" aw-tool-tip="{{:: vm.docs.help_text }}">
<i class="fa fa-book"></i>
</a>
</at-panel-heading>
<at-tab-group>

View File

@ -6,6 +6,11 @@ function AddController ($state, models, strings) {
vm.strings = strings;
vm.panelTitle = strings.get('state.ADD_BREADCRUMB_LABEL');
vm.docs = {
url: 'https://docs.ansible.com/ansible-tower/latest/html/administration/clustering.html',
help_text: vm.strings.get('tooltips.DOCS_HELP_TEXT')
};
vm.tab = {
details: { _active: true },
instances: {_disabled: true },

View File

@ -8,6 +8,11 @@ function EditController ($rootScope, $state, models, strings) {
vm.strings = strings;
vm.panelTitle = instanceGroup.get('name');
vm.docs = {
url: 'https://docs.ansible.com/ansible-tower/latest/html/administration/clustering.html',
help_text: vm.strings.get('tooltips.DOCS_HELP_TEXT')
};
vm.tab = {
details: {
_active: true,

View File

@ -48,4 +48,30 @@
.List-tableRow .List-titleBadge {
margin: 0 0 0 5px;
}
.Panel-docsLink {
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
padding: 7px;
background: @at-white;
border-radius: @at-border-radius;
height: 30px;
width: 30px;
margin: 0 20px 0 auto;
i {
font-size: @at-font-size-icon;
color: @at-gray-848992;
}
}
.Panel-docsLink:hover {
background-color: @at-blue;
i {
color: @at-white;
}
}
}

View File

@ -28,7 +28,8 @@ function InstanceGroupsStrings (BaseString) {
ns.tooltips = {
ADD_INSTANCE_GROUP: t.s('Create a new Instance Group'),
ASSOCIATE_INSTANCES: t.s('Associate an existing Instance')
ASSOCIATE_INSTANCES: t.s('Associate an existing Instance'),
DOCS_HELP_TEXT: t.s('Instance Groups Help')
};
ns.instance = {

View File

@ -1,7 +1,5 @@
<at-panel>
<at-panel-heading>
{{ vm.panelTitle }}
</at-panel-heading>
<at-panel-heading title="{{:: vm.panelTitle }}"></at-panel-heading>
<at-tab-group class="at-TabGroup--padBelow">
<at-tab state="vm.tab.details">{{:: vm.strings.get('tab.DETAILS') }}</at-tab>

View File

@ -1,7 +1,6 @@
<at-panel>
<at-panel-heading>
{{ vm.panelTitle }}
</at-panel-heading>
<at-panel-heading title="{{:: vm.panelTitle }}"></at-panel-heading>
<at-tab-group class="at-TabGroup--padBelow">
<at-tab state="vm.tab.details">{{:: vm.strings.get('tab.DETAILS') }}</at-tab>
<at-tab state="vm.tab.instances">{{:: vm.strings.get('tab.INSTANCES') }}</at-tab>

View File

@ -1,6 +1,5 @@
<at-panel>
<at-panel-heading>
{{ vm.panelTitle }}
</at-panel-heading>
<at-panel-heading title="{{:: vm.panelTitle }}"></at-panel-heading>
<div ui-view="jobsList"></div>
</at-panel>

View File

@ -1,9 +1,8 @@
<at-panel>
<at-panel-heading hide-dismiss="true">
{{ vm.strings.get('list.PANEL_TITLE') }}
<span class="badge List-titleBadge">
{{ instanceGroupCount }}
</span>
<at-panel-heading
title="{{:: vm.strings.get('list.PANEL_TITLE') }}"
hide-dismiss="true"
badge="{{ instanceGroupCount }}">
</at-panel-heading>
<at-panel-body>