mirror of
https://github.com/fergalmoran/dss.git
synced 2026-02-14 12:04:01 +00:00
Re-ordered mix footer buttons
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
define ['backbone', 'marionette', 'app.lib/router', 'app.lib/panningRegion', 'app.lib/audioController', 'views/header',
|
||||
define ['backbone', 'marionette', 'vent', 'app.lib/router', 'app.lib/panningRegion', 'app.lib/audioController', 'views/header',
|
||||
'views/sidebar/sidebarView',
|
||||
'models/mix/mixCollection'],
|
||||
(Backbone, Marionette, DssRouter, PanningRegion, AudioController, HeaderView, SidebarView, MixCollection) ->
|
||||
(Backbone, Marionette, vent, DssRouter, PanningRegion, AudioController, HeaderView, SidebarView, MixCollection) ->
|
||||
Marionette.Region.prototype.open = (view) ->
|
||||
@.$el.hide();
|
||||
@.$el.html(view.el);
|
||||
@@ -11,24 +11,6 @@ define ['backbone', 'marionette', 'app.lib/router', 'app.lib/panningRegion', 'ap
|
||||
App = new Marionette.Application();
|
||||
App.audioController = new AudioController()
|
||||
|
||||
App.vent.on "mix:favourite", (model) ->
|
||||
console.log "App(vent): mix:favourite"
|
||||
model.save 'favourited', !model.get('favourited'), patch: true
|
||||
true
|
||||
|
||||
App.vent.on "mix:like", (model) ->
|
||||
console.log "App(vent): mix:like"
|
||||
model.save 'liked', !model.get('liked'), patch: true
|
||||
true
|
||||
|
||||
App.vent.on "mix:share", (mode, model) ->
|
||||
console.log "App(vent): mix:share"
|
||||
if (mode == "facebook")
|
||||
social.sharePageToFacebook(model);
|
||||
else if (mode == "twitter")
|
||||
social.sharePageToTwitter(model);
|
||||
true
|
||||
|
||||
App.vent.on "routing:started", ->
|
||||
console.log "App(vent): routing:started"
|
||||
enablePushState = true;
|
||||
@@ -66,6 +48,25 @@ define ['backbone', 'marionette', 'app.lib/router', 'app.lib/panningRegion', 'ap
|
||||
)
|
||||
true
|
||||
|
||||
App.addInitializer ->
|
||||
@listenTo vent, "mix:favourite", (model) ->
|
||||
console.log "App(vent): mix:favourite"
|
||||
model.save 'favourited', !model.get('favourited'), patch: true
|
||||
true
|
||||
|
||||
@listenTo vent, "mix:like", (model) ->
|
||||
console.log "App(vent): mix:like"
|
||||
model.save 'liked', !model.get('liked'), patch: true
|
||||
true
|
||||
|
||||
@listenTo vent, "mix:share", (mode, model) ->
|
||||
console.log "App(vent): mix:share"
|
||||
if (mode == "facebook")
|
||||
social.sharePageToFacebook(model);
|
||||
else if (mode == "twitter")
|
||||
social.sharePageToTwitter(model);
|
||||
true
|
||||
|
||||
App.headerRegion.show(new HeaderView());
|
||||
sidebarView = new SidebarView();
|
||||
App.sidebarRegion.show(sidebarView)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Generated by CoffeeScript 1.6.2
|
||||
(function() {
|
||||
define(['backbone', 'marionette', 'app.lib/router', 'app.lib/panningRegion', 'app.lib/audioController', 'views/header', 'views/sidebar/sidebarView', 'models/mix/mixCollection'], function(Backbone, Marionette, DssRouter, PanningRegion, AudioController, HeaderView, SidebarView, MixCollection) {
|
||||
define(['backbone', 'marionette', 'vent', 'app.lib/router', 'app.lib/panningRegion', 'app.lib/audioController', 'views/header', 'views/sidebar/sidebarView', 'models/mix/mixCollection'], function(Backbone, Marionette, vent, DssRouter, PanningRegion, AudioController, HeaderView, SidebarView, MixCollection) {
|
||||
var App, sidebarView;
|
||||
|
||||
Marionette.Region.prototype.open = function(view) {
|
||||
@@ -11,29 +11,6 @@
|
||||
};
|
||||
App = new Marionette.Application();
|
||||
App.audioController = new AudioController();
|
||||
App.vent.on("mix:favourite", function(model) {
|
||||
console.log("App(vent): mix:favourite");
|
||||
model.save('favourited', !model.get('favourited'), {
|
||||
patch: true
|
||||
});
|
||||
return true;
|
||||
});
|
||||
App.vent.on("mix:like", function(model) {
|
||||
console.log("App(vent): mix:like");
|
||||
model.save('liked', !model.get('liked'), {
|
||||
patch: true
|
||||
});
|
||||
return true;
|
||||
});
|
||||
App.vent.on("mix:share", function(mode, model) {
|
||||
console.log("App(vent): mix:share");
|
||||
if (mode === "facebook") {
|
||||
social.sharePageToFacebook(model);
|
||||
} else if (mode === "twitter") {
|
||||
social.sharePageToTwitter(model);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
App.vent.on("routing:started", function() {
|
||||
var enablePushState, pushState;
|
||||
|
||||
@@ -78,6 +55,31 @@
|
||||
});
|
||||
return true;
|
||||
});
|
||||
App.addInitializer(function() {
|
||||
this.listenTo(vent, "mix:favourite", function(model) {
|
||||
console.log("App(vent): mix:favourite");
|
||||
model.save('favourited', !model.get('favourited'), {
|
||||
patch: true
|
||||
});
|
||||
return true;
|
||||
});
|
||||
this.listenTo(vent, "mix:like", function(model) {
|
||||
console.log("App(vent): mix:like");
|
||||
model.save('liked', !model.get('liked'), {
|
||||
patch: true
|
||||
});
|
||||
return true;
|
||||
});
|
||||
return this.listenTo(vent, "mix:share", function(mode, model) {
|
||||
console.log("App(vent): mix:share");
|
||||
if (mode === "facebook") {
|
||||
social.sharePageToFacebook(model);
|
||||
} else if (mode === "twitter") {
|
||||
social.sharePageToTwitter(model);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
App.headerRegion.show(new HeaderView());
|
||||
sidebarView = new SidebarView();
|
||||
App.sidebarRegion.show(sidebarView);
|
||||
|
||||
@@ -59,8 +59,27 @@
|
||||
class="icon-star-empty"></i> Favourite</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="footer-button">
|
||||
<ul class="list-nostyle list-horiz">
|
||||
<li title="<%= play_count %> Plays" class="stats-item bordered-right">
|
||||
<span class="icon-play stats">Plays:</span> <%= play_count %>
|
||||
</li>
|
||||
<li title="<%= download_count %> Downloads" class="stats-item bordered-right">
|
||||
<span class="icon-download-alt stats">Downloads:</span> <%= download_count %>
|
||||
</li>
|
||||
<li title="<%= comment_count %> Comments" class="stats-item bordered-right">
|
||||
<span class="icon-pencil stats">Comments:</span> <%= comment_count %>
|
||||
</li>
|
||||
<li title="<%= like_count %> Likes" class="stats-item bordered-right">
|
||||
<span class="icon-heart stats">Likes:</span> <%= like_count %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer-button">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown"><i class="icon-share"></i>Share
|
||||
<button class="btn btn-primary btn-mini dropdown-toggle" data-toggle="dropdown"><i
|
||||
class="icon-share"></i>Share
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -78,29 +97,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if user.is_authenticated %}
|
||||
<% if (download_allowed) { %>
|
||||
<div class="download-button footer-button">
|
||||
<a class="btn btn-mini" data-id="<%= id %>">
|
||||
<i class="icon-download"></i> Download</a>
|
||||
</div>
|
||||
<% } %>
|
||||
{% endif %}
|
||||
<div class="footer-button">
|
||||
<ul class="list-nostyle list-horiz">
|
||||
<li title="<%= play_count %> Plays" class="stats-item bordered-right">
|
||||
<span class="icon-play stats">Plays:</span> <%= play_count %>
|
||||
</li>
|
||||
<li title="<%= download_count %> Downloads" class="stats-item bordered-right">
|
||||
<span class="icon-download-alt stats">Downloads:</span> <%= download_count %>
|
||||
</li>
|
||||
<li title="<%= comment_count %> Comments" class="stats-item bordered-right">
|
||||
<span class="icon-pencil stats">Comments:</span> <%= comment_count %>
|
||||
</li>
|
||||
<li title="<%= like_count %> Likes" class="stats-item bordered-right">
|
||||
<span class="icon-heart stats">Likes:</span> <%= like_count %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if user.is_staff %}
|
||||
<div class="edit-button footer-button-right">
|
||||
@@ -109,6 +105,14 @@
|
||||
class="icon-edit"></i>Edit</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
<% if (download_allowed) { %>
|
||||
<div class="download-button footer-button-right">
|
||||
<a class="btn btn-mini btn-success" data-id="<%= id %>">
|
||||
<i class="icon-download"></i> Download</a>
|
||||
</div>
|
||||
<% } %>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user