Skip to content

Commit

Permalink
Merge pull request #417 from ember-admin/new-blueprints
Browse files Browse the repository at this point in the history
New blueprints
  • Loading branch information
igorrKurr committed Jul 26, 2015
2 parents 417b025 + 17be916 commit 5251b5a
Show file tree
Hide file tree
Showing 31 changed files with 301 additions and 5,809 deletions.
99 changes: 98 additions & 1 deletion app/styles/app.scss → app/styles/ember-cli-admin.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import 'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap';
@import "components/typeahead";
@import "components/tree_view";

Expand Down Expand Up @@ -275,3 +274,101 @@ html, body {

}
}

.thumbnail {
position: relative;
padding: 0px;
}

.thumbnail img {
width: 100%;
}

.delete-asset {
position: absolute;
top: 0px;
right: -10px;
}

.asset_holder li {
list-style: none;
display: inline;
}

.loading-container {
position: fixed;
width: 100%;
height: 100%;
display: flex;
align-items: center;
background: rgba(0, 0, 0, 0.71);
top: 0;
left: 0;
}

.loading-indicator {
color: white;
margin: 0 auto;
}

.loading-text {
font-size: 1.3vmax;
}

.error-indicator {
color: white;
margin: 0 auto;
}

.spinner {
width: 60px;
height: 60px;
background-color: #fff;
margin: 100px auto;
-webkit-animation: rotateplane 1.2s infinite ease-in-out;
animation: rotateplane 1.2s infinite ease-in-out;
}

@-webkit-keyframes rotateplane {
0% {
-webkit-transform: perspective(120px)
}
50% {
-webkit-transform: perspective(120px) rotateY(180deg)
}
100% {
-webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg)
}
}

@keyframes rotateplane {
0% {
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg)
}
50% {
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg)
}
100% {
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
}
}

.error-header {
font-size: 3vmax;
display: block;
width: 100%;
}

.red {
color: red;
}

.error-footer {
display: block;
width: 100%;
margin-top: 5rem;
color: #d2d2d2;
}
5 changes: 0 additions & 5 deletions blueprints/admin-app/files/app/adapters/application.js

This file was deleted.

18 changes: 18 additions & 0 deletions blueprints/admin-app/files/app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Ember from 'ember';
import AdminResolver from 'ember-cli-admin/admin-resolver';
import loadInitializers from 'ember/load-initializers';
import config from './config/environment';

var App;

Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver: AdminResolver
});

loadInitializers(App, config.modulePrefix);

export default App;
10 changes: 0 additions & 10 deletions blueprints/admin-app/files/app/initializers/navigation.js

This file was deleted.

3 changes: 3 additions & 0 deletions blueprints/admin-app/files/app/navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function() {
this.navigate("Dashboard", { route: "dashboard" });
}
16 changes: 16 additions & 0 deletions blueprints/admin-app/files/app/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Ember from 'ember';
import MetaRoute from 'ember-cli-admin/dsl/meta-route';
import config from './config/environment';

var Router = Ember.Router.extend({
location: config.locationType
});

Router.map(function() {
});

MetaRoute.map(Router, function() {
this.route("dashboard", {path: "/"});
});

export default Router;
3 changes: 1 addition & 2 deletions blueprints/admin-app/files/app/routes/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Ember from 'ember';
import BaseAdminRouteMixin from 'ember-cli-admin/mixins/routes/base';

var mainRoute = Ember.Route.extend(BaseAdminRouteMixin);
export default mainRoute;
export default Ember.Route.extend(BaseAdminRouteMixin);
2 changes: 2 additions & 0 deletions blueprints/admin-app/files/app/styles/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap';
@import 'ember-cli-admin';
1 change: 1 addition & 0 deletions blueprints/admin-app/files/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{partial 'admin/index'}}
49 changes: 49 additions & 0 deletions blueprints/admin-app/files/config/environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* jshint node: true */

module.exports = function(environment) {
var ENV = {
modulePrefix: '<%= modulePrefix %>',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
appName: '<%= adminAppName %>',
titleLinksTo: '<%= titleLinksTo %>',
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
}
},

APP: {
// Here you can pass flags/options to your application instance
// when it is created
}
};

if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
}

if (environment === 'test') {
// Testem prefers this...
ENV.baseURL = '/';
ENV.locationType = 'none';

// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;

ENV.APP.rootElement = '#ember-testing';
}

if (environment === 'production') {

}

