summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-10-06 22:42:17 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-10-06 22:42:17 +0200
commit97d3ae3a0e1c7da0877345fa429394822dec6443 (patch)
tree8beb2d0159cf024f65d95af63c61eb3db741a95c /module/web
parenttask to optimize js code (diff)
downloadpyload-97d3ae3a0e1c7da0877345fa429394822dec6443.tar.xz
template for file-view
Diffstat (limited to 'module/web')
-rw-r--r--module/web/static/css/default/style.less57
-rw-r--r--module/web/static/js/views/fileView.js4
-rw-r--r--module/web/templates/default/dashboard.html14
3 files changed, 63 insertions, 12 deletions
diff --git a/module/web/static/css/default/style.less b/module/web/static/css/default/style.less
index 355f5a569..aa60fd8f3 100644
--- a/module/web/static/css/default/style.less
+++ b/module/web/static/css/default/style.less
@@ -13,6 +13,8 @@
@yellow: #fee247;
@blue: #3a79aa;
@lightblue: lighten(spin(@blue, 5), 10%);
+@lighterblue: lighten(spin(@blue, 10), 20%);
+@lightestblue: lighten(spin(@blue, 20), 40%);
@darkblue: darken(spin(@blue, -5), 10%);
@darkerblue: darken(spin(@blue, -10), 20%);
@emph: #FF7637;
@@ -358,36 +360,37 @@ footer h2 {
list-style: none;
}
+/*
+ Package View
+*/
+
.package-view {
- height: 30px;
- width: 100%;
+ margin-bottom: 3px;
+}
+
+.package-view > div {
color: @light;
.gradient(top, @blue, @lightblue); // background-color: @blue;
font-weight: bold;
border-radius: 5px;
- margin-bottom: 3px;
line-height: 28px;
}
-.package-view > div {
- height: 100%;
-}
-
-.package-view:hover {
+.package-view > div:hover {
.gradient(top, @blue, @darkblue);
}
-.package-view .package-row {
+.package-row {
display: inline-block;
height: 100%;
padding-left: 8px;
}
-.package-view .first {
+.package-row.first {
width: 50%;
}
-.package-view .second {
+.package-row.second {
width: 30%;
.gradient(top, @darkblue, @darkerblue);
@@ -401,4 +404,36 @@ footer h2 {
display: inline;
width: 20px;
height: 20px;
+
+ canvas {
+ margin-bottom: -3px;
+ }
+}
+
+/*
+ File view
+*/
+
+.file-view {
+ margin-top: 3px;
+}
+
+.file-view > div {
+ border-radius: 5px;
+ .gradient(top, @lighterblue, @lightestblue);
+ line-height: 26px;
+}
+
+.file-view > div:hover {
+ .gradient(top, @blue, @lightblue)
+}
+
+.file-row {
+ display: inline-block;
+ height: 100%;
+ padding-left: 8px;
+}
+
+.file-row.first {
+ width: 50%;
} \ No newline at end of file
diff --git a/module/web/static/js/views/fileView.js b/module/web/static/js/views/fileView.js
index 7db8112c8..1c96c61e2 100644
--- a/module/web/static/js/views/fileView.js
+++ b/module/web/static/js/views/fileView.js
@@ -4,6 +4,8 @@ define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) {
return Backbone.View.extend({
tagName: 'li',
+ className: 'file-view',
+ template: _.template($("#template-file").html()),
events: {
},
@@ -12,7 +14,7 @@ define(['jquery', 'backbone', 'underscore'], function($, Backbone, _) {
},
render: function() {
- this.$el.html(this.model.get('name'));
+ this.$el.html(this.template(this.model.toJSON()));
return this;
}
diff --git a/module/web/templates/default/dashboard.html b/module/web/templates/default/dashboard.html
index d8d06956f..67b3b8483 100644
--- a/module/web/templates/default/dashboard.html
+++ b/module/web/templates/default/dashboard.html
@@ -27,6 +27,20 @@
</div>
</div>
</script>
+
+ <script type="text/template" id="template-file">
+ <div>
+ <div class="file-row first">
+ File <%= fid %>: <%= name %>
+ </div>
+ <div class="file-row second">
+ <%= download.statusmsg %>
+ </div>
+
+ <div class="file-row third">
+ </div>
+ </div>
+ </script>
{% endblock %}
{% block content %}