Simplify client side templates structure of pages style

This commit is contained in:
Dmitriy Simushev 2014-10-06 10:38:33 +00:00
parent a61b48252c
commit 406e11a38e
14 changed files with 21 additions and 31 deletions

View File

@ -150,25 +150,16 @@ gulp.task('page-styles', function() {
// TODO: Process all available styles, not only the default one.
var stylePath = config.pageStylesPath + '/default';
return eventStream.merge(
gulp.src(stylePath + '/templates_src/client_side/default/**/*.handlebars')
.pipe(handlebars({
// Use specific version of Handlebars.js
handlebars: handlebarsEngine
}))
.pipe(wrapHandlebarsTemplate())
.pipe(concat('default_app.tpl.js')),
gulp.src(stylePath + '/templates_src/client_side/users/**/*.handlebars')
.pipe(handlebars({
// Use specific version of Handlebars.js
handlebars: handlebarsEngine
}))
.pipe(wrapHandlebarsTemplate())
.pipe(concat('users_app.tpl.js'))
)
.pipe(uglify({preserveComments: 'some'}))
.pipe(header(config.compiledTemplatesHeader))
.pipe(gulp.dest(stylePath + '/templates_compiled/client_side'));
return gulp.src(stylePath + '/templates_src/client_side/**/*.handlebars')
.pipe(handlebars({
// Use specific version of Handlebars.js
handlebars: handlebarsEngine
}))
.pipe(wrapHandlebarsTemplate())
.pipe(concat('templates.js'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(header(config.compiledTemplatesHeader))
.pipe(gulp.dest(stylePath + '/templates_compiled/client_side'));
});
// Generate .pot files based on the sources

View File

@ -24,7 +24,7 @@
Mibew.Views.ThreadsCollection = Mibew.Views.CompositeBase.extend(
/** @lends Mibew.Views.ThreadsCollection.prototype */
{
template: Handlebars.templates['threads_collection'],
template: Handlebars.templates['users/threads_collection'],
/**
* Default item view constructor.

View File

@ -24,7 +24,7 @@
Mibew.Views.VisitorsCollection = Mibew.Views.CompositeBase.extend(
/** @lends Mibew.Views.VisitorsCollection.prototype */
{
template: Handlebars.templates['visitors_collection'],
template: Handlebars.templates['users/visitors_collection'],
/**
* Default item view constructor.

View File

@ -28,7 +28,7 @@
* Template function
* @type Function
*/
template: Handlebars.templates['agent'],
template: Handlebars.templates['users/agent'],
/**
* Name of wrapper tag for an agent view

View File

@ -28,7 +28,7 @@
* Template function
* @type Function
*/
template: Handlebars.templates['no_threads'],
template: Handlebars.templates['users/no_threads'],
/**
* View initializer

View File

@ -28,7 +28,7 @@
* Template function
* @type Function
*/
template: Handlebars.templates['no_visitors'],
template: Handlebars.templates['users/no_visitors'],
/**
* View initializer

View File

@ -28,7 +28,7 @@
* Template function
* @type Function
*/
template: Handlebars.templates['queued_thread'],
template: Handlebars.templates['users/queued_thread'],
/**
* Default item view constructor.

View File

@ -28,7 +28,7 @@
* Template function
* @type Function
*/
template: Handlebars.templates['status_panel'],
template: Handlebars.templates['users/status_panel'],
/**
* Map model events to the view methods

View File

@ -28,7 +28,7 @@
* Template function
* @type Function
*/
template: Handlebars.templates['visitor'],
template: Handlebars.templates['users/visitor'],
/**
* Default item view constructor.

View File

@ -9,7 +9,7 @@
<script type="text/javascript" src="{{asset "js/libs/handlebars.min.js"}}"></script>
<!-- Client side templates -->
<script type="text/javascript" src="{{asset "@CurrentStyle/templates_compiled/client_side/default_app.tpl.js"}}"></script>
<script type="text/javascript" src="{{asset "@CurrentStyle/templates_compiled/client_side/templates.js"}}"></script>
<!-- Application files -->
<script type="text/javascript" src="{{asset "js/compiled/mibewapi.js"}}"></script>

View File

@ -10,7 +10,7 @@
<script type="text/javascript" src="{{asset "js/libs/handlebars.min.js"}}"></script>
<!-- Client side templates -->
<script type="text/javascript" src="{{asset "@CurrentStyle/templates_compiled/client_side/default_app.tpl.js"}}"></script>
<script type="text/javascript" src="{{asset "@CurrentStyle/templates_compiled/client_side/templates.js"}}"></script>
<!-- Default application files -->
<script type="text/javascript" src="{{asset "js/compiled/mibewapi.js"}}"></script>

View File

@ -17,8 +17,7 @@
<script type="text/javascript" src="{{asset "js/libs/handlebars.min.js"}}"></script>
<!-- Client side templates -->
<script type="text/javascript" src="{{asset "@CurrentStyle/templates_compiled/client_side/default_app.tpl.js"}}"></script>
<script type="text/javascript" src="{{asset "@CurrentStyle/templates_compiled/client_side/users_app.tpl.js"}}"></script>
<script type="text/javascript" src="{{asset "@CurrentStyle/templates_compiled/client_side/templates.js"}}"></script>
<!-- Application files -->
<script type="text/javascript" src="{{asset "js/compiled/mibewapi.js"}}"></script>