Skip to content

Commit

Permalink
chore(project-structure): introducing hierarchical folders structure …
Browse files Browse the repository at this point in the history
…(scripts, templates) reflecting feature/route
  • Loading branch information
vucalur committed Jan 8, 2014
1 parent 6f637af commit 0c683b6
Show file tree
Hide file tree
Showing 24 changed files with 70 additions and 61 deletions.
18 changes: 9 additions & 9 deletions django_wibses/django_wibses/wibses/yo/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ module.exports = function (grunt) {
// Watches files for changes and runs tasks based on the changed files
watch: {
coffee: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.{coffee,litcoffee,coffee.md}'],
files: ['<%= yeoman.app %>/scripts/**/*.{coffee,litcoffee,coffee.md}'],
tasks: ['newer:coffee:dist']
},
coffeeTest: {
files: ['test/spec/{,*/}*.{coffee,litcoffee,coffee.md}'],
files: ['test/spec/**/*.{coffee,litcoffee,coffee.md}'],
tasks: ['newer:coffee:test', 'karma']
},
compass: {
Expand All @@ -62,7 +62,7 @@ module.exports = function (grunt) {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= yeoman.app %>/{,*/}*.html',
'<%= yeoman.app %>/**/*.html',
'.tmp/styles/{,*/}*.css',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
Expand Down Expand Up @@ -178,7 +178,7 @@ module.exports = function (grunt) {
{
expand: true,
cwd: '<%= yeoman.app %>/scripts',
src: '{,*/}*.coffee',
src: '**/*.coffee',
dest: '.tmp/scripts',
ext: '.js'
}
Expand All @@ -189,7 +189,7 @@ module.exports = function (grunt) {
{
expand: true,
cwd: 'test/spec',
src: '{,*/}*.coffee',
src: '**/*.coffee',
dest: '.tmp/spec',
ext: '.js'
}
Expand All @@ -206,11 +206,11 @@ module.exports = function (grunt) {
generatedImagesDir: '.tmp/images/generated',
imagesDir: '<%= yeoman.app %>/images',
javascriptsDir: '<%= yeoman.app %>/scripts',
fontsDir: '<%= yeoman.app %>/styles/fonts', /*Do not set to '<%= yeoman.app %>/fonts' since it'll rename files, but leave out references in generated css*/
fontsDir: '<%= yeoman.app %>/styles/fonts', /*Do not set to '<%= yeoman.app %>/fonts' since it'll rename files, but leave out references in generated css*/
importPath: '<%= yeoman.app %>/bower_components',
httpImagesPath: '/images',
httpGeneratedImagesPath: '/images/generated',
httpFontsPath: '/styles/fonts', /*Do not set to '/fonts' since it'll rename files, but leave out references in generated css*/
httpFontsPath: '/styles/fonts', /*Do not set to '/fonts' since it'll rename files, but leave out references in generated css*/
relativeAssets: false,
assetCacheBuster: false
},
Expand Down Expand Up @@ -239,7 +239,7 @@ module.exports = function (grunt) {
dist: {
files: {
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/scripts/**/*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css',
'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/styles/fonts/*'
Expand All @@ -260,7 +260,7 @@ module.exports = function (grunt) {

// Performs rewrites based on rev and the useminPrepare configuration
usemin: {
html: ['<%= yeoman.dist %>/{,*/}*.html'],
html: ['<%= yeoman.dist %>/**/*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
options: {
assetsDirs: ['<%= yeoman.dist %>']
Expand Down
21 changes: 11 additions & 10 deletions django_wibses/django_wibses/wibses/yo/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,17 @@

<!-- endbower -->
<script src="scripts/app.js"></script>
<script src="scripts/services/scriptService.js"></script>
<script src="scripts/services/defaultScriptService.js"></script>
<script src="scripts/services/forkService.js"></script>
<script src="scripts/services/tokenProviderService.js"></script>
<script src="scripts/services/modalService.js"></script>
<script src="scripts/controllers/script.js"></script>
<script src="scripts/controllers/slot.js"></script>
<script src="scripts/controllers/modal.js"></script>
<script src="scripts/directives/parameters.js"></script>
<script src="scripts/filters/filters.js"></script>
<script src="scripts/COMMON/filters.js"></script>
<script src="scripts/COMMON/services/scriptService.js"></script>
<script src="scripts/COMMON/services/defaultScriptService.js"></script>
<script src="scripts/COMMON/services/forkService.js"></script>
<script src="scripts/edit/MODULES.js"></script>
<script src="scripts/edit/directives/parameters.js"></script>
<script src="scripts/edit/controllers/script.js"></script>
<script src="scripts/edit/controllers/slot.js"></script>
<script src="scripts/edit/controllers/modal.js"></script>
<script src="scripts/edit/services/tokenProviderService.js"></script>
<script src="scripts/edit/services/modalService.js"></script>
<!-- endbuild -->
<!--TODO vucalur: use Bower resources for ui.grid-->
<script type="text/javascript" src="http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js"></script>
Expand Down
25 changes: 2 additions & 23 deletions django_wibses/django_wibses/wibses/yo/app/scripts/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,21 @@

angular.module('wibsesApp', [
'ngRoute'
'wibsesApp.controller'
'wibsesApp.directive'
])

angular.module('wibsesApp.controller', [
'wibsesApp.service'
'wibsesApp.filter'
'ui.bootstrap.typeahead'
'wibsesApp.modal.service'
'wibsesApp.edit'
])

angular.module('wibsesApp.service', [
'ngResource'
])

angular.module('wibsesApp.modal.service', [
'ngResource'
'ngGrid'
'wibsesApp.modal.controller'
])

angular.module('wibsesApp.modal.controller', [
'wibsesApp.service'
'ui.bootstrap.modal'
])

angular.module('wibsesApp.directive', [])

angular.module('wibsesApp.filter', [])

###################################################################################

angular.module('wibsesApp').config ['$routeProvider', ($routeProvider) ->
$routeProvider
.when '/editor',
templateUrl: 'template/OUR/edit.html'
templateUrl: 'template/OUR/edit/edit.html'
controller: 'ScriptCtrl'
controllerAs: 'ctrl'
resolve:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict'

angular.module('wibsesApp.edit', [
'wibsesApp.edit.controller'
'wibsesApp.edit.directive'
])

angular.module('wibsesApp.edit.controller', [
'wibsesApp.service'
'wibsesApp.edit.service'
'wibsesApp.edit.modal.service'
'wibsesApp.filter'
'ui.bootstrap.typeahead'
])

angular.module('wibsesApp.edit.service', [])

angular.module('wibsesApp.edit.modal.service', [
'ngResource'
'ngGrid'
'wibsesApp.edit.modal.controller'
])

angular.module('wibsesApp.edit.modal.controller', [
'wibsesApp.edit.service'
'ui.bootstrap.modal'
])

angular.module('wibsesApp.edit.directive', [])
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

angular.module('wibsesApp.modal.controller')
angular.module('wibsesApp.edit.modal.controller')
.controller 'ScriptsListCtrl',
class Ctrl
@$inject: ['$scope', 'modalService', 'scriptsList']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

angular.module('wibsesApp.controller').controller 'ScriptCtrl',
angular.module('wibsesApp.edit.controller').controller 'ScriptCtrl',
class ScriptCtrl
@$inject: ['$scope', '$log', '$timeout', 'modalService', 'scriptService', 'defaultScriptService', 'forkService', 'script']
constructor: (@$scope, @$log, @$timeout, @modalService, @scriptService, @defaultScriptService, @forkService, script) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

angular.module('wibsesApp.controller').controller 'SlotCtrl',
angular.module('wibsesApp.edit.controller').controller 'SlotCtrl',
class SlotCtrl
@$inject: ['$scope', 'tokenProviderService']
constructor: (@$scope, @tokenProviderService) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

angular.module('wibsesApp.directive')
angular.module('wibsesApp.edit.directive')
.directive 'parameters', () ->
templateUrl: 'template/OUR/parameters/parameters.html'
templateUrl: 'template/OUR/edit/parameters/parameters.html'
restrict: 'E'
scope:
params: '='
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

angular.module('wibsesApp.modal.service')
angular.module('wibsesApp.edit.modal.service')
.factory('modalService', ['scriptService', '$modal',
(@scriptService, @$modal) ->
@onLoadAction
Expand All @@ -12,7 +12,7 @@ angular.module('wibsesApp.modal.service')
@listModal = undefined
if not @listModal?
@listModal = @$modal.open(
templateUrl: 'template/OUR/uiModals/scripts-list.html'
templateUrl: 'template/OUR/edit/uiModals/scripts-list.html'
controller: 'ScriptsListCtrl'
resolve:
scriptsList: =>
Expand All @@ -25,7 +25,7 @@ angular.module('wibsesApp.modal.service')
@listModal = undefined
if not @listModal?
@listModal = @$modal.open(
templateUrl: 'template/OUR/uiModals/script-revisions.html'
templateUrl: 'template/OUR/edit/uiModals/script-revisions.html'
controller: 'ScriptRevisionsCtrl'
resolve:
revisionsList: =>
Expand All @@ -47,7 +47,7 @@ angular.module('wibsesApp.modal.service')
@forkNameModal = undefined
if not @forkNameModal?
@forkNameModal = @$modal.open(
templateUrl: 'template/OUR/uiModals/fork-name.html'
templateUrl: 'template/OUR/edit/uiModals/fork-name.html'
controller: 'ForkNameCtrl'
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

angular.module('wibsesApp.service').service 'tokenProviderService',
angular.module('wibsesApp.edit.service').service 'tokenProviderService',
class TokenProviderService
@$inject: ['$http']
constructor: (@$http) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h4>Tokens:</h4>
typeahead="suggestion as suggestion.base for suggestion in slotCtrl.getTokens($viewValue)"
typeahead-min-length="3"
typeahead-wait-ms="500"
typeahead-template-url="template/OUR/tokenAutocomplete/typeahead-match.html">
typeahead-template-url="template/OUR/edit/tokenAutocomplete/typeahead-match.html">
</div>
<button type="submit" class="btn btn-primary">Add</button>
</form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="param input-group">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="params[key]">{{key}}
<input type="checkbox" ng-model="params[key]">{{ key }}
</label>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="row">
<li ng-repeat="(key, value) in params">
<div class="param-wrapper col-lg-3">
<ng-include src="'template/OUR/parameters/inputs/' + getInputType(key) +'.html'"></ng-include>
<ng-include src="'template/OUR/edit/parameters/inputs/' + getInputType(key) +'.html'"></ng-include>
</div>
</li>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<div class="forms">
<ul class="list-inline">
<li ng-repeat="form in match.model.forms"><span class="badge badge-warning">{{form}}</span></li>
<li ng-repeat="form in match.model.forms"><span class="badge badge-warning">{{ form }}</span></li>
</ul>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

describe 'Directive: parameters', () ->

beforeEach module 'wibsesApp.directive'
beforeEach module 'template/OUR/parameters/parameters.html', 'template/OUR/parameters/parameters.html'
beforeEach module 'template/OUR/parameters/inputs/checkbox.html', 'template/OUR/parameters/inputs/checkbox.html'
beforeEach module 'template/OUR/parameters/inputs/number.html', 'template/OUR/parameters/inputs/number.html'
beforeEach module 'template/OUR/parameters/inputs/text.html', 'template/OUR/parameters/inputs/text.html'
beforeEach module 'wibsesApp.edit.directive'
beforeEach module 'template/OUR/edit/parameters/parameters.html', 'template/OUR/edit/parameters/parameters.html'
beforeEach module 'template/OUR/edit/parameters/inputs/checkbox.html', 'template/OUR/edit/parameters/inputs/checkbox.html'
beforeEach module 'template/OUR/edit/parameters/inputs/number.html', 'template/OUR/edit/parameters/inputs/number.html'
beforeEach module 'template/OUR/edit/parameters/inputs/text.html', 'template/OUR/edit/parameters/inputs/text.html'

element = {}
$compile = {}
Expand Down

0 comments on commit 0c683b6

Please sign in to comment.