-
+
diff --git a/awx/ui/client/src/portal-mode/portal-mode.block.less b/awx/ui/client/src/portal-mode/portal-mode.block.less
new file mode 100644
index 0000000000..70d90f8626
--- /dev/null
+++ b/awx/ui/client/src/portal-mode/portal-mode.block.less
@@ -0,0 +1,23 @@
+@import "awx/ui/client/src/shared/layouts/one-plus-one.less";
+
+.PortalMode-container{
+ .OnePlusOne-container;
+}
+
+.PortalMode-panel--left{
+ .OnePlusOne-panel--left;
+}
+.PortalMode-panel--right{
+ .OnePlusOne-panel--right;
+ .List-tableHeader:last-of-type{
+ text-align:left;
+ }
+}
+.PortalMode-panelHeader{
+ .OnePlusOne-panelHeader;
+}
+.PortalMode-filter{
+ position: absolute;
+ top: 45px;
+ right: 35px;
+}
\ No newline at end of file
diff --git a/awx/ui/client/src/portal-mode/portal-mode.route.js b/awx/ui/client/src/portal-mode/portal-mode.route.js
new file mode 100644
index 0000000000..f738e3c615
--- /dev/null
+++ b/awx/ui/client/src/portal-mode/portal-mode.route.js
@@ -0,0 +1,33 @@
+import {templateUrl} from '../shared/template-url/template-url.factory';
+import {PortalModeJobTemplatesController} from './portal-mode-job-templates.controller';
+import {PortalModeJobsController} from './portal-mode-jobs.controller';
+
+// Using multiple named views requires a parent layout
+// https://github.com/angular-ui/ui-router/wiki/Multiple-Named-Views
+export default {
+ name: 'portalMode',
+ url: '/portal',
+ ncyBreadcrumb: {
+ label: "PORTAL MODE"
+ },
+ resolve: {
+ features: ['FeaturesService', function(FeaturesService) {
+ return FeaturesService.get();
+ }]
+ },
+ views: {
+ // the empty parent ui-view
+ "" : {
+ templateUrl: templateUrl('portal-mode/portal-mode-layout'),
+ },
+ // named ui-views inside the above
+ 'job-templates@portalMode': {
+ templateUrl: templateUrl('portal-mode/portal-mode-job-templates'),
+ controller: PortalModeJobTemplatesController
+ },
+ 'jobs@portalMode': {
+ templateUrl: templateUrl('portal-mode/portal-mode-jobs'),
+ controller: PortalModeJobsController
+ }
+ }
+};
\ No newline at end of file
diff --git a/awx/ui/client/src/shared/layouts/one-plus-one.less b/awx/ui/client/src/shared/layouts/one-plus-one.less
new file mode 100644
index 0000000000..ee578d995b
--- /dev/null
+++ b/awx/ui/client/src/shared/layouts/one-plus-one.less
@@ -0,0 +1,53 @@
+/*
+* Large resolution 1/2 + 1/2 width panels
+* Small resolution: 100% width panels, stacked
+* Options: static height, custom breakpoint
+*/
+
+@import "awx/ui/client/src/shared/branding/colors.default.less";
+
+
+.OnePlusOne-container(@height: 100%; @breakpoint: 900px){
+ height: @height;
+ display: flex;
+ flex-diration: row;
+ @media screen and(max-width: @breakpoint){
+ flex-direction: column;
+ }
+}
+
+.OnePlusOne-panel--left(@height: 100%; @breakpoint: 900px){
+ flex: 1 1;
+ height: @height;
+ width: 100%;
+ margin-right: 20px;
+ .Panel{
+ height: 100%;
+ }
+ @media screen and (max-width @breakpoint){
+ margin-right: 0px;
+ height: inherit;
+ }
+}
+
+.OnePlusOne-panel--right(@height: 100%; @breakpoint: 900px){
+ flex: 1 1;
+ height: @height;
+ width: 100%;
+ margin-right: 0px;
+ .Panel{
+ height: 100%;
+ }
+ @media screen and (max-width @breakpoint){
+ height: inherit;
+ }
+}
+
+.OnePlusOne-panelHeader{
+ color: @default-interface-txt;
+ font-size: 14px;
+ font-weight: bold;
+ margin-right: 10px;
+ text-transform: uppercase;
+ display: flex;
+}
diff --git a/awx/ui/client/src/shared/stateExtender.provider.js b/awx/ui/client/src/shared/stateExtender.provider.js
index 07b3c2051e..35d530db08 100644
--- a/awx/ui/client/src/shared/stateExtender.provider.js
+++ b/awx/ui/client/src/shared/stateExtender.provider.js
@@ -13,7 +13,8 @@ export default function($stateProvider){
data: state.data,
ncyBreadcrumb: state.ncyBreadcrumb,
onEnter: state.onEnter,
- onExit: state.onExit
+ onExit: state.onExit,
+ views: state.views
});
}
};
diff --git a/awx/ui/client/src/widgets.js b/awx/ui/client/src/widgets.js
index 09d13e5463..dae0b52e0f 100644
--- a/awx/ui/client/src/widgets.js
+++ b/awx/ui/client/src/widgets.js
@@ -7,6 +7,5 @@
import "./widgets/InventorySyncStatus";
import "./widgets/JobStatus";
import "./widgets/ObjectCount";
-import "./widgets/PortalJobs";
import "./widgets/SCMSyncStatus";
-import "./widgets/Stream";
+import "./widgets/Stream";
\ No newline at end of file
diff --git a/awx/ui/client/src/widgets/PortalJobs.js b/awx/ui/client/src/widgets/PortalJobs.js
deleted file mode 100644
index 2725d75b59..0000000000
--- a/awx/ui/client/src/widgets/PortalJobs.js
+++ /dev/null
@@ -1,199 +0,0 @@
-/*************************************************
- * Copyright (c) 2015 Ansible, Inc.
- *
- * All Rights Reserved
- *************************************************/
-
-
- /**
- * @ngdoc function
- * @name widgets.function:PortalJobs
- * @description
- *
- */
-
-
-
-angular.module('PortalJobsWidget', ['RestServices', 'Utilities'])
-.factory('PortalJobsWidget', ['$rootScope', '$compile', 'LoadSchedulesScope', 'LoadJobsScope', 'PortalJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'PortalJobTemplateList' ,
- function ($rootScope, $compile, LoadSchedulesScope, LoadJobsScope, PortalJobsList, ScheduledJobsList, GetChoices, GetBasePath, PortalJobTemplateList ) {
- return function (params) {
- var scope = params.scope,
- target = params.target,
- filter = params.filter || "User" ,
- choicesCount = 0,
- listCount = 0,
- jobs_scope = scope.$new(true),
- max_rows,
- user,
- html, e,
- url;
-
- if (scope.removeListLoaded) {
- scope.removeListLoaded();
- }
- scope.removeListLoaded = scope.$on('listLoaded', function() {
- listCount++;
- if (listCount === 1) {
- //api_complete = true;
- scope.$emit('WidgetLoaded', "portal_jobs", jobs_scope);
- }
- });
-
- // After all choices are ready, load up the lists and populate the page
- if (scope.removeBuildJobsList) {
- scope.removeBuildJobsList();
- }
- scope.removeBuildJobsList = scope.$on('buildJobsList', function() {
- if (PortalJobsList.fields.type) {
- PortalJobsList.fields.type.searchOptions = scope.type_choices;
- }
- user = scope.$parent.current_user.id;
- url = (filter === "All Jobs" ) ? GetBasePath('jobs') : GetBasePath('jobs')+'?created_by='+user ;
- LoadJobsScope({
- parent_scope: scope,
- scope: jobs_scope,
- list: PortalJobsList,
- id: 'active-jobs',
- url: url , //GetBasePath('jobs')+'?created_by='+user,
- pageSize: max_rows,
- spinner: true
- });
-
- $(window).resize(_.debounce(function() {
- resizePortalJobsWidget();
- }, 500));
- });
-
- if (scope.removeChoicesReady) {
- scope.removeChoicesReady();
- }
- scope.removeChoicesReady = scope.$on('choicesReady', function() {
- choicesCount++;
- if (choicesCount === 2) {
- setPortalJobsHeight();
- scope.$emit('buildJobsList');
- }
- });
-
-
- scope.filterPortalJobs = function(filter) {
- $("#active-jobs").empty();
- $("#active-jobs-search-container").empty();
- user = scope.$parent.current_user.id;
- url = (filter === "All Jobs" ) ? GetBasePath('jobs') : GetBasePath('jobs')+'?created_by='+user ;
- LoadJobsScope({
- parent_scope: scope,
- scope: jobs_scope,
- list: PortalJobsList,
- id: 'active-jobs',
- url: url , //GetBasePath('jobs')+'?created_by='+user,
- pageSize: max_rows,
- spinner: true
- });
- };
-
- html = '';
- html += "
\n";
- html += "
\n";
- html += "
\n";
- html += "
\n";
- html += "
" ;
- html += "
\n"; //row
-
- html += "
\n";
- html += "
\n";
- html += "
\n"; //list
- html += "
\n"; //active-jobs-tab
- html += "
\n";
-
- e = angular.element(document.getElementById(target));
- e.html(html);
- $compile(e)(scope);
-
-
- GetChoices({
- scope: scope,
- url: GetBasePath('unified_jobs'),
- field: 'status',
- variable: 'status_choices',
- callback: 'choicesReady'
- });
-
- GetChoices({
- scope: scope,
- url: GetBasePath('unified_jobs'),
- field: 'type',
- variable: 'type_choices',
- callback: 'choicesReady'
- });
-
-
-
- // Set the height of each container and calc max number of rows containers can hold
- function setPortalJobsHeight() {
- var docw = $(window).width(),
- box_height, available_height, search_row, page_row, height, header, row_height;
-
- available_height = Math.floor($(window).height() - $('#main-menu-container .navbar').outerHeight() - $('#refresh-row').outerHeight() - 35);
- $('.portal-job-template-container').height(available_height);
- $('.portal-container').height(available_height);
- search_row = Math.max($('.search-row:eq(0)').outerHeight(), 50);
- page_row = Math.max($('.page-row:eq(0)').outerHeight(), 33);
- header = 100; //Math.max($('#completed_jobs_table thead').height(), 41);
- height = Math.floor(available_height) - header - page_row - search_row ;
- if (docw < 765 && docw >= 493) {
- row_height = 27;
- }
- else if (docw < 493) {
- row_height = 47;
- }
- else if (docw < 768) {
- row_height = 44;
- }
- else if (docw < 865) {
- row_height = 87;
- }
- else if (docw < 925) {
- row_height = 67;
- }
- else if (docw < 992) {
- row_height = 55;
- }
- else if (docw < 1415) {
- row_height = 47;
- }
- else {
- row_height = 44;
- }
- max_rows = Math.floor(height / row_height);
- if (max_rows < 5){
- box_height = header+page_row + search_row + 40 + (5 * row_height);
- if (docw < 1140) {
- box_height += 40;
- }
- $('.portal-job-template-container').height(box_height);
- max_rows = 5;
- }
- }
-
- // Set container height and return the number of allowed rows
- function resizePortalJobsWidget() {
- setPortalJobsHeight();
- jobs_scope[PortalJobsList.iterator + '_page_size'] = max_rows;
- jobs_scope.changePageSize(PortalJobsList.name, PortalJobsList.iterator, false);
- scope[PortalJobTemplateList.iterator + '_page_size'] = max_rows;
- scope[PortalJobTemplateList.iterator + 'PageSize'] = max_rows;
- scope.changePageSize(PortalJobTemplateList.name, PortalJobTemplateList.iterator, false);
- }
-
-
-
- };
-}
-]);