Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
//= require "bastion_katello/architectures/architectures.module.js"
//= require_tree "./architectures"

//= require "bastion_katello/dates/dates.module.js"

//= require "bastion_katello/i18n/translations.js"

//= require "bastion_katello/bastion-katello-bootstrap.js"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</td>
<td bst-table-cell><div subscription-type="subscription"></div></td>
<td bst-table-cell><div subscription-start-date="subscription"></div></td>
<td bst-table-cell>{{ subscription.end_date | date:"shortDate" }}</td>
<td bst-table-cell><date date="subscription.end_date" /></td>
<td bst-table-cell>{{ subscription.support_level }}</td>
<td bst-table-cell>{{ subscription.contract_number }}</td>
<td bst-table-cell>{{ subscription.account_number }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h4 data-block="modal-header" translate>
<td bst-table-cell>{{ subscription | subscriptionConsumedFilter }}</td>
<td bst-table-cell><div subscription-type="subscription"></div></td>
<td bst-table-cell><div subscription-start-date="subscription"></div></td>
<td bst-table-cell>{{ subscription.end_date | date:"shortDate" }}</td>
<td bst-table-cell><date date="subscription.end_date" /></td>
<td bst-table-cell>{{ subscription.support_level }}</td>
<td bst-table-cell>{{ subscription.contract_number }}</td>
<td bst-table-cell>{{ subscription.account_number }}</td>
Expand All @@ -118,4 +118,4 @@ <h4 data-block="modal-header" translate>
Done
</button>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ angular.module('Bastion.content-hosts', [
'Bastion.hosts',
'Bastion.errata',
'Bastion.host-collections',
'Bastion.repository-sets'
'Bastion.repository-sets',
'Bastion.dates'
]);
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ <h3 translate ng-show="selectedErrataOption === 'current'">Installable Errata</h
{{ erratum.errata_id }}
</a>
</td>
<td bst-table-cell >{{ erratum.title }}</td>
<td bst-table-cell >{{ erratum.updated | date:'shortDate' }}</td>
<td bst-table-cell>{{ erratum.title }}</td>
<td bst-table-cell><date date="erratum.updated" /></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<td bst-table-cell>{{ event.type }}</td>
<td bst-table-cell>{{ event.target }}</td>
<td bst-table-cell>{{ event.messageText }}</td>
<td bst-table-cell>{{ event.timestamp | date:"short" }}</td>
<td bst-table-cell><short-date-time date="event.timestamp" /></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ <h4 translate>Content Host Status</h4>

<dl class="dl-horizontal dl-horizontal-left">
<dt translate>Registered</dt>
<dd>{{ host.created_at | date:'short' }}</dd>
<dd><short-date-time date="host.created_at" /></dd>

<dt translate> Registered By</dt>
<dd>
Expand All @@ -315,7 +315,7 @@ <h4 translate>Content Host Status</h4>
</dd>

<dt translate>Last Checkin</dt>
<dd>{{ (host.subscription_facet_attributes.last_checkin | date:'short') || ("Never checked in" | translate) }}</dd>
<dd><short-date-time date="host.subscription_facet_attributes.last_checkin" default="'Never checked in' | translate" /></dd>
</dl>

<div class="divider"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h4 translate>Provisioning Host Details</h4>
<dd>{{ host.puppet_environment_name }}</dd>

<dt translate>Last Puppet Report</dt>
<dd>{{ host.last_report | date:'short' }}</dd>
<dd><short-date-time date="host.last_report" /></dd>

<dt translate>Model</dt>
<dd>{{ host.model_name }}</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ <h2 translate>Content Hosts</h2>
<td bst-table-cell>{{ host.operatingsystem_name }}</td>
<td bst-table-cell>{{ host.content_facet_attributes.lifecycle_environment.name }}</td>
<td bst-table-cell>{{ host.content_facet_attributes.content_view.name || "" }}</td>
<td bst-table-cell>{{ (host.subscription_facet_attributes.registered_at | date:'short') || ("Never registered" | translate) }}</td>
<td bst-table-cell>{{ (host.subscription_facet_attributes.last_checkin | date:'short') || ("Never checked in" | translate) }}</td>
<td bst-table-cell><short-date-time date="host.subscription_facet_attributes.registered_at" default="'Never registered' | translate" /></td>
<td bst-table-cell><short-date-time date="host.subscription_facet_attributes.last_checkin" default="'Never checked in' | translate" /></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ angular.module('Bastion.content-views', [
'Bastion.utils',
'Bastion.content-views.versions',
'Bastion.components',
'Bastion.packages'
'Bastion.packages',
'Bastion.dates'
]);
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
{{ errata.type }}
</td>
<td bst-table-cell>
{{ errata.issued | date:'M/d/yy' }}
<date date="errata.issued" />
</td>
<td bst-table-cell>
{{ errata.updated | date:'M/d/yy' }}
<date date="errata.updated" />
</td>
<td bst-table-cell>{{ errata.title }}</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</span>
<span ng-hide="repository.last_sync == null">
<a href="/foreman_tasks/tasks/{{repository.last_sync.id}}">{{ repository.last_sync.result | capitalize}}</a>
({{ repository.last_sync.ended_at | date:"short" }})
<short-date-time date="repository.last_sync.ended_at" />
</span>
</span>
<span ng-hide="repository.url" translate>N/A</span>
Expand All @@ -113,4 +113,4 @@
</table>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</a>
</td>
<td bst-table-cell>{{ filter.description }}</td>
<td bst-table-cell>{{ filter.updated_at | date:"short" }}</td>
<td bst-table-cell><short-date-time date="filter.updated_at" /></td>
<td bst-table-cell>
{{ filter.type | filterContentType }}
<span ng-if="filter.type === 'erratum' && filter.rules[0].types">{{ '- Date and Type' | translate }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ <h3 translate>Promotion History</h3>

<div data-block="table">
<table class="table table-striped table-bordered" ng-class="{'table-mask': table.working}">
<thead>
<tr bst-table-head>
<th translate>Date</th>
<th translate>Version</th>
<th translate>Description</th>
<th translate>Action</th>
<th translate>User</th>
<th translate>Status</th>
</tr>
</thead>
<thead>
<tr bst-table-head>
<th translate>Date</th>
<th translate>Version</th>
<th translate>Description</th>
<th translate>Action</th>
<th translate>User</th>
<th translate>Status</th>
</tr>
</thead>

<tbody>
<tr bst-table-row ng-repeat="history in table.rows">
<td bst-table-cell>{{ history.created_at | date:'short' }}</td>
<td bst-table-cell>{{ history.version }} </td>
<td bst-table-cell class="preserve-newlines">{{ history.description }}</td>
<td bst-table-cell>{{ actionText(history) }}</td>
<td bst-table-cell>{{ history.user }}</td>
<td bst-table-cell>{{ history.task.result }}</td>
</tr>
</tbody>
<tbody>
<tr bst-table-row ng-repeat="history in table.rows">
<td bst-table-cell><short-date-time date="history.created_at" /></td>
<td bst-table-cell>{{ history.version }} </td>
<td bst-table-cell class="preserve-newlines">{{ history.description }}</td>
<td bst-table-cell>{{ actionText(history) }}</td>
<td bst-table-cell>{{ history.user }}</td>
<td bst-table-cell>{{ history.task.result }}</td>
</tr>
</tbody>
</table>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h3 translate>Deb Repositories</h3>
Not Synced
</span>
<span ng-show="repository.url">
{{ repository.last_sync.ended_at | date:"short" }}
<short-date-time date="repository.last_sync.ended_at" />
</span>
<span ng-hide="repository.url" translate>N/A</span>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h3 translate>
Not Synced
</span>
<span ng-show="repository.url">
{{ repository.last_sync.ended_at | date:"short" }}
<short-date-time date="repository.last_sync.ended_at" />
</span>
<span ng-hide="repository.url" translate>N/A</span>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h3 translate>File Repositories</h3>
Not Synced
</span>
<span ng-show="repository.url">
{{ repository.last_sync.ended_at | date:"short" }}
<short-date-time date="repository.last_sync.ended_at" />
</span>
<span ng-hide="repository.url" translate>N/A</span>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h3 translate>OSTree Repositories</h3>
Not Synced
</span>
<span ng-show="repository.url">
{{ repository.last_sync.ended_at | date:"short" }}
<short-date-time date="repository.last_sync.ended_at" />
</span>
<span ng-hide="repository.url" translate>N/A</span>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h3 translate>
Not Synced
</span>
<span ng-show="repository.url">
{{ repository.last_sync.ended_at | date:"short" }}
<short-date-time date="repository.last_sync.ended_at" />
</span>
<span ng-hide="repository.url" translate>N/A</span>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<span ng-show="hideProgress(version)">
{{ historyText(version) }}
({{ version.last_event.created_at | date:'short' }})
(<short-date-time date="version.last_event.created_at" />)
</span>
</td>
<td bst-table-cell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<span ng-show="errata.severity">- {{ errata.severity }}</span>
</td>
<td bst-table-cell>{{ errata.hosts_available_count || 0 }}</td>
<td bst-table-cell>{{ errata.updated | date:'shortDate'}}</td>
<td bst-table-cell><date date="errata.updated" /></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2 translate>Content Views</h2>
<span ng-hide="contentView.composite" translate>No</span>
</td>
<td bst-table-cell>
<span ng-show="contentView.last_published">{{ contentView.last_published | date:"medium" }}</span>
<span ng-show="contentView.last_published"><long-date-time date="contentView.last_published" /></span>
<span ng-hide="contentView.last_published" translate>
Not yet published
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* @ngdoc module
* @name Bastion.dates
*
* @description
* Module providing directives for formatting dates.
*/
angular.module('Bastion.dates', [
'Bastion',
'react'
]);

angular.module('Bastion.dates').factory('componentRegistry',
['$window', function($window) {
return $window.tfm.componentRegistry;
}]
);

angular.module('Bastion.dates').factory('dateComponent',
['componentRegistry', function(componentRegistry) {
return function(componentName) {
var dateWrapper = componentRegistry.wrapperFactory().with('i18n').wrapper;
return dateWrapper(componentRegistry.getComponent(componentName).type);
};
}]
);

angular.module('Bastion.dates').directive('date',
['dateComponent', 'reactDirective', function(dateComponent, reactDirective) {
return reactDirective(dateComponent('IsoDate'), ['date']);
}]
);

angular.module('Bastion.dates').directive('shortDateTime',
['dateComponent', 'reactDirective', function(dateComponent, reactDirective) {
return reactDirective(dateComponent('ShortDateTime'), ['date', 'seconds']);
}]
);

angular.module('Bastion.dates').directive('longDateTime',
['dateComponent', 'reactDirective', function(dateComponent, reactDirective) {
return reactDirective(dateComponent('LongDateTime'), ['date', 'seconds']);
}]
);

angular.module('Bastion.dates').directive('relativeDate',
['dateComponent', 'reactDirective', function(dateComponent, reactDirective) {
return reactDirective(dateComponent('RelativeDateTime'), ['date']);
}]
);
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<span ng-show="contentView.composite" translate>Yes</span>
<span ng-hide="contentView.composite" translate>No</span>
</td>
<td bst-table-cell>{{ contentView.last_published | date:'longDate' }}</td>
<td bst-table-cell><long-date-time date="contentView.last_published" /></td>
<td bst-table-cell class="number-cell">{{ contentView.repositories.length || 0 }}</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
<span ng-show="errata.severity">- {{ errata.severity | errataSeverity}}</span>
</td>
<td bst-table-cell class="number-cell">{{ errata.hosts_available_count || 0 }}</td>
<td bst-table-cell>{{ errata.updated | date:'shortDate'}}</td>

<td bst-table-cell><date date="errata.updated" /></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ angular.module('Bastion.environments', [
'Bastion.ostree-branches',
'Bastion.puppet-modules',
'Bastion.repositories',
'Bastion.content-views'
'Bastion.content-views',
'Bastion.dates'
]);
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ <h4 translate>{{ errata.title }}</h4>
<dd>{{ errata.severity | errataSeverity }}</dd>

<dt translate>Issued</dt>
<dd>{{ errata.issued | date:'shortDate' }}</dd>
<dd><short-date-time date="errata.issued" /></dd>

<dt translate>Last Updated On</dt>
<dd>{{ errata.updated | date:'shortDate' }}</dd>
<dd><short-date-time date="errata.updated" /></dd>

<dt translate>Reboot Suggested?</dt>
<dd>{{ errata.reboot_suggested | booleanToYesNo }}</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ angular.module('Bastion.errata', [
'Bastion.common',
'Bastion.i18n',
'Bastion.components.formatters',
'Bastion.tasks'
'Bastion.tasks',
'Bastion.dates'
]);
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<span translate>{{ errata.hosts_applicable_count || 0 }} Applicable, </span>
<span translate>{{ errata.hosts_available_count || 0 }} Installable</span>
</td>
<td bst-table-cell>{{ errata.updated | date:'shortDate'}}</td>
<td bst-table-cell><short-date-time date="errata.updated" /></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ <h4 data-block="modal-header">Sync Plan Management</h4>
<tr bst-table-row ng-repeat="syncPlan in table.rows" class="clickable-row"
ng-click="selectSyncPlan(syncPlan)" ng-class="{'selected-row': syncPlan === selectedSyncPlan }">
<td bst-table-cell>{{ syncPlan.name }}</td>
<td bst-table-cell>{{ syncPlan.sync_date | date:'medium' }}</td>
<td bst-table-cell><long-date-time date="syncPlan.sync_date" /></td>
<td bst-table-cell>{{ syncPlan.enabled }}</td>
<td bst-table-cell>{{ syncPlan.interval | translate | capitalize }}</td>
<td bst-table-cell>{{ syncPlan.next_sync | date:'medium' }}</td>
<td bst-table-cell><long-date-time date="syncPlan.next_sync" /></td>
</tr>
</tbody>
</table>
Expand All @@ -84,4 +84,4 @@ <h4 data-block="modal-header">Sync Plan Management</h4>
Done
</button>
</div>
</div>
</div>
Loading