Skip to content

Commit

Permalink
Merge pull request #487 from marmelab/invite
Browse files Browse the repository at this point in the history
[RFR] Improve first contact: add invite after setup
  • Loading branch information
jpetitcolas committed Jun 4, 2015
2 parents f989ea1 + 36518a9 commit db27d14
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/javascripts/ng-admin/Crud/delete/DeleteController.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ define(function () {
this.actions = view.actions();
this.entity = view.getEntity();
this.notification = notification;

this.$scope.entry = entry;
this.$scope.view = view;
$scope.$on('$destroy', this.destroy.bind(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ define(function (require) {
this.PanelBuilder.getPanelsData(sortField, sortDir).then(function (panels) {
self.panels = panels;
});
this.hasEntities = this.PanelBuilder.hasEntities();
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ function PanelBuilder($q, ReadQueries, Configuration, AdminDescription) {
this.Configuration = Configuration();
}

PanelBuilder.prototype.hasEntities = function() {
return this.Configuration.entities.length > 0;
}

/**
* Returns all elements of each dashboard panels
*
Expand Down
11 changes: 10 additions & 1 deletion src/javascripts/ng-admin/Main/view/dashboard.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="row">
<div class="row" ng-if="dashboardController.hasEntities">
<div class="col-lg-12">
<div class="page-header">
<h1>Dashboard</h1>
Expand Down Expand Up @@ -34,3 +34,12 @@ <h1>Dashboard</h1>
</div>
</div>
</div>

<div class="row" ng-if="!dashboardController.hasEntities">
<div class="col-lg-12">
<div class="dashboard-invite">
<p>All dependencies are set, ng-admin is ready to run!</p>
<p>Now you can <a href="https://github.com/marmelab/ng-admin/blob/master/README.md#configuring-ng-admin">update the configuration</a>: add entities to the admin, then refresh.</p>
</div>
</div>
</div>
11 changes: 11 additions & 0 deletions src/sass/ng-admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ ul.collapsible {
}
}

.dashboard-invite {
margin: 3em;
padding: 1em;
text-align: center;
background-color: #DFF0D8;
p {
padding: .5em;
margin: 0;
}
}

/**
* Grid
*/
Expand Down

0 comments on commit db27d14

Please sign in to comment.