Fixed mix create

This commit is contained in:
Fergal Moran
2013-05-26 11:01:34 +01:00
parent dee2201a4f
commit 134280c028
47 changed files with 83 additions and 81 deletions

View File

@@ -1,5 +1,5 @@
define ['backbone', 'marionette', 'app.lib/router', 'app.lib/panningRegion', 'views/header', 'views/sidebar/sidebar',
'models/mix/collection'],
define ['backbone', 'marionette', 'app.lib/router', 'app.lib/panningRegion', 'views/header', 'views/sidebar/sidebarView',
'models/mix/mixCollection'],
(Backbone, Marionette, DssRouter, PanningRegion, HeaderView, SidebarView, MixCollection) ->
Marionette.Region.prototype.open = (view) ->
@.$el.hide();

View File

@@ -1,7 +1,7 @@
// Generated by CoffeeScript 1.3.3
(function() {
define(['backbone', 'marionette', 'app.lib/router', 'app.lib/panningRegion', 'views/header', 'views/sidebar/sidebar', 'models/mix/collection'], function(Backbone, Marionette, DssRouter, PanningRegion, HeaderView, SidebarView, MixCollection) {
define(['backbone', 'marionette', 'app.lib/router', 'app.lib/panningRegion', 'views/header', 'views/sidebar/sidebarView', 'models/mix/mixCollection'], function(Backbone, Marionette, DssRouter, PanningRegion, HeaderView, SidebarView, MixCollection) {
var App, sidebarView;
Marionette.Region.prototype.open = function(view) {
this.$el.hide();

View File

@@ -1,6 +1,6 @@
define ['app', 'marionette',
'models/mix/item', 'views/mix/list', 'views/mix/detail', 'views/mix/edit',
'models/user/item', 'views/user/userEditView'],
'models/mix/mixItem', 'views/mix/mixListView', 'views/mix/mixDetailView', 'views/mix/mixEditView',
'models/user/userItem', 'views/user/userEditView'],
(App, Marionette, MixItem, MixListView, MixDetailView, MixEditView, UserItem, UserEditView)->
class DssController extends Marionette.Controller
home: ->
@@ -27,6 +27,18 @@ define ['app', 'marionette',
)
true
uploadMix: ->
console.log("Controller: mixUpload")
app = require('app')
mix = new MixItem({
title: '',
description: '',
mix_image: '',
is_featured: false
});
app.contentRegion.show(new MixEditView({model: mix}))
true
editMix: (slug) ->
console.log("Controller: mixEdit")
app = require('app')

View File

@@ -3,7 +3,7 @@
var __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; };
define(['app', 'marionette', 'models/mix/item', 'views/mix/list', 'views/mix/detail', 'views/mix/edit', 'models/user/item', 'views/user/userEditView'], function(App, Marionette, MixItem, MixListView, MixDetailView, MixEditView, UserItem, UserEditView) {
define(['app', 'marionette', 'models/mix/mixItem', 'views/mix/mixListView', 'views/mix/mixDetailView', 'views/mix/mixEditView', 'models/user/userItem', 'views/user/userEditView'], function(App, Marionette, MixItem, MixListView, MixDetailView, MixEditView, UserItem, UserEditView) {
var DssController;
DssController = (function(_super) {
@@ -48,6 +48,22 @@
return true;
};
DssController.prototype.uploadMix = function() {
var app, mix;
console.log("Controller: mixUpload");
app = require('app');
mix = new MixItem({
title: '',
description: '',
mix_image: '',
is_featured: false
});
app.contentRegion.show(new MixEditView({
model: mix
}));
return true;
};
DssController.prototype.editMix = function(slug) {
var app, mix;
console.log("Controller: mixEdit");

View File

@@ -6,6 +6,7 @@ define ['marionette', 'app.lib/controller'],
"": "home",
"/": "home",
"mix/upload": "uploadMix",
"mixes": "showMixList",
"mixes/:type": "showMixList"
"mix/:slug": "showMix"

View File

@@ -18,6 +18,7 @@
DssRouter.prototype.appRoutes = {
"": "home",
"/": "home",
"mix/upload": "uploadMix",
"mixes": "showMixList",
"mixes/:type": "showMixList",
"mix/:slug": "showMix",

View File

@@ -1,4 +1,4 @@
define ['backbone', 'models/activity/item', 'app.lib/backbone.dss.model.collection'], \
define ['backbone', 'models/activity/activityItem', 'app.lib/backbone.dss.model.collection'], \
(Backbone, ActivityItem, DssCollection) ->
class ActivityCollection extends DssCollection
model: ActivityItem

View File

@@ -1,17 +1,16 @@
// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.3.3
(function() {
var __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; };
define(['backbone', 'models/activity/item', 'app.lib/backbone.dss.model.collection'], function(Backbone, ActivityItem, DssCollection) {
var ActivityCollection, _ref;
define(['backbone', 'models/activity/activityItem', 'app.lib/backbone.dss.model.collection'], function(Backbone, ActivityItem, DssCollection) {
var ActivityCollection;
ActivityCollection = (function(_super) {
__extends(ActivityCollection, _super);
function ActivityCollection() {
_ref = ActivityCollection.__super__.constructor.apply(this, arguments);
return _ref;
return ActivityCollection.__super__.constructor.apply(this, arguments);
}
ActivityCollection.prototype.model = ActivityItem;

View File

@@ -1,17 +1,16 @@
// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.3.3
(function() {
var __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; };
define(['backbone'], function(Backbone) {
var ActivityItem, _ref;
var ActivityItem;
return ActivityItem = (function(_super) {
__extends(ActivityItem, _super);
function ActivityItem() {
_ref = ActivityItem.__super__.constructor.apply(this, arguments);
return _ref;
return ActivityItem.__super__.constructor.apply(this, arguments);
}
ActivityItem.prototype.urlRoot = com.podnoms.settings.urlRoot + "activity/";

View File

@@ -1,4 +1,4 @@
define ['backbone', 'models/comments/item', 'app.lib/backbone.dss.model.collection'],
define ['backbone', 'models/comment/commentItem', 'app.lib/backbone.dss.model.collection'],
(Backbone, CommentItem, DssCollection) ->
class CommentCollection extends DssCollection
model: CommentItem

View File

@@ -3,7 +3,7 @@
var __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; };
define(['backbone', 'models/comments/item', 'app.lib/backbone.dss.model.collection'], function(Backbone, CommentItem, DssCollection) {
define(['backbone', 'models/comment/commentItem', 'app.lib/backbone.dss.model.collection'], function(Backbone, CommentItem, DssCollection) {
var CommentCollection;
CommentCollection = (function(_super) {

View File

@@ -1,6 +0,0 @@
define ['app.lib/backbone.dss.model'], \
(DssModel) ->
class MixItem extends DssModel
urlRoot: com.podnoms.settings.urlRoot + "mix/"
MixItem

View File

@@ -1,4 +1,4 @@
define ['backbone', 'models/mix/item', 'app.lib/backbone.dss.model.collection'], \
define ['backbone', 'models/mix/mixItem', 'app.lib/backbone.dss.model.collection'], \
(Backbone, MixItem, DssCollection) ->
class MixCollection extends DssCollection
model: MixItem

View File

@@ -3,7 +3,7 @@
var __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; };
define(['backbone', 'models/mix/item', 'app.lib/backbone.dss.model.collection'], function(Backbone, MixItem, DssCollection) {
define(['backbone', 'models/mix/mixItem', 'app.lib/backbone.dss.model.collection'], function(Backbone, MixItem, DssCollection) {
var MixCollection;
MixCollection = (function(_super) {

View File

@@ -0,0 +1,6 @@
define ['backbone', 'app.lib/backbone.dss.model'], \
(Backbone, DssModel) ->
class MixItem extends Backbone.Model
urlRoot: com.podnoms.settings.urlRoot + "mix/"
MixItem

View File

@@ -3,7 +3,7 @@
var __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; };
define(['app.lib/backbone.dss.model'], function(DssModel) {
define(['backbone', 'app.lib/backbone.dss.model'], function(Backbone, DssModel) {
var MixItem;
MixItem = (function(_super) {
@@ -17,7 +17,7 @@
return MixItem;
})(DssModel);
})(Backbone.Model);
return MixItem;
});

View File

@@ -1,4 +1,4 @@
define ['backbone', 'models/user/item', 'app.lib/backbone.dss.model.collection'], \
define ['backbone', 'models/user/userItem', 'app.lib/backbone.dss.model.collection'], \
(Backbone, UserItem, DssCollection) ->
class UserCollection extends DssCollection
model: UserItem

View File

@@ -3,7 +3,7 @@
var __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; };
define(['backbone', 'models/user/item', 'app.lib/backbone.dss.model.collection'], function(Backbone, UserItem, DssCollection) {
define(['backbone', 'models/user/userItem', 'app.lib/backbone.dss.model.collection'], function(Backbone, UserItem, DssCollection) {
var UserCollection;
UserCollection = (function(_super) {

View File

@@ -1,4 +1,4 @@
define ['marionette', 'models/activity/collection', 'views/activity/item', 'text!/tpl/ActivityListView'],
define ['marionette', 'models/activity/activityCollection', 'views/activity/activityItemView', 'text!/tpl/ActivityListView'],
(Marionette, ActivityCollection, ActivityItemView, Template) ->
class ActivityListView extends Marionette.CompositeView

View File

@@ -3,7 +3,7 @@
var __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; };
define(['marionette', 'models/activity/collection', 'views/activity/item', 'text!/tpl/ActivityListView'], function(Marionette, ActivityCollection, ActivityItemView, Template) {
define(['marionette', 'models/activity/activityCollection', 'views/activity/activityItemView', 'text!/tpl/ActivityListView'], function(Marionette, ActivityCollection, ActivityItemView, Template) {
var ActivityListView;
ActivityListView = (function(_super) {

View File

@@ -1,4 +1,4 @@
define ['marionette', 'views/comments/item', 'text!/tpl/CommentListView'],
define ['marionette', 'views/comment/commentItemView', 'text!/tpl/CommentListView'],
(Marionette, CommentItemView, Template) ->
class CommentListView extends Marionette.CompositeView

View File

@@ -3,7 +3,7 @@
var __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; };
define(['marionette', 'views/comments/item', 'text!/tpl/CommentListView'], function(Marionette, CommentItemView, Template) {
define(['marionette', 'views/comment/commentItemView', 'text!/tpl/CommentListView'], function(Marionette, CommentItemView, Template) {
var CommentListView;
CommentListView = (function(_super) {

View File

@@ -1,4 +1,4 @@
define ['marionette', 'models/mix/item', 'views/mix/item', 'text!/tpl/MixDetailView'],
define ['marionette', 'models/mix/mixItem', 'views/mix/mixItemView', 'text!/tpl/MixDetailView'],
(Marionette, MixItem, MixItemView, Template) ->
class MixDetailView extends Marionette.Layout

View File

@@ -3,7 +3,7 @@
var __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; };
define(['marionette', 'models/mix/item', 'views/mix/item', 'text!/tpl/MixDetailView'], function(Marionette, MixItem, MixItemView, Template) {
define(['marionette', 'models/mix/mixItem', 'views/mix/mixItemView', 'text!/tpl/MixDetailView'], function(Marionette, MixItem, MixItemView, Template) {
var MixDetailView;
MixDetailView = (function(_super) {

View File

@@ -19,7 +19,7 @@ define ['app.lib/editableView', 'moment', 'libs/backbone/backbone.syphon', 'text
console.log("MixEditView: onRender")
@sendImage = false
parent = this
if @model.id is 'undefined'
if not @model.id
$("#mix-upload", @el).uploadifive(
uploadScript: "/ajax/upload_mix_file_handler/"
buttonText: "Select audio file (mp3 for now please)"

View File

@@ -40,7 +40,7 @@
console.log("MixEditView: onRender");
this.sendImage = false;
parent = this;
if (this.model.id === 'undefined') {
if (!this.model.id) {
$("#mix-upload", this.el).uploadifive({
uploadScript: "/ajax/upload_mix_file_handler/",
buttonText: "Select audio file (mp3 for now please)",

View File

@@ -1,4 +1,4 @@
define ['moment', 'app', 'marionette', 'models/comments/collection', 'views/comments/list', 'text!/tpl/MixListItemView'],
define ['moment', 'app', 'marionette', 'models/comment/commentCollection', 'views/comment/commentListView', 'text!/tpl/MixListItemView'],
(moment, App, Marionette, CommentsCollection, CommentsListView, Template) ->
class MixItemView extends Marionette.ItemView
template: _.template(Template)

View File

@@ -4,7 +4,7 @@
__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; };
define(['moment', 'app', 'marionette', 'models/comments/collection', 'views/comments/list', 'text!/tpl/MixListItemView'], function(moment, App, Marionette, CommentsCollection, CommentsListView, Template) {
define(['moment', 'app', 'marionette', 'models/comment/commentCollection', 'views/comment/commentListView', 'text!/tpl/MixListItemView'], function(moment, App, Marionette, CommentsCollection, CommentsListView, Template) {
var MixItemView;
MixItemView = (function(_super) {

View File

@@ -1,4 +1,4 @@
define ['marionette', 'models/mix/collection', 'views/mix/item', 'text!/tpl/MixListView'],
define ['marionette', 'models/mix/mixCollection', 'views/mix/mixItemView', 'text!/tpl/MixListView'],
(Marionette, MixCollection, MixItemView, Template) ->
class MixListView extends Marionette.CompositeView

View File

@@ -3,7 +3,7 @@
var __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; };
define(['marionette', 'models/mix/collection', 'views/mix/item', 'text!/tpl/MixListView'], function(Marionette, MixCollection, MixItemView, Template) {
define(['marionette', 'models/mix/mixCollection', 'views/mix/mixItemView', 'text!/tpl/MixListView'], function(Marionette, MixCollection, MixItemView, Template) {
var MixListView;
MixListView = (function(_super) {

View File

@@ -1,4 +1,4 @@
define ['underscore', 'backbone', 'marionette', 'views/activity/list', 'text!/tpl/SidebarView'],
define ['underscore', 'backbone', 'marionette', 'views/activity/activityListView', 'text!/tpl/SidebarView'],
(_, Backbone, Marionette, ActivityListView, Template) ->
class SidebarView extends Marionette.Layout
template: _.template(Template)

View File

@@ -3,7 +3,7 @@
var __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; };
define(['underscore', 'backbone', 'marionette', 'views/activity/list', 'text!/tpl/SidebarView'], function(_, Backbone, Marionette, ActivityListView, Template) {
define(['underscore', 'backbone', 'marionette', 'views/activity/activityListView', 'text!/tpl/SidebarView'], function(_, Backbone, Marionette, ActivityListView, Template) {
var SidebarView;
return SidebarView = (function(_super) {

View File

@@ -2,3 +2,4 @@ define ['app', 'marionette'],
(App, Marionette)->
class UserItemView extends Marionette.ItemView
itemView: UserItemView

View File

@@ -1,33 +0,0 @@
// Generated by CoffeeScript 1.6.2
(function() {
var __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; };
define(['views/user/userItem'], function(UserItemView) {
var UserListView, _ref;
return UserListView = (function(_super) {
__extends(UserListView, _super);
function UserListView() {
_ref = UserListView.__super__.constructor.apply(this, arguments);
return _ref;
}
return UserListView;
})(Marionette.CompositeView(function() {
({
template: "<h1>Hello Sailor</h1",
itemView: UserItemView,
itemViewContainer: "#content",
tagName: "li",
initialize: function() {
return console.log("User list view initializing");
}
});
return UserListView;
}));
});
}).call(this);

View File

@@ -0,0 +1,6 @@
// Generated by CoffeeScript 1.3.3
(function() {
define(['marionette', 'views/user/userItemView']);
}).call(this);

View File

@@ -53,6 +53,8 @@
{% endif %}
<script src="{{ STATIC_URL }}js/libs/jquery.js"></script>
<script src="{{ STATIC_URL }}js/libs/jquery.form.js"></script>
<script src="{{ STATIC_URL }}js/libs/jquery.cookie.js"></script>
<script src="{{ STATIC_URL }}js/libs/uploadify/jquery.uploadifive.js"></script>
<script src="{{ STATIC_URL }}js/libs/bootstrap/bootstrap.js"></script>
<script src="{{ STATIC_URL }}js/libs/jasny/bootstrap-fileupload.js"></script>
<script src="{{ STATIC_URL }}js/libs/modernizr.js"></script>
@@ -67,12 +69,10 @@
<script src="{{ STATIC_URL }}js/com.podnoms.player.js"></script>
{% endcompress %}
{% comment %}
<script src="{{ STATIC_URL }}js/libs/jquery.cookie.js"></script>
<script src="{{ STATIC_URL }}js/libs/jasny/bootstrap-rowlink.js"></script>
<script src="{{ STATIC_URL }}js/libs/bootstrap/bootstrap-timepicker.js"></script>
<script src="{{ STATIC_URL }}js/libs/bootstrap/bootstrap-datepicker.js"></script>
<script src="{{ STATIC_URL }}js/app/chat.js"></script>
<script src="{{ STATIC_URL }}js/libs/uploadify/jquery.uploadifive.js"></script>
<script src="{{ STATIC_URL }}js/libs/jquery.iphone-switch.js"></script>
<script src="{{ STATIC_URL }}js/libs/jquery.tablesorter.js"></script>
<script src="{{ STATIC_URL }}js/libs/tiny_mce/jquery.tinymce.js"></script>