blob: 78dd3b774fd1a5376336cf5748a94094e6eaca1a [file] [log] [blame]
Anand Doshi10bcf5e2012-06-26 18:54:10 +05301// ERPNext - web based ERP (http://erpnext.com)
2// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17// js inside blog page
18wn.pages['{{ name }}'].onload = function(wrapper) {
19 erpnext.blog_list = new wn.ui.Listing({
20 parent: $(wrapper).find('#blog-list').get(0),
Anand Doshif01059f2012-07-13 00:46:59 +053021 method: 'website.blog.get_blog_list',
Anand Doshi10bcf5e2012-06-26 18:54:10 +053022 hide_refresh: true,
23 no_toolbar: true,
24 render_row: function(parent, data) {
25 if(data.content && data.content.length==1000) {
26 data.content += repl('... <a href="%(name)s.html">(read on)</a>', data);
27 }
Anand Doshi10bcf5e2012-06-26 18:54:10 +053028 parent.innerHTML = repl('<h2><a href="%(name)s.html">%(title)s</a></h2>\
Anand Doshi200c4432012-07-13 01:14:52 +053029 %(content)s<br /><br />', data);
Anand Doshi10bcf5e2012-06-26 18:54:10 +053030 },
31 page_length: 10
32 });
33 erpnext.blog_list.run();
Anand Doshi51146c02012-07-12 18:41:12 +053034}