return ENV;
};
54 changes: 11 additions & 43 deletions blueprints/admin-app/index.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,14 @@
var processTextContent = require('ember-cli-admin/lib/proccess-text-content').processTextContent;

module.exports = {
description: 'Generates an app scaffold',
beforeInstall: function(options) {
var process = processTextContent.bind(this);
process('app/app.js',
{
replace: {
'ember/resolver': "ember-cli-admin/admin-resolver",
'Resolver: Resolver': 'Resolver: AdminResolver',
'import Resolver': 'import AdminResolver'
}
});
process('app/templates/application.hbs',
{
replace: {
'<h2 id="title">Welcome to Ember.js</h2>\n\n{{outlet}}': "{{partial 'admin/index'}}"
}
});
process('app/router.js',
{
insert: {
"import config from './config/environment';": "\nimport MetaRoute from 'ember-cli-admin/dsl/meta-route';",
"export default Router;" : "\nMetaRoute.map(Router, function() {\nthis.route(\"dashboard\", {path: \"/\"});});\n\texport default Router;"
}
});
var appName = "\n\t\t\tappName: '" + options.entity.name + "',";
process('config/environment.js',
{
insert: {
"EmberENV: {": appName
}
});
process('Brocfile.js',
{
insert: {
"EmberApp();": "\nvar pickFiles = require('broccoli-static-compiler');\nvar bootstrapFonts = pickFiles('bower_components/bootstrap-sass-official/assets/fonts/bootstrap', {\n\tsrcDir: '/',\n\tdestDir: '/assets/bootstrap'\n});\nvar mergeTrees = require('broccoli-merge-trees');"
},
replace: {
"module.exports = app.toTree();": "module.exports = mergeTrees([app.toTree(), bootstrapFonts]);"
}
});
description: 'Generates an admin app scaffold',
locals: function(options) {
var entity = options.entity;
var adminAppName = entity.name;
var titleLinksTo = entity.titleLinksTo || 'http://ember-admin.com';

}
return {
modulePrefix: this.project.name(),
adminAppName: adminAppName,
titleLinksTo: titleLinksTo,
};
},
};
2 changes: 2 additions & 0 deletions blueprints/ember-cli-admin/files/app/styles/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap';
@import 'ember-cli-admin';
23 changes: 10 additions & 13 deletions blueprints/ember-cli-admin/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
var fs = require('fs');
var path = require('path');
var renameFile = require('ember-cli-admin/lib/proccess-text-content').renameFile;

module.exports = {
normalizeEntityName: function() {},

afterInstall: function() {
renameFile.bind(this)('app/styles/app.css', 'app/styles/app.scss');
this.addBowerPackagesToProject([
{name: "bootstrap-sass-official", target: "3.2.0"},
{name: "typeahead.js", target: "0.10.5"},
{name: "jquery-ui-sortable", target: "git://github.com/ryantbrown/jquery-ui-sortable.git"},
{name: "jquery-ui-touch-punch", target: "git://github.com/cbier/bower-jquery-ui-touch-punch.git"}
]);

var self = this;
return this.addPackagesToProject([
{name: "ember-cli-map", target: "0.2.2"},
{name: "ember-cli-bootstrap-datepicker", target: "0.4.0"},
{name: "broccoli-merge-trees", target: "0.1.4"},
{name: "broccoli-static-compiler", target: "0.1.4"},
{name: "ember-cli-sass", target: "^4.0.0"}
]);
]).then(function() {
return self.addBowerPackagesToProject([
{name: "bootstrap-sass-official", target: "3.3.4"},
{name: "bootstrap-datepicker", target: "~1.4.0"},
{name: "typeahead.js", target: "0.10.5"},
{name: "jquery-ui-sortable", target: "*"},
{name: "jquery-ui-touch-punch-improved", target: "0.3.1"}
]);
});
}
};
17 changes: 1 addition & 16 deletions blueprints/table-view-controller/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
var path = require('path');
/*jshint node:true*/

module.exports = {
description: 'Generates tableview controller for specified resource',
fileMapTokens: function() {
return {
__path__: function(options) {
if (options.pod) {
return path.join(options.podPath, options.dasherizedModuleName);
}
return 'controllers';
},
__name__: function(options) {
if (options.pod) {
return "controller";
}
return options.dasherizedModuleName;
}
};
}
};
Loading

0 comments on commit 5251b5a

Please sign in to comment.