Merge branch 'master' into perpetual

This commit is contained in:
Nabin Hait 2013-09-03 11:26:00 +05:30
commit 180fb50373
4 changed files with 21 additions and 22 deletions

View file

@ -65,7 +65,8 @@ def make(doctype=None, name=None, content=None, subject=None,
d.parentfield = "communications"
if date:
d.creation = date
d.communication_date = date
d.communication_medium = communication_medium

View file

@ -2,7 +2,7 @@
{
"creation": "2013-01-29 10:47:14",
"docstatus": 0,
"modified": "2013-09-02 16:28:18",
"modified": "2013-09-02 18:16:52",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -171,7 +171,7 @@
"default": "Today",
"doctype": "DocField",
"fieldname": "communication_date",
"fieldtype": "Date",
"fieldtype": "Datetime",
"label": "Date"
},
{

View file

@ -35,21 +35,22 @@ def get_docs(options):
def get_static_pages():
mydocs = {}
for repo in ("lib", "app"):
for fname in os.listdir(get_path(repo, "docs")):
if fname.endswith(".md"):
fpath = get_path(repo, "docs", fname)
with open(fpath, "r") as docfile:
src = unicode(docfile.read(), "utf-8")
try:
temp, headers, body = src.split("---", 2)
d = json.loads(headers)
except Exception, e:
webnotes.msgprint("Bad Headers in: " + fname)
continue
d["_intro"] = body
d["_gh_source"] = get_gh_url(fpath)
d["_modified"] = get_timestamp(fpath)
mydocs[fname[:-3]] = d
for basepath, folders, files in os.walk(get_path(repo, "docs")):
for fname in files:
if fname.endswith(".md"):
fpath = get_path(basepath, fname)
with open(fpath, "r") as docfile:
src = unicode(docfile.read(), "utf-8")
try:
temp, headers, body = src.split("---", 2)
d = json.loads(headers)
except Exception, e:
webnotes.msgprint("Bad Headers in: " + fname)
continue
d["_intro"] = body
d["_gh_source"] = get_gh_url(fpath)
d["_modified"] = get_timestamp(fpath)
mydocs[fname[:-3]] = d
return mydocs

View file

@ -72,7 +72,7 @@ wn.views.CommunicationList = Class.extend({
prepare: function(doc) {
//doc.when = comment_when(this.doc.modified);
doc.when = doc.modified;
doc.when = doc.creation;
if(!doc.content) doc.content = "[no content]";
if(!wn.utils.is_html(doc.content)) {
doc.content = doc.content.replace(/\n/g, "<br>");
@ -263,9 +263,6 @@ wn.views.CommunicationComposer = Class.extend({
content: form_values.content,
doctype: me.doc.doctype,
name: me.doc.name,
lead: me.doc.lead,
contact: me.doc.contact,
company: me.doc.company || wn.defaults.get_default("company"),
send_me_a_copy: form_values.send_me_a_copy,
send_email: form_values.send_email,
print_html: print_html,