add load indicators to the rest of the sections

This commit is contained in:
Mads Rasmussen
2015-09-03 12:18:17 +02:00
parent 0701869769
commit 077badd8d7
12 changed files with 325 additions and 239 deletions

View File

@@ -12,6 +12,7 @@ function DashboardController($scope, $routeParams, dashboardResource, localizati
$scope.page = {};
$scope.page.nameLocked = true;
$scope.page.loading = true;
$scope.dashboard = {};
localizationService.localize("sections_" + $routeParams.section).then(function(name){
@@ -20,6 +21,7 @@ function DashboardController($scope, $routeParams, dashboardResource, localizati
dashboardResource.getDashboard($routeParams.section).then(function(tabs){
$scope.dashboard.tabs = tabs;
$scope.page.loading = false;
});
}

View File

@@ -1,41 +1,46 @@
<form
ng-controller="Umbraco.DashboardController"
class="umb-dashboard"
val-form-manager>
<div ng-controller="Umbraco.DashboardController">
<umb-editor-view umb-tabs>
<umb-load-indicator ng-if="page.loading"></umb-load-indicator>
<umb-editor-header
name="dashboard.name"
name-locked="page.nameLocked"
tabs="dashboard.tabs">
</umb-editor-header>
<form
ng-show="!page.loading"
class="umb-dashboard"
val-form-manager>
<umb-editor-container>
<umb-editor-view umb-tabs>
<umb-tabs-content view="true">
<umb-tab id="tab{{tab.id}}" ng-repeat="tab in dashboard.tabs" rel="{{tab.id}}">
<umb-editor-header
name="dashboard.name"
name-locked="page.nameLocked"
tabs="dashboard.tabs">
</umb-editor-header>
<div ng-repeat="property in tab.properties" ng-switch on="property.serverSide">
<umb-editor-container>
<umb-tabs-content view="true">
<umb-tab id="tab{{tab.id}}" ng-repeat="tab in dashboard.tabs" rel="{{tab.id}}">
<div ng-repeat="property in tab.properties" ng-switch on="property.serverSide">
<div class="span12 umb-dashboard-control clearfix" ng-switch-when="false">
<h3 ng-show="property.caption">{{property.caption}}</h3>
<div ng-include="property.path"></div>
</div>
<div class="span12 umb-dashboard-control clearfix" ng-switch-when="true">
<h3 ng-show="property.caption">{{property.caption}}</h3>
<iframe ng-src="dashboard/usercontrolproxy.aspx?ctrl={{ property.path}}"></iframe>
</div>
<div class="span12 umb-dashboard-control clearfix" ng-switch-when="false">
<h3 ng-show="property.caption">{{property.caption}}</h3>
<div ng-include="property.path"></div>
</div>
<div class="span12 umb-dashboard-control clearfix" ng-switch-when="true">
<h3 ng-show="property.caption">{{property.caption}}</h3>
</umb-tab>
</umb-tabs-content>
<iframe ng-src="dashboard/usercontrolproxy.aspx?ctrl={{ property.path}}"></iframe>
</div>
</umb-editor-container>
</div>
</umb-editor-view>
</umb-tab>
</umb-tabs-content>
</umb-editor-container>
</umb-editor-view>
</form>
</form>
</div>

View File

@@ -14,6 +14,7 @@ function ContentEditController($scope, $rootScope, $routeParams, $q, $timeout, $
$scope.isNew = $routeParams.create;
$scope.page = {};
$scope.page.loading = false;
$scope.page.menu = {};
$scope.page.menu.currentNode = null;
$scope.page.menu.currentSection = appState.getSectionState("currentSection");
@@ -105,22 +106,31 @@ function ContentEditController($scope, $rootScope, $routeParams, $q, $timeout, $
}
if ($routeParams.create) {
$scope.page.loading = true;
//we are creating so get an empty content item
contentResource.getScaffold($routeParams.id, $routeParams.doctype)
.then(function (data) {
$scope.loaded = true;
$scope.content = data;
init($scope.content);
resetLastListPageNumber($scope.content);
$scope.page.loading = false;
});
}
else {
$scope.page.loading = true;
//we are editing so get the content item from the server
contentResource.getById($routeParams.id)
.then(function (data) {
$scope.loaded = true;
$scope.content = data;
if (data.isChildOfListView && data.trashed === false) {
@@ -140,6 +150,9 @@ function ContentEditController($scope, $rootScope, $routeParams, $q, $timeout, $
syncTreeNode($scope.content, data.path, true);
resetLastListPageNumber($scope.content);
$scope.page.loading = false;
});
}

View File

@@ -1,81 +1,85 @@
<form name="contentForm"
ng-controller="Umbraco.Editors.Content.EditController"
ng-show="loaded"
ng-submit="save()"
novalidate
val-form-manager>
<div ng-controller="Umbraco.Editors.Content.EditController">
<umb-editor-view umb-tabs>
<umb-load-indicator ng-if="page.loading"></umb-load-indicator>
<umb-editor-header
menu="page.menu"
name="content.name"
tabs="content.tabs">
</umb-editor-header>
<form name="contentForm"
ng-show="!page.loading"
ng-submit="save()"
novalidate
val-form-manager>
<umb-editor-view umb-tabs>
<umb-editor-header
menu="page.menu"
name="content.name"
tabs="content.tabs">
</umb-editor-header>
<umb-editor-container>
<umb-editor-container>
<umb-tabs-content class="form-horizontal" view="true">
<umb-tab id="tab{{tab.id}}" ng-repeat="tab in content.tabs" rel="{{tab.id}}">
<umb-tabs-content class="form-horizontal" view="true">
<umb-tab id="tab{{tab.id}}" ng-repeat="tab in content.tabs" rel="{{tab.id}}">
<umb-property ng-repeat="property in tab.properties" property="property">
<umb-editor model="property"></umb-editor>
</umb-property>
<umb-property ng-repeat="property in tab.properties" property="property">
<umb-editor model="property"></umb-editor>
</umb-property>
</umb-tab>
</umb-tabs-content>
</umb-tab>
</umb-tabs-content>
</umb-editor-container>
</umb-editor-container>
<umb-editor-footer>
<umb-editor-footer>
<umb-editor-footer-content-left>
<umb-breadcrumbs ancestors="ancestors" ng-if="ancestors && ancestors.length > 0"></umb-breadcrumbs>
</umb-editor-footer-content-left>
<umb-editor-footer-content-left>
<umb-breadcrumbs ancestors="ancestors" ng-if="ancestors && ancestors.length > 0"></umb-breadcrumbs>
</umb-editor-footer-content-left>
<umb-editor-footer-content-right ng-class="{'umb-dimmed': busy}">
<umb-editor-footer-content-right ng-class="{'umb-dimmed': busy}">
<div class="btn-group" ng-show="listViewPath">
<a class="btn" href="#{{listViewPath}}">
<localize key="buttons_returnToList">Return to list</localize>
</a>
</div>
<div class="btn-group" ng-show="listViewPath">
<a class="btn" href="#{{listViewPath}}">
<localize key="buttons_returnToList">Return to list</localize>
</a>
</div>
<div class="btn-group" ng-show="!isNew">
<a class="btn" ng-click="preview(content)">
<localize key="buttons_showPage">Preview page</localize>
</a>
</div>
<div class="btn-group" ng-show="!isNew">
<a class="btn" ng-click="preview(content)">
<localize key="buttons_showPage">Preview page</localize>
</a>
</div>
<div class="btn-group dropup" ng-if="defaultButton">
<div class="btn-group dropup" ng-if="defaultButton">
<a class="btn btn-success" href="#" ng-click="performAction(defaultButton)" prevent-default>
<localize key="{{defaultButton.labelKey}}">{{defaultButton.labelKey}}</localize>
</a>
<a class="btn btn-success" href="#" ng-click="performAction(defaultButton)" prevent-default>
<localize key="{{defaultButton.labelKey}}">{{defaultButton.labelKey}}</localize>
</a>
<a class="btn btn-success dropdown-toggle" data-toggle="dropdown" ng-if="subButtons.length > 0">
<span class="caret"></span>
</a>
<a class="btn btn-success dropdown-toggle" data-toggle="dropdown" ng-if="subButtons.length > 0">
<span class="caret"></span>
</a>
<a href="#">Return to list</a>
<a href="#">Return to list</a>
<ul aria-labelledby="dLabel" class="dropdown-menu bottom-up" ng-if="subButtons.length > 0" role="menu">
<li ng-repeat="btn in subButtons">
<a href="#" ng-click="performAction(btn)" prevent-default>
<localize key="{{btn.labelKey}}">{{btn.labelKey}}</localize>
</a>
</li>
</ul>
<ul aria-labelledby="dLabel" class="dropdown-menu bottom-up" ng-if="subButtons.length > 0" role="menu">
<li ng-repeat="btn in subButtons">
<a href="#" ng-click="performAction(btn)" prevent-default>
<localize key="{{btn.labelKey}}">{{btn.labelKey}}</localize>
</a>
</li>
</ul>
</div>
</div>
</umb-editor-footer-content-right>
</umb-editor-footer-content-right>
</umb-editor-footer>
</umb-editor-footer>
</umb-editor-view>
</umb-editor-view>
</form>
</form>
</div>

View File

@@ -10,6 +10,7 @@ function DataTypeEditController($scope, $routeParams, $location, appState, navig
//setup scope vars
$scope.page = {};
$scope.page.loading = false;
$scope.page.nameLocked = false;
$scope.page.menu = {};
$scope.page.menu.currentSection = appState.getSectionState("currentSection");
@@ -47,10 +48,13 @@ function DataTypeEditController($scope, $routeParams, $location, appState, navig
$scope.preValues = [];
if ($routeParams.create) {
$scope.page.loading = true;
//we are creating so get an empty data type item
dataTypeResource.getScaffold()
.then(function(data) {
$scope.loaded = true;
$scope.preValuesLoaded = true;
$scope.content = data;
@@ -58,13 +62,19 @@ function DataTypeEditController($scope, $routeParams, $location, appState, navig
//set a shared state
editorState.set($scope.content);
$scope.page.loading = false;
});
}
else {
$scope.page.loading = true;
//we are editing so get the content item from the server
dataTypeResource.getById($routeParams.id)
.then(function(data) {
$scope.loaded = true;
$scope.preValuesLoaded = true;
$scope.content = data;
@@ -84,6 +94,9 @@ function DataTypeEditController($scope, $routeParams, $location, appState, navig
navigationService.syncTree({ tree: "datatype", path: [String(data.id)] }).then(function (syncArgs) {
$scope.page.menu.currentNode = syncArgs.node;
});
$scope.page.loading = false;
});
}

View File

@@ -1,62 +1,66 @@
<form name="contentForm"
ng-controller="Umbraco.Editors.DataType.EditController"
ng-show="loaded"
ng-submit="save()"
novalidate
val-form-manager>
<div ng-controller="Umbraco.Editors.DataType.EditController">
<umb-editor-view>
<umb-load-indicator ng-if="page.loading"></umb-load-indicator>
<umb-editor-header
menu="page.menu"
name="content.name"
name-locked="page.nameLocked">
</umb-editor-header>
<form name="contentForm"
ng-show="!page.loading"
ng-submit="save()"
novalidate
val-form-manager>
<umb-editor-view>
<umb-editor-header
menu="page.menu"
name="content.name"
name-locked="page.nameLocked">
</umb-editor-header>
<umb-editor-container class="form-horizontal">
<umb-editor-container class="form-horizontal">
<umb-property property="properties.selectedEditor">
<div>
<select name="selectedEditor"
ng-model="content.selectedEditor"
required
ng-options="e.alias as e.name for e in content.availableEditors"></select>
<span class="help-inline" val-msg-for="selectedEditor" val-toggle-msg="required">Required</span>
</div>
<umb-property property="properties.selectedEditor">
<div>
<select name="selectedEditor"
ng-model="content.selectedEditor"
required
ng-options="e.alias as e.name for e in content.availableEditors"></select>
<span class="help-inline" val-msg-for="selectedEditor" val-toggle-msg="required">Required</span>
</div>
</umb-property>
</umb-property>
<umb-property property="properties.selectedEditorId">
<div>{{content.selectedEditor}}</div>
</umb-property>
<umb-property property="properties.selectedEditorId">
<div>{{content.selectedEditor}}</div>
</umb-property>
<umb-property
property="preValue"
ng-repeat="preValue in preValues">
<umb-property
property="preValue"
ng-repeat="preValue in preValues">
<umb-editor model="preValue" is-pre-value="true"></umb-editor>
</umb-property>
<umb-editor model="preValue" is-pre-value="true"></umb-editor>
</umb-property>
</umb-editor-container>
</umb-editor-container>
<umb-editor-footer>
<umb-editor-footer>
<umb-editor-footer-content-right>
<umb-editor-footer-content-right>
<div class="btn-group">
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
<localize key="buttons_save">Save</localize>
</button>
</div>
<div class="btn-group">
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
<localize key="buttons_save">Save</localize>
</button>
</div>
</umb-editor-footer-content-right>
</umb-editor-footer-content-right>
</umb-editor-footer>
</umb-editor-footer>
</umb-editor-view>
</umb-editor-view>
</form>
</form>
</div>

View File

@@ -1,58 +1,62 @@
<form novalidate name="contentForm"
ng-controller="Umbraco.Editors.Media.EditController"
ng-show="loaded"
ng-submit="save()"
val-form-manager>
<div ng-controller="Umbraco.Editors.Media.EditController">
<umb-editor-view umb-tabs>
<umb-load-indicator ng-if="page.loading"></umb-load-indicator>
<umb-editor-header
name="content.name"
tabs="content.tabs"
menu="page.menu">
</umb-editor-header>
<form novalidate name="contentForm"
ng-show="!page.loading"
ng-submit="save()"
val-form-manager>
<umb-editor-container>
<umb-editor-view umb-tabs>
<umb-tabs-content view="true" class="form-horizontal">
<umb-tab id="tab{{tab.id}}" rel="{{tab.id}}" ng-repeat="tab in content.tabs">
<umb-editor-header
name="content.name"
tabs="content.tabs"
menu="page.menu">
</umb-editor-header>
<umb-property property="property" ng-repeat="property in tab.properties">
<umb-editor model="property"></umb-editor>
</umb-property>
<umb-editor-container>
</umb-tab>
</umb-tabs-content>
<umb-tabs-content view="true" class="form-horizontal">
<umb-tab id="tab{{tab.id}}" rel="{{tab.id}}" ng-repeat="tab in content.tabs">
</umb-editor-container>
<umb-property property="property" ng-repeat="property in tab.properties">
<umb-editor model="property"></umb-editor>
</umb-property>
<umb-editor-footer>
</umb-tab>
</umb-tabs-content>
<umb-editor-footer-content-left>
<umb-breadcrumbs ng-if="ancestors && ancestors.length > 0" ancestors="ancestors"></umb-breadcrumbs>
</umb-editor-footer-content-left>
</umb-editor-container>
<umb-editor-footer>
<umb-editor-footer-content-left>
<umb-breadcrumbs ng-if="ancestors && ancestors.length > 0" ancestors="ancestors"></umb-breadcrumbs>
</umb-editor-footer-content-left>
<umb-editor-footer-content-right ng-class="{'umb-dimmed': busy}">
<umb-editor-footer-content-right ng-class="{'umb-dimmed': busy}">
<div class="btn-group" ng-show="listViewPath">
<a class="btn" href="#{{listViewPath}}">
<localize key="buttons_returnToList">Return to list</localize>
</a>
</div>
<div class="btn-group" ng-show="listViewPath">
<a class="btn" href="#{{listViewPath}}">
<localize key="buttons_returnToList">Return to list</localize>
</a>
</div>
<div class="btn-group">
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
<localize key="buttons_save">Save</localize>
</button>
</div>
<div class="btn-group">
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
<localize key="buttons_save">Save</localize>
</button>
</div>
</umb-editor-footer-content-right>
</umb-editor-footer-content-right>
</umb-editor-footer>
</umb-editor-footer>
</umb-editor-view>
</umb-editor-view>
</form>
</form>
<div>

View File

@@ -13,6 +13,7 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
$scope.currentNode = null; //the editors affiliated node
$scope.page = {};
$scope.page.loading = false;
$scope.page.menu = {};
$scope.page.menu.currentSection = appState.getSectionState("currentSection");
$scope.page.menu.currentNode = null; //the editors affiliated node
@@ -42,18 +43,25 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
if ($routeParams.create) {
$scope.page.loading = true;
mediaResource.getScaffold($routeParams.id, $routeParams.doctype)
.then(function (data) {
$scope.loaded = true;
$scope.content = data;
editorState.set($scope.content);
$scope.page.loading = false;
});
}
else {
$scope.page.loading = true;
mediaResource.getById($routeParams.id)
.then(function (data) {
$scope.loaded = true;
$scope.content = data;
if (data.isChildOfListView && data.trashed === false) {
@@ -80,7 +88,9 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
});
}
});
$scope.page.loading = false;
});
}
$scope.save = function () {

View File

@@ -1,59 +1,64 @@
<form novalidate name="contentForm"
ng-controller="Umbraco.Editors.Member.EditController"
ng-show="loaded"
ng-submit="save()"
val-form-manager>
<div ng-controller="Umbraco.Editors.Member.EditController">
<umb-editor-view umb-tabs>
<umb-load-indicator ng-if="page.loading"></umb-load-indicator>
<umb-editor-header
name="content.name"
name-locked="page.nameLocked"
tabs="content.tabs"
menu="page.menu">
</umb-editor-header>
<form novalidate name="contentForm"
ng-show="!page.loading"
ng-submit="save()"
val-form-manager>
<umb-editor-container>
<umb-editor-view umb-tabs>
<umb-tabs-content view="true" class="form-horizontal">
<umb-tab id="tab{{tab.id}}" rel="{{tab.id}}" ng-repeat="tab in content.tabs">
<umb-editor-header
name="content.name"
name-locked="page.nameLocked"
tabs="content.tabs"
menu="page.menu">
</umb-editor-header>
<umb-property property="property" ng-repeat="property in tab.properties">
<umb-editor model="property"></umb-editor>
</umb-property>
<umb-editor-container>
</umb-tab>
</umb-tabs-content>
<umb-tabs-content view="true" class="form-horizontal">
<umb-tab id="tab{{tab.id}}" rel="{{tab.id}}" ng-repeat="tab in content.tabs">
</umb-editor-container>
<umb-property property="property" ng-repeat="property in tab.properties">
<umb-editor model="property"></umb-editor>
</umb-property>
<umb-editor-footer>
</umb-tab>
</umb-tabs-content>
<umb-editor-footer-content-left>
<umb-breadcrumbs ng-if="ancestors && ancestors.length > 0" ancestors="ancestors"></umb-breadcrumbs>
</umb-editor-footer-content-left>
</umb-editor-container>
<umb-editor-footer>
<umb-editor-footer-content-left>
<umb-breadcrumbs ng-if="ancestors && ancestors.length > 0" ancestors="ancestors"></umb-breadcrumbs>
</umb-editor-footer-content-left>
<umb-editor-footer-content-right ng-class="{'umb-dimmed': busy}">
<umb-editor-footer-content-right ng-class="{'umb-dimmed': busy}">
<div class="btn-group" ng-if="listViewPath">
<a class="btn" href="#{{listViewPath}}">
<localize key="buttons_returnToList">Return to list</localize>
</a>
</div>
<div class="btn-group" ng-if="listViewPath">
<a class="btn" href="#{{listViewPath}}">
<localize key="buttons_returnToList">Return to list</localize>
</a>
</div>
<div class="btn-group">
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
<localize key="buttons_save">Save</localize>
</button>
</div>
<div class="btn-group">
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
<localize key="buttons_save">Save</localize>
</button>
</div>
</umb-editor-footer-content-right>
</umb-editor-footer-content-right>
</umb-editor-footer>
</umb-editor-footer>
</umb-editor-view>
</umb-editor-view>
</form>
</form>
</div>

View File

@@ -1,30 +1,34 @@
<form novalidate name="contentForm"
ng-controller="Umbraco.Editors.Member.ListController"
ng-show="loaded">
<div ng-controller="Umbraco.Editors.Member.ListController">
<umb-editor-view umb-tabs>
<umb-load-indicator ng-if="page.loading"></umb-load-indicator>
<umb-editor-header
name="content.name"
name-locked="page.lockedName"
tabs="content.tabs"
menu="page.menu">
</umb-editor-header>
<form novalidate name="contentForm" ng-show="!page.loading">
<umb-editor-container>
<umb-editor-view umb-tabs>
<umb-tabs-content view="true" class="form-horizontal">
<umb-tab id="tab{{tab.id}}" rel="{{tab.id}}" ng-repeat="tab in content.tabs">
<umb-editor-header
name="content.name"
name-locked="page.lockedName"
tabs="content.tabs"
menu="page.menu">
</umb-editor-header>
<umb-property property="property" ng-repeat="property in tab.properties">
<umb-editor model="property"></umb-editor>
</umb-property>
<umb-editor-container>
</umb-tab>
</umb-tabs-content>
<umb-tabs-content view="true" class="form-horizontal">
<umb-tab id="tab{{tab.id}}" rel="{{tab.id}}" ng-repeat="tab in content.tabs">
</umb-editor-container>
<umb-property property="property" ng-repeat="property in tab.properties">
<umb-editor model="property"></umb-editor>
</umb-property>
</umb-editor-view>
</umb-tab>
</umb-tabs-content>
</form>
</umb-editor-container>
</umb-editor-view>
</form>
</div>

View File

@@ -10,6 +10,7 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
//setup scope vars
$scope.page = {};
$scope.page.loading = false;
$scope.page.menu = {};
$scope.page.menu.currentSection = appState.getSectionState("currentSection");
$scope.page.menu.currentNode = null; //the editors affiliated node
@@ -29,26 +30,37 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
//if there is no doc type specified then we are going to assume that
// we are not using the umbraco membership provider
if ($routeParams.doctype) {
$scope.page.loading = true;
//we are creating so get an empty member item
memberResource.getScaffold($routeParams.doctype)
.then(function(data) {
$scope.loaded = true;
$scope.content = data;
setHeaderNameState($scope.content);
editorState.set($scope.content);
$scope.page.loading = false;
});
}
else {
$scope.page.loading = true;
memberResource.getScaffold()
.then(function (data) {
$scope.loaded = true;
$scope.content = data;
setHeaderNameState($scope.content);
editorState.set($scope.content);
$scope.page.loading = false;
});
}
@@ -66,10 +78,13 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
});
}
else {
$scope.page.loading = true;
//we are editing so get the content item from the server
memberResource.getByKey($routeParams.id)
.then(function(data) {
$scope.loaded = true;
$scope.content = data;
setHeaderNameState($scope.content);
@@ -94,6 +109,9 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
// after the redirect, so we will bind all subscriptions which will show the server validation errors
// if there are any and then clear them so the collection no longer persists them.
serverValidationManager.executeAndClearAllSubscriptions();
$scope.page.loading = false;
});
}

View File

@@ -14,11 +14,12 @@ function MemberListController($scope, $routeParams, $location, $q, $window, appS
$scope.page = {};
$scope.page.lockedName = true;
$scope.page.loading = true;
//we are editing so get the content item from the server
memberResource.getListNode($routeParams.id)
.then(function (data) {
$scope.loaded = true;
$scope.content = data;
editorState.set($scope.content);
@@ -32,6 +33,9 @@ function MemberListController($scope, $routeParams, $location, $q, $window, appS
// after the redirect, so we will bind all subscriptions which will show the server validation errors
// if there are any and then clear them so the collection no longer persists them.
serverValidationManager.executeAndClearAllSubscriptions();
$scope.page.loading = false;
});
}