# HG changeset patch
# User rougeronj
# Date 1429866796 -7200
# Node ID 05ed0d95a511d2757be3395adc02303258437352
# Parent 823e8f1d26f795a072a04dbd2b632253a94a7116
split templates in main, list-bin and wikipedia-bin
diff -r 823e8f1d26f7 -r 05ed0d95a511 client/js/list-bin.js
--- a/client/js/list-bin.js Fri Apr 24 11:12:23 2015 +0200
+++ b/client/js/list-bin.js Fri Apr 24 11:13:16 2015 +0200
@@ -2,14 +2,7 @@
Rkns.ResourceList.Bin = Rkns.Utils.inherit(Rkns._BaseBin);
-Rkns.ResourceList.Bin.prototype.resultTemplate = Rkns._.template(
- '
" data-description="<%-description%>" ' +
- '<% if (image) { %>data-image="<%- Rkns.Utils.getFullURL(image) %>"<% } else { %>data-image=""<% } %> >' +
- '<% if (image) { %>
<% } %>' +
- '<% if (description) { %><%=hdescription%>
<% } %><% if (image) { %><% } %>'
-);
+Rkns.ResourceList.Bin.prototype.resultTemplate = renkanJST['templates/list-bin.html'];
Rkns.ResourceList.Bin.prototype._init = function(_renkan, _opts) {
this.renkan = _renkan;
diff -r 823e8f1d26f7 -r 05ed0d95a511 client/js/main.js
--- a/client/js/main.js Fri Apr 24 11:12:23 2015 +0200
+++ b/client/js/main.js Fri Apr 24 11:13:16 2015 +0200
@@ -98,6 +98,7 @@
Rkns.__renkans.push(this);
this.options = _.defaults(_opts, Rkns.defaults, {templates: renkanJST});
+ this.template = renkanJST['templates/main.html'];
_(this.options.property_files).each(function(f) {
Rkns.$.getJSON(f, function(data) {
@@ -287,17 +288,6 @@
};
-Renkan.prototype.template = _.template(
- '<% if (options.show_bins) { %><%- translate("Select contents:")%>
' +
- '
' +
- '
' +
- '
<% } %>' +
- '<% if (options.show_editor) { %><% } %>'
-);
-
Renkan.prototype.translate = function(_text) {
if (Rkns.i18n[this.options.language] && Rkns.i18n[this.options.language][_text]) {
return Rkns.i18n[this.options.language][_text];
diff -r 823e8f1d26f7 -r 05ed0d95a511 client/js/wikipedia-bin.js
--- a/client/js/wikipedia-bin.js Fri Apr 24 11:12:23 2015 +0200
+++ b/client/js/wikipedia-bin.js Fri Apr 24 11:13:16 2015 +0200
@@ -34,12 +34,7 @@
Rkns.Wikipedia.Bin = Rkns.Utils.inherit(Rkns._BaseBin);
-Rkns.Wikipedia.Bin.prototype.resultTemplate = Rkns._.template(
- '" data-description="<%-description%>" data-image="<%- Rkns.Utils.getFullURL( static_url + \'img/wikipedia.png\' ) %>">' +
- '
' +
- '<%=hdescription%>
'
-);
+Rkns.Wikipedia.Bin.prototype.resultTemplate = renkanJST['templates/wikipedia-bin/resulttemplate.html'];
Rkns.Wikipedia.Bin.prototype._init = function(_renkan, _opts) {
this.renkan = _renkan;
diff -r 823e8f1d26f7 -r 05ed0d95a511 client/templates/list-bin.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/templates/list-bin.html Fri Apr 24 11:13:16 2015 +0200
@@ -0,0 +1,25 @@
+
+ data-image="<%- Rkns.Utils.getFullURL(image) %>"
+ <% } else { %>
+ data-image=""
+ <% } %>
+><% if (image) { %>
+
+<% } %>
+
+ <% if (description) { %>
+ <%=hdescription%>
+ <% } %>
+ <% if (image) { %>
+
+ <% } %>
+
\ No newline at end of file
diff -r 823e8f1d26f7 -r 05ed0d95a511 client/templates/main.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/templates/main.html Fri Apr 24 11:13:16 2015 +0200
@@ -0,0 +1,27 @@
+<% if (options.show_bins) { %>
+
+
+
<%- translate("Select contents:")%>
+
+
+
+
+
+<% } %> <% if (options.show_editor) { %>
+
+<% } %>
diff -r 823e8f1d26f7 -r 05ed0d95a511 client/templates/wikipedia-bin/resulttemplate.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/templates/wikipedia-bin/resulttemplate.html Fri Apr 24 11:13:16 2015 +0200
@@ -0,0 +1,11 @@
+
+
+
+
+ <%=hdescription%>
+
\ No newline at end of file