diff --git a/static/css/core-ui.css b/static/css/core-ui.css index 5b8bd7e45..5e0a88e7c 100644 --- a/static/css/core-ui.css +++ b/static/css/core-ui.css @@ -100,6 +100,12 @@ padding: 30px; } +@media (max-width: 767px) { + .co-tab-content { + padding: 20px; + } +} + .co-tabs li { list-style: none; display: block; @@ -206,15 +212,16 @@ } .co-tab-element.open li { - display: block; + height: 60px; } .co-tab-element.closed li { - display: none; + height: 0px; + overflow: hidden; } .co-tab-element.closed li.active { - display: block; + height: 60px; } } @@ -960,6 +967,36 @@ padding-left: 28px; } +.co-table .mobile-row { + border-bottom: 2px solid #eee; + padding-bottom: 10px; + margin-bottom: 10px; + + position: relative; +} + +.co-table .mobile-row:last-child { + border-bottom: 0px solid #eee; + padding-bottom: 0px; + margin-bottom: 0px; +} + +.co-table .mobile-row .mobile-col-header { + font-weight: bold; + color: #444; +} + +.co-table .mobile-row .mobile-col-value { + padding: 6px; +} + +.co-table .mobile-row .options-col { + position: absolute; + top: -6px; + right: 0px; +} + + .cor-checkable-menu { display: inline-block; } diff --git a/static/css/directives/ui/manager-header.css b/static/css/directives/ui/manager-header.css new file mode 100644 index 000000000..5d778c9a8 --- /dev/null +++ b/static/css/directives/ui/manager-header.css @@ -0,0 +1,55 @@ +.manager-header { + margin-bottom: 10px; + padding-bottom: 10px; + border-bottom: 1px solid #eee; +} + +.manager-header h3 { + margin-bottom: 10px; +} + +.manager-header .manager-header-side-controls { + float: right; +} + +.manager-filter-box { + margin-bottom: 20px; + height: 30px; +} + +.manager-filter-box input { + float: right; + min-width: 175px; + max-width: 300px; +} + +@media (max-width: 767px) { + .manager-header { + position: relative; + padding-bottom: 36px; + } + + .manager-header .manager-header-side-controls { + float: none; + display: block; + border-top: 1px solid #eee; + padding-top: 6px; + position: absolute; + top: 34px; + left: 0px; + right: 0px; + } + + .manager-header .manager-header-side-controls .btn { + display: block; + width: 100%; + } + + .manager-filter-box { + margin-bottom: 30px; + } + + .manager-filter-box input { + max-width: none; + } +} \ No newline at end of file diff --git a/static/css/directives/ui/robots-manager.css b/static/css/directives/ui/robots-manager.css index a04fbcdc2..de625143e 100644 --- a/static/css/directives/ui/robots-manager.css +++ b/static/css/directives/ui/robots-manager.css @@ -1,3 +1,7 @@ +.robots-manager-element .robot { + white-space: nowrap; +} + .robots-manager-element .robot a { font-size: 16px; cursor: pointer; @@ -78,9 +82,3 @@ .robots-manager-element .member-perm-summary { margin-right: 14px; } - -.robots-manager-element .co-filter-box { - float: right; - min-width: 175px; - margin-bottom: 10px; -} \ No newline at end of file diff --git a/static/css/quay.css b/static/css/quay.css index b62e575e0..f18bc1cc9 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -4744,13 +4744,3 @@ i.rocket-icon { text-align: center; } -.manager-header { - margin-bottom: 10px; - padding-bottom: 10px; - border-bottom: 1px solid #eee; -} - -.manager-header h3 { - margin-bottom: 10px; -} - diff --git a/static/directives/manager-header.html b/static/directives/manager-header.html new file mode 100644 index 000000000..79fd62b58 --- /dev/null +++ b/static/directives/manager-header.html @@ -0,0 +1,4 @@ +
+ | Robot Account Name | Teams | Repository Permissions | @@ -48,7 +45,7 @@
+ |
-
+
{{ getPrefix(robotInfo.name) }}+{{ getShortenedName(robotInfo.name) }}
@@ -81,7 +78,12 @@
Permissions on
- {{ robotInfo.repositories.length }}
+ {{ robotInfo.repositories.length }}
repository
repositories
diff --git a/static/js/core-ui.js b/static/js/core-ui.js
index a1fc083d2..c21d7a541 100644
--- a/static/js/core-ui.js
+++ b/static/js/core-ui.js
@@ -715,4 +715,85 @@ angular.module("core-ui", [])
}
};
return directiveDefinitionObject;
- });
\ No newline at end of file
+ })
+
+ .directive('corTable', function() {
+ var directiveDefinitionObject = {
+ priority: 1,
+ replace: false,
+ transclude: false,
+ restrict: 'C',
+ scope: {},
+ compile: function(tElement, tAttrs, transclude) {
+ if (!window.matchMedia('(max-width: 767px)').matches) {
+ return;
+ }
+
+ var cloneWithAttr = function(e, kind, opt_fullclone) {
+ var clone = $(document.createElement(kind));
+ var attributes = $(e).prop("attributes");
+ $.each(attributes, function() {
+ clone.attr(this.name, this.value);
+ });
+
+ if (opt_fullclone) {
+ for (var i = 0; i < e.childNodes.length; ++i) {
+ clone.append($(e.childNodes[i]).clone(true));
+ }
+ }
+
+ return clone;
+ };
+
+ var appendRepeater = function(div, tr, headers) {
+ // Find all the tds directly under the tr and convert into a header + value span.
+ tr.children('td').each(function(idx, td) {
+ var displayer = cloneWithAttr(tr, 'div');
+ displayer.append(headers[idx].clone(true).addClass('mobile-col-header'));
+ displayer.append(cloneWithAttr(td, 'div', true).addClass('mobile-col-value'));
+ div.append(displayer);
+ });
+ };
+
+ // Find the thead's tds and turn them into header elements.
+ var headers = [];
+ tElement.find('thead td').each(function(idx, td) {
+ headers.push(cloneWithAttr(td, 'div', true));
+ });
+
+ // Find the element with the 'ng-repeat'.
+ var repeater = tElement.find('[ng-repeat]')[0];
+
+ // Convert the repeater into a repeater.
+ var divRepeater = cloneWithAttr(repeater, 'div').addClass('mobile-row');
+
+ // If the repeater is a tbody, then we append each child tr. Otherwise, the repeater
+ // itself should be a tr.
+ if (repeater.nodeName.toLowerCase() == 'tbody') {
+ $(repeater).children().each(function(idx, tr) {
+ appendRepeater(divRepeater, $(tr), headers);
+ });
+ } else {
+ appendRepeater(divRepeater, $(repeater), headers);
+ }
+
+ var repeaterBody = $(document.createElement('tbody'));
+ var repeaterTr = $(document.createElement('tr'))
+ var repeaterTd = $(document.createElement('td'))
+
+ repeaterTd.append(divRepeater);
+ repeaterTr.append(repeaterTd);
+ repeaterBody.append(repeaterTr);
+
+ // Remove the tbody and thead.
+ tElement.find('thead').remove();
+ tElement.find('tbody').remove();
+ tElement.append(repeaterBody);
+ },
+
+ controller: function($rootScope, $scope, $element) {
+ $element.addClass('co-table');
+ }
+ };
+ return directiveDefinitionObject;
+});
diff --git a/static/js/directives/ui/manager-header.js b/static/js/directives/ui/manager-header.js
new file mode 100644
index 000000000..59509e684
--- /dev/null
+++ b/static/js/directives/ui/manager-header.js
@@ -0,0 +1,18 @@
+/**
+ * An element which displays the header bar for a manager UI component.
+ */
+angular.module('quay').directive('managerHeader', function () {
+ var directiveDefinitionObject = {
+ priority: 0,
+ templateUrl: '/static/directives/manager-header.html',
+ replace: false,
+ transclude: true,
+ restrict: 'C',
+ scope: {
+ 'headerTitle': '@headerTitle'
+ },
+ controller: function($scope, $element) {
+ }
+ };
+ return directiveDefinitionObject;
+});
\ No newline at end of file
+ |