1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Translate VIEW MORE and VIEW LESS into component strings

This commit is contained in:
kialam 2018-05-31 16:32:34 -04:00
parent 265554accb
commit e66b00eb64
3 changed files with 10 additions and 4 deletions

View File

@ -52,6 +52,11 @@ function ComponentsStrings (BaseString) {
COPIED: t.s('Copied to clipboard.')
};
ns.toggle = {
VIEW_MORE: t.s('VIEW MORE'),
VIEW_LESS: t.s('VIEW LESS')
};
ns.layout = {
CURRENT_USER_LABEL: t.s('Logged in as'),
VIEW_DOCS: t.s('View Documentation'),

View File

@ -2,11 +2,12 @@ import { TRUNCATED, TRUNCATE_LENGTH } from './constants';
const templateUrl = require('~components/toggle/toggle-tag.partial.html');
function controller ($scope, TagService) {
function controller ($scope, TagService, strings) {
const { tags } = $scope;
const vm = this;
vm.truncatedLength = TRUNCATE_LENGTH;
vm.truncated = TRUNCATED;
vm.strings = strings;
vm.toggle = () => {
vm.truncated = !vm.truncated;
@ -19,7 +20,7 @@ function controller ($scope, TagService) {
});
}
controller.$inject = ['$scope', 'TagService'];
controller.$inject = ['$scope', 'TagService', 'ComponentsStrings'];
function atToggleTag () {
return {

View File

@ -3,12 +3,12 @@
<div ng-repeat="tag in vm.tags | limitTo: vm.truncatedLength">
<at-tag tag="tag.value" icon="{{ tag.icon }}" link="{{ tag.link }}"></at-tag>
</div>
<button class="ToggleComponent-button" ng-click="vm.toggle()">VIEW MORE</button>
<button class="ToggleComponent-button" ng-click="vm.toggle()">{{:: vm.strings.get('toggle.VIEW_MORE') }}</button>
</div>
<div ng-show="!vm.truncated" class="ToggleComponent-container">
<div ng-repeat="tag in vm.tags">
<at-tag tag="tag.value" icon="{{ tag.icon }}" link="{{ tag.link }}"></at-tag>
</div>
<button class="ToggleComponent-button" ng-click="vm.toggle()">VIEW LESS</button>
<button class="ToggleComponent-button" ng-click="vm.toggle()">{{:: vm.strings.get('toggle.VIEW_LESS') }}</button>
</div>
</div>