summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/web/static/js/app.js1
-rw-r--r--module/web/static/js/default.js8
-rw-r--r--module/web/static/js/models/TreeCollection.js15
-rw-r--r--module/web/static/js/views/fileView.js2
-rw-r--r--module/web/templates/default/base.html2
-rw-r--r--module/web/templates/default/settings.html17
6 files changed, 21 insertions, 24 deletions
diff --git a/module/web/static/js/app.js b/module/web/static/js/app.js
index e846f3e0a..52a181463 100644
--- a/module/web/static/js/app.js
+++ b/module/web/static/js/app.js
@@ -23,6 +23,7 @@ define([
_.extend(this, options);
};
+ // Add Global Helper functions
_.extend(Application.prototype, Backbone.Events, {
diff --git a/module/web/static/js/default.js b/module/web/static/js/default.js
index c82ae3299..4436a85c1 100644
--- a/module/web/static/js/default.js
+++ b/module/web/static/js/default.js
@@ -2,14 +2,14 @@ define('default', ['jquery', 'app', 'views/headerView', 'views/packageTreeView']
function($, App, HeaderView, TreeView) {
App.init = function() {
- var view = new HeaderView();
- view.render();
+ App.header = new HeaderView();
+ App.header.render();
};
App.initPackageTree = function() {
$(function() {
- var view = new TreeView();
- view.init();
+ App.treeView = new TreeView();
+ App.treeView.init();
});
};
diff --git a/module/web/static/js/models/TreeCollection.js b/module/web/static/js/models/TreeCollection.js
index 6476ea7b5..27d2cefce 100644
--- a/module/web/static/js/models/TreeCollection.js
+++ b/module/web/static/js/models/TreeCollection.js
@@ -26,11 +26,20 @@ define(['jquery', 'backbone', 'underscore', 'models/Package', 'collections/FileL
return Backbone.Model.prototype.fetch.call(this, options);
},
+ // Parse the response and updates the collections
parse: function(resp, xhr) {
+ if (this.get('packages') === null)
+ this.set('packages', new PackageList(_.values(resp.packages)));
+ else
+ this.packages.update(_.values(resp.packages));
+
+ if (this.get('files') === null)
+ this.set('files', new FileList(_.values(resp.files)));
+ else
+ this.files.update(_.values(resp.files));
+
return {
- root: new Package(resp.root),
- packages: new PackageList(_.values(resp.packages)),
- files: new FileList(_.values(resp.files))
+ root: new Package(resp.root)
};
}
diff --git a/module/web/static/js/views/fileView.js b/module/web/static/js/views/fileView.js
index b37d4aefa..f020a69d4 100644
--- a/module/web/static/js/views/fileView.js
+++ b/module/web/static/js/views/fileView.js
@@ -1,4 +1,4 @@
-define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) {
+define(['jquery', 'backbone', 'underscore', 'app'], function($, Backbone, _, App) {
// Renders single file item
return Backbone.View.extend({
diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html
index cd66734f0..c67ad82f6 100644
--- a/module/web/templates/default/base.html
+++ b/module/web/templates/default/base.html
@@ -71,7 +71,7 @@
<div class="header_block">
<i class="icon-time icon-white"></i> Remaining:<br>
<i class="icon-retweet icon-white"></i> Status:<br>
- <i class="icon-download-alt icon-white"></i> Downloaded: <br>
+ <i class="icon-download-alt icon-white"></i> Downloads: <br>
</div>
<div id="notification_div">
diff --git a/module/web/templates/default/settings.html b/module/web/templates/default/settings.html
index 0011b0bb5..ba4f1b690 100644
--- a/module/web/templates/default/settings.html
+++ b/module/web/templates/default/settings.html
@@ -19,22 +19,11 @@
<li><a href="#">General blabla</a></li>
<li><a href="#">General blabla</a></li>
<li><a href="#">General blabla</a></li>
- <li class="nav-header">{{ _("User") }}</li>
- <li><a href="#">User blaba</a></li>
- <li><a href="#">User blab la</a></li>
- <li><a href="#">User blabal</a></li>
<li class="nav-header">{{ _("Addons") }}</li>
<li><a href="#">Addons balba</a></li>
<li><a href="#">Addons balbal</a></li>
- <li class="nav-header">{{ _("Accounts") }}</li>
- <li><a href="#">Accounts blabal </a></li>
- <li><a href="#">Accounts bala</a></li>
- <li><a href="#">Accounts blabla</a></li>
- <li><a href="#">Accounts nalai</a></li>
<li class="divider"></li>
- <li class="nav-header">{{ _("Admin") }}</li>
- <li><a href="#">User Übersicht</a></li>
- <li><a href="#">User hinzufügen</a></li>
+ <li class="nav-header">{{ _("Accounts") }}</li>
</ul>
</div>
<!-- Info Popup -->
@@ -111,10 +100,9 @@
</div>
</div>
</div>
- <script src="static/js/libs/jquery-1.8.0.js"></script>
+ <script src="static/js/libs/jquery-1.8.3.js"></script>
{# <script src="static/js/libs/bootstrap-2.1.1.js"></script>#}
<script type="text/javascript">
-
$(".bnmaxspeed").click(function() {
$(".bnmaxspeed").removeClass("active");
$(this).toggleClass("active");
@@ -137,6 +125,5 @@
title: 'Gib an wie viele Downloads gleichzeitg laufen dürfen.'
});
-
</script>
{% endblock %} \ No newline at end of file