Commit 36c46d90 authored by alexandre's avatar alexandre
Browse files

Added user list-detail views

parent a201d892
...@@ -17,6 +17,16 @@ window.W = window.W || {}; ...@@ -17,6 +17,16 @@ window.W = window.W || {};
var view = new W.AboutView(); var view = new W.AboutView();
baseView.showChildView('main', view); baseView.showChildView('main', view);
}, },
userList: function () {
var baseView = this.getOption('application').getView();
var view = new W.UserListView();
baseView.showChildView('main', view);
},
userDetail: function () {
var baseView = this.getOption('application').getView();
var view = new W.UserDetailView();
baseView.showChildView('main', view);
},
scoreList: function () { scoreList: function () {
var baseView = this.getOption('application').getView(); var baseView = this.getOption('application').getView();
var view = new W.ScoreListView(); var view = new W.ScoreListView();
......
...@@ -14,6 +14,8 @@ window.W = window.W || {}; ...@@ -14,6 +14,8 @@ window.W = window.W || {};
'apropos(/)': 'about', 'apropos(/)': 'about',
'partitions(/)': 'scoreList', 'partitions(/)': 'scoreList',
'partitions/:id(/)': 'scoreDetail', 'partitions/:id(/)': 'scoreDetail',
'users/(/)': 'userList',
'users/:id(/)': 'userDetail',
}, },
initialize: function (options) { initialize: function (options) {
......
...@@ -1457,6 +1457,17 @@ window.W = window.W || {}; ...@@ -1457,6 +1457,17 @@ window.W = window.W || {};
* User views * User views
*/ */
W.UserListView = Backbone.Marionette.View.extend({
template: '#user-list-template',
});
W.UserDetailView = Backbone.Marionette.View.extend({
template: '#user-detail-template',
});
W.LoginView = Backbone.Marionette.View.extend({ W.LoginView = Backbone.Marionette.View.extend({
template: '#login-template', template: '#login-template',
......
...@@ -22,6 +22,14 @@ ...@@ -22,6 +22,14 @@
{% include "playground/underscore/home.mtpl" %} {% include "playground/underscore/home.mtpl" %}
</script> </script>
<script id="user-list-template" type="text/template">
{% include "playground/underscore/user-list.mtpl" %}
</script>
<script id="user-detail-template" type="text/template">
{% include "playground/underscore/user-detail.mtpl" %}
</script>
<script id="about-template" type="text/template"> <script id="about-template" type="text/template">
{% include "playground/underscore/about.mtpl" %} {% include "playground/underscore/about.mtpl" %}
</script> </script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment