mirror of
https://github.com/fergalmoran/dss.git
synced 2026-02-10 18:13:58 +00:00
Switch..
This commit is contained in:
@@ -28,8 +28,10 @@ var AppRouter = Backbone.Router.extend({
|
||||
//"accounts/login/": "login",
|
||||
//"accounts/logout/": "logout",
|
||||
"user/:id": "user",
|
||||
"users": "users",
|
||||
"user/:id/followers": "userFollowers",
|
||||
"upload/": "defaultRoute",
|
||||
"me": "userDetails",
|
||||
"me": "editUser",
|
||||
"*path": "defaultRoute"
|
||||
},
|
||||
initialize: function () {
|
||||
@@ -80,14 +82,18 @@ var AppRouter = Backbone.Router.extend({
|
||||
}
|
||||
});
|
||||
},
|
||||
userDetails: function () {
|
||||
users: function(){
|
||||
alert('Argle');
|
||||
|
||||
},
|
||||
editUser: function () {
|
||||
var user = new User({
|
||||
id: com.podnoms.settings.currentUser
|
||||
});
|
||||
$('#site-content-fill').html('');
|
||||
user.fetch({
|
||||
success: function () {
|
||||
var content = new UserView({
|
||||
var content = new UserEditView({
|
||||
model: user
|
||||
});
|
||||
$('#content').html(content.render().el);
|
||||
@@ -253,7 +259,7 @@ var AppRouter = Backbone.Router.extend({
|
||||
}
|
||||
});
|
||||
|
||||
com.podnoms.utils.loadTemplate(['HeaderView', 'SidebarView', 'SidebarViewUser', 'UserView', 'MixListView', 'MixListItemView', 'MixView', 'MixCreateView', 'CommentListView', 'CommentListItemView', 'ActivityListView', 'ActivityListItemView', 'ReleaseListView', 'ReleaseListItemView', 'ReleaseItemView', 'ReleaseView', 'ReleaseCreateView', 'ReleaseAudioListView', 'ReleaseAudioItemView', 'EventCreateView', 'EventListView', 'EventListItemView', 'EventView', 'EventItemView'], function () {
|
||||
com.podnoms.utils.loadTemplate(['HeaderView', 'SidebarView', 'SidebarViewUser', 'UserEditView', 'MixListView', 'MixListItemView', 'MixView', 'MixCreateView', 'CommentListView', 'CommentListItemView', 'ActivityListView', 'ActivityListItemView', 'ReleaseListView', 'ReleaseListItemView', 'ReleaseItemView', 'ReleaseView', 'ReleaseCreateView', 'ReleaseAudioListView', 'ReleaseAudioItemView', 'EventCreateView', 'EventListView', 'EventListItemView', 'EventView', 'EventItemView'], function () {
|
||||
window.app = new AppRouter();
|
||||
// Trigger the initial route and enable HTML5 History API support, set the
|
||||
// root folder to '/' by default. Change in app.js.
|
||||
|
||||
0
static/js/app/models/followers.coffee
Normal file
0
static/js/app/models/followers.coffee
Normal file
6
static/js/app/models/followers.js
Normal file
6
static/js/app/models/followers.js
Normal file
@@ -0,0 +1,6 @@
|
||||
// Generated by CoffeeScript 1.3.3
|
||||
(function() {
|
||||
|
||||
|
||||
|
||||
}).call(this);
|
||||
@@ -22,3 +22,8 @@ var User = DSSModel.extend({
|
||||
return this.get('profile').avatar_type == 'custom';
|
||||
}
|
||||
});
|
||||
|
||||
var UserCollection = TastypieCollection.extend({
|
||||
model: User,
|
||||
url:com.podnoms.settings.urlRoot + "users/"
|
||||
});
|
||||
2
static/js/app/views/user/userItem.coffee
Normal file
2
static/js/app/views/user/userItem.coffee
Normal file
@@ -0,0 +1,2 @@
|
||||
class UserItemView extends Marionette.ItemView ->
|
||||
itemView: UserItemView
|
||||
23
static/js/app/views/user/userItem.js
Normal file
23
static/js/app/views/user/userItem.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// Generated by CoffeeScript 1.3.3
|
||||
(function() {
|
||||
var UserItemView,
|
||||
__hasProp = {}.hasOwnProperty,
|
||||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
||||
|
||||
UserItemView = (function(_super) {
|
||||
|
||||
__extends(UserItemView, _super);
|
||||
|
||||
function UserItemView() {
|
||||
return UserItemView.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
return UserItemView;
|
||||
|
||||
})(Marionette.ItemView(function() {
|
||||
return {
|
||||
itemView: UserItemView
|
||||
};
|
||||
}));
|
||||
|
||||
}).call(this);
|
||||
2
static/js/app/views/user/userList.coffee
Normal file
2
static/js/app/views/user/userList.coffee
Normal file
@@ -0,0 +1,2 @@
|
||||
class UserListView extends Marionette.CollectionView ->
|
||||
|
||||
19
static/js/app/views/user/userList.js
Normal file
19
static/js/app/views/user/userList.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// Generated by CoffeeScript 1.3.3
|
||||
(function() {
|
||||
var UserListView,
|
||||
__hasProp = {}.hasOwnProperty,
|
||||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
||||
|
||||
UserListView = (function(_super) {
|
||||
|
||||
__extends(UserListView, _super);
|
||||
|
||||
function UserListView() {
|
||||
return UserListView.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
return UserListView;
|
||||
|
||||
})(Marionette.CollectionView(function() {}));
|
||||
|
||||
}).call(this);
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
*/
|
||||
|
||||
UserView = DSSEditableView.extend({
|
||||
UserEditView = DSSEditableView.extend({
|
||||
events: {
|
||||
"click #save-changes": "saveChanges",
|
||||
"change input[type=radio]": "selectAvatar"
|
||||
@@ -93,7 +93,7 @@
|
||||
<script src="{{ STATIC_URL }}js/app/views/sidebar.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/app/views/sidebaruser.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/app/views/mix.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/app/views/user.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/app/views/userEdit.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/app/views/comment.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/app/views/activity.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/app/views/release.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user